Consider $H=\{ (x,y) \in {\bf R}^2\mid x$ or $y$ is an integer $\}$ If $d$ is canonical distance in ${\bf R}^2$, show that if $d(x):=d(x,H)$, (1) $$ d(x) - d(y) \leq d(x,y) $$ if $x,\ y$ are in same square determined by $H$, for instance we can assume that $x,\ y\in [0,1]^2$, and (2) $$ \sqrt{ d(x)^2+ d(y)^2 }\leq d(x,y) $$ if $x,\ y$ are in different square
Proof : (1) Divide a small square $[0,1]^2$ into four triangles by using two diagonals.
(1.1) Then if $x,\ y$ are in a triangle then from $x,\ y$ we draw orthogonal lines $xh_1,\ yh_2$ to the base on the triangle Hence we have a polygon $xh_1h_2y$
That is, $|d(x)-d(y)|^2 + d(h_1,h_2)^2 = d(x,y)^2 $ by Pythagoras theorem So we solved this case
(1.2) If $x,\ y$ are in opposite triangles, then define $\epsilon,\ \delta$ s.t. $$ d(x)+\epsilon= d(y)+\delta =\frac{1}{2} $$ Here $\epsilon,\ \delta \geq 0$
Consider a parallel lines passing through $x,\ y$ s.t. these lines meet orthogonally to $H$ and the distance of two lines is $\epsilon +\delta $. That is, $$ |d(x)-d(y)| = |\epsilon -\delta | \leq \epsilon +\delta \leq d(x,y)$$
(Since $x,\ y$ are in two parallel lines, $d(x,y)$ is larger than the distance of two lines)
Here equality holds iff $x,\ y$ give a distance of two parallel lines
(1.3) If $x,\ y$ are in different triangles and if they are adjacent, I have no idea
Thank you in advance
Q.1. applies to any non-empty $H\subset S$ where $(S,d)$ is any metric space, provided that we define $d(x)=\inf \{d(x,h):h\in H\}.$
By contradiction, suppose $d(x)-d(y)>d(x,y).$ Then let $d(x)=k+d(y)+d(x,y)$ where $k>0.$
There exists $h\in H$ such that $d(y)< d(h,y)+k/2.$ Then, since $d(h,x)\geq d(x),$ we have $$d(x)=k+d(y)+d(x,y)=$$ $$=k+[\;d(y)-d(h,y)\;]+[\;d(h,y)+d(y,x)\;]\geq $$ $$\geq k+\;[d(y)-d(h,y)\;]+d(h,x)\geq$$ $$\geq k+[\;d(y)-d(h,y)\;]+d(x)>$$ $$>k-k/2+d(x).$$ So we have $d(x)>k-k/2+d(x)$, which implies $k<0,$ a contradiction.