[proofplan]
We first show that the hypotheses force $X$ to have no isolated points. This lets us choose two periodic points whose finite orbits are disjoint, hence separated by a positive distance. That separation supplies a uniform scale. Given a point $x$ and a neighbourhood $U$, we choose a periodic comparison point $r\in U$, shrink to a smaller [open set](/page/Open%20Set) whose first period-length iterates follow the orbit of $r$, and use transitivity to send some point of this smaller set near one of the two reference periodic orbits. The triangle inequality then shows that either this point or the comparison point $r$ separates from $x$ by a fixed positive amount.
[/proofplan]
[step:Show that $X$ has no isolated points]
Assume, toward a contradiction, that $p\in X$ is isolated. Then $\{p\}$ is a non-empty open subset of $X$. Since the periodic points of $f$ are dense in $X$, the open set $\{p\}$ contains a periodic point; hence $p$ is periodic.
Let $m\in\mathbb{N}$ be a period of $p$, so $f^m(p)=p$. Define the finite orbit set
\begin{align*}
\mathcal{O}(p):=\{f^i(p):0\leq i\leq m-1\}.
\end{align*}
We claim that $\mathcal{O}(p)$ is dense in $X$. Let $V\subset X$ be a non-empty open set. Apply the residue-refined topological transitivity hypothesis with modulus $1$, residue $0\in\{0\}$, and the non-empty open sets $\{p\}$ and $V$. There exists $n\in\mathbb{N}$ such that
\begin{align*}
f^n(\{p\})\cap V\neq\varnothing.
\end{align*}
Thus $f^n(p)\in V$. Since $p$ has period $m$, the point $f^n(p)$ belongs to $\mathcal{O}(p)$. Hence every non-empty open set meets $\mathcal{O}(p)$, so $\mathcal{O}(p)$ is dense.
The set $\mathcal{O}(p)$ is finite, hence compact and closed in the [metric space](/page/Metric%20Space) $X$. Since it is also dense, $\mathcal{O}(p)=X$. This contradicts the hypothesis that $X$ is infinite. Therefore $X$ has no isolated points.
[guided]
We prove this first because the later construction needs room to choose distinct periodic orbits. Suppose that $p\in X$ is isolated. By definition of isolated, the singleton $\{p\}$ is open in $X$. Since periodic points are dense, every non-empty open set contains a periodic point, so the open set $\{p\}$ contains a periodic point. The only point it contains is $p$, hence $p$ itself is periodic.
Choose a period $m\in\mathbb{N}$ for $p$, so $f^m(p)=p$. The orbit of $p$ is then the finite set
\begin{align*}
\mathcal{O}(p):=\{f^i(p):0\leq i\leq m-1\}.
\end{align*}
We now use the residue-refined transitivity hypothesis from the open set $\{p\}$. Let $V\subset X$ be any non-empty open set. Apply the hypothesis with modulus $1$, residue $0\in\{0\}$, and the non-empty open sets $\{p\}$ and $V$. This gives an integer $n\in\mathbb{N}$ such that
\begin{align*}
f^n(\{p\})\cap V\neq\varnothing.
\end{align*}
This means exactly that $f^n(p)\in V$. But $p$ is periodic with period $m$, so $f^n(p)=f^j(p)$ for the unique residue $j\in\{0,\dots,m-1\}$ with $n\equiv j\pmod m$. Thus $f^n(p)\in\mathcal{O}(p)$.
We have shown that every non-empty open set $V$ intersects $\mathcal{O}(p)$. Therefore $\mathcal{O}(p)$ is dense in $X$. Because $X$ is a metric space, finite sets are closed; hence the finite set $\mathcal{O}(p)$ is closed. A closed [dense subset](/page/Dense%20Subset) of $X$ must equal $X$, so $X=\mathcal{O}(p)$. This makes $X$ finite, contradicting the assumption that $X$ is infinite. Hence no isolated point can exist.
[/guided]
[/step]
[step:Choose two disjoint periodic orbits and define a uniform separation scale]
Because $X$ has no isolated points and the periodic points are dense, $X$ contains at least two periodic points with disjoint finite orbits. Indeed, choose one periodic point $p\in X$, define its finite orbit $\mathcal{O}(p)$ as above, and choose a point $z\in X\setminus\mathcal{O}(p)$, which exists because $X$ is infinite. The finite set $\mathcal{O}(p)$ is closed in the metric space $X$, so $X\setminus\mathcal{O}(p)$ is open. Since $z\in X\setminus\mathcal{O}(p)$, this complement is a non-empty open neighbourhood of $z$. Density of periodic points gives a periodic point $q\in X\setminus\mathcal{O}(p)$. Then $\mathcal{O}(p)\cap\mathcal{O}(q)=\varnothing$; otherwise the two periodic orbits would coincide.
Define
\begin{align*}
P:=\mathcal{O}(p),
\end{align*}
and
\begin{align*}
Q:=\mathcal{O}(q).
\end{align*}
The sets $P$ and $Q$ are non-empty, finite, and disjoint. Define their mutual distance by
\begin{align*}
\eta:=\min\{d(a,b):a\in P,\ b\in Q\}.
\end{align*}
Since the minimum is taken over a finite non-empty set of positive numbers, $\eta>0$. Set
\begin{align*}
\varepsilon:=\frac{\eta}{16}.
\end{align*}
We will prove that $\varepsilon/2$ is a sensitivity constant.
[/step]
[step:Choose a periodic comparison point inside the given neighbourhood]
Fix $x\in X$ and let $U\subset X$ be an open neighbourhood of $x$. By density of periodic points, choose a periodic point $r\in U$. Let $m\in\mathbb{N}$ be a period of $r$, so $f^m(r)=r$.
For each $i\in\{0,\dots,m-1\}$, continuity of $f^i:X\to X$ at $r$ gives an open neighbourhood $W_i\subset U$ of $r$ such that
\begin{align*}
d(f^i(w),f^i(r))<\varepsilon
\end{align*}
for every $w\in W_i$. Define
\begin{align*}
W:=\bigcap_{i=0}^{m-1}W_i.
\end{align*}
Then $W$ is a non-empty open subset of $U$, contains $r$, and satisfies
\begin{align*}
d(f^i(w),f^i(r))<\varepsilon
\end{align*}
for every $w\in W$ and every $i\in\{0,\dots,m-1\}$.
[/step]
[step:Find a point in $W$ whose orbit approaches a reference periodic orbit at the right time]
For each $i\in\{0,\dots,m-1\}$, the point $f^i(r)$ cannot be within $2\varepsilon$ of both $P$ and $Q$. If there were $a\in P$ and $b\in Q$ with
\begin{align*}
d(f^i(r),a)<2\varepsilon
\end{align*}
and
\begin{align*}
d(f^i(r),b)<2\varepsilon,
\end{align*}
then the triangle inequality would give
\begin{align*}
d(a,b)<4\varepsilon=\frac{\eta}{4},
\end{align*}
contradicting the definition of $\eta$.
Thus for each residue $i\in\{0,\dots,m-1\}$, at least one of the two finite orbit sets is at distance at least $2\varepsilon$ from $f^i(r)$. Choose such a set and denote it by $A_i$, so $A_i$ is either $P$ or $Q$, and
\begin{align*}
d(f^i(r),a)\geq 2\varepsilon
\end{align*}
for every $a\in A_i$.
For every non-empty subset $A\subset X$ and every point $z\in X$, define
\begin{align*}
\operatorname{dist}(z,A):=\inf\{d(z,a):a\in A\}.
\end{align*}
Define the non-empty open set
\begin{align*}
V_i:=\{z\in X:\operatorname{dist}(z,A_i)<\varepsilon\}.
\end{align*}
Choose any residue $j\in\{0,\dots,m-1\}$. By the residue-refined topological transitivity hypothesis applied to the non-empty open sets $W$ and $V_j$, there exist $y\in W$ and $N\in\mathbb{N}$ such that $N\equiv j\pmod m$ and
\begin{align*}
f^N(y)\in V_j.
\end{align*}
Write $N=am+j$ for some integer $a\geq 0$.
Therefore there exists $a_j\in A_j$ such that
\begin{align*}
d(f^N(y),a_j)<\varepsilon.
\end{align*}
Since $r$ has period $m$, we also have
\begin{align*}
f^N(r)=f^j(r).
\end{align*}
Using the defining separation of $A_j$ from $f^j(r)$ and the triangle inequality,
\begin{align*}
d(f^N(y),f^N(r))\geq d(a_j,f^j(r))-d(f^N(y),a_j)>\varepsilon.
\end{align*}
[guided]
The goal of this step is to produce a point $y\in W$ whose image at some time is far from the corresponding image of the periodic point $r$. The two reference periodic orbit sets $P$ and $Q$ are separated by distance $\eta$, and $\varepsilon=\eta/16$ is much smaller than that separation.
Fix a residue $i\in\{0,\dots,m-1\}$. The point $f^i(r)$ cannot lie close to both $P$ and $Q$. Indeed, if there were points $a\in P$ and $b\in Q$ such that
\begin{align*}
d(f^i(r),a)<2\varepsilon
\end{align*}
and
\begin{align*}
d(f^i(r),b)<2\varepsilon,
\end{align*}
then the triangle inequality would imply
\begin{align*}
d(a,b)\leq d(a,f^i(r))+d(f^i(r),b)<4\varepsilon=\frac{\eta}{4}.
\end{align*}
This contradicts the definition of $\eta$, because every point of $P$ is at distance at least $\eta$ from every point of $Q$.
Therefore, for each residue $i$, at least one of $P$ or $Q$ is uniformly far from $f^i(r)$. Choose one such orbit set and call it $A_i$. Thus $A_i\in\{P,Q\}$ and
\begin{align*}
d(f^i(r),a)\geq 2\varepsilon
\end{align*}
for every $a\in A_i$.
For every non-empty subset $A\subset X$ and every point $z\in X$, define the distance from $z$ to $A$ by
\begin{align*}
\operatorname{dist}(z,A):=\inf\{d(z,a):a\in A\}.
\end{align*}
Now define the open $\varepsilon$-neighbourhood of this chosen finite orbit by
\begin{align*}
V_i:=\{z\in X:\operatorname{dist}(z,A_i)<\varepsilon\}.
\end{align*}
This set is non-empty and open because $A_i$ is non-empty and the function $z\mapsto \operatorname{dist}(z,A_i)$ is continuous on the metric space $X$.
We now use the residue-refined topological transitivity hypothesis to send a point of $W$ into one of these open neighbourhoods at a time compatible with the period of $r$. Choose any residue $j\in\{0,\dots,m-1\}$. Applying the residue-refined hypothesis to $W$, $V_j$, the modulus $m$, and the residue $j$, we obtain a point $y\in W$ and an integer $N\in\mathbb{N}$ such that $N\equiv j\pmod m$ and
\begin{align*}
f^N(y)\in V_j.
\end{align*}
Equivalently, $N=am+j$ for some integer $a\geq 0$.
By the definition of $V_j$, there exists $a_j\in A_j$ satisfying
\begin{align*}
d(f^N(y),a_j)<\varepsilon.
\end{align*}
Since $r$ has period $m$, the equality $N=am+j$ gives
\begin{align*}
f^N(r)=f^{am+j}(r)=f^j(r).
\end{align*}
Finally, the point $a_j$ lies in the orbit set chosen to be far from $f^j(r)$, so
\begin{align*}
d(f^j(r),a_j)\geq 2\varepsilon.
\end{align*}
The triangle inequality therefore gives
\begin{align*}
d(f^N(y),f^N(r))=d(f^N(y),f^j(r))\geq d(a_j,f^j(r))-d(f^N(y),a_j)>\varepsilon.
\end{align*}
This is the needed separation between $y$ and the periodic comparison point $r$ at the same iterate $N$.
[/guided]
[/step]
[step:Compare both points to $x$ and obtain sensitivity]
We have $r\in U$, $y\in W\subset U$, and
\begin{align*}
d(f^N(y),f^N(r))>\varepsilon.
\end{align*}
By the triangle inequality,
\begin{align*}
d(f^N(y),f^N(r))\leq d(f^N(y),f^N(x))+d(f^N(x),f^N(r)).
\end{align*}
Hence at least one of the two quantities on the right is greater than $\varepsilon/2$. If
\begin{align*}
d(f^N(y),f^N(x))>\frac{\varepsilon}{2},
\end{align*}
then $y\in U$ separates from $x$ at time $N$. Otherwise,
\begin{align*}
d(f^N(r),f^N(x))>\frac{\varepsilon}{2},
\end{align*}
and the point $r\in U$ separates from $x$ at time $N$.
Thus for every $x\in X$ and every open neighbourhood $U$ of $x$, there exists $z\in U$ and $N\in\mathbb{N}$ such that
\begin{align*}
d(f^N(z),f^N(x))>\frac{\varepsilon}{2}.
\end{align*}
Since $\varepsilon/2=\eta/32>0$ depends only on the two fixed periodic orbit sets $P$ and $Q$, not on $x$ or $U$, the map $f$ has sensitive dependence on initial conditions.
[/step]