%gmChapt04.tex

\graphicspath{{./figures/}}

\chapter{Curves and Curvatures\label{Chapter4}}

This chapter contains the fundamentals  of differential geometry
that are used   in the book.  Our main aim is to define the
orientation and curvatures of a curve  or a surface as the main
contrast invariant differential operators we shall deal with in
image and curve smoothing.

\section{Tangent, normal, and curvature}

We summarize  in this section the concepts and results about
smooth curves that are needed in this chapter and elsewhere in the
book. The curves we considered will always be plane curves.

\begin{definition}
We call \textit{simple arc}  or \textit{Jordan arc} the image $\Gamma$ of a continuous one-to-one function
$\fxx:[0,1]\to\RR^2$, $\fxx(t)=(x(t),y(t))$.  We say that $\Gamma$ is a \textit{simple closed curve} or \textit{Jordan
curve} if the mapping restricted to $(0,1)$ is one-to-one and if $\fxx(0)=\fxx(1)$. If $\fxx$ is continuously
differentiable on $[0,1]$, we define
  the arc length of the segment of the curve between $\fxx(t_0)$ and
  $\fxx(t)$ by
\begin{equation}\label{arclength}
L(\fxx,t_0,t)=\int_{t_0}^{t}|\fxx'(\tau)|\,\rmd \tau=\int_{t_0}^{t}\sqrt{\fxx'(\tau)\cdot\fxx'(\tau)}\,\rmd \tau.
\end{equation} In particular, set
$$L(t)=L(\fxx, 0, t)=\int_{0}^{t}|\fxx'(\tau)|\,\rmd \tau=\int_{0}^{t}\sqrt{\fxx'(\tau)\cdot\fxx'(\tau)}\,\rmd \tau.$$
\end{definition}



The curves we deal with will always be smooth. Now, we want the definition of ``smoothness'' to describe an intrinsic
property of $\Gamma$ rather than a property of some parameterization $\fxx(s)$ of $\Gamma$. If a function $\fxx$
representing $\Gamma$ is $C^1$, then the function $L$ in equation \eqref{arclength} has a derivative with respect to
$s$,
\[
L'(t)=|\fxx'(t)|
\]
that is continuous. Nevertheless,  the curve itself may not conform to our idea of being smooth, which at a minimum
requires a tangent at every point $\fxy\in\Gamma$. For example, the motion of a point on the boundary of a unit disk as
it rolls along the $x$-axis is described by $\fxx(t)=(t-\sin t, 1-\cos t)$, which is a $C^\infty$ function.
Nevertheless, the curve has cusps at all multiples of $2\pi$. The problem is that $\fxx'(2k\pi)=0$.

\begin{definition}\label{definition4.1}
We say that a curve  $\Gamma$ admits an arc-length parameterization $s\in \RR\mapsto\fxx(s)$ if the function $\fxx$ is
$C^1$ and $L'(s)=|\fxx'(s)|=1$ for all s. In case $\Gamma$ is closed, we identify $[0,l(\Gamma)]$ algebraically with
the circle group by adding elements of $[0,l(\Gamma)]$ modulo $l(\Gamma)$. We say that $\Gamma$ is $C^m$, $m\in\mathbb
N$, $m\geq1$, if the arc-length parameterization $\fxx$ is a $C^m$ function.
\end{definition}

\begin{exercise}
The aim of the exercise is to give a formula transforming  a $C^1$ parameterization $t\in [0,1]\to \fxx(t)$
 such that $|\fxx'(t)|\neq 0$ for all $t$ into an arc-length parameterization. Notice that $L: [0,1]\to [0, L(1)]$
 is increasing. Set, for $s\in [0, L(1)]$,  $\tilde \fxx(s)=\fxx(L^{-1}(s))$ and check that $\tilde \fxx$ is an arc-length
 parameterization
 of the curve defined by $\fxx.$ \finex
\end{exercise}

 An arc-length parameterization is also called a
{\em Euclidean parameterization}. If a Jordan curve has an arc-length parameterization $\fxx$, then the domain of
definition of $\fxx$ on the real line must be an interval $[a,b]$, where $b-a$ is the length of $\Gamma$, which we
denote by $l(\Gamma)$. In this case, we will always take $[0,l(\Gamma)]$ as the domain of definition of $\fxx$.

\begin{definition}\label{definition4.2} Assume that $\Gamma$ is $C^2$ and
let $s\mapsto\fxx(s)$ be an arc-length parameterization. The tangent vector ${\bm\tau}$ is defined as
${\bm\tau}(s)=\fxx'(s)$. The curvature vector of the curve $\Gamma$ is defined by ${\bm\kappa}(s)=\fxx''(s)$. The
normal vector $\fxn(s)$ is defined by $\fxn(s)={\bm\tau}^\perp$, where $(x,y)^\perp=(-y,x)$.
\end{definition}
One can easily describe all Euclidean parameterizations of a Jordan curve.

\begin{proposition}\label{proposition4.3}
Suppose that $\Gamma$ is a $C^1$ Jordan curve
with arc-length parameterization $\fxx:[0,l(\Gamma)]\to\Gamma$.
Then any other arc-length parameterization
$\fxy:[0,l(\Gamma)]\to\Gamma$ is of the form
$\fxy(s)=\fxx(s+\sigma)$ or $\fxy(s)=\fxx(-s+\sigma)$ for some
$\sigma\in[0,l(\Gamma)]$. \end{proposition}

 \begin{proof}
 Denote by $C$ the interval $[0,l(\Gamma)]$,  defined as
 an additive subgroup of $\RR$ modulo $l(\Gamma)$.
 Let  $\fxx, \; \fxy:  C\mapsto \Gamma$  be two length preserving
 parameterizations of $\Gamma.$  Then $f=\fxx\circ\fxy^{-1}$ is a
 length preserving bijection of $C$. Using the parameterization of
 $C$, this implies $f(s)=\pm s
 +\sigma$ for some $\sigma\in [0, l(\Gamma)]$ and the proof is easily
 concluded.  (See  exercise \ref{exercise4.1} for some more details.)
\end{proof}


\begin{proposition} \label{proposition4.4}
Let $\Gamma$ be a $C^2$ Jordan curve,
and let $\fxx$ and $\fxy$ by any two arc-length parameterizations of $\Gamma$.
\begin{enumerate}[$(i)$]\setlength\itemsep{2pt}
\item If $\fxx(s)=\fxy(t)$, then $\fxx'(s)=\pm\fxy'(t)$.
\item The vector $\bm{\kappa}$ is independent of the choice of arc-length
parameterizations and it is orthogonal to $\bm{\tau}=\fxx'$.
\end{enumerate}
\end{proposition}
\begin{proof} By Proposition \ref{proposition4.3},
$\fxy(s)=\fxx(\pm s+\sigma)$ and $(i)$ follows by differentiation. This is also geometrically obvious: $\fxx'(s)$ and
$\fxy'(t)$ are unit vectors tangent to $\Gamma$ at the same point. Thus, they either point in the same direction or
they point in opposite directions.

Using any of the above representations and differentiating twice
shows that $\fxx''=\fxy''$. Since $\fxx'\cdot\fxx'=1$,
differentiating this expression shows that $\fxx''\cdot\fxx'=0$.
Thus, $\fxx''$ and $\fxx'$ are orthogonal and $\fxx''$ and
$\fxx'^\perp$ are collinear.
\end{proof}

It  will be convenient to have a flexible notation for the
curvature in the different contexts we will use it. This is the
object of the next definition.
\begin{definition}[and notation] Given a $C^2$ curve $\Gamma$, which is
parameterized by length as $s\mapsto \fxx(s)$ and $\fxx=\fxx(s)$ a
point of $\Gamma$, we denote in three equivalent ways the
curvature of $\Gamma$ at $\fxx=\fxx(s)$,
$$\bm{\kappa}(\fxx)=\bm{\kappa}(\fxx(s))=
\bm{\kappa}(s)=\fxx''(s).$$ In the first notation, $\bm\kappa$ is the curvature of the  curve $\Gamma$ at a point
$\fxx$ implicitly supposed to belong $\Gamma$. In the second notation a particular parameterization of $\Gamma$,
$\fxx(s)$, is being used. In the third one, $\fxx$ is omitted.
\end{definition}
The above notations create no ambiguity or contradiction, since by
Proposition \ref{proposition4.4} the curvature is independent of
the Euclidean parameterization. Of course, a smooth Jordan curve
is locally a graph. More specifically:
 \begin{proposition}\label{figureafaire} A $C^1$ Jordan arc $\Gamma$ can be
represented around each one of its points $\fxx_0$ as the graph of a $C^1$ scalar function $y=f(x)$ such that
$\fxx_0=(0,f(0))=(0,0)$,  $f'(0)=0$, and \begin{equation}\label{courburedegraphe}\bm{\kappa}(\fxx_0)=(0,
f''(0)).\end{equation}
 Conversely, the graph of any $C^1$ function $f$ is a $C^1$ Jordan arc. If $f$ is $C^2$ the  curvature of its associated
 Jordan curve satisfies
 \eqref{courburedegraphe} at each point where $f'(0)=0$.
\end{proposition}
\begin{proof}
 Assume we are given a $C^1$ Jordan arc $\Gamma$
and an arc-length parameterization $\fxc$ in a neighborhood of $\fxx_0=\fxc(s_0)\in\Gamma$. We assume, without loss of
generality, that $s_0=0$. Then we can establish a local coordinate system with origin  $\fxx_0$ and based on the two
unit vectors $\fxc'(0)$ and $\fxc'(0)^\perp$ where the $x$-axis is positive in the direction of $\fxc'(0)$. If we write
$\fxc(s)=(x(s),y(s))$ in this coordinate system, then
\begin{align*}
x(s)&=\fxc(s)\cdot\fxc'(0),\\
y(s)&=\fxc(s)\cdot\fxc'(0)^\perp.
\end{align*}
Since $\rmd x/\rmd s(s)=\fxc'(s)\cdot\fxc'(0)$,  $\rmd x/\rmd s(0)=1$. Then the inverse function theorem implies the
existence of a $C^1$ function $g$ and a $\delta>0$ such that $s=g(x)$ for $|x|<\delta$. This means that, for
$|x|<\delta$, $\Gamma$ is represented locally by the graph of the $C^1$ function
$f(x)=y(g(x))=\fxc(g(x))\cdot\fxc'(0)^\perp$. To be slightly more precise, denote the graph of $f$ for $|x|<\delta$ by
$\Gamma_f$. Since $g$ is one-to-one, $\Gamma_f$ is a homeomorphic image of the open interval $(-\delta,\delta)$ and
$\Gamma_f\subset\Gamma$. If $\Gamma$ is $C^2$, then $f$ is $C^2$ and $f''(0)=\fxc''(0)\cdot\fxc'(0)^\perp$. Thus, on
the local coordinate system, the coordinates of $c''(0)=\bm{\kappa}(x_0)$ are $(0, f''(0))$.

Conversely, given a $C^1$ function $f$, we can  consider the graph $\Gamma_f$ of $f$ in a neighborhood of the origin.
Then $\Gamma_f$ is represented by $\fxc$, where $\fxc(x)=(x,f(x))$. We may assume that $f(0)=0$ and $f'(0)=0$ (by a
translation and rotation if necessary). The arc-length along $\Gamma$ is measured by
\[
s(x)=\int_0^x\sqrt{1+[f'(t)]^2}\,\rmd t,
\]
and $s'(x)=\sqrt{1+[f'(x)]^2}$, so that $s'(0)=1$.  This time there is a $C^1$ function $h$ such that $h(s)=x$ and
$h'(s)=(1+[f'(h(s))]^2)^{-1/2}$. Then $\Gamma$ is represented by $\tilde\fxc(s)=(h(s), f(h(s)))$. Short computations
show that $|\tilde\fxc'(s)|=1$. If in addition $f$ is $C^2$, then $\Gamma$ is $C^2$ and it is an easy check that
$\tilde\fxc''(0)\cdot\tilde\fxc'(0)^\perp=f''(0)$.
\end{proof}
\begin{exercise} Make the above ``short computations" and  the ``easy check''.
\finex
\end{exercise}

\section{The structure of the set of level lines\label{levellinestructure}}

We saw in Chapter \ref{Chap3} how an image can be represented by its level sets. The next step, with a view toward
shape analysis, is the representation of an image in terms of its level lines. We rely heavily on the implicit function
theorem to develop this representation. We begin with a two-dimensional version. The statement here is just a slight
variation on the implicit function theorem quoted in section \ref{sectionI.4}.

\begin{theorem}\label{theorem4.5}
Let $u\in \mathcal F$ be a $C^1$ function such that $Du(\fxx_0)\ne0$ at some $\fxx_0=(x_0,y_0)$. Let $\bm{i}$
 denote the unit vector in the direction
$(u_x,u_y)$, let $\bm{j}$ denote the unit vector in the orthogonal
direction $(-u_y,u_x)$, and write $\fxx=\fxx_0+x\bm{i}+y\bm{j}$.
Then there is a disk $D(\fxx_0, r)$ and
 a unique $C^1$ function $\varphi$, $\varphi:[-r,r]\to\RR$, such that if
 $\fxx\in D(\fxx_0, r)$, then
\[
u(x,y)=u(\fxx_0)\quad \Longleftrightarrow\quad x=\varphi(y).
\]
\end{theorem}
  The following
corollary is a global version of this local result.

\begin{corollary}\label{corollary4.6}Assume that $u\in  \mathcal F$ is $C^1$  and let
$u^{-1}(\lambda)=\{\fxx\mid u(\fxx)=\lambda\}$ for
$\lambda\in\RR$. If $\lambda\neq u(\infty)$ and  $Du(\fxx)\ne0$
for all $\fxx\in u^{-1}(\lambda)$, then $u^{-1}(\lambda)$ is a
finite union of disjoint Jordan curves.
\end{corollary}
\begin{proof}From Theorem \ref{theorem4.5} we know that for each point $\fxx\in
u^{-1}(\lambda)$ there is an open disk $D(\fxx,r(\fxx))$ such that $\overline{D}(\fxx,r(\fxx))\cap u^{-1}(\lambda)$ is
a $C^1$ Jordan arc $\fxx(s)$ and we can take the endpoints of the arc on $\partial D(\fxx,r(\fxx))$.  Since
$\lambda\neq u(\infty)$, $u^{-1}(\lambda)$ is compact.  Thus there is a finite number of points $\fxx_i$,
$i=1,\ldots,m$, such that $u^{-1}(\lambda)\subset\bigcup_{i=1}^mD(\fxx_i,r(\fxx_i))$. This implies that
$u^{-1}(\lambda)$ is a finite union of Jordan arcs which we can parameterize by length. The rest of the proof is very
intuitive and is left to the reader. I consists of iteratively gluing the Jordan arcs until they close up into one or
several Jordan curves.
  \end{proof}


\begin{figure}[!t]
\setkeys{Gin}{width=10cm} \centerline{
\includegraphics{fig04.02.1.eps}
} \caption{\label{42} Level lines as representatives of  the
shapes present in an image.  Left: noisy binary image with two
apparent shapes; right: the two longest level lines.}
\end{figure}


The next theorem is one of the few results that we are going to
quote rather than prove, as we have done with the implicit
function theorem.

\begin{theorem}[Sard's theorem] Let $u\in\mathcal F\cap C^1$. Then for
 almost every $\lambda$ in the range of $u$, the set
  $u^{-1}(\lambda)$ is nonsingular, which means that for all $\fxx\in u^{-1}(\lambda)$,
   $Du(\fxx)\ne0$.
\end{theorem}
As a direct consequence of Sard's Theorem and  Corollary
\ref{corollary4.6}, we obtain:

\begin{corollary}Let $u\in \mathcal F\cap C^1$. Then for almost
 every $\lambda$ in the range of $u$, the set $u^{-1}(\lambda)$ is the union
 of   a finite set of
 disjoint simple closed $C^1$ curves.
\end{corollary}
 The sole purpose of the next proposition is to convince the
reader that the level lines of
 a function provide a faithful representation of the function.
  \begin{proposition} Let $u\in \mathcal F\cap C^1$.
   Then $u$ can be reconstructed from the following data: the  family of all of its level lines at
  nonsingular levels, the level of each level line being also kept.
  \end{proposition}
  \begin{proof} Let  $G$ be the
  closure of the union of the ranges of all level lines of $u$ at nonsingular
  levels.
If $\fxx\in G$, then there are points $\fxx_n$ belonging to level
lines of some levels $\lambda_n$ such that $\fxx_n\to \fxx$. As a
consequence, $\lambda_n=u(\fxx_n)\to  u(\fxx)$. So we get back the
value of $u(\fxx)$.
\newline Let now $\fxx$ belong to the  open set
$G^{c}$. Let us first prove that $Du(\fxx)=0$. Assume by contradiction that $Du(\fxx)\neq 0$. By using the first order
Taylor expansion of $u$ around $\fxx$, one sees that for all $r>0$ the connected range $u(B(\fxx,r))$ must contain some
interval $(u(\fxx)-\alpha(r), u(\fxx)+\alpha(r))$ with $\alpha(r)\to 0$ as $r\to 0$. By Sard's theorem some of the
values in this interval are nonsingular. Thus we can find nonsingular levels $\lambda_n\to u(\fxx)$ and points
$\fxx_n\to \fxx$ such that $u(\fxx_n)=\lambda_n$. This implies that $\fxx\in G$ and yields a contradiction.
\newline Thus $Du(\fxx)=0$ on $G^c$ and $u$ is
therefore constant on each connected component $A$ of $G^c$. The
value of $u$ is then uniquely determined by the value of $u$ on
the boundary of $A$. This value is known, since $\partial A$ is
contained in $G$.
  \end{proof}

\begin{figure}[!t]
\setkeys{Gin}{width=6cm} \centerline{
\includegraphics{fig04.01.1.eps}
\includegraphics{fig04.01.2.eps}
}
\caption[Level lines]{\label{fig41}Level lines as a complete representation of the shapes present in an image. All level lines of the image of a sea bird for levels that are multiples of 12 are displayed. Notice that we do not need a previous smoothing to visualize the shape structures in an image: It is sufficient to quantize the displayed levels.}
\end{figure}


\section{Curvature of the level lines}

\subsection*{The intrinsic local coordinates}
We continue to work in $\RR^2$.  Consider a real-valued function $u$ that is twice continuously differentiable in a
neighborhood of $\fxx_0\in\RR^2$.   To simplify the notation, we will often write $Du$ rather than $Du(\fxx_0)$, and so
on.

\begin{definition}
If  $Du=(u_x,u_y)\not=0$, then we establish a local coordinate system by letting $\bm{i}=Du/|Du|$ and
$\bm{j}={Du}^{\perp}/|Du|$, where ${Du}^{\perp}=(-u_y,u_x)$. Thus, for a point $\fxx$ near $\fxx_0$, we write
$\fxx=\fxx_0+x\bm{i}+y\bm{j}$ and the  local coordinates of $\fxx$ are $(x,y)$. (See Figure \ref{fig43}.) Without risk
of ambiguity we shall write $u(x,y)$ for $u(\fxx)=u(\fxx_0+x\bm{i}+y\bm{j}).$
\end{definition}
Since $u$ is $C^2$, we can use  Taylor's formula to express $u$ in this coordinate system in a neighborhood of
$\fxx_0$.
\begin{equation}\label{57}
u(\fxx)=u(x,y)=u(\fxx_0)+px+ax^2+by^2+cxy+O(|\fxx|^3),
\end{equation}
where $p=u_x(0,0)=|Du(\fxx_0)|>0$ and

\begin{equation}\label{58}
\begin{alignedat}{2}
a&=\frac{1}{2}\frac{\partial^2 u}{\partial x^2}(0,0)=&\frac1{2}D^2u\Big(\frac{Du}{|Du|},\frac{Du}{|Du|}\Big)(\fxx_0),\\
b&=\frac{1}{2}\frac{\partial^2 u}{\partial y^2}(0,0)=&\frac1{2}D^2u\Big(\frac{Du^{\perp}}{|Du|},\frac{Du^{\perp}}{|Du|}\Big)(\fxx_0),\\
c&=\frac{\partial^2 u}{\partial x\partial y}(0,0)=&D^2u\Big(\frac{Du^{\perp}}{|Du|},\frac{Du}{|Du|}\Big)(\fxx_0).
\end{alignedat}
\end{equation}



\begin{exercise}
Check the three above formulas. \finex
\end{exercise}
\begin{figure}[!t]
\setkeys{Gin}{width=4cm} \centerline{
\includegraphics{fig04.03.1.eps}
} \caption[Intrinsic coordinates]{\label{fig43}Intrinsic coordinates.  Note that $\varphi''(0)>0$, so $b<0$.}
\end{figure}


The implicit function theorem \ref{theorem4.5} ensures that in a neighborhood of $\fxx_0$ the set $\{\fxx\mid
u(\fxx)=u(\fxx_0)\}$ is a $C^2$ graph whose equation can be written in the local coordinates $x=\varphi(y)$, where
$\varphi$ is a $C^2$ function in an interval $I$ containing $y=0$. In this interval, we have
$u(\varphi(y),y)=u(\fxx_0)$. Differentiating this shows that $u_x\varphi'+u_y=0$ for $y\in I$. Since
$|Du(\fxx_0)|=u_x(0,0)$ and $u_y(0,0)=0$ in our coordinate system, we obtain $\varphi'(0)=0$. A second differentiation
of $u_x(\varphi(y),y)\varphi'+u_y(\varphi(y),y)=0$  yields
\[
(u_{xx}\varphi'+u_{xy})\varphi'+ u_x\varphi''+u_{yx}\varphi'+u_{yy}=0.
\]
Since $\varphi'(0)=0$, we obtain $\varphi''(0)=-u_{yy}(0,0)/u_x(0,0)$. Using the notation of \eqref{58}, one obtains
\begin{equation}\label{59}
\varphi(y)=-\frac{b}{p}y^2+o(y^2).
\end{equation}

Equation \eqref{59} is the representation of the level line $\{\fxx\mid u(\fxx)=u(\fxx_0)\}$ in the intrinsic
coordinates at $\fxx_0$. Let us set $|2b/p|=1/R$. If the curve is a circle,  $R$ is the radius of this circle. More
generally $R$ is called {\it radius of the osculatory circle} to  the curve. See exercise \ref{radiusofcircle}.

We are now going to  do another simple computation to determine the curvature vector of the Jordan arc $\fxc$ defined
by $\fxc(y)=\fxx_0+ \varphi(y)\bm{i}+y\bm{j}$ near $y=0$. Recall that we denote the curvature of a curve $\fxc$ by
$\bm{\kappa}(\fxc)$ and the value of this function at a point $\fxc(y)$ by $\bm{\kappa}(\fxc)(y)$.) Since in the local
coordinates $\fxc'(y)=(\varphi'(y),1)$ and $\fxc''(y)=(\varphi''(y),0)$, at $y=0$, we have  $\fxc'(0)=(0,1)$ and
$\fxc''(0)=(\varphi''(0),0)$, so that $\fxc''(0)\cdot\fxc'(0)=0$. Using this and the expression of the curvature in
local graph coordinates \eqref{courburedegraphe} yields
$$\bm{\kappa}(\fxc)(0)=(\varphi''(0),0)=\varphi''(0)\frac{Du}{|Du|}(\fxx_0).$$ We now use \eqref{59} and \eqref{58} to write the last
expression as
\begin{equation}\label{eqcurv}
\bm{\kappa}(\fxc)(0)=-\frac1{|Du|}D^2u\Big(\frac{Du^{\perp}}{|Du|},\frac{Du^{\perp}}{|Du|}\Big)\frac{Du}{|Du|}(\fxx_0)
\end{equation}
 This tells us that the vectors $\bm{\kappa}(\fxc)(0)$ and $Du(0)$ are collinear.
  Equation \eqref{eqcurv} also leads to the following definition  and lemma introducing a scalar curvature.

\begin{definition}\label{definition4.14} Let $u$ be a real-valued function that is  $C^2$ in a neighborhood
of a point $\fxx\in\RR^2$ and assume that $Du(\fxx)\not=0$. The curvature of $u$ at $\fxx$, denoted by ${\rm
curv}(u)(\fxx)$, is the real number defined in the local coordinates at $\fxx$ by
\begin{equation}\label{curvu}
\frac{1}{|Du|^3}D^2u(Du^{\perp},Du^{\perp})(\fxx)=\frac{u_{xx}u_y^2-2u_{xy}u_xu_y+u_{yy}u_x^2}{(u_x^2+u_y^2)^{3/2}}(0,0).
\end{equation}
\end{definition}

\begin{exercise}
Check the above identity. \finex
\end{exercise}

\begin{lemma} Assume that $u:\RR^2\to\RR$ is $C^2$
 in a neighborhood of a point $\fxx_0$ and assume that $Du(\fxx_0)\not=0$.
  Let $N=N(\fxx_0)$ be a  neighborhood  of $\fxx_0$ in which the iso-level set
  of $u$, $\{\fxx\mid u(\fxx)=u(\fxx_0)\}$, is a simple $C^2$ arc,
   which we still denote by $\fxx=\fxx(s)$. Then at every point
   $\fxx$ of this arc,
\begin{equation}\label{eq62x}
\bm{\kappa}(\fxx)=-{\rm curv}(u)(\fxx)\frac{Du}{|Du|}(\fxx).
\end{equation}
\end{lemma}

\begin{proof} This is an immediate consequence of  \eqref{eqcurv} and \eqref{curvu}. We need only remark that,
given the hypotheses of the lemma, there is a neighborhood $N$ of $\fxx_0$ such that $Du(\fxx)\not=0$ for $\fxx\in N$
and such that $\{\fxx\mid u(\fxx)=u(\fxx_0)\}$ is a simple $C^2$ arc for $\fxx\in N$. Then the argument we made to
derive \eqref{eqcurv} holds for any point $\fxx\in N\cap\{\fxx\mid u(\fxx)=u(\fxx_0)\}$.
\end{proof}
The next exercise proposes as a sanity check a verification that the curvature thus defined is contrast invariant and
rotation invariant.
\begin{exercise}\label{exercise4.5} Use equation \eqref{curvu} to show that
\begin{equation}
{\rm curv}(u)=\frac{\partial}{\partial x}\Big(\frac{Du}{|Du|}\Big)+\frac{\partial}{\partial
y}\Big(\frac{Du}{|Du|}\Big)={\rm div}\Big(\frac{Du}{|Du|}\Big).
\end{equation}
Use this last relation to show that ${\rm curv}(g(u))={\rm curv}(u)$ if $g$ is any $C^2$ function $g:\RR\to\RR$ such
that $g'(x)>0$ for all $x\in\RR$. What happens if $g'(x)<0$ for all $x\in\RR$?  Show that ${\rm curv}(U)={\rm
curv}(u)$, where $U(s,t)=u(x,y)$ and $x=s\cos\theta-t\sin\theta$, $y=s\sin\theta+t\cos\theta$. Check that ${\rm
curv}(-u)=-{\rm curv}(u)$ and give a geometric interpretation to this relation. \finex
\end{exercise}


Before leaving this section, we wish to emphasize geometric aspects of the functions we have introduced. Perhaps the
most important fact is that the curvature of a $C^2$ Jordan arc $\Gamma$ is an intrinsic property of $\Gamma$; it does
not depend on the parameterization. If $\fxx$ is a point on $\Gamma$, then the curvature vector $\bm{\kappa}(\fxx)$
points toward the center of the osculating circle. Furthermore, $1/|\bm{\kappa}(\fxx)|$ is the radius of this circle,
so when $|\bm{\kappa}(\fxx)|$ is large, the osculating circle is small, and the curve is "turning a sharp corner."

If $Du(\fxx)\not=0$, then the vector $Du(\fxx)$ points in the direction of greatest increase, or steepest ascent, of
$u$ at $\fxx$: Following the gradient leads uphill. The function ${\rm curv}(u)$ does not have such a clear geometric
interpretation, and it is perhaps best thought of in terms of equation \eqref{eq62x}: ${\rm curv}(u)(\fxx)$ is the
coefficient of $-Du(\fxx)/|Du(\fxx)|$ that yields the curvature vector $\bm{\kappa}(\fxx)$ of the level curve through
the point $\fxx$. We cannot over emphasize the importance of the two operators curv and Curv for the theories that
follow. In addition to \eqref{eq62x}, a further relation between these operators is shown in Proposition
\ref{proposition5.8}, and it is this result that connects function smoothing with curve smoothing.

\section{The principal curvatures of a level surface}

We saw in Exercise \ref{exercise4.5} that ${\rm curv}(u)$ was
contrast invariant. This idea will be generalized to $\RR^N$ by
introducing other differential operators that are contrast
invariant. These operators will be functions of the
\textit{principal curvatures} of the level surfaces of $u$. For
$\fxz\in\RR^N$, $\fxz^\perp$ will denote the hyperplane
$\{\fxy\mid \fxz\cdot\fxy=0\}$ that is orthogonal to $\fxz$.
(There should be no confusion with this notation and the same
notation for $\fxz\in\RR^2$. In $\RR^2$, $\fxz^\perp$ is a vector
orthogonal to $\fxz$, and the corresponding ``hyperplane'' is the
line $\{t\fxz^\perp\mid t\in\RR\}$.)

\begin{proposition}\label{proposition4.16} Assume that $u:\RR^N\to\RR$ is $C^2$ in a
neighborhood of a point $\fxx_0$ and assume that
$Du(\fxx_0)\not=0$. Let $g:\RR\to\RR$ be a $C^2$ contrast change
such that $g'(s)>0$ for all $s\in\RR$.  Then
$Dg(u(\fxx_0))=g'(u(\fxx_0))Du(\fxx_0)$, and
$\tilde{D}^2g(u(\fxx_0))=g'(u(\fxx_0))\tilde{D}^2u(\fxx_0)$, where
$\tilde{D}^2u(\fxx_0)$ denotes the restriction of the quadratic
form $D^2u(\fxx_0)$  to the hyperplane $Du(\fxx_0)^\perp$. This
means, in particular, that $(1/|Du(\fxx_0)|)\tilde{D}^2u(\fxx_0)$
is invariant under such a contrast change.
\end{proposition}

\begin{proof}To simplify the notation, we will suppress the argument $\fxx_0$; thus, we write $Du$ for $Du(\fxx_0)$, and so on. We use the notation $\fxy\otimes\fxy$, $\fxy\in\RR^N$, to denote the linear mapping $\fxy\otimes\fxy:\RR^N\to\RR^N$ defined by $(\fxy\otimes\fxy)(\fxx)=(\fxx\cdot\fxy)\fxy$. The range of $\fxy\otimes\fxy$ is the one-dimensional space $\RR\fxy$.

An application of the chain rule shows that $Dg(u)=g'(u)Du$. This implies that $Du^\perp=Dg(u)^\perp$. (Recall that $g'(s)>0$ for all $s\in\RR$.) A second differentiation shows that
\[
D^2g(u)=g''(u)Du\otimes Du+g'(u)D^2u.
\]
If $\fxy\in Du^\perp$, then $(Du\otimes Du)(\fxy)=0$ and $D^2g(u)(\fxy,\fxy)=g'(u)D^2u(\fxy,\fxy)$. This means that
$D^2g(u)=g'(u)D^2u$ on $Du^\perp=Dg(u)^\perp$, which proves the result.
\end{proof}
\begin{exercise}
Taking euclidian coordinates, give the matrix of $\fxy\otimes \fxy$. Check the above differentiations.
\finex
\end{exercise}
 We are now going to define locally the  level surface of a smooth function $u$, and for this we
quote one more version of the implicit function theorem, in arbitrary dimension $N$.

\begin{theorem}[Implicit function theorem]\label{theorem4.17} Assume that $u:\RR^N\to\RR$ is $C^m$ in the neighborhood of $\fxx_0$ and assume that $Du(\fxx_0)\not=0$. Write $\fxx=\fxx_0+\fxy+z\bm{i}$, where $\bm{i}=Du(\fxx_0)/|Du(\fxx_0)|$
and  $\fxy\in Du(\fxx_0)^\perp$. Then there exists a ball $B(\fxx_0,\rho)$ and a unique real-valued $C^m$ function
$\varphi$ defined on $B(\fxx_0,\rho)\cap\{\fxx\mid\fxx=\fxx_0+\fxy, \bm{i}\cdot\fxy=0\}$ such that for every $\fxx\in
B(\fxx_0,\rho)$
\[
u(\fxx)=u(\fxx_0) \Longleftrightarrow \varphi(\fxy)=z.
\]
\end{theorem}

In other words, the equation $\varphi(\fxy)=z$ describes the set
$\{\fxx\mid u(\fxx)=u(\fxx_0)\}$ near $\fxx_0$ as the graph of a
$C^m$ function $\varphi$. Thus, locally we have a surface passing
through $\fxx_0$ that we call the \textit{level surface of $u$
around $\fxx_0$}.

We are going to use Proposition \ref{proposition4.16} and Theorem \ref{theorem4.17}, first, to give a simple intrinsic
representation for the level surface of a function $u$ around a point $\fxx_0$ and, second, to relate the eigenvalues
of the quadratic form introduced in Proposition \ref{proposition4.16} to the curvatures of lines drawn on the level
surface of $u$.

\begin{proposition} Assume that $u:\RR^N\to\RR$ is $C^2$ in a neighborhood of
 $\fxx_0\in\RR^N$ and that $p=Du(\fxx_0)\not=0$. Denote the eigenvalues of the
  restriction of the quadratic form $D^2u(\fxx_0)$ to the
  hyperplane $Du(\fxx_0)^\perp$
  by $\mu_1,\dots,\mu_{N-1}$. Let $\bm{i}_N=Du(\fxx_0)/|Du(\fxx_0)|$ and
   select $\bm{i}_1,\ldots,\bm{i}_{N-1}$ so they form an orthonormal basis of
   eigenvectors of the restriction of $D^2u(\fxx_0)$ to  $Du(\fxx_0)^\perp$.
   Write $\fxx=\fxx_0+\fxz$, where
   $\fxz=x_1\bm{i}_1+\cdots+x_N\bm{i}_N=\fxy+x_N\bm{i}_N$.
   Then if $|\fxz|$ is sufficiently small, the function $\varphi(\fxy)=x_N$ that
   solves
   the equation $u(\fxy,\varphi(\fxy))=u(\fxx_0)$ can be expressed locally as
\[
x_N=\frac{-1}{2p}\sum_{i=1}^{N-1}\mu_ix_i^2+o(|\fxy|^2).
\]
\end{proposition}

\begin{proof}Assume, without loss of generality, that $\fxx_0=0$ and that $u(0)=0$.
 Using the notation of Theorem \ref{theorem4.17}, for $\fxx\in B(0,\rho)$, $u(\fxy,x_N)=0$ if and only
 if $\varphi(\fxy)=x_N$, and $\varphi$ is $C^2$ in $B(0,\rho)$. Furthermore, by differentiating the expression
 $u(\fxy,\varphi(\fxy))=0$, we see that $u_{x_i}+u_{x_N}\varphi_{x_i}=0$, $i=1,\ldots,N-1$ for $|\fxx|<\rho$.
 In particular, $u_{x_i}(0)+u_{x_N}(0)\varphi_{x_i}(0)=0$. In the local coordinate system we have chosen,
  $|Du(0)|=|u_{x_N}(0)|$, and since $Du(0)\not=0$, we conclude that $u_{x_i}(0)=0$ for $i=1,\ldots,N-1$ and
  hence that $\varphi_{x_i}(0)=0$ for $i=1,\ldots,N-1$. This means that the local expansion of $\varphi$
  has the form
\[
\varphi(\fxy)=\frac1{2}D^2\varphi(0)(\fxy,\fxy)+o(|\fxy|^2).
\]

Now differentiate the relation $u_{x_i}+u_{x_N}\varphi_{x_i}=0$ again to obtain
\[
u_{x_ix_j}+u_{x_ix_N}\varphi_{x_j}+(u_{x_Nx_j}+u_{x_Nx_N}\varphi_{x_j})\varphi_{x_i}+u_{x_N}\varphi_{x_ix_j}=0.
\]
Since we have just shown that $\varphi_{x_i}(0)=0$ for $i=1,\ldots,N-1$, we see from this last expression that $\tilde
D^2u(0)+p\tilde D^2\varphi(0)=0$, where $p=u_{x_N}(0)$ and $\tilde D^2u(0)$, $\tilde D^2\varphi(0)$ are the
restrictions of the quadratic forms $D^2u(0)$ and $D^2\varphi(0)$ to the hyperplane $Du(0)^\perp$. Thus we have
\begin{equation}\label{513}
x_N=\frac{-1}{2p}D^2u(0)(\fxy,\fxy)+o(|\fxy|^2).
\end{equation}
Recall that $\fxy\in Du(0)^\perp$ and that $\fxy=x_1\bm{i}_1+\cdots+x_{N-1}\bm{i}_{N-1}$, where the $\bm{i}_i$ are an
orthonormal basis of eigenvectors of $D^2(0)$ restricted to $Du(0)^\perp$. Thus,
\[
x_N=\frac{-1}{2p}\sum_{i=1}^{N-1}\mu_ix_i^2+o(|\fxy|^2),
\]
which is what we wished to prove.
\end{proof}

This formula reads
\[
x_2=\frac{-1}{2p}\mu_1x_1^2+o(|x_1|^2)
\]
if $N=2$, which is just equation \eqref{59} with different notation.
 Thus, $\mu_1=|Du|{\rm curv}(u)$, confirming that
 $\mu_1=\partial^2 u/\partial x_1^2$.
We are now going to use our two-dimensional analysis to give a
further interpretation of the eigenvalues $\mu_i$ for $N>2$. We
begin by considering the curve $\Gamma_{\bm\nu}$ defined by the
two equations $\fxx=\fxx_0+t{\bm\nu}+x_N\bm{i}_N$ and
$\varphi(t{\bm\nu})=x_N$,
 where ${\bm\nu}$ is a unit vector in $Du(\fxx_0)^\perp$. Their
 solution in the local coordinates is $\varphi(t\bm{\nu})=x_N$,
 whenever $t\in\RR$ is small.  Thus, $\Gamma_\nu$ is a curve passing
 by $\fxx_0$, drawn on the level surface of  $u$ and projecting into a straight line
 of $Du^\perp$.
 By \eqref{513} its equation is
\[
x_N=\varphi(t\bm{\nu})=\frac{-1}{2|Du(\fxx_0)|}D^2u(\fxx_0)({\bm\nu},\bm{\nu})t^2+o(t^2),
\]
and its normal at $\fxx_0$ is $\frac{Du(\fxx_0)}{|Du(\fxx_0)|}.$ Thus the curvature vector
 of $\Gamma_\nu$ at $\fxx_0$ is
\[
\bm{\kappa}(\Gamma_{\bm\nu})(\fxx_0)=\frac{-1}{|Du(\fxx_0)|}D^2u(\fxx_0)({\bm\nu},{\bm\nu})\frac{Du(\fxx_0)}{|Du(\fxx_0)|}.
\]
By defining
$\kappa_{\bm\nu}=|Du(\fxx_0)|^{-1}D^2u(\fxx_0)({\bm\nu},{\bm\nu})$,
we have
\[
\bm{\kappa}(\Gamma_{\bm{\bm\nu}})(\fxx_0)=-\kappa_{\bm\nu}\frac{Du(\fxx_0)}{|Du(\fxx_0)|},
\]
which has the same form as equation \eqref{eq62x}. So the modulus
of $\kappa_{\bm\nu}$ is equal to the modulus of the  curvature of
$\Gamma_\nu$ at $\fxx_0$. This leads us to call principal
curvatures of the level surface of $u$ at $\fxx_0$ the numbers
$\kappa_{\bm{\nu}}$ obtained by letting $\bm{\nu}=\bm{i}_j$,
$j=1,\ldots,N-1$, where the unit vectors $\bm{i}_j$ are an
orthonormal system of eigenvectors of $D^2u(\fxx_0)$ restricted to
$Du(\fxx_0)^\perp$.

\begin{definition}\label{definition4.19} Let $u:\RR^2\to \RR$ be
$C^2$ at $\fxx_0$, with $Du(\fxx_0)\neq  0.$ The principal
curvatures of $u$ at $\fxx_0$ are the real numbers
\[
\kappa_{j}=\frac{\mu_j}{|Du(\fxx_0)|},
\]
where   $\mu_j$ are the eigenvalues of $D^2u(\fxx_0)$ restricted
to $Du(\fxx_0)^\perp$.
\end{definition}

 It follows from Proposition \ref{proposition4.16} that the principal curvatures
are invariant under a $C^2$ contrast change $g$ such that
$g'(s)>0$ for all $s\in\RR$.

\begin{definition}\label{definitionmeancurvatureoffunction}
The mean curvature of a $C^2$ function $u:\RR^N\to\RR$ at $\fxx_0\in\RR^N$ is the sum of the principal curvatures at
$\fxx_0$. It is denoted by ${\rm curv}(u)(\fxx_0)$.
\end{definition}

Note that this definition agrees with  Definition
\ref{definition4.1} when $N=2$. The next result provides another
representation for ${\rm curv}(u)$.

\begin{proposition} \label{linkmeancurvatureprincipalcurvatures}The mean curvature of $u$ is given by
\[
{\rm curv}(u)={\rm div}\Big(\frac{Du}{|Du|}\Big).
\]
\end{proposition}
\begin{proof}Represent the matrix $D^2u$ in the
 coordinate system $\bm{i}_j$, $j=1,\ldots,N-1$, and $\bm{i}_N=Du(\fxx_0)/|Du(\fxx_0)|$,
  where the $\bm{i}_j$, $j=1,\ldots,N-1$, form a complete set of eigenvectors of the
   linear mapping $D^2u(\fxx_0)$ restricted to $Du^\perp(\fxx_0)$. Then in this coordinate
    system, $D^2u(\fxx_0)$ has the following form (illustrated for $N=5$):
\begin{equation*}D^2u(\fxx_0)=
\begin{bmatrix}
u_{11}&0&0&0&u_{15}\\
0&u_{22}&0&0&u_{25}\\
0&0&u_{33}&0&u_{35}\\
0&0&0&u_{44}&u_{45}\\
u_{51}&u_{52}&u_{53}&u_{54}&u_{55}
\end{bmatrix},
\end{equation*}
where $u_{jk}=u_{x_jx_k}(\fxx_0)$, and $u_{jj}=\kappa_j$ is the eigenvalue associated with $\bm{i}_j$. Thus, by definition, we see that
\[
{\rm curv}(u)=\frac{\Delta u}{|Du|}-\frac1{|Du|}D^2u\Big(\frac{Du}{|Du|},\frac{Du}{|Du|}\Big).
\]
We also have
\begin{align*}
{\rm div}\Big(\frac{Du}{|Du|}\Big)&=\sum_{j=1}^N \frac{\partial}{\partial x_j}\Big(\frac{u_{x_j}}{|Du|}\Big)\\
&=\frac1{|Du|}\sum_{j=1}^N u_{x_jx_j}-\frac1{|Du|^3}\sum_{j,k=1}^N u_{x_jx_k}u_{x_j}u_{x_k}\\
&=\frac{\Delta u}{|Du|}-\frac1{|Du|}D^2u\Big(\frac{Du}{|Du|},\frac{Du}{|Du|}\Big).\qedhere
\end{align*}
\end{proof}

With this representation, it is clear that the mean curvature has
the same invariance properties as the curvature of a $C^2$
function defined on $\RR^2$. (See Exercise \ref{exercise4.5}.)
\section{Exercises}
\begin{exercise}\label{exercise4.1} Let $\Gamma$ by a Jordan arc
parameterized by $\fxx:[0,1]\to\Gamma$ and by $\fxy:[0,1]\to\Gamma$. Show that $\fxx=\fxy\circ f$ or
$\fxx=\fxy\circ(1-f)$, where $f$ is a continuous, strictly increasing function that maps $[0,1]$ onto $[0,1]$. Hint:
$\fxx$ and $\fxy$ are one-to-one, and since $[0,1]$ is compact, they are homeomorphisms. Thus, $\fxy^{-1}(\fxx)=f$ is a
one-to-one continuous mapping of $[0,1]$ onto itself.  As an application, give a proof of Proposition
\ref{proposition4.3}. \finex
\end{exercise}

\begin{exercise}\label{supplementproposition4.3} State and prove
an adaptation of Propositions \ref{proposition4.3} and
\ref{proposition4.4} to a Jordan arc. \finex
\end{exercise}

The curvature vector has been defined in terms of the arc length. Curves, however, are often naturally defined in terms
of other parameters. The next two exercises develop the differential relations between an arc-length parameterization
and another parameterization.

\begin{exercise}\label{calculcourburesparametrees}Assume that $\Gamma$ is a $C^2$ Jordan arc or curve.
 Let $s\mapsto\fxx(s)$ be an arc-length parameterization and let
 $t\mapsto\fxy(t)$ be any other parameterization with the property
 that $\fxy'(t)\not=0$. Since $\fxx$ and $\fxy$  are one-to-one, we
 can consider the function $\fxy^{-1}(\fxx)=\varphi$. Then $\fxx(s)=\fxy(\varphi(s))$,
  where $\varphi(s)=t$. The inverse function $\varphi^{-1}$ is given by
\[
s=\varphi^{-1}(t)=\int_{t_0}^t \sqrt{\fxy'(r)\cdot\fxy'(r)}\,\rmd
r,
\]
so we know immediately that $\varphi^{-1}$ is absolutely
continuous with continuous derivative equal to
$\sqrt{\fxy'(t)\cdot\fxy'(t)}$. Thus, we also know that
$\varphi'(s)=|\fxy'(\varphi(s))|^{-1}$. Note that we made a choice
above by taking $\sqrt{\fxy'(r)\cdot\fxy'(r)}$ to be positive.
This is equivalent to assuming that $\fxx'(s)$ and
$\fxy'(\varphi(s))$ point in the same direction or that
$\varphi'(s)>0$.
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item Show that
$\bm{\kappa}(s)=\fxx''(s)=\fxy''(\varphi(s))[\varphi'(s)]^2+\fxy'(\varphi(s))\varphi''(s)$
and deduce that
\[
\varphi''(s)=-\frac{\fxy''(\varphi(s))\varphi'(s)\cdot\fxy'(\varphi(s))}{|\fxy'(\varphi(s))|^3}=-\frac{\fxy''(\varphi(s))\cdot\fxy'(\varphi(s))}{|\fxy'(\varphi(s))|^4}.
\]
\item Use the results of (i) to show that
\begin{equation}\label{eq41}
\bm{\kappa}(s)=\fxx''(s)=\frac{1}{|\fxy'(t)|^2}\left[\fxy''(t)-\Bigg(\fxy''(t)\cdot\frac{\fxy'(t)}{|\fxy'(t)|}\Bigg)\frac{\fxy'(t)}{|\fxy'(t)|}\right],
\end{equation}
where $\varphi(s)=t$. Show that we get the same expression for the
right-hand side of \eqref{eq41} with the assumption that
$\varphi'(s)<0$. This shows that the curvature vector
$\bm{\kappa}$ does not depend on the choice of parameter. \item
Consider the scalar function $\kappa(\fxy)$ defined by
$\kappa(\fxy)(s)={\bm\kappa}(s)\cdot\fxx'(s)^\perp$. Use equation
\eqref{eq41} to show that
\[
\kappa(\fxy)(t)=\frac{\fxy''(t)\cdot[\fxy'(t)]^{\perp}}{|\fxy'(t)|^3}
\]
Note that $\kappa(\fxy)$ is determined up to a sign that depends
on the sign of $\varphi'(s)$; however,
$|\kappa(\fxy)|=|{\bm\kappa}|$ is uniquely determined. \finex
\end{enumerate}
\end{exercise}

\begin{exercise}Assume that $\Gamma$ is a Jordan arc or curve that is represented by a $C^1$ function $t\mapsto\fxx(t)$ with the property that $\fxx'(t)\not=0$. Prove that $\Gamma$ is $C^1$.
\end{exercise}

\begin{exercise}\leavevmode \label{radiusofcircle}
\begin{enumerate}[(i)]\setlength\itemsep{2pt}
\item Consider the arc-length parameterization of the circle with
radius $r$ centered at the origin given by $\fxx(s)=(r\cos(s/r),
r\sin(s/r))$. Show that the length of the curvature vector is
$1/r$. \item Compute the scalar curvature of the graph of
$y=(a/2)x^2$ at $x=0$. \finex
\end{enumerate}
\end{exercise}

\begin{exercise} Complete the proof of Corollary
\ref{corollary4.6}.
\end{exercise}

\begin{exercise}
The kinds of techniques used in this exercise are important for work in later chapters.
 The exercise demonstrates that it is possible to bracket a $C^2$ function locally with two functions that are radial and either increasing or decreasing.  We say that a function $f$ is radial and increasing if there exists an increasing function $g:\RR^+\to\RR$ such that $f(\fxx)=g(|\fxx_c-\fxx|^2)$, $\fxx_c\in\RR^2$. We say that $f$ is radial and decreasing if $g$ is decreasing. Let $u:\RR^2\to\RR$ be $C^2$ and assume that $Du(\fxx_0)\not=0$. We wish to show that for every $\varepsilon>0$
 there exist two $C^2$ radial functions $f^{-}_{\varepsilon}$ and $f^{+}_{\varepsilon}$ (increasing or decreasing, depending on the situation) that satisfy the following four conditions:
\begin{gather}
f^{-}_{\varepsilon}(\fxx_0)=u(\fxx_0)=f^{+}_{\varepsilon}(\fxx_0),\\
Df^{-}_{\varepsilon}(\fxx_0)=Du(\fxx_0)=Df^{+}_{\varepsilon}(\fxx_0),\\
{\rm curv}(f^{-}_{\varepsilon})(\fxx_0)+\frac{2\varepsilon}{p}={\rm curv}(u)(\fxx_0)={\rm curv}f^{+}_{\varepsilon}(\fxx_0)-\frac{2\varepsilon}{p},\\
f^{-}_{\varepsilon}(\fxx)+o(|\fxx_0-\fxx|^2)\leq u(\fxx)\leq
f^{+}_{\varepsilon}(\fxx)+o(|\fxx_0-\fxx|^2).
\end{gather}

1. Without loss of generality, take $\fxx_0=(0,0)$, $u(0,0)=0$,
and $Du(\fxx_0)=(p,0)$, $p>0$. Then we have the Taylor expansion
\[
u(\fxx)=px+ax^2+by^2+cxy+o(x^2+y^2),
\]
where $a$, $b$, and $c$ are given in \eqref{58}. Show that for
every $\varepsilon>0$,
\[
px+\Big(-\frac{c^2}{\varepsilon}+a\Big)x^2+(b-\varepsilon)y^2+o(x^2+y^2)\leq
u(x,y)\leq
px+\Big(\frac{c^2}{\varepsilon}+a\Big)x^2+(b+\varepsilon)y^2+o(x^2+y^2).
\]

2. Let $f$ be a radial function defined by
$f(x,y)=g((x-x_c)^2+y^2)$, where $g:\RR^+\to\RR$ is $C^2$ and
either increasing or decreasing. Show by expanding $f$ at $(0,0)$
that
\[
f(x,y)=g(x_c^2)-2x_cg'(x_c^2)x+(2x_c^2g''(x_c^2)+g'(x_c^2))x^2+g'(x_c^2)y^2+o(x^2+y^2).
\]

3. The idea is to construct $f^{+}_{\varepsilon}$ and
$f^{-}_{\varepsilon}$ by matching the coefficients of the
expansion of $f$ with the coefficients of the functions
$px+(\pm(c^2/{\varepsilon})+a)x^2+(b\pm\varepsilon)y^2$. There are
three cases to consider: $b<0$, $b=0$, and $b>0$. Show that in
each case it is possible to find values of $x_c$ and functions $g$
so the functions $f^{+}_{\varepsilon}$ and $f^{-}_{\varepsilon}$
satisfy the four condition. Note that both $x_c$ and $g$ depend on
$\varepsilon$. Discuss the geometry for each case. \finex
\end{exercise}


\begin{exercise}By computing explicitly the terms $\partial g(u)/\partial x_i$, verify that $Dg(u)=g'(u)Du$. Similarly, verify that $D^2(g(u))=g''(u)Du\otimes Du+g'(u)D^2u$ by computing the second-order terms $\partial^2 g(u) /\partial x_i\partial x_j$. \finex
\end{exercise}


\section{Comments and references}

\paragraph*{Calculus and differential geometry.} The differential calculus of curves and surfaces used in this chapter can be found in many books, and no doubt most readers are familiar with this material. Nevertheless, a few references to specific results may be useful. As a general reference on calculus, and as a specific reference for the implicit function theorem, we suggest the text by Courant and John \cite{CJ2000}. (The implicit function theorem can be found on page 221 of volume II.) Elementary results about classical differential geometry can be found in \cite{DS1950}. A statement and proof of Sard's theorem can be found in \cite{KP1999}.

\remove{\paragraph*{Topology of plane sets.}  All of the material
presented is quite straightforward, except the Jordan curve
theorem. We believe that one of the best proofs of this result is
still to be found in the book by M. H. A. Newman \cite{MHAN1951}.
Newman's treatment is elementary, it describes the problems
associated with proving this ``obvious'' result, and it introduces
the nonspecialist to some simple combinatorial topology. Another
interesting approach to prove the Jordan curve theorem can be
found in \cite{JD1960}.}

\paragraph*{Level lines.} An introduction  to the use of level
lines in computer vision can be found in \cite{Caselles:1999:TML}.
  A complete discussion of the definition of level lines for $BV$
  functions can be found in \cite{AMCAMAMO}.  One can decompose an image into into its level lines at quantized levels
  and conversely reconstruct the image from this topographic map. A fast algorithm, the Fast Level Set Transform (FLST)
   performing these algorithms  is described in \cite{lisani2001fse}. Its principle is  very simple: a) perform the
   bilinear interpolation, b) rule out all singular levels where saddle point occur c) quantize the other
   levels, in which the level lines are finite unions of parametric Jordan curves. The image is then parsed into a set
   of parametric Jordan curves. This set is easily ordered in a tree structure, since
    two Jordan level curves do not meet. Thus either one
   surrounds the other one or conversely.  The level lines tree is a shape parser for the image, many level lines
   surrounding perceptual shapes or parts of perceptual shapes.

\paragraph*{Curvature.} It is a well-known mathematical technique
to define a set implicitly as the zero set of its distance function. In case the set is a curve, one can compute its
curvature at a point $\fxx$ by computing the curvature ${\rm curv}(u)(\fxx)$, where $u$ is a signed distance function
of the curve. This yields an intrinsic formula for the curvature that is not dependent on a parameterization of the
curve. The same technique has been applied in recent years as a useful numerical tool. This started with Barles report
on flame propagation \cite{barles1985rfp} and was extended by Sethian \cite{Sethian:1982:AFP} and by Osher and Sethian
\cite{Osher:1988:FPCb} in a series of papers on the numerical simulation of the motion of a surface by its mean
curvature.

\ifodd\count0
    \clearpage
    \leavevmode
    \thispagestyle{empty}
    \clearpage
\else\relax
\fi
