\documentclass[12pt]{article}
\usepackage[width=16cm,height=22cm]{geometry}
\usepackage[intlimits]{amsmath}
\usepackage{amsfonts,amssymb,amsthm,mathtools}
\usepackage{ifthen}
\usepackage{wasysym}

\theoremstyle{definition}
\newtheorem{exercise}{Exercise}
\newtheorem{defn}{Definition}
\newtheorem{note}{Note}

\newcommand{\eqdef}{\coloneqq}
\newcommand{\RealNumbers}{\mathbb{R}}
\newcommand{\PositiveRealNumbers}{\mathbb{R}_+}
\newcommand{\ComplexNumbers}{\mathbb{C}}
\newcommand{\eps}{\varepsilon}
\newcommand{\OmegaR}{\widehat{\Omega}}
\newcommand{\hsp}[1]{\mbox{}\vphantom{0_0^0}\hspace{#1}\mbox{}}
\newcommand{\ubrace}[1]{\underbrace{\mbox{}\vphantom{0_0^0}\hspace{#1}\mbox{}}_?}
\newcommand{\vertstrut}{{\displaystyle\vphantom{\int}}}
\newcommand{\bigvertstrut}{{\displaystyle\vphantom{\int_0^1}}}

\makeatletter
\newcommand{\mytitle}[2][empty]{
\newcommand{\titlename}{#2}
\newcommand{\shorttitlename}{\ifthenelse{\equal{#1}{empty}}{#2}{#1}}
\renewcommand{\@oddfoot}{\hfill{}\shorttitlename{},\quad{}page~{\thepage}~of~\pageref{endlabel}\hfill}
\begin{center}\bfseries\LARGE\titlename\end{center}\par\medskip}
\makeatother

\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}

\begin{document}

\mytitle[Logarithmic distance on the positive half-line]{Logarithmic distance\\on the positive half-line}

\bigskip\noindent
Denote the interval $(0,+\infty)$ by $\PositiveRealNumbers$.

\begin{defn}
Define the function $\rho\colon\PositiveRealNumbers\times\PositiveRealNumbers\to[0,+\infty)$ by\par\smallskip
\[
\rho(x,y)\eqdef\bigl|\ln(x)-\ln(y)\bigr|.
\]
\end{defn}

\bigskip

\begin{exercise}
Recall that for all $a,b>0$\par\smallskip
\[
\ln(a)-\ln(b)=\ln\frac{\hsp{3em}}{\hsp{3em}}.
\]
So, $\rho$ can be written in the following form:\par\smallskip
\[
\rho(x,y)=\hsp{5em}
\]
\end{exercise}

\bigskip

\begin{note}
In the following exercise we use $\max$ and $\min$ and threat them
as functions of two real arguments:
\[
\max(7,3)=7,\qquad \min(7,3)=3.
\]
\end{note}

\bigskip

\begin{exercise}
Fill the table:\par\smallskip
\[
\begin{array}{c|c|c|c}
\bigvertstrut & \hsp{1em}\max(x,y)\hsp{1em} & \hsp{1em}\min(x,y)\hsp{1em} & 
  \hsp{3em}\displaystyle\bigl|\ln(x)-\ln(y)\bigr|\hsp{3em} \\\hline
\bigvertstrut \text{Case}\ x\ge y\colon & & & \\\hline
\bigvertstrut \text{Case}\ x<y\colon & & & 
\end{array}
\]
\end{exercise}

\bigskip

\begin{exercise}
Express $\rho(x,y)$ through $\max(x,y)$ and $\min(x,y)$:\par\smallskip
\[
\rho(x,y)\;=\;\ln\bigl(\hsp{6em}\bigr)-\ln\bigl(\hsp{6em}\bigr)\;=\;\ln\frac{\hsp{6em}}{\hsp{6em}}.
\]
\end{exercise}

\bigskip

\clearpage
\section*{Direct verification that $\boldsymbol{\rho}$ is a distance}

\medskip\noindent
We are going to prove that $\rho$ is a distance on $\PositiveRealNumbers$.

\begin{exercise}
List the conditions from the definition of distance (= metric).
\begin{enumerate}
\item\mbox{}
\par\bigskip\bigskip\bigskip\bigskip
\item\mbox{}
\par\bigskip\bigskip\bigskip\bigskip
\item For all $x$,\qquad $\rho(x,x)=\ubrace{3em}$.
\par\bigskip
\item For all $x,y$,\quad if $x\ne y$, then\qquad $\ubrace{7em}$
\end{enumerate}
\end{exercise}

\bigskip

\begin{exercise}
Prove that $\rho$ is symmetric.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $x,y\in\PositiveRealNumbers$, $x\ne y$.
Prove that $\rho(x,y)>0$.
\end{exercise}

\bigskip\bigskip\bigskip

\begin{exercise}
Prove that $\rho$ fulfills the triangular inequality.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\clearpage
\section*{Abstract construction: inheritance of a distance}

\bigskip
Creative task: please find a better title for this section.

\bigskip
\begin{exercise}[Inheritance of a distance] \label{exer:inheritance_of_a_distance}
Let $(M,d)$ be a metric space, $X$ be a set
and $\phi\colon X\to M$ be an injective function.
Define the function $f\colon X\times X\to[0,+\infty]$ by
\[
f(x,y)\eqdef d(\phi(x),\phi(y)).
\]
Prove that $f$ is a distance on $X$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Explain how to apply the construction from the Exercise \ref{exer:inheritance_of_a_distance}
to define the logarithmic distance
\[
\rho(x,y)=\bigl|\ln(x)-\ln(y)\bigr|.
\]
\end{exercise}



\clearpage
\section*{$\boldsymbol{\PositiveRealNumbers}$ as a group}

\medskip

\begin{exercise}
The set $\PositiveRealNumbers$ is usually considered with the binary operation $\ubrace{7em}$\\[2ex]
and is a $\underbrace{\hsp{8em}}_{\text{commutative/non-commutative}}$ group.
\end{exercise}

\bigskip

\begin{exercise}
The function $\ubrace{7em}$ is an isomorphism\\
from the group $(\RealNumbers,+)$ to the group $(\PositiveRealNumbers,\ubrace{2em})$.
\end{exercise}

\bigskip\bigskip

\section*{The distance $\boldsymbol{\rho}$ is invariant under dilations\\
(in other words, is homogeneous of degree $\boldsymbol{0}$)}

\begin{exercise} \label{exer:rho_and_dilations}
Let $x,y,t>0$. Simplify:\par\medskip
\[
\rho(tx,ty)=\hsp{25em}
\]
\end{exercise}

\bigskip

\begin{note}
In other words, the Exercise \ref{exer:rho_and_dilations} states
that the distance $\rho$ conforms with the operation of the group $\PositiveRealNumbers$.
\end{note}

\bigskip

\begin{exercise}
Let $x,y>0$. Express $\rho(x,y)$ through $\displaystyle\rho\left(x/y,1\right)$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\clearpage
\section*{$\boldsymbol{\delta}$-neighborhoods of $\boldsymbol{1}$ with respect to the distance $\boldsymbol{\rho}$}

\medskip

\begin{exercise}[right $\delta$-neighborhood of $1$ with respect to the distance $\rho$] \mbox{} \\[1ex]
Let $\delta>0$.
Find all $u\in[1,+\infty)$ such that $\rho(u,1)\le\delta$.
\end{exercise}

\medskip
\begin{align*}
\begin{cases}
u\ge 1  \\[1ex]
\rho(u,1)\le\delta
\end{cases}
&\quad\Longleftrightarrow\quad
\begin{cases}
u\ge 1 \\[3ex]
\hsp{4em}
\end{cases}
\quad\Longleftrightarrow\quad
\hsp{15em}
\\[15ex]
&\quad\Longleftrightarrow\quad \ubrace{3em} \le u\le \ubrace{3em}
\quad\Longleftrightarrow\quad u\in\Bigl[\qquad\quad,\qquad\quad\Bigr].
\end{align*}

\bigskip\bigskip

\begin{exercise}[left $\delta$-neighborhood of $1$ with respect to the distance $\rho$] \mbox{} \\[1ex]
Let $\delta>0$.
Find all $u\in(0,1]$ such that $\rho(u,1)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}[$\delta$-neighborhood of $1$ with respect to the distance $\rho$] \mbox{} \\[1ex]
Let $\delta>0$.
Find all $u\in\PositiveRealNumbers$ such that $\rho(u,1)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip


\clearpage
\section*{$\boldsymbol{\delta}$-entourages with respect to the distance $\boldsymbol{\rho}$}

\medskip

\begin{exercise}
Let $\delta>0$ and $x\in\PositiveRealNumbers$.
Find all $y\in[x,+\infty)$ such that $\rho(x,y)\le\delta$.
\end{exercise}

\medskip

\begin{align*}
\begin{cases}
x\le y  \\[1ex]
\rho(x,y)\le\delta
\end{cases}
&\quad\Longleftrightarrow\quad
\begin{cases}
x\le y \\[1ex]
\rho\bigl(x/y,\qquad\bigr)\hsp{3em}
\end{cases}
\quad\Longleftrightarrow\quad
\hsp{10em}
\\[15ex]
&\quad\Longleftrightarrow\quad
\ubrace{3em}\le y\le\ubrace{3em}
\quad\Longleftrightarrow\quad
y\in\Bigl[\qquad\quad,\qquad\quad\Bigr].
\end{align*}

\bigskip\bigskip

\begin{exercise}
Let $\delta>0$ and $x\in\PositiveRealNumbers$.
Find all $y\in(0,x]$ such that $\rho(x,y)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $\delta>0$ and $x\in\PositiveRealNumbers$.
Find all $y\in\PositiveRealNumbers$ such that $\rho(x,y)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip

\clearpage
\section*{Comparison to another dilation invariant distance}

\medskip\noindent
\begin{defn}
Define the function 
$\rho_1\colon\PositiveRealNumbers\times\PositiveRealNumbers\to[0,+\infty)$ by
\[
\rho_1(x,y)=\frac{|x-y|}{\max(x,y)}.
\]
It can be shown that $\rho_1$ is a distance on $\PositiveRealNumbers$.
\end{defn}

\bigskip

\begin{exercise}
Express $\rho_1(x,y)$ through $\max(x,y)$ and $\min(x,y)$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $t\in(0,1)$. Compare $\displaystyle\ln\frac{1}{t}$ with $1-t$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $x,y\in\PositiveRealNumbers$.
Compare $\rho(x,y)$ with $\rho_1(x,y)$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Prove that the function
$\displaystyle t\mapsto\frac{\ln\frac{1}{t}}{1-t}$
decreases on $(0,1)$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $t\in(0,1)$. Find a positive constant $C>0$ such that
$\forall t\in\left[\frac{1}{2},1\right]$
\[
\ln\frac{1}{t}\le C(1-t).
\]
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Prove that for all $x,y\in\PositiveRealNumbers$ such that $\rho(x,y)\le\frac{1}{2}$
the distance $\rho$ can be bounded by a multiple of $\rho_1$ in the following manner:
\[
\rho(x,y)\le C\,\rho_1(x,y).
\]
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip


\clearpage
\section*{Examples and counter-examples of sequences\\such that $\boldsymbol{\rho(x_n,x_{n+1})\to0}$}

\indent
For each one of the following sequences $(x_n)_{n=1}^\infty$
determine whether $\rho(x_n,x_{n+1})\to0$ or not.

\bigskip

\begin{exercise}
$x_n\eqdef n$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
$\displaystyle x_n\eqdef n^2$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
$\displaystyle x_n\eqdef\ln(n)$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
$\displaystyle x_n\eqdef 2^n$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
$\displaystyle x_n\eqdef\frac{1}{2^n}$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
$\displaystyle x_n\eqdef\frac{1}{n}$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip

\label{endlabel}
\end{document}
