\section{Introduction}\label{s1}


Let $ \Omega\subset {{\rr}^n}$ be a   domain (that is, an open and connected set) of ${{\rr}^n}$  with $n\ge2$.
The Rademacher's theorem says that if $u:U\to{\mathbb R}$ is a Lipschitz function,
that is,
 \begin{equation}\label{lip}|u(x)-u(y)|\le \lambda|x-y|\quad\forall x,y\in \Omega \quad \mbox{for some $0\le \lambda<\infty$,}
 \end{equation}
 then    $u$ is differentiable at almost all $x\in\Omega$  and
 $|\nabla u(x)| ={\mathop\mathrm{\,Lip}} u(x)$, where  the pointwise Lipschitz constant
 \begin{equation}\label{pointlip} {\mathop\mathrm{\,Lip}} u(x):=\limsup_{y\to x}\frac{|u(y)-u(x)|}{|y-x|}\quad \mbox{for all $x\in\Omega$}. \end{equation}
 Consequently, denoting by  $u\in{\mathop\mathrm{\,Lip}}(\Omega)$ the class of all Lipschitz functions in $\Omega$,
and by  $\dot W^{1,\infty}(\Omega)$ the set of all functions $u\in L^\infty_{\mathop\mathrm{\,loc\,}}(\Omega)$  whose distributional derivatives $\nabla u\in L^\infty(\Omega;{{\rr}^n})$, one has that
  $\dot W^{1,\infty}(\Omega)={\mathop\mathrm{\,Lip}}(\Omega)$ and
  $\||\nabla u|\|_{L^\infty(\Omega)} =\|{\mathop\mathrm{\,Lip}} \, u \, \|_{L^\infty(\Omega)}=\sup_{x\in\Omega}{\mathop\mathrm{\,Lip}} u(x). $

An analogue  Rademacher's theorem also holds in   Carnot-Carath\'{e}odory  spaces. To be precise,
let $X:=\{X_1,  ... ,X_m\}$  for some $m\le n$ be  a family  of smooth vector fields  in ${\Omega}$
which satisfies the H\"ormander condition, that is,   there is a step $k \ge 1$ such that, at  each point,
  $\{X_i\}^{m}_{i=1}$ and all their commutators up to at most order $k$ generate the whole ${{\rr}^n}$.
 
  Denote by $\dot W^{1,\infty}_X(\Omega)$ the set of
all functions $u\in L^\infty_{\mathop\mathrm{\,loc\,}}(\Omega)$ whose
distributional horizontal derivatives $Xu\in L^\infty(\Omega;{\mathbb R}^m)$. Define the corresponding
 Carnot-Carath\'{e}odory distance
\begin{equation} \label{dcc}
  d_{CC}(x,y):=\sup\{u(y)-u(x) \ | \ u\in \dot W^{1,\infty}_X(\Omega), \||Xu|\|_{L^\infty(\Omega)}\le1\}, \quad\forall x,y\in \Omega.
\end{equation}
The Lipschitz class
${\mathop\mathrm{\,Lip}} _{d_{CC}}(\Omega)$  and also corresponding pointwise Lipschitz constant ${\mathop\mathrm{\,Lip}}_{d_{CC}}u $
 are then defined by \eqref{lip}  and \eqref{pointlip} with $|x-y|$ replaced by $d_{CC}(x,y)$.
Then
 $\dot W^{1,\infty}_X(\Omega)={\mathop\mathrm{\,Lip}}_{d_{CC}}(\Omega)$ and
 $\||X u|\|_{L^\infty(\Omega)} =\|{\mathop\mathrm{\,Lip}}_{d_{CC}} u\|_{L^\infty(\Omega)} $; see for example \cite{gn,FSS,ksz}.
Moreover, one has
\begin{equation*}
\||X u|\|_{L^\infty(\Omega)}
 =\min\{\lambda\ge 0 \ | \ |u(x)-u(y)|\le \lambda d_{CC}(x,y), \quad\forall x,y\in \Omega\}.
\end{equation*}
Note that, in  Eculidean case, that is, $X=\{\frac{\partial }{\partial {x_i}}\}_{1\le i\le n}$, one has
 $d_{CC}(x,y)=|x-y|$ for all $x,y\in\Omega$ with $|x-y|<{\mathop\mathrm{\,dist\,}}(x,\partial\Omega)$, but not for all $x,y\in \Omega$ unless $\Omega$ is convex.

Indeed, in this case $d_{CC}(x,y)$ is  the infimum of the Eculidean length of
all curves in ${\Omega}$ joining $x,y$









 In this paper we consider Rademacher type theorem involving Hamiltonians $H(x,p)$
 in both of Euclidean and Carnot-Carath\'eodory spaces.
Suppose that $H:\Omega\times{\mathbb R}^m\to{\mathbb R}$ is  a measurable  and satisfies
\begin{enumerate}
  \vspace{-0.15cm}\item [(H1)]   For each $x\in\Omega$,
  $H(x,\cdot)$  is quasi-convex,  that is,
 \begin{equation*}
 H(x,t p + (1 - t)q) \le \max \{H(x,p), H(x,q)\}, \quad \forall p, q \in {\mathbb R}^m, \ \forall \, t\in[0,1] \ \text{and} \  \forall x\in\Omega.
\end{equation*}
\item [(H2)] \vspace{-0.15cm} For each $  x\in \Omega $, $H(x,0)=\min_{p\in{{\rr}^m}}H(x,p)=0$.
 \vspace{-0.15cm} \item [(H3)] For any $  \lambda \ge 0$,  there exist  $0\le   R'_\lambda \le R_\lambda <\infty$ and
$ \lim_{\lambda\to\infty}R'_\lambda=\infty$ such that
$$B(0,R'_\lambda)\subset  \Big\{p\in{\mathbb R}^{m}\ |\ H(x,p)\le \lambda \Big\}\subset B(0,R_\lambda),
\ \
\forall x\in \Omega .$$
  \end{enumerate}
Given any $\lambda\ge 0$, define
\begin{equation}\label{d311}
d _{\lambda} (x,y):= \sup\{u(y)-u(x) : u \in \dot W^{1,\infty}_{X }(\Omega),\ \|H(\cdot, Xu)\|_{L^\infty(\Omega)} \le \lambda,
  \}\quad\forall \mbox{$x,y \in \Omega$}.
\end{equation}
Then $d_\lambda$ is nonnegative satisfies the triangle inequality,
that is, $$\mbox{ $d_\lambda(x,y)\ge0$ for all $x,y\in\Omega$ and
$d_\lambda(x,y)\le d_\lambda(x,z)+d_\lambda(z,y)$ for all $x,y,z\in \Omega$.}$$
If $R_\lambda'>0$, then
  $d _\lambda$ is a pseudo-distance, that is, $d_\lambda(x,y)=0$   implies $x=y$.


By definition, given any $\lambda\ge 0$, if  $u\in  W_{X}^{1,\infty}(U)$ and $\|H(\cdot,Xu)\|_{L^\infty(U)}\le \lambda$,
 then it holds that $
u(y)-u(x)\leq d_{\lambda}(x,y), \ \forall\ x,y\in \Omega.$
It is natural to ask whether the converse is true or not.
However, such converse is not necessarily true as  witted by   the Hamiltonian
\begin{equation}\label{[p]}
\lfloor|p|\rfloor =\max\{t\in {\mathbb N} \ | \  |p|-t\ge 0\},\quad \forall x\in \Omega,\, p\in{{\rr}^m}.
\end{equation}
 For details see Remark 1.3 below. The point is that $ \lfloor |p|\rfloor$  is not lower-semicontinuous.
Below, the converse is shown to be true if $H(x,p)$ is assumed additionally to be  lower-semicontinuous in the variable $p$, that is,
\begin{enumerate}\vspace{-0.15cm}
\item[(H0)] For almost all $x\in\Omega$,
$H(x,p)\le\liminf_{q\to p}H(x,q),\quad\forall p\in{{\rr}^n}.$
\end{enumerate}






\begin{thm} \label{rad}
Suppose that $H$ satisfies (H0)-(H3).
Given  any $\lambda \ge 0 $ and any function $u:\Omega\to {\mathbb R}$,
 the following are equivalent:

  \begin{enumerate}
  \vspace{-0.15cm}
  \item[(i)] $u\in \dot W_{X}^{1,\infty}(\Omega) \ \text{and}  \ \|H(\cdot,Xu)\|_{L^\infty(\Omega)}\le\lambda$;
  \vspace{-0.15cm}
  \item[(ii)]
$u(y)-u(x)\le d_\lambda (x,y)$,   $\forall x,y\in \Omega$;
\vspace{-0.15cm}
\item[(iii)]
For any $x\in\Omega$, there exists a neighborhood $N(x)\subset\Omega$ such that
$u(y)-u(z)\le  d_\lambda (z,y)$,  $\forall y,z \in N(x)$;
\vspace{-0.15cm}
\item[(iv)]
For any $x\in\Omega$, there exists a neighborhood $N(x)\subset\Omega$ such that
$u(y)-u(x)\le  d_\lambda (x,y)$  $\forall y  \in N(x)$.
\end{enumerate}
In particular,
\begin{align}\label{ident}\|H(\cdot,Xu)\|_{L^\infty(\Omega)}&=\min\{\lambda>0 \ | \ \lambda \ \mbox{satisfies  (ii)}\}\nonumber\\
&=\min\{\lambda>0 \ | \ \lambda \ \mbox{satisfies   (iii)}\}=\min\{\lambda>0 \ | \ \lambda \ \mbox{satisfies   (iv)}\}.
\end{align}
\end{thm}


Associated to Hamiltonian $H$ or $\{d_\lambda\}_{\lambda\ge0}$, denote by $\dot W^{1,\infty}_H(\Omega)$ as the collection of all
$u\in \dot W^{1,\infty}_X(\Omega)$ with $\|H(\cdot,Xu)\|_{L^\infty(\Omega)}<\infty$.
Denote by ${\mathop\mathrm{\,Lip}}_H(\Omega,X)$  the class of functions $u:\Omega\to\infty$ satisfying (ii) equipped with (semi-)norms
$${\mathop\mathrm{\,Lip}}_H(u,\Omega)=\min\{\lambda>0 \ | \ \lambda \ \mbox{satisfies  (ii)}\}.$$
Write the  pointwise  ``Lipschitz" constant
$${\mathop\mathrm{\,Lip}}_Hu(x)=\min\{\lambda\ge0 \ | \ \lambda \ \mbox{satisfies   (iv)}\}.$$
If $H(x,p)=|p|$, then $ d_\lambda=\lambda d_{CC}$ and hence ${\mathop\mathrm{\,Lip}}_H(\Omega)={\mathop\mathrm{\,Lip}}_{d_{CC}}(\Omega)$ and ${\mathop\mathrm{\,Lip}}_H u(x)={\mathop\mathrm{\,Lip}}_{d_{CC}}u(x)$.
Consequently we have the following.

\begin{cor}Suppose that $H$ satisfies (H0)-(H3).
Then $\dot W^{1,\infty}_H(\Omega)={\mathop\mathrm{\,Lip}}_H(\Omega)$ and
 $$\|H(\cdot,Xu)\|_{L^\infty(\Omega)}={\mathop\mathrm{\,Lip}}_H(u,\Omega)=\sup_{x}{\mathop\mathrm{\,Lip}}_Hu(x).$$

\end{cor}


The   assumption (H0) above, that is, the lower semicontinuity of $H(x,p)$ in  the variable $p$,   is necessary  as witted by the following example.
\begin{rem} \rm Obviously, the Hamiltonian $H(x,p)$ given by $\eqref{[p]}$ satisfies (H1)-(H3)  but does not satisfy (H0).
 Note that, given any $\lambda\in(0,1)$,  we have
  \begin{align*}
    d_{\lambda} (x,y) & =\sup\{u(y)-u(x) \ | \ u \in \dot W^{1,\infty}_X(\Omega), \|H(\cdot,X u)\|_{L^\infty(\Omega)}=\|\lfloor|X u|\rfloor\|_{L^\infty(\Omega)} \le \lambda\} \\
   
     & =\sup\{u(y)-u(x) \ | \ u \in \dot W^{1,\infty}_X(\Omega), \| |X u| \|_{L^\infty(\Omega)} \le 1\} \\
     &=d_{CC}(x,y).
  \end{align*}
Given any $ z\in\Omega$, writing $u(x)=d_\lambda(z,x)$, by the triangle inequality we have
$$u(y)-u(x)=d_\lambda(z,y)-d_\lambda(z,x)\le d_\lambda(x,y)$$
Recall that, when $X=\{\frac{\partial}{\partial x_j}\}_{1\le j\le n}$   or  when  $X$ is given by Carnot type H\"ormander vector fields,
one always has $|X d_{CC} (z,\cdot) | =1$ almost everywhere; see  \cite{monti}. For such $X$, we then have
 $\|H(\cdot,X u)\|_{L^\infty(\Omega)}=1>\lambda$. Thus Theorem \ref{rad} fails.
\end{rem}





Next, we apply  the above Rademacher type property to  study    minimization problem for    $L^\infty$-functionals corresponding to above Hamiltonian $H(x,p)$ in both Euclidean and Carathe\'odory spaces:
$${\mathcal F}(u,U):=\big\|H(\cdot, Xu )\big\|_{L^\infty(U)}\  \mbox{for any $u\in  W^{1,\infty}_{X,{\mathop\mathrm{\,loc\,}}}(U)$ and  domain $ U\subset \Omega$}.$$

Aronsson \cite{a1,a2,a3,a4} in 1960's  initiated the study in this direction
via introducing  absolute minimizers. 
A  function $u\in  W^{1,\infty}_{X,{\mathop\mathrm{\,loc\,}}}(U)$  is called an absolute minimizer  in $U$ for $H$ and $X$
(write $u\in AM(U;H,X)$ for short)  if for any open set $V\Subset U$, it holds that
$${\mathcal F}_H(u,V) \le {\mathcal F}_H(v,V)  
\mbox{\ whenever}\ v\in \dot W^{1,\infty}_X(V)\cap C(\overline V)\ \mbox{and} \ u\big|_{\partial V}=v\big|_{\partial V}.$$
Thanks to Theorem \ref{rad}  we build up the following existence  of  absolute minimizers.













\begin{thm}\label{t231}
Suppose that  $H$  satisfies (H0)-(H3).
Given any domain $U\Subset{\Omega}$ and $g\in {\mathop\mathrm{\,Lip}}_{d_{CC}}(\partial U)$, there must be a function $u\in AM(U;H,X)\cap {\mathop\mathrm{\,Lip}}_{d_{CC}}(\overline U)$
  so that $u|_{\partial U}=g$.
\end{thm}


Theorem \ref{rad} and \ref{t231} improves or extends several previous studies in the literature. We recall them and also some related study as below.
 \begin{rem} \label{re1}
 \rm
(i) In Euclidean space, that is,  $X=\{\frac{\partial }{\partial x_i} \}_{1\le i\le n}$,
if $H(x,p)$ is lower semi-continuous in $U \times {{\rr}^n}$,
   $H(x,\cdot)$ is convex for each $x \in U$, and   satisfies (H2) and (H3),
     (ii)$\Rightarrow$(i) in Theorem 1.1 was proved in
  Champion-De Pascale \cite{cp} (see also \cite{c03,acjs} for convex $H(p)$ in Euclidean spaces).
 The proof in \cite{cp} relies on the lower semi-continuity  in both of $x$ and $p$ and also convexity in $p$ heavily, which allows to approximating $H(x,p)$ via continuous Hamiltonian in $x$ and $p$.
     But such an approach fails under the weaker assumptions (H0)\&(H1)  here.
We refer to Section 5 for more details and related further discussions.


(ii) In both of Euclidean and Carrot-Carath\'{e}odory spaces, if $H(x,p)=\sqrt{\langle A(x)p,p\rangle}$, where $A(x)$ is measurable symmetric matrix-valued functions satisfying uniform ellipticity, then Theorem 1.1 was established  in \cite{ksz,ksz2}.
       The proofs therein rely on the inner product structure, and also do  not work here.
For measure spaces endowed strongly regular nonlocal Dirichlet energy forms, where the Hamiltonian is given by the square root of Dirichlet form, we refer \cite{sp,kz,ksz2,flw} for some corresponding Rademacher type property.


(iii) Under merely (H0)-(H3), one can not expect that
${\mathop\mathrm{\,Lip}}_H(x)=H(x,Xu(x)) $ almost everywhere.  Recall that  in Euclidean spaces,
there does exists  $A(x)$, which satisfying  Remark (ii) above, so that such pointwise property fails for the Hamiltonian
$\sqrt {\langle A(x)p,p\rangle}$. For more details see   \cite{s97,ksz}.
       \end{rem}



 \begin{rem}\rm
(i)  In the Eculidean spaces, that is,   $X=\{\frac{\partial }{\partial x_i}\}_{1\le i\le n}$,

 if $H(x,p)$ is given by  Euclidean norm   and  also any Banach norm,
the existence of  absolute minimizers was established in   Aronsson \cite{a1,a2} and   Aronsson et al \cite{acj}.
If $H(x,p)$ is given b  $\sqrt{\langle A(x)p,p\rangle}$ with $A$ being as in Remark 1.5 (ii) above,  existence of  absolute minimizers is given by \cite{ksz} with the aid of
 \cite{js}.
In a similar way, with the aid of \cite{js},
Guo et al \cite{gxy}   also obtained the the existence of absolute minimizers
if
 $H(x,p)$ is a measurable function in $\Omega\times{{\rr}^n}$, and satisfies that $\frac1C< H(x,p)<C$ for all $x\in\Omega$ and $p\in S^{n-1}$, where  $C\ge1$ is a constant, and that $H(x,\eta p) = |\eta| H(x,p)$ for all $x\in \Omega$, $p\in{{\rr}^n}$ and $\eta\in{\mathbb R}$.

(ii)  In Euclidean spaces, if $H(x,p)$ is continuous in both variables $x,p$  and quasi-convex in $x$ with an additional growth assumption with respect to $p$,
Barron et al \cite{bjw} built up the existence of absolute minimizers.
If $H(x,p)$ is lower semi-continuous in $x$ and convex in $p$ and  satisfies (H1)-(H3), Champion-De Pascale \cite{cp} established the existence of absolute minimizers with the help of their Rademacher type theorem
where the lower semi-continuity of $H$ plays a key role.


(iii)  In  Heisenberg groups,  if $H(x,p)=\frac12|p|^2$ we refer to \cite{b1} for the existence of absolute minimizers.
In any Carnot group,
 if  $H\in C^2(\Omega\times {\mathbb R}^m)$, $D^2_{pp}H(x, \cdot)$ is positive definite,  and
    there exists $ \alpha\ge1$ such that
\begin{equation}\label{e1.2}
H(x,\eta p) = \eta^{\alpha}H(x,p)\quad\forall x\in \Omega,\ \eta>0,\ p\in{{\rr}^n},
\end{equation}
then the existence of absolute minimizers was obtained by
Wang   \cite{wcy}    via considering viscosity solutions to the corresponding Aronsson equations.
     \end{rem}


Finally, we sketch the idea of the proofs of Theorem 1.1 and 1.4.

In Section 2, we prove Theorem 1.1.
Since (i)$\Rightarrow$(ii)  follows from the definition and that
 (ii)$\Rightarrow $(iii)  as well as (iii)$\Rightarrow $(iv)  is obvious, it suffices to    prove (iii)$\Rightarrow $(i) and also (iv)$\Rightarrow$(iii).
\begin{enumerate}
\item[$\bullet$]  To prove   (iii)$\Rightarrow $(i), we borrow some ideas from \cite{sk,sp,flw,ksz}, which were designed for  nonlocal Dirichlet energy forms originally.
The key is that,
 by employing assumptions (H0), (H1) and Mazur's theorem, we  are able to prove that if $v_j\in\dot W^{1,\infty}_X(\Omega)$ with $\|H(\cdot, Xv_j)\|_{L^\infty(\Omega)}\le\lambda$
  and $v_j\to v$ in $C^0(\Omega)$ as $j\to\infty$, then $v \in\dot W^{1,\infty}_X(\Omega)$
  with $\|H(\cdot, Xv)\|_{L^\infty(\Omega)}\le\lambda$; see  Lemma \ref{l6.1} for details.
Thanks to this,
 choosing a suitable sequence of approximation functions via the definition of $d_\lambda$,  we  then show that
 $$\mbox{$ d _{\lambda}(x,\cdot) \in  W_{X}^{1,\infty}(\Omega)$ and $\|H(\cdot,Xd _{\lambda}(x,\cdot))\|_{L^\infty(\Omega)}\le\lambda$ for all $\lambda>0$ and $x\in \Omega$}.$$
See Lemma \ref{lem3.2}.
Given any $u$ satisfying (iii),  we construct  approximation functions $u_j$ from $d_\lambda$
and use Lemma \ref{l6.2} to show  $H(x,Du_j)\le \lambda$. That is (i) holds.


\item[$\bullet$] The justification of  (iv)$\Rightarrow $(iii) follows from the length property  of pesudo-distance $d_\lambda$ in Proposition \ref{len}.
To get such length property we find some special functions
which fulfill the assumption (iii)  Theorem 1.1, and hence
we  show that the pesudo-distance $d_\lambda$ has a length property.
\end{enumerate}


In Section 4, we prove Theorem 1.4 by using above Rademacher type property and
  Perron's approach, where we borrow some ideas from  \cite{bjw,cp,cpp}.
 The proof consists of the following two parts.

\begin{enumerate}
\item[$\bullet$]   Given any domain $U\Subset{\Omega}$, we consider   an intrinsic distance $d_\lambda^U$ induced from $U$. Via $d_\lambda^U$, for $g\in {\mathop\mathrm{\,Lip}}_{d_{CC}}(\partial U)$, we introduce
  Macshane extensions of $g$ in $U$, which serve as max/min minimizers of the $L^\infty$-functional $\mathcal F_H$ with boundary $g$;  Lemma \ref{lem231}.

Note that the reason to use   $d^U_\lambda$  but  not $d_\lambda$  is that  $d^U_\lambda$ has length property
but $d_\lambda$ may not have.  However, while $U$ is bounded under the metric $d_{CC}$, it may be unbounded under the metric $d_\lambda^U$ since we do not pose any regularity assumption on $\partial{U}$, which makes it quite implicit to see the continuity of Macshane extensions in $\overline U$ from the definition though it is fairly obvious that Macshane extensions are continuous in $U$. Hence the key point is to show the Macshane extensions are continuous in $\overline U$ whose verification is done in Lemma \ref{cont}.

\item[$\bullet$] Via Perron's method (similarly as in \cite{cpp}),  by using  above MacShane extensions, in a constructive way, we obtain the existence
 absolute minimizers $AM(U;H,X)$ with boundary value  $g\in {\mathop\mathrm{\,Lip}}_{d_{CC}}(\partial U)$.
\end{enumerate}




\section{Proof of Theorem 1.1}




Suppose that $X$ is a H\"ormander vector field in $\Omega$.
 By \cite[Chapter 11]{HK},
for any compact set $K \subset \Omega$, there exists $C(K) \ge 1$ such that
\begin{equation*}
  C(K)^{-1} |x - y | \le {d_{CC}}(x,y) \le C(K) |x - y |^{\frac{1}{k}} \quad   \forall x, y \in {{\rr}^n},
\end{equation*}
which shows that $\Omega$ has Euclidean topology.
Moreover, from the definition of $d_\lambda$ and $d_{CC}$, the assumption (H3) implies the following:
\begin{lem}\label{lem311}
For any $\lambda \ge 0$,
\begin{eqnarray}\label{e311}
 R'_\lambda{d_{CC}}(x,y) \leq d_\lambda (x,y) \leq   R_\lambda{d_{CC}}(x,y)<\infty \quad\forall x,y\in\Omega.
\end{eqnarray}
\end{lem}
\begin{proof}
For $\lambda\ge 0$, by (H3), we have
\begin{align*}
  \{u\in \dot W^{1,\infty}_{X }(\Omega ) \ | \  \||Xu|\|_{L^\infty(\Omega )} \le R'_\lambda\} &\subset \{u\in \dot W^{1,\infty}_{X }(\Omega ) \ | \ \|H(x,Xu)\|_{L^\infty(\Omega )} \le \lambda\} \\
  & \subset \{u\in \dot W^{1,\infty}_{X }(\Omega ) \ |  \ \||Xu|\|_{L^\infty(\Omega )} \le R_\lambda\}.
\end{align*}
From this and the definitions of ${d_{CC}}$ in \eqref{dcc} and $d_\lambda$ in \eqref{d311},
we deduce  \eqref{e311}.
\end{proof}


\begin{lem} \label{l6.1}
Suppose that $ \{u_j\}_{j\in{\mathbb N}}\in \dot W^{1,\infty}_X(\Omega )$,
 and there exists $\lambda\ge0$ such that
 $\|H(x,Xu_j)\|_{L^\infty(\Omega )}\le \lambda$ for  all $j\in{\mathbb N}$.
 If $u_j\to u$ in $C^0(\Omega )$, then  $u\in \dot W^{1,\infty}_X(\Omega )$ and
  $\|H(x,Xu)\|_{L^\infty(\Omega )}\le \lambda$.
\end{lem}

\begin{proof} By Rademacher's theorem, one has
$$|u(x)-u(y)|=\lim_{j\to\infty}|u_j(x)-u_j(y)|\le\limsup_{j\to\infty} \||Xu_j|\|_{L^\infty(\Omega )}d_{CC}(x,y)$$
By (H3) and $\|H(\cdot,Xu_j)\|_{L^\infty(\Omega )}\le \lambda$, we have
 $\||Xu_j|\|_{L^\infty(\Omega )}\le R_\lambda$ for all $j$, and hence
 $$|u(x)-u(y)| \le R_\lambda d_{CC}(x,y).$$
By Rademacher's theorem for $X$,  we have $u\in W^{1,\infty}_X(\Omega )$.

Next we show that   $\|H(x,Xu)\|_{L^\infty(\Omega )}\le \lambda$.
  Since  $\||Xu_j|\|_{L^\infty(\Omega )}\le R_\lambda$ implies  $\||Xu_j|\|_{L^2(\Omega )}\le R_\lambda |\Omega |$
  for all $j\in{\mathbb N}$,
  we  know that,     $Xu_j$ converges  to some function $q\in L^2(u,{\mathbb R}^m)$
   in weak sense as $j\to\infty$ (up to some subsequence), that is,
 $$  \lim_{j\to\infty}\int_\Omega  \langle Xu_j, \varphi\rangle\,dx=    \int_\Omega  \langle Xu, \varphi\rangle\,dx\quad\forall \varphi\in C_c^\infty(\Omega ,{\mathbb R}^m).$$
 Since $u_j\to u$ in $C^0(\Omega )$ as $j\to\infty$, we have $q=Xu$.

 By Mazur's Theorem, for any $l>0$, we can find a finite  convex combination $w_l$ of $\{Xu_i\}_{i=1}^{\infty}$ so that  $\|w_l-Xu\|_{L^2(\Omega )}\to0 $ as $l\to\infty$.
 Here $w_l$ is a finite  convex combination of $\{Xu_i\}_{i=1}^{\infty}$ if
 there exist $\{\eta_{i}\}_{i=1}^{k_l}$ for some $k_l$  such that
 $$\mbox{$\sum_{i=1}^{k_l}\eta_i=1$ and $w_l=\sum_{i=1}^{k_l}Xu_i$.}$$
 By the quasi-convexity of $H(x,\cdot)$ as in (H0),
 we have
 $$H(x,w_l)=H(x,\sum_{i=1}^{k_l}\eta_i Xu_i)\le \sup_{1\le i\le k_l}H(x, Xu_i)\le\lambda\quad\mbox{for almost all $x\in \Omega $}.$$
 Up to considering subsequence we may assume that $w_l\to Xu$ almost everywhere.
By the lower-semicontinuity of $H(x,\cdot)$ as in (H1),
 we conclude that
 $$H(x,Xu)\le\lim_{l\to\infty}H(x,w_l)\le  \lambda\quad\mbox{for almost all $x\in \Omega $}.$$
The proof is complete.
\end{proof}

\begin{lem} \label{l21}
 If $v  \in \dot W^{1,\infty}_{X }(\Omega)$, then
  \begin{equation}\label{claimx}\mbox{$v^+=\max\{v,0\}\in  \dot W^{1,\infty}_{X }(\Omega)$
 and $Xv^+=(Xv)\chi_{\{x\in\Omega, v>0\}} $.} \end{equation}
 Consequently,   let $\{v_i\}_{1\le i\le j} \subset \dot W^{1,\infty}_{X }(\Omega)$  for some $j\in{\mathbb N}$.
If  $ u=\max_{1\le i \le j}\{v_i\}$ or $ u=\min_{1\le i \le j}\{v_i\}$, then   \begin{equation}\label{claimxx}\mbox{$u\in \dot W^{1,\infty}_{X }(\Omega)$ and $\|H(x,Xu )\|_{L^\infty(\Omega)} \le \max_{1\le s\le j}\{\|H(x,Xv_s)\|_{L^\infty(\Omega)} \}$.}\end{equation}
\end{lem}
\begin{proof}  Note that \eqref{claimx} implies that \eqref{claimxx}.
Indeed,
If $u  =\max\{v_1,v_2\}$, where $v_i \in \dot W^{1,\infty}_{X }(\Omega)$ for $i=1,2$,
 then
   $u  =v_2+(v_1-v_2)^+.$
By \eqref{claimx}, $u \in  \dot W^{1,\infty}_{X }(\Omega)$ and
   \begin{displaymath}
Xu =Xv_2+X(v_1-v_2)^+ =Xv_2+[(X(v_1-v_2)]\chi_{\{x\in\Omega, v_1>v_2\}}=
(Xv_2)\chi_{\{x\in\Omega, v_1\le v_2\}}+ (Xv_1 ) \chi_{\{x\in\Omega, v_1>v_2\}}.
\end{displaymath} Thus
 $$H(x,Xu(x))= H(x, Xv_2)\chi_{\{x\in\Omega, v_1\le v_2\}}+ H(x,  Xv_1 ) \chi_{\{x\in\Omega, v_1>v_2\}}  \quad \mbox{for almost all $x\in\Omega$}.$$
 Similar result  holds for $u=\min\{v_1,v_2\}$.
This gives \eqref{claimxx} when $j=2$.
 By an induction argument, we get  \eqref{claimxx} for $j\in{\mathbb N}$.


 Below, we prove    \eqref{claimx} via  a standard way (see \cite{ev} Problems 5.17\&5.18 when $X=\{\frac{\partial}{\partial x_i}\}_{1\le i\le n}$).
  Indeed, for any $x_1,x_2 \in \Omega$, by (H3)  we have
  $$|v_+(x)-v_+(y)| \le  |v(x)-v(y)| \le R_\lambda {d_{CC}}(x_1,x_2)$$
  and hence,
by the Rademacher type theorem for $X$,
  $v_+ \in \dot W^{1,\infty}_{X }(\Omega)$.
 
  To see  $Xv^+=(Xv)\chi_{\{x\in\Omega, v>0\}},$
  let  $F_\epsilon(t )=[(t^2 +\epsilon^2 )^{1/2}-\epsilon]\chi_{(0,\infty)}(t)$ for $\epsilon>0$. Then
   \begin{equation*}
  v_+(x)=     \lim_{\epsilon \to 0}F_\epsilon(v(x))\quad \mbox{for all $x\in\Omega$}.
\end{equation*}
Let
 $\{v_{\delta}\}_{\delta>0}\in C^\infty(\Omega)  $ be a smooth approximation of $v$ in $W^{1,2}_{X,{\mathop\mathrm{\,loc\,}}}(\Omega)$ as $\delta\to0$. By $F_\epsilon\in C^1({\mathbb R})$, by the chain rule,
  $$
 X F_\epsilon(v_\delta )= (F_\epsilon)'(v_\delta)Xv_\delta \quad \mbox{in $ \Omega $}.$$
 A direct  calculation leads to
 $F_\epsilon(v_\delta)\to F_\epsilon(v)$   and
 $(F_\epsilon)'(v_\delta)\to (F_\epsilon)'(v_+ ) $ in $C^0(\Omega)$ as $\delta\to0$.
  Note that  $(F_\epsilon)'(v_+ ) \in L^\infty_{\mathop\mathrm{\,loc\,}}(\Omega)$ uniformly in $\epsilon\in(0,1]$ and
  $ (F_\epsilon)'(v_+ )\to \chi_{\{x\in\Omega: v>0\}}$ in $\Omega $ as   $\epsilon\to0$.
 Thus by $Xv_\delta\to Xv $ in $L^2_{\mathop\mathrm{\,loc\,}}(\Omega)$ as $\delta\to0$, for any $\varphi\in C_c^\infty(\Omega)$ one has
 \begin{align*}\int_\Omega v_+X^\ast\varphi\,dx&=\lim_{\epsilon\to0}
 \int_\Omega  F_\epsilon(v_+)X^\ast\varphi\,dx\\&= \lim_{\epsilon\to0}\lim_{\delta\to0}
 \int_\Omega  F_\epsilon(v_\delta)X^\ast\varphi\,dx\\
 &= -\lim_{\epsilon\to0}\lim_{\delta\to0}\int_\Omega  (F_\epsilon)'(v_\delta)(Xv_\delta) \varphi\,dx\\
  &= -\lim_{\epsilon\to0} \int_\Omega  (F_\epsilon)'(v_+)(Xv ) \varphi\,dx\\
 &=-\int_\Omega   (Xv ) \chi_{\{x\in\Omega: v>0\}} \varphi\,dx,
 \end{align*}
 which gives that $ Xv^+= (Xv ) \chi_{\{x\in\Omega: v>0\}}$ as desired.

\end{proof}




\begin{lem}\label{lem3.2}
For any $ \lambda \ge 0$ and $x \in \Omega $, we have
$ d_\lambda(x, \cdot), d_\lambda(\cdot,x)\in \dot W^{1,\infty}_{X }(\Omega )$ and
 $$\|H(\cdot,Xd_\lambda(x, \cdot))\|_{L^\infty(\Omega )} \le \lambda\quad\mbox{and}\quad\|H(\cdot,-Xd_\lambda(\cdot,x))\|_{L^\infty(\Omega )} \le \lambda.$$
\end{lem}

\begin{proof}
Given any $x\in \Omega $ and $\lambda \ge 0$, write $v(z)=d_\lambda(x,z)$ for all $z\in \Omega $.
To see $H(\cdot,Xv)\le \lambda$ almost everywhere, by Lemma \ref{l6.1},
 it suffices to find a sequence of function $u_j\in W^{1,\infty}(\Omega )$ so that
$H(\cdot,Xu_j)\le \lambda$ almost everywhere  and $u_j\to v$ in $C^0(\Omega )$ as $j\to\infty$.

To this end, let $\{K_j\}_{j \in {\mathbb N}}$ be a sequence of compact subsets in $\Omega $ with $\Omega  = \bigcup_{j \in {\mathbb N}} K_j$ and $K_j \subset K_{j+1}^{\circ}$.
For $j \in {\mathbb N}$ and $y \in K_j$, by definition of $d_\lambda$ we can find a function
$v_{y,j} \in\dot W^{1,\infty}_X(\Omega)$ such that $H(\cdot,Xv_{y,j})\le\lambda$ almost everywhere,
$$d_\lambda(x,y)-\frac{1}{2j}\le v_{y,j}(y) -v_{y,j}(x).$$
Since Lemma \ref{lem311} implies that  $d_\lambda(x, \cdot)$ is continuous,
 there exists an open neighbourhood $N_{y,j}$ of $y$ with
$$d_\lambda(x, z) - \frac{1}{j} \le v_{y,j}(z)-v_{y,j}(x),  \quad\forall z\in N_{y,j}. $$
Thanks to the compactness of $K_j$,
there exist $y_1, \cdots , y_l\in K_j$  such that
$K_j \subset \bigcup_{i=1}^{l} N_{y_i,j}$. 
Write
$$u_j(z) := \max\{v_{y_i,j}(z)-v_{y_i,j}(x) : i = 1, \cdots , l\}\quad\forall z\in K_j.$$
Then $u_j(x)=0$, and
$$d_\lambda(x,z) \le u_j(z)+ \frac{1}{j} \ \text{for all} \ z\in K_j.$$
Moreover by Lemma \ref{l21} we have
$$H(\cdot,Xu_j)\le \lambda\quad \mbox{in}\ \Omega .$$
Since
  $$d_\lambda(x,z)  \ge u_j(z) \ \text{for all} \ z\in K_j$$
  is clear, we conclude that $u_j\to u $ in $C^0(K_i)$ as $j\to\infty$ for all $i$, and hence in $C^0(\Omega )$ as $j\to\infty$.

  Similarly, we can show $\|H(x,-Xd_\lambda(\cdot, x ))\|_{L^\infty(\Omega )} \le \lambda$ which finishes the proof.
\end{proof}


In general, for any $E \subset \Omega $, we define
\begin{equation*}
  d_{\lambda,E}(z) := \inf_{x \in E} \{d_\lambda(x,z)\}.
\end{equation*}

\begin{lem}\label{l6.2}
  For any set $E\subset\Omega $, we have  $d_{\lambda,E} \in \dot W^{1,\infty}_{X }(\Omega )$ and $\|H(x,Xd_{\lambda,E} )\|_{L^\infty(\Omega )}\le \lambda$.
\end{lem}

\begin{proof}
 
   Let $\{K_j\}_{j \in {\mathbb N}}$ be a sequence of compact subsets in $\Omega $ with $\Omega  = \bigcup_{j \in {\mathbb N}} K_j$ and $K_j \subset K_{j+1}^{\circ}$.
   For each $j$ and $y\in K_j$, we can find $z_{y,j}\in E$ such that
   $$d_{\lambda,E}(y)\le d_{\lambda,z_{y,j}}(y)\le d_{\lambda,E}(y)+1/2j.$$
   Thus there exists a neighborhood $N(y)$ of $y$ such that
    $$d_{\lambda,E}(y)\le d_{\lambda,z_{y,j}}(y)\le d_{\lambda,E}(z)+1/ j\quad\forall z\in N(y).$$
   So we can find $\{y_1,\cdots, y_{l_j}\}$ such that
   $K_j=\cup_{i=1}^{l_j}N(y_i) $ for all $i=1,\cdots l_j$.
     Write $$u_j(z)=\min\{d_{\lambda,z_{y_i,j}}(z)\} \quad\forall z\in K_j.$$
    $$d_{\lambda,E}\le u_j(z)\le d_{\lambda,E}+1/j\quad \mbox{in}\ K_j .$$
    This means that $u_j\to d_{\lambda,E}$ in $C^0(\Omega)$ as $j\to\infty$.
    Note that $$\|H(\cdot, Xu_j )\|_{L^\infty(\Omega)}\le \lambda.$$
    By Lemma \ref{lem3.2} we have $d_{\lambda,E}\in \dot W^{1,\infty}_X(\Omega)$ and $\|H(\cdot, Xd_{\lambda,E})\|_{L^\infty(\Omega)}\le \lambda$ as desired.
\end{proof}



We are able to to prove (i)$\Rightarrow$(ii)$\Rightarrow$(iii)$\Rightarrow$(i) in Theorem 1.1 as below.


\begin{proof} [Proofs of (i)$\Rightarrow$(ii)$\Rightarrow$(iii)$\Rightarrow$(i) in Theorem 1.1.]
The definition of $d_\lambda$ directly gives (i)$\Rightarrow$(ii). Obviously, (ii)$\Rightarrow$(iii).
Below we  prove (iii)$\Rightarrow$ (i). Recall that (iii) says that
$u(y)-u(z)\le  d_\lambda (z,y)$  for all $x \in \Omega$ and $y,z \in N(x)$, where $N(x)\subset \Omega$ is   a neighbourhood of $x$.
To get (i), since   $\Omega=\cup_{x\in \Omega}N(x)$,
it  suffices to show that  for all  $x\in \Omega$, one has
  $u\in  W_{X}^{1,\infty}(N(x))$ and $\|H(\cdot,Xu)\|_{L^\infty(N(x))}\le\lambda$.


Fix any $x$, and write $ U=N(x)$. Without loss of generality we assume that $U$ is bounded.

Notice that   $u\in L^\infty(U)$. Let  $M\in {\mathbb N}$ so that $M\ge  \sup_{U} |u|$.
  For each $k \in {\mathbb N}$ and $l = -Mk, ... , Mk$,
   set $$u_{k,l}(z) := l/k + d_\lambda (z, F_{k,l})\quad\forall z\in U $$
   where $$F_{k, l} := \{ y \in U  \ | \ u(y) \le \frac{l}{k} \}.$$
 Then $$\|H(\cdot,u_{k,l})\|_{L^\infty(U)}\le\lambda.$$
   Set
  $$ u_k (z):= \min_{l = -Mk, ... , Mk}u_{k,l}\quad\forall z\in U.$$
 We claim that, for every $k$ and $z \in N(x)$, if $u(z)\in [\frac{l}{k},\frac{l+M}{k}]$, then $u_k(z) \in [u(z),\frac{l+M}{k}]$. First notice that if $l'\ge l+M$, then $z \in F_{k,l'}$ and $d_\lambda(z,F_{k,l'})=0$. We infer that $u_{k,l'}(z)=l'/k$ and hence
\begin{equation}\label{eq2121}
  u_k(z) \le \min_{l'\ge l+M}\{u_{k,l'}(z)\}=\frac{l+M}{k}.
\end{equation}
On the other hand, if $l'' \le l$, we can find $w \in \partial F_{k,l''}$ such that $d_{\lambda,F_{k,l''}}(z)=d_\lambda(w,z)$. Since $w \in \partial F_{k,l''}$, we deduce that $u(w)=l''/k$ and
\begin{equation}\label{eq2122}
  u_{k,l''}(z)=l''/k+d_{\lambda,F_{k,l''}}(z)=u(w)+d_\lambda(w,z).
\end{equation}
Notice that since $w \in F_{k,l''} \subset N(x)$ we have
\begin{equation}\label{eq2123}
  u(z)-u(w) \le d_\lambda(w,z).
\end{equation}
Combining \eqref{eq2122} and \eqref{eq2123}, we have
\begin{equation}\label{eq2124}
  u(z)\le u(w)+  d_\lambda(w,z) = u_{k,l''}(z).
\end{equation}
Now, \eqref{eq2121} and \eqref{eq2124} imply
  $$u(z) \le \min_{l = -Mk, ... , Mk}u_{k,l}(z) =u_k(z) \le \frac{l+M}{k}.$$
Since $u(z) \ge \frac{l}{k}$, we have
$$|u(z)-u_k(z)| \le \frac{M}{k}.$$
One then has that   $u_k \to u$  in $C^0(U)$ as $k\to\infty$.
Thanks to Lemma \ref{l6.1}, we arrive at $u\in  W_{X}^{1,\infty}(U)\ \text{and}  \ \|H(\cdot,Xu)\|_{L^\infty(U)}\le\lambda$ as desired.
\end{proof}




To prove (iv)$\Rightarrow$ (iii) in Theorem 1.1, we need the following length property of $ d_\lambda$.
Precisely, denote by  $\rho_\lambda$   the length pseudo-distance induced by $d_\lambda$, that is,
\begin{equation*}
  \rho_\lambda (x, y) := \inf \{\ell_{d_\lambda} ({\gamma}) \  | \ {\gamma} \in \mathcal C(a, b; x, y;  \Omega )\},
\end{equation*}
 where  $ \mathcal C(a, b; x, y;  \Omega)$ denotes the class of all continuous curves ${\gamma}:[a,b]\to U$ with
${\gamma}(a)=x$ and ${\gamma}(b)=y$, and $$\ell_{d_\lambda}({\gamma}):= \sup \bigg \{ \sum_{i=0}^{N-1} d_\lambda ({\gamma}(t_{i}), {\gamma}(t_{i+1}))\ \bigg | \ a=t_0 < t_1 < \cdots < t_N=b  \bigg \}.$$
\begin{prop}\label{len} Suppose that $H(x,p)$ satisfies (H0)-(H3).
   For any   $\lambda \ge 0$,    we have     $d _\lambda=\rho_\lambda$.

 \end{prop}

To prove Proposition 1.4, we need the following approximation midpoint property property of $d_\lambda$.


\begin{prop} \label{p301}
For any $\lambda\ge 0$,   we have
  \begin{equation}\label{eq2211}
    \inf_{z\in\Omega}\max\{d_\lambda (x,z),d_\lambda (z,y)\} \le \frac{1}{2}d_\lambda (x,y) \quad\mbox{for all $x,y \in \Omega $.}
  \end{equation}

\end{prop}
\begin{proof}
 Suppose that
\eqref{eq2211} were not true.
 There exist $x_0,y_0\in\Omega$ such that
 $$
    \inf_{z\in\Omega}\max\{d_\lambda (x_0,z),d_\lambda (z,y_0)\} \ge \frac{1}{2}d_\lambda (x,y)+\epsilon_0:=r_0.
$$
for some $\epsilon_0>0$.
  Given any $\delta\in(0,r_0)$, let
  $$f(z) := \min\{d_\lambda(x_0, z)-(r_0 - \delta), 0\} + \max\{(r_0 - \delta) - d_\lambda(z, y_0), 0\}\quad\forall z\in\Omega.$$
 It is clear that $f(z)=\min\{d_\lambda(x, z)-(r - \delta), 0\}$ whenever   $d_\lambda(x_0,z)<r_0$,
 and $f(z)=\max\{(r - \delta) - d_\lambda(z, y), 0\}$ whenever     $d_\lambda(z,y_0)<r_0$; in particular,
 $f(y_0) = r - \delta$ and $f(x_0) = -(r - \delta)$.
     Moreover, $f \equiv 0$ whenever  $z\in \Omega$ but $d_\lambda(x_0,z)> r_0-\delta$ and  $d_\lambda(z,y_0)> r_0-\delta$.
     Thus   $f$ satisfies Theorem \ref{rad}(iii), where the open neighborhood $N(x)=\{y\in \Omega, d_\lambda(x_0,z)<r_0\}$ if $d_\lambda(x_0,x)<r_0$, $N(x)=\{y\in \Omega, d_\lambda( z,y_0)<r_0\}$ if $d_\lambda(x_0,x)<r_0$ if $d_\lambda( x,y_0)<r_0$ and
     $N(x)=\{y\in \Omega, d_\lambda( x_0,z)>r_0-\delta, d_\lambda( z,y_0)>r_0-\delta\}$  otherwise.
By Theorem 1.1,   $f$ satisfies Theorem \ref{rad}(ii), which implies that $$d_\lambda(x_0, y_0) \ge f(y_0) - f(x_0) = 2r_0 - 2\delta= d_\lambda (x_0,y_0)+2\epsilon_0 - 2\delta.$$  As  $\delta\to0$, this yields that $d_\lambda(x_0, y_0) \ge d_\lambda (x_0,y_0)+\epsilon_0$, which is a contradiction.
\end{proof}



    We are in the position to show







\begin{proof}[Proof of Proposition \ref{len}.] Note that
 $d_\lambda \le \rho_\lambda  $ follow from the  the triangle inequality  for $d_\lambda$.

 To see   $\rho_\lambda\le d_\lambda$,    for any $x\in\Omega$, let
 $r_x > 0$ such that let $r_x > 0$ be sufficiently small such that $B_{d_\lambda}(x, 3r_x) \Subset \Omega $. Let $ y  \in B_{d_\lambda}(x, r)$ and
$\delta := d_\lambda(x, y)$.  For any  $0 < \epsilon < \delta$, we claim that  there exists a curve   ${\gamma}\subset B_{d_\lambda}(x,3r_x)$ satisfying
$$\ell_{d_\lambda} ({\gamma}_\epsilon)\le \delta+\epsilon.$$
Indeed, write $y_0=x$ and $y_1=y$.
Applying Proposition \ref{p301} with $\epsilon/4$, there exists a point $y_{1/2}$ such that
$$\max\{d_\lambda(y_0,y_{1/2}),d_\lambda(y_{1/2},y_1) \}\le  \frac12\delta+\frac14\epsilon.$$
In general, given any $t\ge2$,
 by induction and using Proposition \ref{p301} with $2^{-2t }\epsilon$,
 for any $s\in D_t := \{k2^{-t} | 0\le k\le 2^t\}$ we can find
 $y_s \in  B_{d_\lambda}(y_0, 2r)$   such   that
\begin{equation*}
  d_\lambda(y_{j2^{-t}}, y_{(j+1)2^{-t}}) \le \frac12 \left[2^{-t-1}\bigg ( \delta + \epsilon\sum_{j=1}^{t-1}2^{-j} \bigg )\right]+2^{-2t }\epsilon=2^{-t }\bigg ( \delta + \epsilon\sum_{j=1}^{t }2^{-j} \bigg ) .
\end{equation*}
Note that, for any $s\in D=\cup_{t\in{\mathbb N}} D_t $,  one has
$$d_\lambda(y_{s_1},y_{s_2})\le |s_1-s_2|(\delta+\epsilon)\quad\forall s_1,s_2\in D,\ s_1\le s_2.$$
Since $D$ is dense in $[0, 1]$ and $\overline {B_{d_\lambda}(y_0, 2r)}$ is complete,
letting  ${\gamma}_\epsilon: [0, 1] \to B_{d_\lambda}(y_0, 3r)$ be the curve given by
${\gamma}_\epsilon(s)=y_s$ for $s\in D$ and ${\gamma}_\epsilon(s)=\lim_{s'\in D\to s}y_{s'}$ one has
$$d_\lambda({\gamma}_\epsilon (s_1),{\gamma}_\epsilon(s_2))\le |s_1-s_2|(\delta+\epsilon)\quad\forall s_1,s_2\in [0,1],\ s_1\le s_2,$$
which gives
 $\ell_{d_\lambda} ({\gamma}_\epsilon)\le \delta+\epsilon $ as desired.



   By the triangle inequality, for any $z\in\Omega$  we have
$$\rho_\lambda(z,y) -\rho_\lambda (z,x)\le \ell_{d_\lambda}({\gamma}_\epsilon )  \le d_\lambda (x, y )+\epsilon\quad\forall y \in B_{d_\lambda }(x, r_x).$$
By sending $\epsilon\to0$,  this yields
\begin{equation*}
\rho_\lambda (z,y) -\rho_\lambda (z,x) \le d_\lambda (x,y)\quad\forall y \in B_{d_\lambda}(x, r_x).
\end{equation*}
Thus, for any   $z\in \Omega$,
  $\rho_\lambda(z,\cdot)$ satisfies    Theorem 1.1 (iii).
By Theorem 1.1, $\rho_\lambda(z,\cdot)$ satisfies  Theorem 1.1 (i) , that is,  $\rho_\lambda(z,\cdot)\in \dot W^{1,\infty}_X(\Omega)$ and $\|H(\cdot,X\rho_\lambda(z,\cdot))\|_{L^\infty(\Omega)}\le\lambda$.
By definition,  $$\rho_\lambda (z,w) \le d_\lambda(z,w)\quad\forall w\in \Omega $$  as desired.
\end{proof}


\begin{proof}[Proof of (iii)$\Leftrightarrow$(iv) in Theorem 1.1] Obviously, (iii)$\Rightarrow$(iv). To see the converse,
let $y,z \in N(x)$. We need to show
$$   u(y)-u(z)\le d_\lambda(z,y).    $$
By Proposition \ref{len}, we know $(\Omega,d_\lambda)$ is a length space for any $\lambda>0$. Hence for any $\epsilon>0$, there exists ${\gamma}_{z,y}^\epsilon: [0,1] \to \Omega$ joining $z$ and $y$ such that
\begin{equation}\label{ez1}
  \ell_{d_\lambda}({\gamma}_{z,y}^\epsilon) \le d_\lambda(z,y) +\epsilon.
\end{equation}
Since ${\gamma}_{z,y}^\epsilon \subset \Omega$ is compact, we can find a finite set $\{t_i\}_{i=0}^n \subset [0,1]$ satisfying
$$ t_0=0, \ t_n=1, \ \text{and } {\gamma}(t_{i+1}) \in N({\gamma}(t_i)), \ i=0,\cdots , n-1 $$
where $N({\gamma}(t_i))$ is the neighbourhood of ${\gamma}(t_i)$ in (iv).
Hence by (iv) we have
\begin{equation*}
  u({\gamma}(w_{i+1})) - u({\gamma}(w_i)) \le d_\lambda({\gamma}(w_{i}),{\gamma}(w_{i+1})), \ i=0, \cdots i-1.
\end{equation*}
Summing the above inequalities from $0$ to $n-1$, we have
\begin{align*}
  u(y) - u(z) & = u({\gamma}(w_n)) - u({\gamma}(w_0)) \le \sum_{i=0}^{n-1}d_\lambda({\gamma}(w_{i}),{\gamma}(w_{i+1}))
    \le \sum_{i=0}^{n-1} \ell_{d_\lambda}({\gamma}_{z,y}^\epsilon | _{[w_i,w_{i+1}]}) \\
   & = \ell_{d_\lambda}({\gamma}_{z,y}^\epsilon )
   \le d_\lambda(y,z) +\epsilon
\end{align*}
where in the last inequality we applied \eqref{ez1}.
Letting $\epsilon\to0$ in the above inequality, we obtain (iii).
\end{proof}





\section{MacShane extensions and minimizers}



Let $U\Subset \Omega$ be any domain.
Note that   the restriction of $d_\lambda$ in $U$ may not have length property in $U$,
and moreover,
Theorem 1.1 with $\Omega $ replaced by $U$ may not hold for the restriction of $d_\lambda$ in $U$.
Thus instead of $d_\lambda$, below we use pseudo-distances
 $\{d^U_\lambda\}_{\lambda> 0}$  in $U $,
 which are defined via  \eqref{d311} with $ \Omega$ repalced by $ U$,  that is,
\begin{equation*}
d^{U} _{\lambda} (x,y):= \sup\{u(y)-u(x) : u \in W^{1,\infty}_{X }(U),\ \|H(\cdot, Xu)\|_{L^\infty(U)} \le \lambda
  \}\quad\forall \mbox{$x,y \in  U$ and $\lambda \ge 0$}.
\end{equation*}
Obviously we have proved the following.
\begin{cor} Both of Theorem 1.1  and Lemma \ref{len} hold with $\Omega$ replaced by $U$ and $d_\lambda$ replaced by $d_\lambda^U$.  In particular, $d_\lambda^U$ has length property in $U$.
\end{cor}


 Observe that, apriori, $d^U_\lambda$ is only defined in $U$ but not in $\overline U$.
Naturally, we extend $d^U_\lambda:U\times U\to[0,\infty)$ as a function  $\widetilde d^U_\lambda: \overline U\times \overline U\to[0,\infty]$  by
$$
\widetilde d_\lambda^U(x,y)=\lim_{r\to0}\inf\{d_\lambda^U(z,w)| (z,w)\in U\times U, |(z,w)-(x,y)|\le r\}.$$
Obviously, $\widetilde d^U_\lambda(x,y)=d^U_\lambda(x,y)$ for all  $(x,y)\notin U\times U$, and $\widetilde d_\lambda^U$ is lower semicontinuos in $\overline U\times \overline U$,
that is, for any $a\in{\mathbb R}$, the set $ \{(x,y)\in \overline U\times \overline U| \widetilde d^U_\lambda(x,y)>a\}$ is open in $\bar U$.
One may also note that it may happen that
  $d^{U}_\lambda(x,y)=+\infty$  for some   $(x,y)\notin U\times U$.
Below, to avoid abuse of notation, we   write $\widetilde d_\lambda^U$ as $d_\lambda ^U$.

 The following property will be used later.
\begin{lem} \label{property}
Let $U \Subset \Omega$ be a   subdomain and $\lambda\ge 0$.
\begin{itemize}
\item [(i)]
  For any $x,y\in \overline U$, we have $d^{U}_\lambda(x,y) \ge  d_\lambda(x,y)\ge  R'_\lambda d_{CC}(x,y)$.



\item [(ii)]
  For any $x\in U$ and $y$ with ${d_{CC}}(x,y)<{d_{CC}}(x,\partial{U})$, we have
$
  d^{U}_\lambda(x, y)\le R_\lambda d_{CC}(x,y).
$


\item [(iii)]
   For any $x\in U$, there exists a point $x^\ast \in \partial{U}$ such that $d^{U}_\lambda(x,x^\ast) < +\infty$.
\item [(iv)]
   For any $x, y \in U$ and $z \in \partial{U}$, we have
    $d^{U}_\lambda(y, z) \le d^{U}_\lambda(y,x) + d^{U}_\lambda(x,z).$

\item[(v)]  Given any $y\in \partial U$, if $d^{U}_\lambda(x,y)= \infty$ for some $x\in U$,
then   $d^{U}_\lambda(z,y)=+\infty$ for any $z \in \overline U$;
if   $d^{U}_\lambda(x,y)<\infty$ for some $x\in U$, then there exists $y_j\in U$ such that
$d^{U}_\lambda(y_j,y)\to0$.
\item[(vi)] Given any $x,y\in \overline U\times \overline U$ the map $\lambda\in[0,\infty)\mapsto d_\lambda(x,y)\in[0,\infty]$ is nondecreasing and for $0\le\lambda<\mu<\infty$,
     $$d^U_\lambda(x,y)<\infty \text{ if and only if } d^U_\mu(x,y)<\infty \ \text{whenever $R'_\lambda>0$}.$$

\item[(vii)] Given any $x,y\in  \overline U^\ast\times \overline  U^\ast$, the map $\lambda\in[0,\infty)\mapsto d_\lambda(x,y)\in[0,\infty]$ is right continuous where
$$\overline U^\ast=\{y\in\overline U \ | \ d_\lambda(x,y)<\infty\quad\mbox{for some $x\in U$ and $\lambda\ge0$ with $R'_\lambda>0$} \}.$$
\end{itemize}
\end{lem}

\begin{proof}
To see (i), for any $x,y\in U$, since the restriction
$u|_U$ is a test function in the definition of $d^{U}_\lambda(x,y)$ whenever
 $u$  is a test function in the definition of $d_\lambda(x,y)$,
we have $d^U_\lambda(x,y)\ge d_\lambda(x,y)$.
In general,
given any    $(x,y)\in (\overline U\times\overline  U)\setminus (U\times U)$,
for any $r>0$ sufficiently small, we have
 $d^U_\lambda(z,w)\ge d_\lambda(z,w)$ whenever $z,w\in U$  and $|(z,w)-(x,y)|\le r$.
By the continuity of $d_\lambda$ in $\Omega\times\Omega$, we have
  $$\lim_{r\to0}\inf\{d^U_\lambda(z,w) \ | \ \mbox{$z,w\in U$  and $|(z,w)-(x,y)|\le r$}\}\ge d_\lambda(x,y),$$
that is, $ d_\lambda^U(x,y)\ge d_\lambda(x,y)$.  Recall that   $d_\lambda(x,y)\ge R'd_{CC}(x,y)$ comes from Lemma 2.1.

\medskip
 To see (ii), given any $y\in U$ with ${d_{CC}}(x,y)<{d_{CC}}(x,\partial{U})$, we can choose a geodesic ${\gamma}\subset B_{d_{CC}}(x,d_{CC}(x,\partial U))$ with respect to ${d_{CC}}$ connecting $x$ and $y$.
For any function $u\in \dot W^{1,\infty}_{X }(U)$ with $\|H(\cdot,Xu)\|_{L^\infty(U)}\le \lambda$,
we know that
$\|Xu\|_{L^\infty(U)}\le R_\lambda$.
It  is standard to find a sequence $\{u_k\}_{k\in{\mathbb N}}$  of smooth function in $U$
such that  $u_k\to u$ everywhere as $k\to\infty$
 and $\|Xu_k\|_{L^\infty(U)}\le  R_\lambda$.
Since
$$u_k(y)-u_k(x)= \int_{\gamma} Xu_k\cdot \dot{\gamma} \le \int_{\gamma} |Xu_k||\dot{\gamma}| \le   \int_{\gamma} R_\lambda|\dot{\gamma}| = R_\lambda {d_{CC}}(x,y).$$
we have
  $$u(y)-u(x)
=\lim_{k \to \infty}\{u_k(y)-u_k(x)\}\le  R_\lambda {d_{CC}}(x,y).$$
Taking supremum in the above inequality over all such $u$, we have $d^U_\lambda(x,y)\le R_\lambda {d_{CC}}(x,y)$.


\medskip
To see (iii), given any $x\in U$,  there exists  $x^\ast\in\partial U$
such that $ d_{CC}(x,x^\ast)=d_{CC}(x,\partial U)$. By (ii) and the definition of $d^U_\lambda(x,x^\ast)$,
we know that  $d_\lambda^U (x,x^\ast)\le R_\lambda d_{CC}(x,x^\ast)<\infty$.

\medskip
To get (iv), choose $z_k\in U$ such that
$d^{U}_\lambda(x,z_k)\to d^{U}_\lambda(x,z)$ as $k\to\infty$.
Since   $d^{U}_\lambda(y, z_k) \le d^{U}_\lambda(y,x) + d^{U}_\lambda(x,z_k)$, letting $k\to\infty$ we get
$d^{U}_\lambda(y, z ) \le d^{U}_\lambda(y,x) + d^{U}_\lambda(x,z )$.

\medskip
Note that (v) is a direct consequence of (iv).

\medskip
We show (vi). The fact that $d_\lambda^U(x,y)$ is non-decreasing with respect to $\lambda$ is obvious for any $x,y \in \overline U$. Assume $0<\lambda<\mu<\infty$. Then $d^U_\mu(x,y)<+\infty$ implies $d^U_\lambda(x,y)<+\infty$. Conversely, if $d_{\mu}^U(x,y)=+\infty$, we show $d_\lambda^U(x,y)=+\infty$. This may happen if  at least one of $x$ and $y$ lie in $\partial{U}$. Then for any $\{x_k\}_{k\in {\mathbb N}} \subset U$ and $\{y_k\}_{k\in {\mathbb N}}\subset U$ converging to $x$ and $y$, it holds
$$ \liminf_{k \to \infty}d_{\mu}^U(x_k,y_k) = +\infty $$
where we let $x_k \equiv x$ (resp. $y_k \equiv y$) if $x \in U$ (resp. $y\in U$). By (i) and (ii), we have for any $\lambda\le \mu$
$$ \liminf_{k \to \infty} d_{\lambda}^U(x_k,y_k) \ge R'_\lambda \liminf_{k \to \infty} d_{CC} (x_k,y_k) \ge \frac{R'_\lambda}{R_{\mu}} \liminf_{k \to \infty} d_{\mu}^U(x_k,y_k) = +\infty $$
where we recall that $\lambda>0$ implies $R'_\lambda>0$ from (H3).



\medskip
Finally, we show (vii). First, by (vi), we know $\overline U^\ast$ is independent of the choice of $\lambda$ hence well defined. Since we only consider $x,y \in U^\ast$,
by an approximation argument, it is enough to show the right-continuity for $x,y \in U$. We argue by contradiction. Assume there exists $\lambda_0 \ge 0$ and $x,y \in U$ such that
\begin{equation}\label{rad0}
  \liminf_{\lambda \to \lambda_0+}d_\lambda^U(x,y)=\lim_{\lambda \to \lambda_0+}d_\lambda^U(x,y) =c > d_{\lambda_0}^U(x,y) .
\end{equation}
Let $w_\lambda(\cdot):= d_\lambda^U(x,\cdot)$. By Lemma \ref{lem3.2}, we know $\|H(\cdot,Xw_\lambda)\|_{L^\infty(U)}\le \lambda$. Since $\{w_\lambda\}_{\lambda>\lambda_0}$ is a non-decreasing sequence with respect to $\lambda$, $\{w_\lambda\}$ converges pointwise to a function $w$ as $\lambda \to \lambda_0+$ and for any compact set $V \Subset U$ and $x,y \in V$, we have $w_\lambda \to w$ in $C^0(V)$. Then applying Lemma \ref{l6.1}, we have
$$  \|H(\cdot,Xw)\|_{L^\infty(V)}\le \lambda  $$
for any $\lambda>\lambda_0$, which implies
\begin{equation}\label{rada}
  \|H(\cdot,Xw)\|_{L^\infty(V)}\le \lambda_0.
\end{equation}
By the definition of $w$,
we have
\begin{equation}\label{radb}
  w(x)=\lim_{\lambda \to \lambda_0+}d_\lambda^U(x,x)=0, \text{ and } w(y)= \lim_{\lambda \to \lambda_0+}d_\lambda^U(x,y)=c
\end{equation}
Combining \eqref{rada} and \eqref{radb} and applying Corollary 3.1, we have
$$c - 0 =w(y) -w(x)  \le d_{\lambda_0}^U(x,y),$$
which contradicts to \eqref{rad0}. The proof of (vii), hence Lemma \ref{property} is complete.
\end{proof}


\begin{align*}
  \mu(g,  \partial U) &:= \inf \big \{ \lambda \ | \ g(y) - g(x) \le d^{U}_\lambda(x, y), \quad \forall \ x, y \in \mathop\mathrm{\,\partial\,}{U}  \big \}\\
   & \ =\inf \big \{ \lambda \ | \ g(y) - g(x) \le d^{U}_\lambda(x, y), \quad \forall \ x, y \in \mathop\mathrm{\,\partial\,}{U}\cap \overline U^\ast  \big \}.
\end{align*}
Thanks to Lemma \ref{property}(vii), we have the following observation:
\begin{align*}
  \mu(g,  \partial U)
   & =\min \big \{ \lambda \ | \ g(y) - g(x) \le d^{U}_\lambda(x, y), \quad \forall \ x, y \in \mathop\mathrm{\,\partial\,}{U}\cap \overline U^\ast  \big \}.
\end{align*}



If $\mu=\mu(g,\partial U)<\infty$, we define
 $${\mathcal S}^+_{g;U}(x) := \inf_{y\in\partial U} \{g(y) + d^{U}_\mu  (y, x)   \}  \quad{\rm and}\quad
  {\mathcal S}^-_{g; U}(x) := \sup_{y\in\partial U} \{g(y) - d^{U}_\mu  (x, y)    \}\quad \forall x \in \overline U.$$
 Note that ${\mathcal S}^\pm_{g; U}$  serve  as    ``MacShane" extensions of $g$ in $U$.




\begin{lem} \label{cont} If
   $\mu=\mu(g,\partial U)<\infty$, then  $\mathcal {S}_{g;U}^\pm  \in \dot W^{1,\infty}_X(U)\cap C^0(\overline U)$ with $\mathcal {S}_{g;U}^\pm=g$ on $\partial U$ and
   $ \|H(\cdot,\mathcal {S}_{g;U}^\pm )\|_{L^\infty(U)}\le \mu.$
\end{lem}


\begin{proof}
First,  for any  $x, y \in  U$,
 by Lemma \ref{property}(iv), we have $$d^U_\mu(x,z)\le d^U_\mu(x,y)+d^U_\mu(y,z),  \quad\forall z\in\partial U,$$ and hence
  \begin{align*}
    \mathcal {S}_{g;U}^-(y)  & =  \sup_{z  \in \partial{U} }\{g(z) - d^U_\mu(y, z)  \} \\
    & \le  \sup_{z  \in \partial{U} }\{g(z) - d^U_\mu
(x, z)+d^U_\mu(x,y)  \} \\
     & \le  \mathcal {S}_{g;U}^-(x)  +d^U_\mu(x,y),
  \end{align*}
that is,   $ \mathcal {S}_{g;U}^- (y)-\mathcal {S}_{g;U}^- (x) \le d^U_\mu(x,y) $.  Similarly,
  one has    $\mathcal {S}_{g;U}^+ (y)-\mathcal {S}_{g;U}^+ (x) \le d^U_\mu(x,y).$ By Corollary 3.1, we have
$\mathcal {S}_{g;U}^\pm  \in \dot W^{1,\infty}_X(U) $  and
   $ \|H(\cdot,\mathcal {S}_{g;U}^\pm )\|_{L^\infty(U)}\le \mu.$

Next, we observe that $\mathcal {S}_{g;U}^\pm  = g $ on  $\partial{U}$.
  Indeed, for any $x\in\partial U$, by definition  we have   $\mathcal {S}_{g;U}^-(x) \ge g(x)\ge \mathcal {S}_{g;U}^+(x)$. Conversely,  for  $y \in \partial{U}$,  one has
  $$g(y) - d^U_\mu(x, y) \le g(x)\le g(y) + d^U_\mu(y, x)$$ and hence
  $\mathcal {S}_{g;U}^-(x) \le g(x)\le \mathcal {S}_{g;U}^+(x) $ as desired.


Finally, we show that   $\mathcal {S}_{g;U}^\pm\in C^0(\overline U)$. We only consider   $\mathcal {S}_{g;U}^-$;
 the proof for $\mathcal {S}_{g;U}^+$ is similar.
It suffices to show that  for any $x \in \partial{U}$ and a sequence $\{x_j\} \subset U$ converging to $x$,
  \begin{equation*}
    \lim_{j \to \infty}\mathcal {S}_{g;U}^-(x_j)=\mathcal {S}_{g;U}^-(x)=g(x).
\end{equation*}

Choosing $x^\ast_j\in\partial U$ such that $d_{CC}(x_j,x^\ast_j)={\mathop\mathrm{\,dist\,}}_{d_{CC}}(x_j,\partial U)$,
then $d_{CC}(x_j,x^\ast_j)\le d_{CC}(x_j,x)\to0$, and hence $d_{CC}(x_j^\ast,  x)\to0 $.
Note that by Lemma \ref{property}(ii), $$d^U _\mu(x_j,x^\ast_j)\le R_\mu d_{CC}(x_i,x^\ast_j)\to0.$$
Since
$$\mathcal {S}_{g;U}^-(x_j)\ge g(x_j^\ast)-d^U _\mu(x_j,x^\ast_j),$$
by the continuity of $g$, we have  $$\liminf_{j \to \infty}\mathcal {S}_{g;U}^-(x_j)\ge g(x).$$

Assume that    $\liminf_{j \to \infty}\mathcal {S}_{g;U}^-(w_j)\ge g(x)+2\epsilon
$ for some $\{w_j\}_{j\in{\mathbb N}}\subset  U$ with $w_j\to x$ and some $\epsilon>0$.
By the definition we can find $z_j\in\partial U$ such that
$
\mathcal {S}_{g;U}^-(w_j)-\epsilon\le g(z_j)-d^U_\mu(w_j,z_j)  $.
Thus
$$g(z_j)-d^U_\mu(w_j,z_j) \ge g(x)+\epsilon$$
Up to some subsequence, we assume that $z_j\to z
  \in\partial U$.
Note that  $d^U_\mu(x,z) \le\liminf_{j\to\infty} d^U_\mu(w_j,z_j)$.
By the continuity of $g$, we conclude  $g(z )-d^U_\mu(x,z) \ge g(x)+\epsilon$, which is a contradiction with the definition  of $\mu$ and $\mu<\infty$.
\end{proof}


Write
\begin{equation}\label{minimizer}\mathbf I(g,U) =\inf\{\|H(\cdot,Xu)\|_{L^\infty(U)} \ | \ u\in W_X^{1,\infty}(U)\cap C^0(\overline U), u|_{\partial U}=g \}.
\end{equation}
 where if the infmum is reached by some function $u$ satisfying conditions  required here,
we   call $u$ as a minimizer for  $\mathbf I(g,U)$.

We have the following result.


\begin{lem}\label{lem231}
For any  $g\in C(\partial U)$ with  $\mu(g,\partial U)<\infty$, we have the following:
\begin{enumerate}
  \item[(i)]  We have $
   \mu(g,\partial U)=\mathbf I(g,U).
 $ Both of $\mathcal {S}_{g;U}^\pm$ are minimizers for $\mathbf I(g,U)$.

\item[(ii)] If  $u$ is a  minimizer for $\mathbf I(g,U)$
    then
$$
 \mathcal {S}_{g;U}^- \le u \le \mathcal {S}_{g;U}^+ \quad\mbox{in $\overline U$ and }
 \| H(x,Xu) \|_{L^\infty(U)} = \mathbf I(g,U)=\mu(g,\partial U) .
$$
\item[(iii)]
If $u,v$ are minimizer for $\mathbf I(g,U)$, then $tu+(1-t)v$ with $t\in(0,1)$, $\max\{u, v\}$ and $\min\{u, v\}$ are minimizers for $\mathbf I(g,U)$.
\end{enumerate}
\end{lem}






\begin{proof}    (i)   Since   $\mu(g,\partial U) <\infty$, then  by lemma  3.3, we know that $\mathcal {S}_{g;U}^\pm $ satisfies  the condition required in \eqref{minimizer} and hence
  \begin{equation} \label{xx0}
  \mathbf I(g,U)\le \|H(\cdot,\mathcal {S}_{g;U}^\pm )\|_{L^\infty(U)}\le \mu.\end{equation}
Below we show that $\mu(g,\partial U)\le  \mathbf I(g,U) .$   Note that combining this and \eqref{xx0} we know that  $\mathbf I(g,U)= \|H(\cdot,\mathcal {S}_{g;U}^\pm )\|_{L^\infty(U)}= \mu$ and moreover,
      $\mathcal {S}_{g;U}^\pm$ are minimizers for ${ \bf I}(g;U)$.

For any $\lambda>\mathbf I(g,U)$,
there is a  $u\in \dot W^{1,\infty}_X(U)\cap C^0(\overline U)$ with $u=g$ on $\partial U$   such that
$  \|H(x,Xu)\|_{L^\infty(U)}\le \lambda$. By Corollary 3.1,
$$u(x)-u(y)\le d_\lambda(x,y), \ \forall x,y\in U.$$
By the continuity of $u$ in $\overline U$ and  the definition of  $d^U_\lambda$ in $\overline U\times\overline U$
we have $$g(x)-g(y)\le d^U_\lambda(x,y).$$
  Thus
$\mu(g,\partial U)\le  \mathbf I(g,U) .$

\medskip
(ii) If $u$ is a minimizer for ${ \bf I}(g;U)$, one has $\|H(\cdot, Xu )\|_{L^\infty(U)} = {\bf I}(g;U)=\mu$.
By Corollary 3.1,  $u(y) - u(x) \le d_\mu(x, y)$ for any $x, y \in U$ and hence, by the continuity of $u$ and the definition of $d_\mu$,
for all $x, y \in \overline U$.
Since $u= g$ on $\partial U$, for any $x \in U$, one has $g(y) - d_\mu(x,  y) \le u(x)$ for any $y \in \partial U$, which yields
$\mathcal {S}_{g;U}^-(x) \le u(x)$. By a similar argument, one also has  $u \le \mathcal {S}_{g;U}^+$ in $U$  as desired.

\medskip
(iii)  Suppose that $u_1,u_2$ are  minimizers for ${\bf I}(g;U)$.  Letting $u_\eta:=(1-\eta) u_1+ \eta u_2 $ for $\eta \in [0, 1]$.
 Then $u_\eta\in \dot W^{1,\infty}_X(U)\cap C^0(\overline U)$, and $u_\eta= g$ on $\partial U$,
  and by (H1),   $$H(\cdot, Xu_\eta(\cdot)) \le \max_{i=1,2}\{  H(\cdot, Xu_i(\cdot)) \}\le \mu \ \mbox{ a.e. on $U$}.$$
  This implies that $u_\eta$ is also a minimizer for ${ \bf I}(g;U)$.

Finally, note that $\max \{u_1, u_2\} \in   \dot W^{1,\infty}_X(U)\cap C^0(\overline U)$,   $\max \{u_1, u_2\} = g$ on $\partial U$, and by Lemma \ref{l21},
$$H(\cdot, X\max \{u_1, u_2\}(\cdot)) \le \max_{i=1,2}\{  H(\cdot, Xu_i(\cdot)) \}\le \mu \ \mbox{ a.e. on $U$}.$$
 We know that
\begin{align*}
  {\bf I} (g; U )\le {\mathcal F} (\max\{u_1, u_2\}; U)
   & \le \max \{{\mathcal F} (u; U), {\mathcal F} (v; U)\} =  {\bf I} (g; U ),
\end{align*}
That is,  $\max \{u_1, u_2\}$ is a minimizer for ${ \bf I}(g;U)$.
Similarly, $\min\{u_1, u_2\}$ is a minimizer for ${ \bf I}(g;U)$.
\end{proof}


\section{Proof of Theorem 1.4}

\begin{defn}\label{d231}\rm
Assume that $\mu(g,\partial U)<\infty$.

\begin{enumerate}
\item[(i)]
   A minimizer $u  $  for ${ \bf I}(g;U)$ is called a local superminimizer   for ${ \bf I}(g;U)$
    if $u \ge {\mathcal S}_{u|_{\partial V}; V}^-$ in $V$    for any subdomain $V\subset U$.


\item[(ii)]  A minimizer $u  $  for ${ \bf I}(g;U)$ is called a local subminimizer for ${ \bf I}(g;U)$  if
 $u \le {\mathcal S}_{u|_{\partial V}; V}^+$ in $V$  for any subdomain $V\subset U$.
    \end{enumerate}
\end{defn}

The next lemma shows existence of  local super/sub minimizer    for ${ \bf I}(g;U)$ whenever $\mu(g,U)<\infty$.
\begin{lem}\label{lem234}
If $\mu(g,U)<\infty$, then $\mathcal {S}_{g;U}^+$ is a local superminimizer for ${ \bf I}(g;U)$, and $\mathcal {S}_{g;U}^-$ is a local subminimizer for ${ \bf I}(g;U)$. Moreover, for any $V\Subset U$, we have
\begin{equation}\label{e601}
  {\mathcal S}_{h; V}^+ \le \mathcal {S}_{g;U}^+ \text{ in $V$, where $h=\mathcal {S}_{g;U}^+|_{\partial V}$.}
\end{equation}

\end{lem}






\begin{proof} We only prove that
$ \mathcal {S}_{g;U}^+$ is a local superminimizer for ${ \bf I}(g;U)$.   One may prove that
$\mathcal {S}_{g;U}^-$ is a local subminimizer for ${ \bf I}(g;U)$ in a similar way;  the details are omitted.



  Denote by ${\mathcal S}_{h;V}^-$ as the MacShane extension of $h$ in $V$.
   Then $$ \|H(\cdot, X{\mathcal S}_{h;V}^-)\|_{L^\infty(V)} \le \mu(\mathcal {S}_{g;U}^+,\partial{V}) \le {\mathcal F}(\mathcal {S}_{g;U}^+; V )$$
      Define
  \begin{displaymath}
u:= \left \{ \begin{array}{lll}
\max \{{\mathcal S}_{h;V}^- ;\mathcal {S}_{g;U}^+\} & \quad \text{in} & \quad V \\
\mathcal {S}_{g;U}^+  & \quad \text{in}&\quad \overline U \backslash V
\end{array}
\right.
\end{displaymath}

We claim that
$$
u(y)-u(x)\le d_\mu(x,y)\quad\forall x,y\in  \overline U.$$
Assume this claim holds for the moment.   Note that $u=g$ on $\partial U$.
We know that  $u\in \dot W^{1,\infty}_X\cap C^0(\overline U)$, $u= g$ on $\partial U$
and $\mathbf I(g,U)\le \|H(\cdot,Xu)\|_{L^\infty(U)}\le\mu$,
and hence by Lemma 3.1(i), $\mathbf I(g,\mu)= \|H(\cdot,Xu)\|_{L^\infty(U)}=\mu$.
This implies that $u$
is a minimizer of ${\bf I} (g; U )$. By
Lemma \ref{lem231}(i), $u \le \mathcal {S}_{g;U}^+$ in $U$ and hence,   ${\mathcal S}_{h; V}^- \le \mathcal {S}_{g;U}^+$ on $V$. That is,  $ \mathcal {S}_{g;U}^+$ is a local superminimizer.

To see above claim,  by definition one has
$$u(y)-u(x)=\mathcal {S}_{g;U}^+(y)-\mathcal {S}_{g;U}^+(y)    \le d_\mu(x,y)$$
for all  $x,y\in \overline U\setminus V $.
Since
$$\|H(\cdot, Xu)\|_{L^\infty(V)}\le \max\{\|H(\cdot, X {\mathcal S}_{h;V}^-  )\|_{L^\infty(V)}, \|H(\cdot, X  \mathcal {S}_{g;U}^+ )\|_{L^\infty(V)}\}\le \max\{\mu(h,\partial V),\mu\}\le\mu.$$
applying Theorem 1.1 to $\max \{{\mathcal S}_{h;V}^- ; \mathcal {S}_{g;U}^+\}$,
$u(y)-u(x)  \le d_\mu(x,y)$ for all
  $x,y\in      V$ and hence by the continuity of  for all $x,y\in     \overline  V$.
Finally, if $x\in V$ and $y\in U\setminus  V $ or $x\in U\setminus   V$ and $y\in    V $, for any $\epsilon>0$, there exists a curve ${\gamma}$ joining $x, y$ such that
 $$\ell_{d^U_\mu}({\gamma})\le d_\mu(x,y)+\epsilon.$$
 Let $z\in {\gamma}\cap \partial V$, we have
$$
u(y)-u(x)=u(y)-u(z)+u(z)-u(x)\le d^U_\mu(z,y)+d^U_\mu(x,z)\le \ell_{d^U_\mu}({\gamma})\le d^U_\mu(x,y)+\epsilon .$$
By the arbitrary of $\epsilon>0$, we have $
u(y)-u(x) \le d^U_\mu(x,y)   $ as desired.

To show \eqref{e601}, let
\begin{displaymath}
w:= \left \{ \begin{array}{lll}
\max \{{\mathcal S}_{h;V}^+ ;\mathcal {S}_{g;U}^+\} & \quad \text{in} & \quad V \\
\mathcal {S}_{g;U}^+  & \quad \text{in}&\quad \overline U \backslash V
\end{array}
\right.
\end{displaymath}

Using the same argument for $u$, we infer that $w$ is a minimizer for ${\bf I}(g;U)$. Due to Lemma \ref{lem231}(i), we have ${\mathcal S}_{h; V}^+ \le \mathcal {S}_{g;U}^+ $ in $V$.
\end{proof}


The following result clarifies the relation between absolute minimizers and local super/subminimizers.
\begin{lem} \label{lem235}
If $\mu(g,\partial U)<\infty$, then   $u$ is an absolute minimizer for ${ \bf I}(g;U)$
if and only if it is both a local superminimizer and a local subminimizer for ${ \bf I}(g;U)$.
\end{lem}

\begin{proof}
  If $u$ is an absolute minimizer of ${\bf I} (g; U )$, then for every open subset $V$ of $U$, $u$ is a minimizer for ${ \bf I}(g;V)$. Thus by Lemma 3.1, ${\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} V}; V}^- \le u \le {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} V}; V}^+$, that is, $u$ is both a local superminimizer and a local subminimizer for ${ \bf I}(g;U)$.

  Conversely, suppose that  $u$ is both a local superminimizer and a local subminimizer for ${ \bf I}(g;U)$. Then \begin{equation}\label{xx1}
  \mbox{${\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} W}; W }^- \le u \le {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} W}; W }^+$ in $W$ for any open set $W\subset U$.}
  \end{equation}

 

   By definition,  to show $u$ is absolute minimizer for ${\bf I}(g,U)$,  we  only need to prove that for any
   open subset $V\subset U$, $u$ is a minimizer of ${\bf I}(u|_{\partial V}; V )={\bf I}(u; V )$.

   To this end, let $\{x_j\}_{j \in {\mathbb N}}\subset V$ be a dense  set of $V$.  Set $V_j=V\setminus\{x_i\}_{1\le i\le j}$ and $V_0=V$. Note that
$$\partial V_j=\partial V_{j-1}\cup\{x_j\}=\partial V_0\cup \{x_i\}_{1\le i\le j} . $$

   We construct by induction on $j$ a sequence of minimizers $u_j$ of ${\bf I}(g;U)$ such that $u_j(x_i)=u(x_i)$ for $i=1,...,j$. Firstly, we construct $u_1$. By \eqref{xx1} and Lemma \ref{lem231}(iii), there exists a minimizer $u_1$ of ${\bf I}(u;V)$ such that $u_1(x_1)=u(x_1)$.

   Now suppose $u_j$ has been constructed, we define $u_{j+1}$.
   Since $u_j$ is a minimizer of ${\bf I}(u;V)$ which coincides $u$ at $x_1,...,x_j$, we infer that it is an minimizer of ${\bf I}(u;V_j)$ by the fact that
   \begin{equation}\label{xx2}
     \| H(\cdot,Xv(\cdot)) \|_{L^\infty(V)}=\|H(\cdot,Xv(\cdot))\|_{L^\infty(V_j)}
   \end{equation}
   for any function $v \in \dot W^{1,\infty}_{X }(V)$.

   As a consequence, the value of the infimum of ${\bf I}(u;V_j)$ coincides to the one of ${\bf I}(u;V)$, and the minimizers of ${\bf I}(u;V_j)$ are included in those of ${\bf I}(u;V)$.

   Again, since $u$ is both a local superminimizer and a local subminimizer of ${\bf I}(g;U)$, we have
  $${\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} V_j}; V_j}^- \le u \le {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} V_j}; V_j}^+.$$

 Therefore, Lemma \ref{lem231}(iii) guarantees the existence of a minimizer $u_{j+1}$ of ${\bf I}(u;V_j)$ which coincides $u$ at $x_{j+1}$. Moreover, $u_{j+1}$ has following properties:
 (i) $u_{j+1}$ is a minimizer of ${\bf I} (u; V_j)$ and ${\bf I} (u; V)$; \\
 (ii) $u_{j+1}$ coincides $u$ at $x_1,...,x_{j+1}$.
 Since $u$ and $u_j$ are continuous in $V$ and $\{x_j\}$ is dense in $V$, we infer
 $$u_j \to u \ \text{pointwise in $V$ as $j \to \infty$}.$$
 Notice that \eqref{xx2} implies $\mu_j=\|H(\cdot,Xu_j(\cdot))\|_{L^\infty(V)}$ is a constant $\mu$ with respect to $j$.
 Hence applying Lemma \ref{l6.1} on $V$, we conclude that
 $$ \mu= \mu_1=\|H(\cdot,Xu(\cdot))\|_{L^\infty(V)}.$$
 Since $\mu_1=\|H(\cdot,Xu_1(\cdot))\|_{L^\infty(V)}$ and $u_1$ is a minimizer of ${\bf I}(g;V)$, $u$ is also a minimizer of ${\bf I}(g;V)$.
\end{proof}


\begin{prop} \label{p42}
If $\mu(g,\partial U)<\infty$, then both of  $$U^+_g(x):=\sup\{u(x) : u \text{\ is a local subminimizer for ${ \bf I}(g;U)$} \}$$
and
$$U^-_g(x):=\inf\{u(x) : u \text{\ is a local superminimizer for ${ \bf I}(g;U)$} \}$$
are     absolute minimizers for ${ \bf I}(g;U)$.
\end{prop}

\begin{proof}
We only show that $U^+_g$ is an absolute minimizer for ${ \bf I}(g;U)$; in a similar way  one could prove that
$U^-_g$ is also an absolute minimizer for ${ \bf I}(g;U)$.

Firstly, we show that  $U^+_g$ is a  minimizer of (3.1).
Let $\{x_j\}_{j \in {\mathbb N}}$  be a dense set of $U$.
For any $i,j\in{\mathbb N}$, there exists a local subminimizer $u_{ij} $ for ${\bf I}(g;U)$ such that
  $$u_{ij} (x_i) \ge U^+_g(x_i) - \frac{1}{j}.$$
 Lemma \ref{lem231}(ii) implies that the function $u_j := \max\{u_{ij} \}_{1\le i\le j}$ is a minimizer of ${\bf I}(g;U)$. It results in that
  \begin{equation*}
    \quad U^+(x_i) \ge u_j(x_i) \ge U^+(x_i) - \frac{1}{j}\quad \forall 1\le i\le j
  \end{equation*}
 and hence  $u_j \to U^+$  in $\{x_i\}_{i\in{\mathbb N}}$. This together with the
 $u_j\in W^{1,\infty}_X(U)$ uniformly in $j$
 implies that $u_j \to U^+$   in $C^0(\overline U)$.
 By Lemma \ref{l6.2} we have $U^+_g \in \dot W^{1,\infty}_{X }(U)$ and $\|H(\cdot,XU^+_g)\|_{L^\infty(U)}\le {\bf I}(g;U)$, that is, $U^+_g$ is also a minimizer for ${\bf I}(g;U)$.

 Next we show that  $U^+_g$ is a local subminimizer of ${\bf I}(g;U)$  by contradiction.
 Let $V$ be an open subset of $U$, and assume that for
some $x_0$ in $V$ , one has $U^+_g(x_0) > {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V};V}^+(x_0)$.
By definition of $U^+_g$, there exists a local subminimizer $u$ for ${\bf I}(g;U)$ such that
\begin{equation}\label{x0}
  U^+_g(x_0)\ge u(x_0) > {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V};V}^+(x_0).
\end{equation}
Note that $u\le U^+_g$ in $U$.
Set $E := \{x\in \overline V \ | \ u(x) > {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V};V}^+(x)\}$. Then  $E\subset V$ is a non-empty open set.  Since $u$ is a local subminimizer of ${\bf I}(g;U)$, we have
 $u \le {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} E}; E}^+$ in $  E$. Note that  $u= {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V};V}^+$ on $\partial E$.
 Recalling \eqref{x0} and $x_0 \in E$, we have
 $${\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} E}; E}^+(x_0) \ge u(x_0 ) >   {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V};V}^+(x_0),$$
 which contradicts to \eqref{e601}.

  To check that $U^+_g$ is a local superminimizer of ${\bf I}(g;U)$, we have to prove that the set $A = \{x \in V \ | \ U^+_g(x) < Q^-(x):={\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V}; V}^-(x)\}$ is empty for any open subset $V$ of $U$. In fact we will affirm

  \textsc{Claim}($\ast$):  $u: U \to {\mathbb R}$,
  \begin{displaymath}
u:= \left \{ \begin{array}{lll}
Q^-  & \quad \text{on} & \quad V \\
 U^+_g & \quad \text{on} & \quad U \backslash V
\end{array}
\right.
\end{displaymath}
  is a local subminimizer of ${\bf I}(g;U)$.

  Assume \textsc{Claim}($\ast$) holds. We observe that $u$ can be chosen as a test function in the definition of $U^+_g$. Therefore we have $U^+_g \ge u$ on $U$ and in particular $U^+_g \ge Q^-$ on $V$, which implies $A = \emptyset$ and finishes the proof.

  Now we verify the claim. We need to show for any open subset $B \subset U$,
   $$u \le T:={\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} B};B}^+ \text{ on $B$} .$$
    To this end, define $C := B \cap \{u > T\}$. It suffices to show $$C= \emptyset.$$

   We argue by contradiction. Assume $C \neq \emptyset$ and consider $D := B \cap \{U^+_g > T\}$, then we have $C \cap (B \backslash D) = C \cap \{U^+_g \le T\}= B \cap \{U^+_g \le T < u\} \subset A$. In the following, we will show that $D$ can not be neither an empty set nor a non-empty set.

  If $D$ is empty, then $C \subset A \subset V$.
  By Lemma \ref{lem234}, we know $Q^-:={\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} V}; V}^-$ is a local subminimizer of ${\bf I}(U^+;V)$, hence we have
  \begin{equation}\label{e91}
    Q^-  \le {\mathcal S}_{Q^-|_{\mathop\mathrm{\,\partial\,} C}; C}^+    \quad \text{for any} \ x \in C
  \end{equation}
  by the definition of local subminimizer.
  Notice that owing to the definition of $u$  as well as $\mathop\mathrm{\,\partial\,} C \subset V$ we have $u= Q^-$ on $\mathop\mathrm{\,\partial\,} C$ and owing to the definition of $C$ we observe that $u =T$ on $\mathop\mathrm{\,\partial\,} C$, which implies
  \begin{equation}\label{e92}
    {\mathcal S}_{Q^-|_{\mathop\mathrm{\,\partial\,} C}; C}^+ = {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} C}; C}^+  \ \text{and} \ {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} C}; C}^+ = {\mathcal S}_{T|_{\mathop\mathrm{\,\partial\,} C}; C}^+ \quad \text{for any} \ x \in C.
  \end{equation}
  Therefore, combining \eqref{e91} and \eqref{e92} we get
  \begin{equation} \label{e93}
    u = Q^-  \le {\mathcal S}_{Q^-|_{\mathop\mathrm{\,\partial\,} C}; C}^+ = {\mathcal S}_{u|_{\mathop\mathrm{\,\partial\,} C}; C}^+ = {\mathcal S}_{T|_{\mathop\mathrm{\,\partial\,} C}; C}^+ \le T   \quad \text{for any} \ x \in C
  \end{equation}
  where the last inequality is due to \eqref{e601}. But by the definition of $C$, we know
   \begin{equation}\label{e94}
     u > T \quad \text{for any} \ x \in C.
   \end{equation}
   Since $C$ is non empty, \eqref{e93} and \eqref{e94} give a contradiction.

   If $D$ is non empty, by the definition of $D$, we infer
$U^+_g = T$ on $\mathop\mathrm{\,\partial\,} D$. Hence as $U^+_g$ is a local subminimizer of ${\bf I}(g;U)$ we have
$$U^+_g \le {\mathcal S}_{U^+_g|_{\mathop\mathrm{\,\partial\,} D};D}^+={\mathcal S}_{T|_{\mathop\mathrm{\,\partial\,} D};D}^+ \le T \quad \text{for any} \ x \in D$$
where the last inequality is due to \eqref{e601} again. But this contradicts the definition of $D$. As a consequence, $C$ is empty
and the proof of \textsc{Claim}($\ast$) is done.
\end{proof}

Theorem \ref{t231} is now a direct consequence of the above series of results. Indeed, $U^+_g \in AM(U;H,X)$ thanks to Lemma \ref{lem235} and Proposition \ref{p42}.


\begin{proof}[Proof of Theorem \ref{t231}]
Let $g\in{\mathop\mathrm{\,Lip}}_{d_{CC}} (\partial U)$. By $R'_\mu  d_{CC} \le d^U_\mu$, we have
$\mu(g,\partial U)<\infty$.
The function  $U_g^+$ defined in Proposition \ref{p42} gives the desired absolute minimizer, i.e. $U_g^+ \in AM(U; H,X)$.
\end{proof}



\section{Further discussion}

Note that Rademacher type Theorem \ref{rad} is a cornerstone when showing the existence of absolute minimizers. Indeed, Champion and Pascale \cite{cp} and Guo-Xiang-Yang \cite{gxy} established partial results similar to Theorem \ref{rad} for a special class of Hamiltonians considered in this paper to show the existence of absolute minimizers. However, their method seems to be invalid for more general Hamiltonians considered in this paper. We briefly explain the reason below.

\begin{rem}\rm
Champion and Pascale \cite{cp} showed the MacShane extension is a minimizer of $H$ when $H$ is lower semi-continuous on $U \times {{\rr}^n}$. In fact, they defined another intrinsic distance induced by $H(x,p)$.
For every $\lambda\ge 0$,
\begin{equation*}
L_\lambda (x,q):=\sup_{\{p\in H_\lambda(x)\}} p\cdot q, \quad  \forall \ x\in\overline U \ \mbox{and }\  q\in{{\rr}^m}.
\end{equation*}
where $H_\lambda(x)$ is the sub-level set at $x$, namely, $H_\lambda(x)=\{p \in {\mathbb R}^m \mid H(x,p) \le \lambda\}$.

For $0\le a<b\le +\infty$, let  ${\gamma}:[a,\,b]\to \overline U$ be a Lipschitz curve, that is, there exists a constant $C>0$ such that $|{\gamma}(s)-{\gamma}(t)|\le C|s-t|$ whenever $s,t\in[a,b]$.
The $L_\lambda$-length of ${\gamma}$ is defined by
\begin{equation*}
\ell_\lambda({\gamma}):= \int_a^bL_\lambda\left({\gamma}(\theta),{\gamma}'(\theta)\right)\,d\theta,
\end{equation*}
which is nonnegative, since $L_\lambda(x,q)\ge 0$ for any $x\in\overline U$ and $q\in{{\rr}^n}$.
For a pair of  points  $x,\,y\in\overline U$, the $\overline {d}_{\lambda}$-distance from $x$ to $y$ is defined by

\begin{equation*}
\overline {d}_{\lambda}(x,y):= \inf\Big\{\ell_\lambda({\gamma})\ |\ \gamma\in\mathcal C(a,b;x,y; \overline U)\Big\}.
\end{equation*}
Then, they prove two intrinsic pseudo-distance are equal, that is

\begin{equation}\label{e15}
  d_\lambda(x,y)=\overline {d}_{\lambda}(x,y) \quad \text{for any} \ \lambda >0 \ \text{and for any} \ x,y \in \overline U.
\end{equation}
Thanks to the definition of $\overline {d}_{\lambda}$, they can justify (i)$\Leftrightarrow$(ii) in Rademacher type Theorem \ref{rad}.

However, when asserting \eqref{e15}, we will meet obstacles in generalizing \cite{cp} Proposition A.2 since we are faced with measurable $H$.

On the other hand, Guo-Xiang-Yang \cite{gxy} provided another method to identify a weak version of \eqref{e15} for measurable Finsler metrics $H$, that is \begin{equation}\label{e16}
  \lim_{y \to x}\frac{d_\lambda(x,y)}{\widetilde d_\lambda(x,y)}=1 \quad \text{for any} \ \lambda >0 \ \text{and for any} \ x,y \in \overline U.
\end{equation}
Here $\widetilde d_\lambda$ induced by measurable Finsler metrics $H$ is defined in the following way.
\begin{equation} \label{q2}
\widetilde d_\lambda(x,y):= \sup_N\inf\Big\{\ell_\lambda({\gamma})\ |\ \gamma\in \Gamma_N(a,b;x,y;  \overline  U)\Big\}
\end{equation}
where the supremum is taken over all subsets $N$ of $  \overline U$ such that $|N| = 0$ and $\Gamma_N(a,b;x,y;  U)$
denotes the set of all Lipschitz continuous curves ${\gamma}$ in $  \overline U$ with end points $x$ and $y$ such that
$\mathcal H^1(N \cap {\gamma}) = 0$ with $\mathcal H^1$ being the one dimensional Hausdorff measure.

In fact, \eqref{e16}, combined with the method in \cite{cp} will be sufficient for validating (i)$\Leftrightarrow$(ii) in Rademacher type Theorem \ref{rad}. Unfortunately, since we are coping with H\"{o}rmander vector field, a barrier arises when modifying their proofs. Indeed, their method uses a result by \cite{da} that every $x$-measurable Hamiltonian $H$ can be approximated by a sequence of smooth Hamiltonians $\{H_n\}_n$ such that two intrinsic distances $\widetilde d_\lambda^{H_n}$ and $d_\lambda^{H_n}$ induced by $H_n$ by means of \eqref{q2} and \eqref{d311} satisfy $ \lim_{n \to \infty}d_\lambda^{H_n} = d_\lambda$ and $ \limsup_{n \to \infty}\widetilde d_\lambda^{H_n} \le \widetilde d_\lambda$ uniformly on $ U\times U$ respectively. The process of the proof of \cite{da} is based on a $C^1$ Lusin approximation property for curves. Namely, given a Lipschitz curve ${\gamma}: \ [0,1] \to U$ joining $x$ and $y$, for any $\epsilon >0$, there exists a $C^1$ curve $\widetilde{{\gamma}}: \ [0,1] \to U$ with the same endpoints such that
  $$ \mathcal{L}^1 ( \{t \in [0,1]  \ | \ \widetilde{{\gamma}}(t) \neq {\gamma}(t) \quad \text{or} \quad \widetilde{{\gamma}}'(t)\neq {\gamma}'(t)\})<\epsilon$$
  where $\mathcal{L}^1$ denotes the one dimensional Lebesgue measure. Besides,
  $$ \|\widetilde{{\gamma}}\|_{L^\infty} \le c\|{\gamma}\|_{L^\infty}, $$
  for some constant $c$ depending only on $n$.
  Although this version of $C^1$ Lusin approximation property holds for horizontal curves in Heisenberg groups (\cite{l16}) and step 2 Carnot groups (\cite{ls16}),
   it fails for some horizontal curve in Engel group (\cite{l16}).
  

In summary, it is difficult to generalize the properties of the pseudo metric $\widetilde d_\lambda$ not only from Euclidean space to the case of H\"{o}rmander vector fields but also from lower-semicontinuous $H(x,p)$ to measurable $H(x,p)$. Hence we would like to pose the following open problem.
\end{rem}

\begin{ques}
  Under the assumptions (H0)-(H3), does \eqref{e16} holds?
\end{ques}












