\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{\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}}}

\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[A dilation-invariant distance on $(0,+\infty)$]{A dilation-invariant distance\\on the positive half-line}

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

\begin{defn}
Define the function $\rho_1\colon\PositiveRealNumbers\times\PositiveRealNumbers\to[0,+\infty)$ by
\[
\rho_1(x,y)\eqdef\frac{|x-y|}{\max(x,y)}.
\]
\end{defn}

\begin{note}
We threat $\max$ and $\min$ as functions of two real arguments:
\[
\max(7,3)=7,\qquad \min(7,3)=3.
\]
One can also threat them as functions of one set argument:
\[
\max\{7,3\}=7,\qquad \min\{7,3\}=3.
\]
\end{note}

\bigskip

\begin{exercise}
Fill the table:
\[
\begin{array}{c|c|c|c}
\vertstrut & \hsp{1em}|x-y|\hsp{1em} & \hsp{1em}\max(x,y)\hsp{1em} & \hsp{1em}\min(x,y)\hsp{1em} \\\hline
\vertstrut \text{Case}\ x\ge y\colon & & & \\\hline
\vertstrut \text{Case}\ x<y\colon & & & 
\end{array}
\]
\end{exercise}

\bigskip

\begin{exercise}
Express $|x-y|$ through $\max(x,y)$ and $\min(x,y)$:\par\bigskip
\[
|x-y|=\hsp{10em}
\]
\end{exercise}

\bigskip

\begin{exercise}
Express $\rho_1(x,y)$ through $\max(x,y)$ and $\min(x,y)$:\par\bigskip
\[
\rho_1(x,y)=\hsp{15em}=1-\frac{\hsp{5em}}{\hsp{5em}}.
\]
\end{exercise}

\bigskip\bigskip

\clearpage
\noindent
We are going to prove that $\rho_1$ is a distance on $\PositiveRealNumbers$.

\begin{exercise}
List the conditions from the definition of distance (= metric).
Check which of them are obvious for the function $\rho_1$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
We are going to prove the triangular inequality for $\rho_1$.
Write it for some points $x,y,z\in\PositiveRealNumbers$:
\[
\ubrace{5em} \le \ubrace{10em}.
\]
\end{exercise}

\begin{exercise}
Rewrite the inequality from the previous exercise in the following form:
\[
\text{``something}\ge 0\text{''}
\]
\begin{equation} \label{eq:triangular_inequality}
\ubrace{15em}\ge0.
\end{equation}
\end{exercise}

\begin{exercise}
Write all the possible orderings of three numbers $x,y,z\in\PositiveRealNumbers$:
\begin{align*}
&1)\ x\le y\le z;  &  &2)\ x\le z\le y; & &\hsp{8em} \\[2ex]
&\hsp{8em} & &\hsp{8em} & &\hsp{8em}
\end{align*}
\end{exercise}

\begin{exercise}
The left-hand side of \eqref{eq:triangular_inequality}
is symmetric with respect to the following variables (choose the correct answer):
\begin{itemize}
\item[$\ocircle$] $x$ and $y$
\item[$\ocircle$] $x$ and $z$
\item[$\ocircle$] $y$ and $z$
\end{itemize}
\end{exercise}

\begin{exercise} \label{exer:reduced_orderings}
It follows from the previous exercise that without any loss of generality
we can suppose that
\[
\ubrace{10em}
\]
So, it is sufficient to consider only the following orderings of $x,z,y$:
\[
1) \hsp{2em}\le\hsp{2em}\le\hsp{2em}; \hsp{25em}
\]
\end{exercise}

\clearpage
\begin{exercise}
Consider the first case from the Exercise \ref{exer:reduced_orderings}.
In this case $x,y,z$ are ordered in the following manner:
\begin{equation} \label{eq:first_ordering}
\ubrace{2em}\le\ubrace{2em}\le\ubrace{2em}.
\end{equation}
Calculate the left-hand side of the formula \eqref{eq:triangular_inequality}:
\begin{align*}
\rho_1(\hsp{3em})&+\rho_1(\hsp{3em})-\rho_1(\hsp{3em})=
\\[2ex]
&=\biggl(\hsp{6em}\biggr)+\biggl(\hsp{6em}\biggr)-\biggl(\hsp{6em}\biggr)\\[2ex]
&= \\[10ex]
&= \frac{\bigl(\hsp{4em}\bigr)\bigl(\hsp{4em}\bigr)}{\hsp{4em}}.
\end{align*}
\par\bigskip\noindent
The last expression is\quad$\displaystyle\underbrace{\hsp{3em}}_{\ge\ \text{or}\ \le}0$\quad\mbox{}
by the condition \eqref{eq:first_ordering}.
\end{exercise}

\bigskip

\begin{exercise}
Calculate the left-hand side of \eqref{eq:triangular_inequality} for other cases
from the Exercise \ref{exer:reduced_orderings}.
\end{exercise}

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

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

\bigskip

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

\bigskip\bigskip\bigskip\bigskip\bigskip

\section*{Pairs of the points that are $\boldsymbol{\delta}$-close with respect to $\boldsymbol{\rho_1}$}

\begin{exercise}
Let $\delta\in(0,1)$.
Find all $u\in[1,+\infty)$ such that $\rho_1(u,1)\le\delta$.\par\medskip
\[
\begin{cases}
u\ge 1  \\[1ex]
\rho_1(u,1)\le 1
\end{cases}
\quad\Longleftrightarrow\quad
\begin{cases}
u\ge 1 \\[3ex]
\hsp{4em}
\end{cases}
\quad\Longleftrightarrow\quad
\hsp{15em}
\]
\end{exercise}

\bigskip

\begin{exercise}
Let $\delta\in(0,1)$.
Find all $u\in(0,1]$ such that $\rho_1(u,1)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip\bigskip\bigskip

\begin{exercise}
Let $\delta\in(0,1)$.
Find all $u\in\PositiveRealNumbers$ such that $\rho_1(u,1)\le\delta$.
\end{exercise}

\bigskip\bigskip\bigskip

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

\bigskip\bigskip\bigskip\bigskip\bigskip

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

\bigskip\bigskip\bigskip\bigskip\bigskip

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

\bigskip\bigskip\bigskip\bigskip\bigskip


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

\indent
For each one of the following sequences $(x_n)_{n=1}^\infty$
determine whether $\rho_1(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}
