Suppose for the sake of contradiction that ∣Δ(m,n)∣≤N for all m,n. Note that f is injective, as
f(m)=f(n)⟹Δ(m,n)=0⟹m=n,
as desired.
Let G be the “arrow graph” of f, which is the directed graph with vertex set N and edges n→f(n). The first step in the solution is to classify the structure of G. Injectivity implies that G is a disjoint collection of chains (infinite and half-infinite) and cycles. We have the following sequence of claims that further refine the structure.
Claim — The graph G has no cycles.
Proof. Suppose for the sake of contradiction that fk(n)=n for some k≥2 and n∈N. As m varies over N, we have ∣Δ(m,n)∣≤N, so ff(n)(m) can only take on some finite set of values. In particular, this means that
ff(n)(m1)=ff(n)(m2)
for some m1=m2, which contradicts injectivity.
Claim — The graph G has at most 2N+1 chains.
Proof. Suppose we have numbers m1,…,mk in distinct chains. Select a positive integer B>max{f(m1),…,f(mk)}. Now,
∣Δ(mi,fB−f(mi)(1))∣≤N⟹∣fB(1)−ffB−f(mi)+1(mi)∣≤N.
Since the mis are in different chains, we have that ffB−f(mi)+1(mi) are distinct for each i, which implies that k≤2N+1, as desired.
Claim — The graph G consists of exactly one half-infinite chain.
Proof. Fix some c∈N. Call an element of N bad if it is not of the form fk(c) for some k≥0. It suffices to show that there are only finitely many bad numbers.
Since there are only finitely many chains, ff(c)(n) achieves all sufficiently large positive integers, say all positive integers at least M. Fix A and B such that B>A≥M.
If ff(c)(n)∈[A,B], then ff(n)(c)∈[A−N,B+N], and distinct n generate distinct ff(n)(c) due to the structure of G. Therefore, we have at least B−A+1 good numbers in [A−N,B+N], so there are at most 2N bad numbers in [A−N,B+N].
Varying B, this shows there are at most 2N bad numbers at least A−N.
Let c be the starting point of the chain, so every integer is of the form fk(c), where k≥0. Define a function g:Z≥0→N by
g(k):=fk(c).
Due to the structure of G, g is a bijection. Define
δ(a,b):=Δ(fa(c),fb(c))=g(g(b+1)+a)−g(g(a+1)+b),
so the conditions are equivalent to ∣δ(a,b)∣≤N for all a,b∈Z≥0 and δ(a,b)=0 for a=b, which is equivalent to g(a+1)−a=g(b+1)−b for a=b. This tells us that g(x)−x is injective for x≥1.
Lemma
For all M, there exists a nonnegative integer x with g(x)≤x−M.
Proof. Assume for the sake of contradiction that g(x)−x is bounded below. Fix some large positive K. Since g(x)−x is injective, there exists B such that g(x)−x≥K for all x≥B. Then min{g(B+1),g(B+2),…}≥B+K, while {g(0),…,g(B)} only achieve B+1 values. Thus, at least K−1 values are not achieved by g, which is a contradiction.
Now pick B such that g(B)+N≤B and g(B)>N. Note that infinitely many such B exist, since we can take M to be arbitrarily small in the above lemma. Let
t=max{g−1(g(B)−N),g−1(g(B)−N+1),…,g−1(g(B)+N)}.
Note that g(t)≤g(B)+N≤B, so we have
∣δ(t−1,B−g(t))∣=∣g(B)−g(t−1+g(B+1−g(t)))∣≤N,
so
t−1+g(B+1−g(t))∈{g−1(g(B)−N),g−1(g(B)−N+1),…,g−1(g(B)+N)},
so by the maximality of t, we must have g(B+1−g(t))=1, so B+1−g(t)=g−1(1). We have ∣g(t)−g(B)∣≤N, so
∣(B−g(B))+1−g−1(1)∣≤N.
This is true for infinitely many values of B, so infinitely many values of B−g(B) (by injectivity of g(x)−x), which is a contradiction. This completes the proof.