Let $Z$ be the the set of dyadic and ternary rationals in the interval $\left[\frac12,1\right)$ whose 3-adic valuation is either $-1$ or $0$, with the standard absolute value topology inherited from the real line.


Let $X=\{z\in Z:\nu\_3(x)=0\}$.


Let $Y=\{z\in Z:\nu\_3(x)=-1\}$.


Now define an equivalence relation $\sim$ which partitions $Z$ into equivalence classes $\{x, y\}$ of cardinality $2$ with $x \in X$, $y \in Y$, and $f(x) = y$, where $f:X\to Y$ is given by
$$f(x)=\begin{cases}\frac{4x}3 &\text{if}& x<\frac34\\
\frac{2x}3& \text{if}& x>\frac34.\end{cases}$$


So for example $\frac5{8}\sim\frac56$ and $\frac{7}{8}\sim\frac{7}{12}$.


The quotient (pseudo)metric $d\_\sim$ on $Z/{\sim}$ is the infimum distance by which one can traverse from any equivalence class to another, by stepping on up to infinitely many equivalence classes in-between and summing only the distance *between* classes and not the distance travelled *within* classes. More formally this is defined at [@EricWofsey's answer to "Is there a conceptual reason why topological spaces have quotient structures while metric spaces don't?"](https://mathoverflow.net/a/123753/91341).


**Question**


I seek an explicit definition of $d\_\sim$ in this instance. Of course, in a sense Eric's [answer](https://mathoverflow.net/a/123753/91341) does give that, but it leaves me with a requirement to somehow iterate over all possible sequences of equivalence classes and determine the shortest path, something well beyond my capabilities.


**Also Note**


While this question stands alone without reference to the Collatz conjecture, I feel more comfortable declaring that identifying this metric is a component of my study of the conjecture, partly in the spirit of full-disclosure, but also becase it may be material to the answer, to be mindful of the following observations:


* $g(x)=x+\frac132^{\nu\_2(x)}$ is both a surjection $X\to Y$ and a surjection $Z/{\sim}\to Z/{\sim}$ and seen as a map $g:Z/{\sim}\to Z/{\sim}$ it is essentially the Collatz graph and its graph is connected if and only if the Collatz conjecture is true. One should not be surprised therefore, if some proof that $d\_\sim$ is the trivial metric, $\forall [z\_0],[z\_1]:d\_\sim([z\_0],[z\_1])=0$, were related to the claim that the graph of the orbit of $g$ through $Z/{\sim}$ is connected.
* The $n$-indexed sequences of the form $s\_n(x)=x+(1-2^{-6n})\cdot2^{\nu\_2(x)}\cdot3^{\nu\_3(x)-1}$ form an exact cover of $X$ (up to subsequences) and $g$ is their infinite limit. Moreover, for every $y\in Y$ there are precisely two $s\_n$ (up to subsequences) whose union is the level set by $g$ of $y$.
* If $d\_\sim$ is not the trivial (pseudo)metric, it seems likely a proof that some sequence gives the infimum for the metric may use the sequences given in the two bullets above.
* This question has a "dual", if you like, which is to enquire into the quotient pseudometric obtained when setting $x\sim' g(x)$ instead of $x\sim f(x)$ and moreover the conjecture is equivalent to the claim that $Z/({\sim}\cdot{\sim'})$ is a singleton having $Z$ as its only element.



What is the quotient (pseudo)metric $d_\sim$ and how do I identify the infimum of possible sequences in this instance?
One gets the trivial semi-distance. Let $d$ denote the semi-distance on $Z$ that defines $d\_\sim$ on $Z/\sim$, that is $d\_\sim([z],[z']):=d(z,z')$ for all $z$ and $z'$ in $Z$. Thus $d(z,z')\le |z-z'|$ for all $z$ and $z'$ in $Z$ and $d(x,f(x))=0$ for all $x\in X$.


It is convenient to extend the definition of $f$ to a self-map $[1/2,1)\to[1/2,1)$, still denoted $f$:
$$f(x)=\begin{cases}\frac{4x}3 &\text{if}& 0\le x<\frac34\\
\frac{2x}3& \text{if}& \frac34\le x <1.\end{cases}$$


The key point is that *all orbits of $f$ are dense*. So for every $z$ and $z'$ in $Z$, and for every $\epsilon>0$, there is $m\in\mathbb N$ such that $\lvert f^m(z)-z'\rvert< \epsilon$. Since $X$ is also dense, and since $f$ is everywhere (right) continuous, for all indices $ 0\le j\le m$ there are $x\_j\in X$ such that
\begin{align\*}
\bigl\lvert f^j(z)-x\_j\bigr\rvert<\frac\epsilon m, & \qquad (0\le j\le m) \\
\bigl\lvert f(x\_j)-f^{j+1}(z)\bigr\rvert<\frac\epsilon m, & \qquad (0\le j\le m-1).
\end{align\*}
Therefore for $0\le j\le m-1$
$$\bigl\lvert f(x\_j)-x\_{j+1}\bigr\rvert \le \bigl\lvert f(x\_j)-f^{j+1}(z)\bigr\rvert+\bigl\lvert f^{j+1}(z)-x\_{j+1}\bigr\rvert\le \frac{2\epsilon}m$$
and  

$$d(z,z')\le\bigl\lvert z-x\_0\bigr\rvert+ \bigg(\sum\_{j=0}^{m-1} \bigl\lvert f(x\_j)-x\_{j+1}\bigr\rvert \bigg) +\big|x\_m-z'\big|\le 4\epsilon,$$
which proves that $d$ vanishes identically.


*All orbits of $f$ are dense*: Indeed, having all orbits dense is a property invariant by conjugation, and $f$ is conjugate to the irrational translation (modulo $1$) on $[0,1)\sim\mathbb{R/Z }$ given by $T\_c:x\mapsto {x -c}$, where $c:=\frac {\log 3}{\log 2}-1$ (all orbits of a translation $T\_c$ are dense iff $c$ is irrational).


Consider the homeomorphism $h:[0,1)\to[1/2,1)$ defined by $h(x)=2^{x-1}$. Then it is easy to check that $h\circ T\_c=f \circ h$.


