the highest $t$ for which $\sigma(t) \leq 1$ and $\theta(t) \leq 1$ holds, that is, the point at which the matching exits cell $(1,1)$. Similarly, let $t''$ denote the lowest $t$ for which $\sigma(t) \geq m-1$ and $\theta(t) \geq n-1$ holds. Since $d_\mu(t) \leq \varepsilon_\text{r}$ holds for any $t' \leq t \leq t''$, $d_\mu(t) > \varepsilon_\text{r}$ can hold only for $t < t'$ or $t > t''$. Suppose that $d_\mu(a) > \varepsilon_\text{r}$ holds. Then $a < t'$ holds and $\mu$ is linear between $a$ and $t'$. Therefore, $d_\mu(a) > d_\mu(t)$ holds for any $t$ with $a < t < t'$. Analogously, if $d_\mu(b) > \varepsilon_\text{r}$ holds, then $d_\mu(b) > d_\mu(t)$ holds for any $t$ with $t'' < t < b$ . Hence, $d_\mu[a,b] = \max \left\{ d_\mu(a), d_\mu(b) \right\}$ must hold.

This maximum is a lower bound on the [Fréchet distance]{}, contradicting the assumption that $d_\mu[a,b]$ is larger than the [Fréchet distance]{}. Matching $\mu$ is therefore locally correct.

Algorithm for locally correct [Fréchet matching]{}s {#sec:algorithm}
===================================================

The existence proof directly results in a recursive algorithm, which is given by Algorithm \[alg:findmatching\]. Fig. \[fig:badmatch\] (left), Fig. \[fig:speedcounter\] (left), Fig. \[fig:examplematching\], Fig. \[fig:vertexdependency\], and Fig. \[fig:lengthcounter\] (left) illustrate matchings computed with our 