Regularity properties of the Stern enumeration of the rationals

Abstract: The Stern sequence (s(n)) is defined by s(0) = 0, s(1) = 1, s(2n) = s(n), s(2n+1) = s(n) + s(n+1). Stern showed in 1858 that gcd(s(n),s(n+1)) = 1, and that for every pair of relatively prime positive integers (a,b), there exists a unique n so that s(n) = a and s(n+1) = b. We show that, in a strong sense, the average value of s(n)/s(n+1) is 3/2, and that for all d, (s(n),s(n+1)) is uniformly distributed among all feasible pairs of congruence classes modulo d. More precise results are presented for d = 2 and 3.

\section{Introduction and History}
In 1858, M. A. Stern \cite{ste}
defined the  {\it diatomic  array}, an
unjustly neglected mathematical construction. It is a
Pascal triangle with memory: each row is created by
inserting the sums of pairs of consecutive elements into the previous row.
\begin{equation}
\begin{aligned}
&a\quad b \\
&a\quad a+b\quad b \\
&a\quad 2a+b\quad a+b\quad a+2b\quad b \\
&a\quad 3a+b\quad 2a+b\quad 3a+2b\quad a+b\quad 2a+3b\quad a+2b\quad
a+3b\quad b \\
&\qquad \vdots \\
\end{aligned}
\end{equation}

When $(a,b) = (0,1)$, it is easy to see that each
row of the diatomic array repeats as the first half of the next row
down. The resulting infinite  {\it Stern sequence} can also be
defined recursively by:
\begin{equation}
s(0) = 0,\ s(1) = 1,\qquad s(2n) = s(n),\  s(2n+1) = s(n) + s(n+1).
\end{equation}
Taking $(a,b) = (1,1)$ in (1.1), we obtain blocks of $(s(n))$ for
$2^r \le n \le 2^{r+1}$. Although $s(2^r)=1$ is repeated at the ends,
each pair $(s(n),s(n+1))$ appears below exactly once as a consecutive pair
in a row:
\begin{equation}
\begin{aligned}
& (r=0) &\qquad  &1\quad 1 \\
& (r=1) &\qquad   &1\quad 2\quad 1 \\
& (r=2) &\qquad   &1\quad 3\quad 2\quad 3\quad 1 \\
& (r=3) &\qquad   &1\quad 4\quad 3\quad 5\quad 2\quad 5\quad 3\quad
  4\quad 1 \\
&\qquad \vdots \\
\end{aligned}
\end{equation}
Mirror symmetry (or an easy induction) implies that
for $0 \le k \le 2^r$, we have
\begin{equation}
s(2^r + k) = s(2^{r+1} - k).
\end{equation}

In his original paper, Stern proved that for all $n$,
\begin{equation}
\gcd(s(n),s(n+1)) = 1;
\end{equation}
moreover, for every pair of positive relatively prime integers
$(a,b)$, there is a unique $n$ so that $s(n) = a$ and $s(n+1) =
b$. Stern's discovery predates Cantor's proof of the countability of
${\mathbb Q}$ by fifteen years.
 This property of the Stern sequence has been recently made
explicit and discussed in \cite{cw}. Another enumeration of the
positive rationals involves the {\it Stern-Brocot array}, which also
predates Cantor; see \cite{gkp}, pp. 116--123, 305--306. This was used
by Minkowski in defining his  $?$-function; see \cite{mink}. The
Stern sequence and Stern-Brocot array make brief appearances in
Dickson's {\it History}, see \cite{dic}, pp. 156, 426.
Apparently, de Rham \cite{dr} was the first to consider the
sequence $(s(n))$ {\it per se}, attributing the term ``Stern
sequence'' to Bachmann
\cite{bach}, p. 143, who had only considered the array.
The Stern sequence has recently arisen as well in the discussion of
2-regular sequences \cite{as} and the Tower of Hanoi graph
\cite{hkmpp}. Some other Stern identities and a large bibliography
relating to the Stern sequence are given in \cite{urb}.
A further discussion of the Stern sequence will be found in \cite{rez2}.

Let
\begin{equation}
t(n) = \frac {s(n)}{s(n+1)}.
\end{equation}
Here are blocks of $(t(n))$, for $2^r \le n <2^{r+1}$ for small $r$:
\begin{equation}
\begin{aligned}
& (r=0) &\qquad &  \tfrac 11 \\
& (r=1) &\qquad & \tfrac 12 \quad \tfrac 21 \\
& (r=2) &\qquad & \tfrac 13 \quad  \tfrac 32 \quad \tfrac 23 \quad
  \tfrac 31 \\
& (r=3) &\qquad & \tfrac 14 \quad \tfrac 43 \quad \tfrac 35 \quad \tfrac 52
\quad \tfrac 25 \quad  \tfrac 53 \quad \tfrac 34 \quad \tfrac 41 \\
&\qquad \vdots \\
\end{aligned}
\end{equation}

In Section 3, we shall show that
\begin{equation}
\sum_{n=0}^{N-1} t(n) =   \frac {3N}2 + {\mathcal O}(\log^2 N),
\end{equation}
so the ``average'' element in the Stern enumeration of $\mathbb Q_+$ is
$\frac 32$.

For a fixed integer $d \ge 2$, let
\begin{equation}
S_d(n) := (s(n) \text{ mod }d, s(n+1)\text{ mod }  d)
\end{equation}
and let
\begin{equation}
{\mathcal S}_d = \{(i \text{ mod }d, j\text{ mod }d): \gcd(i,j,d) = 1\}.
\end{equation}
It follows from (1.5) that $S_d(n) \in {\mathcal S}_d$ for all $n$.
In Section 4, we shall show that for each $d$,  the sequence
$(S_d(n))$ is uniformly distributed on
${\mathcal S}_d $, so the ``probability'' that
$s(n) \equiv i \mod d$ can be explicitly computed.
More precisely, let
\begin{equation}
T(N;d,i) = \left\vert\{n: 0 \le n < N\ \& \  s(n) \equiv i \text{ mod }d
\}\right\vert.
\end{equation}
Then there exists $\tau_d < 1$ so that
\begin{equation}
T(N;d,i) = r_{d,i} N +  {\mathcal O}(N^{\tau_d}),
\end{equation}
where
\begin{equation}
r_{d,i} =  \frac 1d
\cdot \prod_{p | i, p | d} \frac {p}{p+1}
\cdot \prod_{p \nmid i, p | d} \frac {p^2}{p^2-1}.
\end{equation}
In particular, the probability that $s(n)$ is a multiple of $d$ is
$I(d)^{-1}$, where
\begin{equation}
I(d) = d \prod_{p\ | \ d} \frac{p+1}p \in \mathbb N.
\end{equation}

In Section 5, we present more specific information for the cases $d =
2$ and 3. It is an easy induction
 that $s(n)$ is even if and only if $n$ is a
multiple of 3, so that $\tau_2 = 0$. We show that $\tau_3 =
\frac 12$ and give an explicit formula for $T(2^r;3,0)$, as well as a
recursive description of those $n$ for which $3 \ | \ s(n)$. We also prove
that, for all $N\ge 1$, $T(N;3,1) - T(N;3,2) \in \{0,1,2,3\}$.

It will be proved in  \cite{rez2} that
\begin{equation}
 T(2^r;4,0) = T(2^r;5,0), \qquad
T(2^r;6,0) = T(2^r;9,0) = T(2^r;11,0);
\end{equation}
we conjecture that $T(2^r;22,0) = T(2^r;27,0)$. (The latter is
true for $r \le 19$.) These
exhaust the possibilities for $T(2^r;N_1,0) = T(2^r;N_2,0)$ with
$N_i \le 128$.
Note that $I(4) = I(5) = 6$, $I(6)=I(8) =I(9) = I(11) = 12$ and $I(22)=I(27)
= 36$. However, $T(2^r;8,0)\neq T(2^r;6,0)$, so there is more
than just asymptotics at work.

\section{Basic facts about the Stern sequence}
We formalize the definition of the diatomic array. Define
$Z(r,k) = Z(r,k;a,b)$ recursively for $r
\ge 0$ and $0 \le k \le 2^r$ by:
\begin{equation}
\begin{gathered}
Z(0,0) = a, \quad  Z(0,1) = b; \\ Z(r+1,2k) = Z(r,k), \quad
Z(r+1,2k+1) = Z(r,k) + Z(r,k+1).
\end{gathered}
\end{equation}
The following lemma follows from (1.2), (2.1) and a simple induction.
\begin{lemma}
For $0 \le k \le 2^r$, we have
\begin{equation}
Z(r,k;0,1) = s(k).
\end{equation}
\end{lemma}
Lemma 2.1 leads directly to a general formula for  the diatomic array.
\begin{theorem}
For $0 \le k \le 2^r$, we have
\begin{equation}
Z(r,k;a,b) = s(2^r-k)a + s(k)b.
\end{equation}
\end{theorem}
\begin{proof}
Clearly, $Z(r,k;a,b)$ is linear in $(a,b)$ and it also satisfies a mirror
symmetry
\begin{equation}
Z(r,k;a,b) = Z(r,2^r-k;b,a)
\end{equation}
for $0 \le k \le 2^r$, c.f. (1.4). Thus,
\begin{equation}
Z(r,k;a,b) = a Z(r,k;1,0) + bZ(r,k;0,1) = aZ(r,2^r-k;0,1) + bZ(r,k;0,1).
\end{equation}
The result then follows from Lemma 2.1.
\end{proof}
The diatomic array contains a self-similarity: any two consecutive entries
in any row determine the corresponding  portion of the succeeding rows. More
precisely, we have a relation whose simple inductive proof is omitted,
and which immediately leads to the iterated generalization of (1.2).
\begin{lemma}
If $0 \le k \le 2^r$ and $0 \le k_0 \le 2^{r_0}-1$, then
\begin{equation}
Z(r+r_0,2^{r}k_0 + k;a,b) =
Z(r,k;Z(r_0,k_0;a,b),Z(r_0,k_0+1;a,b)).
\end{equation}
\end{lemma}
\begin{corollary}
If $n \ge 0$ and $0 \le k \le 2^r$, then
\begin{equation}
s(2^rn + k) = s(2^r-k)s(n) + s(k)s(n+1).
\end{equation}
\end{corollary}
\begin{proof}
Take $(a,b,k_0,r_0) = (0,1,n, \lceil \log_2 (n+1) \rceil)$ in  Lemma
2.3, so that $k_0 < 2^{r_0}$, and then apply Theorem 2.2.
\end{proof}

We turn now to $t(n)$. Clearly, $t(2n) <
1 \le t(2n+1)$ for all $n$; after a little algebra, (1.2) implies
\begin{equation}
t(2n) =  \cfrac 1{1 + \cfrac 1{t(n)}}\ ,
\qquad t(2n+1) = 1 + t(n).
\end{equation}
The mirror symmetry (1.4) yields two other formulas which are
evident in (1.7):
\begin{equation}
t(2^r + k)t(2^{r+1}-k-1) = 1,
\end{equation}
for $0 \le k \le 2^r-1$, which follows from
\begin{equation}
t(2^{r+1}-k-1) = \frac
{s(2^{r+1}-k-1)}{s(2^{r+1}-k)} = \frac {s(2^r + k+1)}{s(2^r+k)} =
\frac 1{t(2^r+k)};
\end{equation}
 and
\begin{equation}
t(2^r + 2\ell)+ t(2^{r+1}-2\ell-2) = 1,
\end{equation}
for $r \ge 1$ and $0 \le 2\ell \le 2^r-2$, which follows from
\begin{equation}
\frac{s(2^r+2\ell)}{s(2^r+2\ell+1)} +
\frac{s(2^{r+1}-2\ell-2)}{s(2^{r+1}-2\ell-1)}
= \frac{s(2^r+2\ell)}{s(2^r+2\ell+1)} +
\frac{s(2^r+2\ell+2)}{s(2^r+2\ell+1)},
\end{equation}
since $s(2m) + s(2m+2) = s(2m+1)$.

Although we will not use it directly here, we mention a simple
closed formula for $t(n)$, and hence for $s(n)$. Stern had already
proved that if $2^r \le n < 2^{r+1}$, then the sum of the
denominators in the continued fraction representation of $t(n)$ is
$r+1$; this is clear from (2.8). Lehmer \cite{leh} gave an exact
formulation, of which the following is a variation.
 Suppose $n$ is odd and $[n]_2$, the binary
representation of $n$,  consists of a block of $a_1$ 1's, followed by
$a_2$ 0's, $a_3$ 1's, etc,
ending with $a_{2v}$ 0's and $a_{2v+1}$ 1's, with $a_j \ge 1$. (That
is, $n = 2^{a_1 + \cdots + a_{2v+1}} - 2^{a_2 + \cdots + a_{2v+1}} \pm
\cdots \pm
2^{a_{2v+1}} - 1$.) Then
\begin{equation}
t(n) = \frac{s(n)}{s(n+1)} = \frac pq = a_{2v+1} + \cfrac 1{a_{2v} +
  \cfrac 1{\dots + \cfrac 1{a_1}}}\ .
\end{equation}
Conversely, if $\frac pq > 1$ and (2.13) gives its presentation as a
simple continued fraction with an odd number of denominators, then the
unique $n$ with $t(n) = \frac pq$ has the binary representation
described above.  (If $n$ is even or $\frac pq < 1$,  apply (2.9) first.)

The {\it Stern-Brocot array} is named after the
clockmaker Achille Brocot, who used it  \cite{broc} in 1861
 as the basis of a gear table; see also \cite{hayes}. This array
 caught the attention of several French number theorists, and is
 discussed in \cite{luc}. It is formed by applying the diatomic rule
 to numerators and denominators simultaneously:
\begin{equation}
\begin{aligned}
& (r=0) &\qquad &  \tfrac 01 \quad \tfrac 10\\
& (r=1) &\qquad & \tfrac 01 \quad \tfrac 11 \quad \tfrac 10 \\
& (r=2) &\qquad & \tfrac 01 \quad  \tfrac 12 \quad \tfrac 11 \quad \tfrac
  21\quad \tfrac 10  \\
& (r=3) &\qquad & \tfrac 01 \quad \tfrac 13 \quad \tfrac 12 \quad \tfrac 23
\quad \tfrac 11 \quad  \tfrac 32 \quad \tfrac 21 \quad \tfrac 31\quad
\tfrac 10\\
&\qquad \vdots \\
\end{aligned}
\end{equation}

This array is not quite the same as (1.7).
If $\frac ab$ and $\frac cd$ are consecutive in the $r$-th
row, then they repeat in the $(r+1)$-st row, separated by $\frac
{a+c}{b+d}$. It is easy to see that the elements of the $r$-th row are
$\frac{s(k)}{s(2^r-k)}$, $0 \le k
\le 2^r$. It is also easy to show that the elements of each row are
increasing, and moreover, that they share a property with the Farey
sequence.
\begin{lemma} For $0 \le k \le 2^r - 2$,
\begin{equation}
\frac{s(k+1)}{s(2^r-k-1)} - \frac{s(k)}{s(2^r-k)} =\frac
1{s(2^r-k)s(2^r-k-1)}.
\end{equation}
That is,
\begin{equation}
s(k+1)s(2^r-k)-s(k)s(2^r - k-1) = 1.
\end{equation}
\end{lemma}
This lemma has a simple proof by induction, which can be found in
\cite{luc}, p.467  and \cite{gkp}, p.117.

The ``new'' entries
in the $(r+1)$-st row of (2.14) are a permutation of the $r$-th row of
(1.7). The easiest way to express the connection (see \cite{rez2})
for rationals $\frac pq > 1$ is that if $0 < k < 2^r$ is odd, then
\begin{equation}
\frac pq = \frac{s(2^r+k)}{s(2^r-k)} = \frac {s(\overleftarrow{2^r+k})}
{s(\overleftarrow{2^r+k}+1)},
\end{equation}
where $\overleftarrow n$ denotes the integer so that $[n]_2$ and
$[\overleftarrow n]_2$ are the reverse of each other. If $\frac pq <
1$, then apply mirror symmetry to the instance of (2.17) which holds
for $\frac qp$.

The  Minkowski $?$-function can be defined using the first half
of the rows of (2.14). For odd $\ell$, $0 \le \ell \le 2^r$,
\begin{equation}
?\left( \frac{s(\ell)}{s(2^{r+1}-\ell)} \right) = \frac \ell{2^r}.
\end{equation}
This gives a strictly increasing map from $\mathbb Q \cap [0,1]$ to
the dyadic rationals in $[0,1]$, which extends to a continuous
strictly increasing map from $[0,1]$ to itself, taking quadratic
irrationals to non-dyadic rationals.

Finally, suppose $N$ is a positive integer, written as
\begin{equation}
N = 2^{r_1} + 2^{r_2} + \cdots + 2^{r_v}, \qquad r_1 > r_2 > \dots > r_v.
\end{equation}
We shall define
\begin{equation}
N_0 = 0;\quad  N_j = 2^{r_1} +\cdots + 2^{r_j}\text{ for } j =
1, \dots, v.
\end{equation}
Further,  for $1 \le j \le v$, let $M_j = 2^{-r_j}N_{j+1}$, so that
\begin{equation}
N_j = N_{j-1} + 2^{r_j} = 2^{r_j}(M_j+1) = 2^{r_{j-1}}M_{j-1}.
\end{equation}
and, for $a < b \in \mathbb Z$, let
\begin{equation}
[a,b):= \{k \in \mathbb Z : a \le k < b \}.
\end{equation}
Our proofs will rely  on the observation that
\begin{equation}
[0,N) = \bigcup_{j=0}^{v-1} [N_j,N_{j+1}) = \bigcup_{j=1}^{v}
    [2^{r_j}M_j,2^{r_j}(M_j+1)),
\end{equation}
where the above unions are disjoint, so that, formally,
\begin{equation}
\sum_{n=0}^{N-1}
= \sum_{j=0}^{v-1} \sum_{n=N_j}^{N_{j+1}-1} =
 \sum_{j=1}^{v} \sum_{n=2^{r_j}M_j}^{2^{r_j}(M_j+1)-1}.
\end{equation}

\section{The Stern-Average Rational}
We begin by looking at the sum of $t(n)$ along the rows of (1.7). Let
\begin{equation}
A(r) = \sum_{n=2^r}^{2^{r+1}-1} t(n)\qquad{\text{and}}\qquad
\tilde A(r) = \sum_{n=0}^{2^{r}-1} t(n) = \sum_{i=0}^{r-1} A(i).
\end{equation}
\begin{lemma}
For $r \ge 0$,
\begin{equation}
A(r) = \frac 32 \cdot 2^r - \frac 12\qquad{\text{and}}\qquad \tilde
A(r) = \frac 32 \cdot 2^r -\frac {r+3}2.
\end{equation}
\end{lemma}
\begin{proof}
First note that $A(0) = t(1) = \frac 11 = \frac 32 - \frac 12$. Now
observe that for $r \ge 0$,
\begin{equation}
\begin{gathered}
A(r+1) = \sum_{j=0}^{2^{r+1}-1} t(2^{r+1} + j) =  \sum_{k=0}^{2^r-1}
t(2^{r+1} + 2k) + \sum_{k=0}^{2^r-1} t(2^{r+1} + 2k+1).
\end{gathered}
\end{equation}
Using (2.11) and (2.8), we can simplify this summation:
\begin{equation}
 \sum_{k=0}^{2^r-1} t(2^{r+1} + 2k) = \frac 12 \left(
 \sum_{k=0}^{2^r-1} t(2^{r+1} + 2k) + t(2^{r+2}-2k-2) \right)
 = 2^{r-1},
\end{equation}
and
\begin{equation}
 \sum_{k=0}^{2^r-1} t(2^{r+1} + 2k+1) =  \sum_{k=0}^{2^r-1}\bigl(1 +
 t(2^r+k)\bigr) = 2^r + A(r).
\end{equation}
Thus, $A(r+1) = 2^{r-1}+2^r+A(r)$, and the formula for $A(r)$ is
established by induction. This also immediately implies the formula for
$\tilde A(r)$.
\end{proof}
\begin{lemma}
If $m$ is even, then
\begin{equation}
\tilde A(r) \le \sum_{k=0}^{2^r-1} t(2^rm + k) < A(r).
\end{equation}
 \end{lemma}
\begin{proof}
For fixed $(k,r)$, let
\begin{equation}
\Phi_{k,r}(x) = \frac {s(2^r-k) x + s(k)}{s(2^r-(k+1))x + s(k+1)}.
\end{equation}
Then it follows from (2.16) that
\begin{equation}
\Phi_{k,r}'(x)  = \frac
{s(k+1)s(2^r-k)-s(k)s(2^r - k-1)}{(s(2^r-(k+1))x + s(k+1))^2} > 0.
\end{equation}
Using (2.7), we see that
\begin{equation}
\begin{gathered}
t(2^rm + k) = \frac{s(2^rm + k)}{s(2^rm + k+1)} =
\frac{s(2^r-k)s(m) + s(k)s(m+1)}{s(2^r-k-1)s(m) + s(k+1)s(m+1)}
\\=\Phi_{k,r}\left(\frac {s(m)}{s(m+1)} \right) = \Phi_{k,r}(t(m)).
\end{gathered}
\end{equation}
Since $m$ is even, $0 \le t(m) < 1$; monotonicity then implies that
\begin{equation}
t(k) = \Phi_{k,r}(0) \le t(2^rm + k) < \Phi_{r,k}(1) = t(2^r+k).
\end{equation}
 Summing (3.10) on $k$ from 0 to $2^r-1$ gives (3.6).
\end{proof}
We use these estimates to establish (1.8).
\begin{theorem}
If $2^r \le N < 2^{r+1}$, then
\begin{equation}
\frac{3N}2 -  \frac{r^2+7r+6}4 \le  \sum_{n=0}^{N-1} t(n) <  \frac{3N}2 -
\frac 12.
\end{equation}
\end{theorem}
\begin{proof}
Recalling (2.24), we apply Lemma 3.2 for each $j$, with $r = r_j$ and
$m = M_j$, so that
\begin{equation}
 \frac 32 \cdot 2^{r_j} - \frac {r_j+3}2 \le
 \sum_{n=N_{j-1}}^{N_j-1}  t(n)
 <  \frac 32\cdot  2^{r_j} - \frac 12.
\end{equation}
 After summing on $j$, we find that
\begin{equation}
 \frac {3N}2 - \frac {r_1 + \dots + r_v + 3v}2 \le
\sum_{n=0}^{N-1} t(n) <  \frac {3N}2 - \frac {v}2.
\end{equation}
To obtain (3.11), note that
$\sum r_j + 3v \le \frac{r(r+1)}2 + 3r+3 =
\frac {r^2+7r+6}2$.
\end{proof}
\begin{corollary}
\begin{equation}
 \sum_{n=0}^{N-1} t(n) =
\frac {3N}2 +  \mathcal O\left( \log^2N \right).
\end{equation}
\end{corollary}
Since $t(2^r-1) = \frac r1$, the true error term is at least $\mathcal
O(\log N)$. Numerical computations using Mathematica suggest
 that $\log^2N$ can be replaced by $\log N \log\log N$.
It also seems that, at least for small fixed
positive integers $t$,
\begin{equation}
\alpha_t:= \lim_{N \to \infty} \frac 1N \sum_{n=0}^{N-1} \frac {s(n)}{s(n+t)}
\end{equation}
exists. We have seen that $\alpha_1 = \frac 32$, and if they exist, the
evidence suggests that
 $\alpha_2\approx 1.262$, $\alpha_3 \approx 1.643$ and $\alpha_4 \approx 1.161$. We
are unable to present an explanation for these specific numerical values.

\section{Stern Pairs, mod $d$}

We fix $d \ge 2$ with prime factorization
$d = \prod p_\ell^{e_\ell}$, $e_\ell \ge 1$, and recall the definitions
of $\mathcal S_d$ and $S_d(n)$ from (1.9) and (1.10). Let
\begin{equation}
N_d = \left\vert \mathcal S_d \right\vert,
\end{equation}
and for $0 \le i < d$, let
\begin{equation}
N_d(i)= \left\vert \{j\text{ mod } d: (i \text{ mod } d, j \text{ mod
} d) \in
\mathcal S_d\} \right\vert.
\end{equation}

We now give two lemmas whose proofs rely on the Chinese Remainder Theorem.
\begin{lemma}
The map $S_d: {\mathbb N} \to \mathcal S_d$ is surjective.
\end{lemma}
\begin{proof}
Suppose $\alpha =(i,j) \in
\mathcal S_d$ with $0 \le i, j \le d-1$.
 We shall show that there exists $w \in \mathbb N$ so that
$\gcd(i, j+wd) = 1$. Consequently, there exists $n$ with  $s(n) = i$ and
$s(n+1) = j +  wd$, so that $S_d(n) = \alpha$.

Write $i= \prod_\ell {q_\ell^{f_\ell}}$, $f_\ell \ge 1$, with $q_\ell$ prime.
 If $q_\ell\ |\ j$, then    $q_\ell\ \nmid \
d$. There exists  $w\ge 0$ so that $w \equiv d^{-1} \mod
{q_\ell^{f_\ell}}$ if
$q_\ell\ |\ j$ and  $w \equiv 0 \mod {q_\ell^{f_\ell}}$ if
$q_\ell\ \nmid\ j$. Then  $j + wd \not\equiv 0 \mod
{q_\ell^{f_\ell}}$ for all $\ell$, so no prime dividing $i$
divides $j + wd$, as desired.
\end{proof}
\begin{lemma}
For $0 \le i \le d-1$,
\begin{equation}
N_d = d^2 \prod_{\ell} \frac {p_\ell^2-1}{p_\ell^2} \qquad
\text{and} \qquad
N_d(i) = d \prod_{p_\ell\ |\ i} \frac {p_\ell-1}{p_\ell}.
\end{equation}
\end{lemma}
\begin{proof}
To compute $N_d$, we use the Chinese Remainder Theorem by
counting the choices for $(i \text{ mod } p_\ell^{e_\ell}, j \text{ mod
}  p_\ell^{e_\ell})$ for each $\ell$. Missing are those
 $(i,j)$ in which $p_\ell$ divides both $i$ and $j$, and so
the total number of classes is $(p_\ell^{e_\ell} -
p_\ell^{e_\ell-1})^2$ for each $\ell$.

Now fix $i$.
If $p_\ell \ |\ i$, then $(i,j) \in \mathcal S_d$ if and only
if $p_\ell \nmid j$; if $p_\ell \nmid i$, then there is no restriction on
$j$. Thus,  there are either $p_\ell^{e_\ell} -
p_\ell^{e_\ell-1}$ or $p_\ell^{e_\ell}$ choices for $j$, respectively.
\end{proof}

Suppose $\alpha = (i,j) \in \mathcal
S_d$; let $L(\alpha):= (i, i+j)$ and $R(\alpha) = (i+j,j)$, where $i+j$ is
reduced mod $d$ if necessary. Then $L(\alpha), R(\alpha) \in \mathcal S_d$ and
the following lemma is immediate.
\begin{lemma}
For all $n$, we have  $S_d(2n) = L(S_d(n))$ and $S_d(2n+1) =
R(S_d(n))$.
\end{lemma}

We now define the directed graph $\mathcal G_d$ as follows.
The vertices of $\mathcal G_d$ are the elements of $\mathcal S_d$.
The edges of $\mathcal G_d$ consist of $(\alpha, L(\alpha))$ and $(\alpha,
R(\alpha))$ where $\alpha \in \mathcal S_d$.
Iterating, we see
that $L^k(\alpha) = (i, i+kj)$ and $R^k(\alpha) = (i + kj, j)$, so that
$L^d = R^d = id$, and $L^{-1} = L^{d-1}$ and $R^{-1} = R^{d-1}$.
Thus, if $(\alpha, \beta)$ is an edge of $\mathcal G_d$, then
there is a walk of length $d-1$ from $\beta$ to $\alpha$.

Each vertex of $\mathcal G_d$ has
out-degree two; since $(L^{-1}(\alpha), \alpha)$ and $(R^{-1}(\alpha), \alpha)$
are edges, each vertex has in-degree two as well.
Let $M_d = [m_{\alpha(d)\beta(d)}] = [m_{\alpha\beta}]$ denote the  adjacency
 matrix for $\mathcal G_d$: $M_d$ is
 the $N_d \times N_d$ 0-1 matrix so that
$m_{\alpha L(\alpha)} = m_{\alpha R(\alpha)} = 1$, with other entries equal to 0.
For a positive integer $r$, write
\begin{equation}
M_d^r = [m_{\alpha\beta}^{(r)}];
\end{equation}
then $m_{\alpha\beta}^{(r)}$ is the number of walks of length $r$
from $\alpha$ to $\beta$.
Finally, for $\gamma \in \mathcal S_d$, and integers $U_1 < U_2$, let
\begin{equation}
B(\gamma;U_1,U_2) = \left\vert \{m: U_1 \le m < U_2\ \&\ S_d(m) = \gamma \}
\right\vert
\end{equation}
The following is essentially  equivalent to Lemma 2.3.
\begin{lemma}
Suppose $\alpha = S_d(m)$, $\beta \in \mathcal S_d$ and $r \ge 1$. Then
$B(\beta;2^rm,2^r(m+1)) =m_{\alpha\beta}^{(r)} $ is equal to the number of
  walks of length $r$ in $\mathcal G_d$ from $\alpha$ to $\beta$.
\end{lemma}
\begin{proof}
The walks of length 1 starting from $\alpha$ are
 $(\alpha, L(\alpha))$ and $(\alpha, R(\alpha))$; that is,
$(S_d(n),S_d(2n))$ and $(S_d(n),S_d(2n+1))$. The rest is an easy induction.
\end{proof}
\begin{lemma}
For sufficiently large $N$, $m_{\alpha\beta}^{(N)} > 0$ for all $\alpha, \beta$.
\end{lemma}
\begin{proof}
Let $\alpha_0 = (0,1) = S_d(0)$. Note that $L(\alpha_0) = \alpha_0$, hence if
there is a walk of length $w$ from $\alpha_0$ to $\gamma$, then there are
such walks of every length $\ge w$.
By Lemma 4.1, for each $\alpha \in \mathcal S_d$, there
exists $n_\alpha$ so that $S_d(n_\alpha) = \alpha$. Choose $r$ sufficiently
large that  $n_\alpha < 2^r$ for all $\alpha$. Then by Lemma 4.4, for every
$\gamma$, there is a walk of length $r$ from $\alpha_0$ to $\gamma$, and so
there is a  walk of length $(d-1)r$ from  $\gamma$ to $\alpha_0$. Thus, for
any $\alpha, \beta \in \mathcal S_d$, there is at least one walk of length
$dr$ from
$\alpha$ to $\beta$ via $\alpha_0$.
\end{proof}

We need a version of Perron-Frobenius. Observe that $A_d = \frac 12
M_d$  is doubly
stochastic and the entries of $A_d^N = 2^{-N}M_d^N$ are
positive for sufficiently large $N$. Thus $A_d$ is {\it
  irreducible} (see \cite{minc}, Ch.1), so it has a simple
eigenvalue of 1, and all its  other eigenvalues are inside the unit
disk. It follows that $M_d$ has a simple eigenvalue of 2. Let
\begin{equation}
f_d(T) = T^k + c_{k-1}T^{k-1} + \cdots + c_0
\end{equation}
be the minimal polynomial of $M_d$. Let $\rho_d < 2$
be the maximum modulus of any non-2 root of  $f_d$, and let $1+\sigma_d$ be
the maximum multiplicity of any such maximal root.
 Then for $r \ge 0$ and all $(\alpha,\beta)$,
\begin{equation}
m_{\alpha\beta}^{r+k} +  c_{k-1}m_{\alpha\beta}^{r+k-1} + \cdots +
c_0m_{\alpha\beta}^{r} = 0.
\end{equation}

It follows from the standard theory of linear recurrences that for
some constants $c_{\alpha\beta}$,
\begin{equation}
m_{\alpha\beta}^{r} = c_{\alpha\beta} 2^r +  \mathcal(r^{\sigma_d}\rho_d^r)\qquad
\text{as } r\to \infty.
\end{equation}
In particular, $\lim_{r\to\infty} A_d^r = A_{d0}:= [c_{\alpha\beta}]$, and
since $A_d^{r+1}
= A_d A_d^r$, it follows that each column of $A_{d0}$ is an eigenvector
of $A_d$, corresponding to $\lambda = 1$. Such eigenvectors are constant
vectors and since $A_{d0}$ is doubly stochastic, we may conclude that
for all $(\alpha,\beta)$, $c_{\alpha\beta} = \frac 1{N_d}$.
Then there exists $c_d > 0$ so that for $r \ge 0$ and all $(\alpha,\beta)$,
\begin{equation}
\left\vert m_{\alpha\beta}^{r} - \frac{2^r}{N_d}\right\vert <
c_dr_d^{\sigma_d}\rho_d^r.
\end{equation}
Computations show that for
for small values of $d$ at least,  $\rho_d = \frac 12$
and $\sigma_d = 0$. In any event, by choosing $2> \bar\rho_d > \rho_d$ if
$\sigma_d > 0$, we can replace $r_d^{\sigma_d}\rho_d^r$ by
$\bar\rho_d^r$ in the upper bound.
Putting this together, we have proved the following theorem.
\begin{theorem}
There exist constants $c_d$ and $\bar\rho_d < 2$ so that if $m \in \mathbb N$
and $\alpha \in \mathcal S_d$, then for all $r \ge 0$,
\begin{equation}
\left\vert B(\alpha;2^rm,2^r(m+1)) - \frac {2^r}{N_d} \right\vert < c_d
\bar\rho_d^r.
\end{equation}
\end{theorem}

We now use this result on blocks of length $2^r$ to get our main theorem.
\begin{theorem}
For fixed $d \ge 2$, there exists $\tau_d< 1$ so that, for all $\alpha \in
\mathcal S_d$,
\begin{equation}
B(\alpha;0,N) = \frac N {N_d} + \mathcal O(N^{\tau_d}).
\end{equation}
\end{theorem}
\begin{proof}
By (2.25), we have
\begin{equation}
B(\alpha;0,N) = \sum_{j=0}^{v-1} B(\alpha;N_j,N_{j+1}) =
\sum_{j=1}^{v} B(\alpha;2^{r_j}M_j,2^{r_j}(M_j+1)).
\end{equation}
It follows that
\begin{equation}
\left\vert B(\alpha;0,N) - \frac N {N_d} \right \vert \le
c_d(\bar\rho_d^{r_1}
+ \cdots + \bar\rho_d^{r_v}).
\end{equation}
If $\bar\rho_d \le 1$, the upper bound is $\mathcal O(r_1) = \mathcal O(\log
N) = \mathcal O(N^{\epsilon})$ for any $\epsilon > 0$.
 If $1 \le \bar\rho_d < 2$, the upper bound is $\mathcal
O(\bar\rho_d^{r_1}) = \mathcal O(N^{\tau_d})$ for $\tau_d = \frac{\log
  \bar\rho_d}{\log 2}$, since $N \le 2^{r_1+1}$.
\end{proof}
Using the notation (1.11), we have
\begin{equation}
T(N;d,i) = \sum_{\alpha = (i,j) \in \mathcal S_d} B(\alpha;0,N),
\end{equation}
and the following is an immediate consequence of Lemma 4.2 and Theorem 4.7.
\begin{corollary}
Suppose $d \ge 2$. Then
\begin{equation}
T(N;d,i) = r_{d,i}N + \mathcal O(N^{\tau_d}),
\end{equation}
where, recalling that $d = \prod p_\ell^{e_\ell}$,
\begin{equation}
r_{d,i} = \frac 1d
\cdot \prod_{p_\ell | i} \frac {p_\ell}{p_\ell+1}
\cdot \prod_{p_\ell \nmid i} \frac {p_\ell^2}{p_\ell^2-1}.
\end{equation}
\end{corollary}
For example, if $p$ is prime, then $f(p,0) = \frac 1{p+1}$ and $f(p,i)
= \frac p{p^2-1}$ when $p \nmid i$.

In some sense, the model here is a Markov Chain, if we imagine
going from $m$ to
$2m$ or $2m+1$ with equal probability, so that the
$B(\beta;2^rm,2^r(m+1))$'s represent the distribution of destinations
after $r$ steps. Ken Stolarsky has pointed out that \cite{sch} is
a somewhat different
application of the limiting theory of Markov Chains in a number
theoretic setting.

\section{Small values of $d$}

 It is immediate to see (and to prove) that $2 \ | \ s(n)$ if and only
 if $3 \ | \
n$, thus $S_2(n)$ cycles among $\{(0,1), (1,1), (1,0)\}$ and $\tau_2 = 0$.
This generalizes to a family of partition
sequences. Suppose $d \ge 2$ is fixed,
and let
$b(d;n)$ denote the number of ways that $n$ can be written in the form
\begin{equation}
n = \sum_{i\ge 0} \epsilon_i 2^i,\qquad \epsilon_i \in \{0,\dots,d-1\},
\end{equation}
so that $b(2;n) = 1$. It is shown in \cite{rez1} that
\begin{equation}
\sum_{n=0}^\infty s(n)X^n = X\prod_{j=0}^\infty\left(1
  + X^{2^j} + X^{2^{j+1}}\right).
\end{equation}
A standard partition argument shows that
\begin{equation}
\sum_{n=0}^\infty b(d;n)X^n = \prod_{j=0}^\infty \frac {1 - X^{d\cdot
    2^j}}{1 - X^{2^j}}.
\end{equation}
Thus,  $s(n) = b(3;n-1)$. An examination of the product in
(5.3) modulo 2 shows that $b(d;n)$ is odd if and
only if $n \equiv 0,1 \text{ mod } d$ (see  \cite{rez1},
Theorems 5.2 and 2.14.)

Suppose now that $d=3$.
Write the 8 elements of $\mathcal S_3$ in lexicographic order:
\begin{equation}
(0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2).
\end{equation}
Then in the notation of the last section,
\begin{equation}
M_3 = \begin{pmatrix}
1&0&0&1&0&0&0&0 \\ 0&1&0&0&0&0&0&1 \\0&0&1&1&0&0&0&0 \\
0&0&0&0&1&0&1&0 \\ 0&1&1&0&0&0&0&0 \\ 0&0&0&0&0&1&0&1 \\
1&0&0&0&0&1&0&0 \\ 0&0&0&0&1&0&1&0
\end{pmatrix}\ .
\end{equation}
The minimal polynomial of $M_3$ is
\begin{equation}
f_3(T) =T^5 -2T^4+T^3-4T^2+4T = T(T-1)(T-2)(T - \mu)(T- \bar\mu),
\end{equation}
where
\begin{equation}
 \mu = \frac {-1 + \sqrt 7 i}2, \qquad
\bar \mu = \frac {-1 -\sqrt 7 i}2.
\end{equation}
Since the roots of $f_3$ are distinct, we see that for each
$(\alpha,\beta) \in
\mathcal S_3$, for $r \ge 1$, there exist constants $v_{\alpha\beta i}$ so that
\begin{equation}
m_{\alpha\beta}^{(r)} = v_{\alpha\beta 1} +   v_{\alpha\beta 2}\mu^r +
v_{\alpha\beta 3}\bar\mu^r + \frac 18\cdot 2^r = \frac 18\cdot 2^r + \mathcal
O(2^{r/2}).
\end{equation}
(As it happens, there are only eight distinct sequences
$m_{\alpha\beta}^{(r)}$.) Corollary 4.8 then implies that
\begin{equation}
\begin{gathered}
T(N;3,0) = \frac N4 + \mathcal O(\sqrt N), \\
T(N;3,1) = \frac {3N}8 + \mathcal O(\sqrt N), \
T(N;3,2) = \frac {3N}8 + \mathcal O(\sqrt N).
\end{gathered}
\end{equation}
Since $T(N;3,0) + T(N;3,1) + T(N;3,2) = N$, we gain complete
information from studying $T(N;3,0)$ and
\begin{equation}
\Delta(N) = \Delta_3(N) :=  T(N;3,1) - T(N;3,2).
\end{equation}
(That is, $\Delta_3(N+1) - \Delta_3(N)$ equals $0, 1, -1$ when $s(N)
\equiv 0, 1, 2$ mod 3, respectively.)

To study $T(N;3,0)$, we first define
the set $A_3 \subset \mathbb N$ recursively by:
\begin{equation}
0,5,7 \in A_3, \qquad 0 < n \in A_3 \implies 2n, 8n\pm 5, 8n \pm 7 \in A_3.
\end{equation}
Thus,
\begin{equation}
A_3 = \{ 0, 5, 7, 10,
14, 20, 28, 33, 35, 40, 45, 47, 49, 51, 56, 61, 63,\dots \}.
\end{equation}

\begin{theorem}
If $n \ge 0$, then $3 \ |\ s(n)$ if and only if $n \in A_3$.
\end{theorem}
\begin{proof}
It follows recursively from (1.2) or directly from (2.7) that
\begin{equation}
s(2n) = s(n),\quad s(8n\pm 5) = 2s(n) + 3s(n\pm 1), \qquad  s(8n\pm 7)
= s(n) + 3s(n\pm 1).
\end{equation}
Thus, 3 divides $s(n)$ if and only if 3 divides $s(2n), s(8n\pm
5)$ or $ s(8n\pm 7)$. Since every $n > 1$ can be written uniquely as
$2n', 8n'\pm 5$ or $8n'\pm 7$ with $0 \le n' < n$, the description of
$A_3$ is complete.
\end{proof}

In the late 1970's, E. W. Dijkstra \cite{dijk}(pp. 215--6, 230--232)
studied the Stern sequence under the name ``fusc'', and gave a
different description of $A_3$ (p. 232):
\smallskip
\begin{quote}
Inspired by a recent exercise of Don Knuth I tried to characterize the
arguments $n$ such that $3\ | \ \it{fusc}(n)$. With braces used to denote
zero or more instances of the enclosed, the vertical bar as the BNF
`or', and the question mark `?' to denote either a 0 or a 1, the
syntactical representation for such an argument (in binary) is
\{0\}1\{?0\{1\}0$\vert$?1\{0\}1\}?1\{0\}. I derived this by considering
-- as a direct derivation of my program -- the finite state automaton
that computes \it{fusc} $(N)$ mod 3.
\end{quote}
\smallskip
Let
\begin{equation}
a_r = | \{ n \in A_3: 2^r \le n < 2^{r+1} \} | = T(2^{r+1};3,0) -
T(2^r;3,0).
\end{equation}
It follows from (5.12) that
\begin{equation}
a_0 = a_1=0, \quad a_2=a_3=a_4 = 2, \quad a_5 = 10.
\end{equation}
\begin{lemma}
For $r \ge 3$,  $(a_r)$ satisfies the recurrence
\begin{equation}
a_r = a_{r-1} + 4a_{r-3}.
\end{equation}
\end{lemma}
\begin{proof}
This is evidently true for $r = 3, 4,5$. If $2^r \le n
< 2^{r+1}$ and $n=2n'$, then $2^{r-1} \le n' < 2^r$, so the even
elements of $A_3$ counted in $a_r$ come from elements of $A_3$ counted in
$a_{r-1}$. If $2^r \le n
< 2^{r+1}$ and $n=8n'\pm5$ or $n=8n'\pm7$, then
$2^{r-3} < n' < 2^{r-2}$ and $n' \in A_3$. Thus the odd
elements of $A_3$ counted in $a_r$ come (in fours) from elements of
$A_3$ counted in $a_{r-3}$.
\end{proof}
The characteristic polynomial of the recurrence (5.16) is $T^3-T^2-4$
(necessarily a factor of $f_3(T)$), and has roots $T=2,\ \mu$
and $\bar\mu$. The details of the following routine computation are omitted.
\begin{theorem}
For $r \ge 0$, we have the exact formula
\begin{equation}
a_r = \frac 14 \cdot 2^r +  \left(\frac{-7+5\sqrt 7 i}{56}\right)\mu^r +
 \left(\frac{-7-5\sqrt 7 i}{56}\right)\bar\mu^r .
\end{equation}
\end{theorem}
Keeping in mind that $s(0) = 0$ is not counted in any $a_r$, we find
 after a further computation that the error estimate $\mathcal O(\sqrt
 N)$ is best possible for $T(N;3,0)$:
\begin{corollary}
\begin{equation}
T(2^r;3,0) = \frac 14 \cdot 2^r +  \left(\frac{7-\sqrt 7
  i}{56}\right)\mu^r +  \left(\frac{7+\sqrt 7 i}{56}\right)\bar\mu^r
+ \frac 12\ .
\end{equation}
\end{corollary}

To study $\Delta(N)$, we first need a somewhat surprising lemma.
\begin{lemma}
For all $N$, $\Delta(2N)= \Delta(4N)$.
\end{lemma}
\begin{proof}
The simplest proof is by induction, and the assertion is trivial for $N=0$.
 There are eight possible ``short'' diatomic arrays modulo 3:
\begin{equation}
\begin{gathered}
\begin{matrix}
  {s(N)}&&&&{s(N+1)} \\  s(2N)&&s(2N+1)&&s(2N+2) \\
  s(4N)&s(4N+1)&s(4N+2)&s(4N+3)&s(4N+4)
\end{matrix} = \\
\begin{matrix}
0&&&&1\\0&&1&&1\\0&1&1&2&1
\end{matrix}\quad\Bigg\vert\Bigg\vert\quad
\begin{matrix}
0&&&&2\\0&&2&&2\\0&2&2&1&2
\end{matrix}\quad \Bigg\vert\Bigg\vert\quad
\begin{matrix}
1&&&&0\\1&&1&&0\\1&2&1&1&0
\end{matrix}\quad\Bigg\vert\Bigg\vert\quad
\begin{matrix}
1&&&&1\\1&&2&&1\\1&0&2&0&1
\end{matrix}  \\
\begin{matrix}
1&&&&2\\1&&0&&2\\1&1&0&2&2
\end{matrix} \quad\Bigg\vert\Bigg\vert\quad
\begin{matrix}
2&&&&0\\2&&2&&0\\2&1&2&2&0
\end{matrix} \quad\Bigg\vert\Bigg\vert\quad
\begin{matrix}
2&&&&1\\2&&0&&1\\2&2&0&1&1
\end{matrix} \quad\Bigg\vert\Bigg\vert\quad
\begin{matrix}
2&&&&2\\2&&1&&2\\2&0&1&0&2
\end{matrix}
 \end{gathered}
\end{equation}
By counting the elements in the rows mod 3 in each case,
we see that  $\Delta(2N+2) - \Delta(2N) =
\Delta(4N+4) - \Delta(4N)$ is equal to:  $1, -1, 2, 0, 1,
-2, -1, 0$, respectively.
\end{proof}
\begin{theorem}
For all $n$, $\Delta(n) \in \{0,1,2,3\}$. More specifically,
\begin{equation}
\begin{gathered}
S_3(m) = (0,1) \implies \Delta(2m) = 0,\ \Delta(2m+1) =0; \\
S_3(m) = (0,2) \implies \Delta(2m) = 3,\ \Delta(2m+1) =3; \\
S_3(m) = (1,*) \implies \Delta(2m) = 1,\ \Delta(2m+1) =2; \\
S_3(m) = (2,*) \implies \Delta(2m) = 2,\ \Delta(2m+1) =1.
\end{gathered}
\end{equation}
\end{theorem}
\begin{proof}

To prove the theorem, we first observe that it is correct for $m \le
4$. We now assume it is true for $m \le
2^r$ and prove it for $2^r \le m < 2^{r+1}$. There are sixteen
cases: $m$ can be even or odd and there are 8 choices for $S_3(m)$.
As a representative example, suppose $S_3(m) = (2,1)$. We shall
consider the cases $m=2t$ and $m=2t+1$ separately. The proofs for the
other seven choices of $S_3(m)$ are very similar and are omitted.

Suppose first that $m=2t < 2^{r+1}$. Then $S_3(m) = S_3(2t) = (2,1)$, hence
$S_3(t) = (2,2)$. We have $\Delta(2m) = 2$ by hypothesis, and hence
$\Delta(4m) = 2$ by Lemma 5.5. The eighth array in (5.19) shows that
$s(4t) \equiv 2$ mod 3, so that $\Delta(4m+1) = \Delta(4m) - 1 = 1$,
as asserted in (5.20).

If, on the other hand, $m=2t+1 < 2^{r+1}$ and  $S_3(m) = S_3(2t+1) = (2,1)$,
then $S_3(t) = (1,1)$. We now have $\Delta(2t) = 1$ and $\Delta(2t+1)
=2$ by hypothesis and $\Delta(4t) = 1$ by Lemma 5.5. The fourth array
in (5.19) shows that $(s(4t),s(4t+1),s(4t+2)) \equiv (1,0,2)\text{ mod
}3$. Thus, it follows that $\Delta(2m) = \Delta(4t+2) = \Delta(4t) + 1
+ 0 =2$ and
 $\Delta(2m+1) = \Delta(4t+3) =  \Delta(4t+2)-1 = 1$, again as desired.
\end{proof}

Since $S_3(m)$ is uniformly distributed on $\mathcal S_3$, (5.20)
shows that $\Delta(n)$ takes the values $(0,1,2,3)$ with limiting
probability $(\frac 18, \frac 38, \frac 38, \frac 18)$.

We conclude with a few words about the results announced at the end of the
first section, but not proved here. For each $(d,i)$, $T(2^r;d,i)$ will
satisfy a recurrence whose characteristic equation is a factor of the
minimal polynomial of $\mathcal S_d$. It happens that $T(2^r;4,0) =
T(2^r;5,0)$ for small values of $r$ and both
satisfy the recurrence with characteristic polynomial
$T^4-2T^3+T^2-4$ (roots: $2,-1,-\tau, -\bar\tau$)
so that equality holds for all $r$. The same
applies to  $T(2^r;6,0) = T(2^r;9,0) = T(2^r;11,0)$, with a more
complicated recurrence.
Results similar to Lemma 5.5 and Theorem 5.6 hold for $d=4$, with a
similar proof;
Antonios Hondroulis has shown that this is also true for $d=6$. No result
has been found yet for $d=5$, although a Mathematica check for $N \le
2^{19}$ shows that $-5 \le T(N;5,1) - T(N;5,4) \le 11$. These topics
will be discussed in greater detail in \cite{rez2}.

\bibliographystyle{amsalpha}

Number Theory (math.NT); Combinatorics (math.CO)


Deficient and multiple points of maps into a manifold

Abstract: For a map $f:X \to M$ into a manifold $M$, we study the sets of deficient and multiple points of $f$. In case of the set of deficient points, we estimate its dimension. For multiple points, we study its density in $X$, and we also provide examples where its complement is dense.

\section{Introduction}

P.~T.~Church and J.~G.~Timourian in \cite{CT} studied the deficient points of maps between manifolds.
\red{For} a map $f: M \to N$ between manifolds of same dimension, a point $y\in N$ is called deficient if the pre-image of
$y$ has less then $A(f)$ points, where $A(f)$ denotes the Hopf's absolute degree of $f$. Related to the notion of deficient point, there is the notion of multiple point of a map. A point $x \in X$ is a multiple point of a map $f: X \to Y$ if $f^{-1}(f(x))\neq \{x\}$, otherwise $x$ is called a single point. The present work extends some results about deficient and multiple points in the literature, which we will describe in more detail.

By {\it dimension of a space $X$ we mean the  covering dimension},
which sometimes is called  topological dimension (see  \cite{HW} and \cite{Engelking}). The following result was proved by P.~T.~Church and J.~G.~Timourian in \cite{CT}.

\begin{theorem}[Theorem 1.1, 2.7, 3.3 and 3.4 \cite{CT}]  \label{theoremCT}
Suppose $M$ and $N$ are oriented connected $n$-manifolds and $f: M \to N$ is a proper map  with degree $\deg f \ne 0$.
Let $E_f$ be the set of points $y \in N$ for which $f^{-1}(y)$ is discrete and has less than $|\deg f|$ essential points.
\begin{enumerate}

\item[\rm(1)] Then $\dim E_f \le n-1$ and, moreover, $E_f$ contains no closed (in $N$) subset of dimension $n-1$.

\item[\rm(2)] If $f$ is discrete (i.e., each $f^{-1}(y)$ is discrete), then $\dim (\overline{E}_f) \le n-2$.

\end{enumerate}
\end{theorem}

In the same paper, the authors generalized this theorem to manifolds which are not necessarily orientable replacing
$|\deg f|$ by Hopf's absolute degree $A(f)$ (c.f., 5.13 \cite{CT}).

We extend the notion of absolute degree and essentially deficient points for maps $f: X \to M$ into manifolds, with $X$ not necessarily a manifold.
Then we prove a result, Theorem 2.11, which extends Theorem \ref{theoremCT}, where $X$ \red{no longer is assumed} to be  a manifold but it satisfies certain cohomological property.

In a study about multiple points of maps between manifolds,  D. L. Gon\c{c}alves proved the following.

\begin{theorem}[\cite{GonOre}, Theorem 2.2]  Let $M,N$ be manifolds of same dimension, $M$ closed. Let $[f]$  be the    homotopy class of  a    map $f:M \to N$.
\begin{itemize}
 \item[a$)$] If the absolute  degree of the map  $f$ is  $1$, then there is a   map $g\in [f]$  such
 that the set of  multiple   points  is not dense in $M$.
 \item[b$)$]  If $A(f)\ne1$ then the set of multiple points of $f$ is dense.
  \end{itemize}

\end{theorem}

The above theorem follows from properties of the Hopf's absolute degree found in the paper of Epstein \cite{Epstein}. Namely, item (a) follows from Hopf's theorem [\cite{Epstein}, Theorem 4.1] and item (b) follows from [\cite{Epstein}, Lemma 2.1a and Theorem 3.1].  We prove Theorem \ref{dominating} which generalizes the item (b) of the above theorem. In this theorem we consider maps from $X$ into $M$ for  certain CW-complex $X$, which are not necessarily manifold.
We also prove another result, Theorem \ref{theorem1}, for a different family of CW-complex, under different hypotheses. A family of complexes which are not manifolds satisfying hypotheses of Theorem \ref{theorem1} is explicitly given.

S. Orevkov gave in  \cite{GonOre} an example of a map $f: S^2 \to \Bbb{R}^2$ for which the set of single points (the complement of the set of multiple points) is dense in $S^2$.  We mimic his example   to show that in many cases one can construct maps where the set of single points is large, namely it is dense. See   Corollary \ref{corol4.6} and Remark 4.6.

The present work contains 3 sections besides the introduction. In section 2,  we estimate the dimension of the set of essentially deficient points. The main results of the section are Propositions 2.8, \ref{prop2} and Theorem \ref{maintheorem}.  Then, in section 3, we consider the study of multiple points, as well single points.  In this case, the results deal with the existence of maps where the set of multiple points is dense.  The main results are Theorem 3.1 and Theorem 3.3. Finally,  in section 4, we show that in many cases one can construct maps where the set of single points is dense. The main results are  Theorem 4.2 and Corollary 4.5.

\section{Deficient points}

In this section, we assume $X$ a connected,  locally path-connected, locally compact  $n$-dimensional paracompact Hausdorff space,
$M$ an $n$-manifold  without boundary and $f: X \to M$  a proper map.
By  $\mathcal{G}$ we denote  the orientation system (over $\Bbb{Z}$) on $M$ and by  $\mathcal{G}_f$  the local system on $X$  induced by $\mathcal{G}$ and $f$.
We consider \u{C}ech cohomology groups with local coefficients and with compact carriers.

\subsection{Local degree, essential points}

Suppose  that $x\in X$  is an isolated point of the set $f^{-1}(f(x))$,
i.e., $x \notin \overline{f^{-1}(f(x))\setminus \{x\}}$.
Then there is a compact set $V \subset X$  such that  $x \in \operatorname{int} V$  and $V \cap f^{-1}(f(x)) = \{x\}$.

Consider the following diagram

\begin{table}[h]
\centering
\begin{tabular}{c} \xymatrix
{
 H^{n} (X;\mathcal{G}_f)  &  H^n(X, X \setminus \{x\};\mathcal{G}_f) \ar[l]_{\hspace{-.6cm}H^{n}(i)} \ar[r]^{\hspace{-.2cm}H^{n}(j)} &
H^n(V,V \setminus \{x\};\mathcal{G}_f |V)  \\
  & H^n(M;\mathcal{G})   & \ar[l]^{\hspace{-.6cm}H^{n}(i')} H^n(M, M \setminus \{f(x)\};\mathcal{G})  \ar[u]^{H^n(f|V)}
}
\end{tabular}
\end{table}

\noindent
where  $i$ and $i'$ are the inclusions, $f|V$ is the restriction of $f$ and $H^n(j)$ is the excision isomorphism.
Note that the composition $(H^n(j))^{-1} \circ H^n(f|V)$ does not depend on the choice of $V$.

Let  $g_M$ be a generator of $H^n(M;\mathcal{G})$.
 The image
$$ \text{d}_x f : =  \big( H^n(i) \circ (H^n(j))^{-1} \circ H^n(f|V) \circ  (H^n(i'))^{-1} \big) (g_M) \in  H^{n} (X;\mathcal{G}_f) $$
we call {\it the local twisted degree element} of $f$ at $x$.

 We say that $x$ is {\it an essential point} of $f$  if  $\text{d}_x f$ is non-zero.
The set of essential points of $f$ is denoted by $X_f$.

The following two lemmas are consequences of the excision and the Mayer-Vietoris sequence.

\begin{lemma}[cf., Lemma 2.3 \cite{CT}] \label{degree}
Suppose  for some $y \in M$,  $f^{-1}(y)$ is discrete (so finite  since $f$ is proper).
Then
$$H^n(f)(g_M) = \sum_{x \in  f^{-1}(y)}  \text{d}_x f  =  \sum_{x \in  f^{-1}(y) \cap X_f }  \text{d}_x f   \ . $$
In particular, if $f^{-1}(y) \cap X_f = \{$x$\}$ then $H^n(f)(g_M) =  \text{d}_x f$.
\end{lemma}

\begin{lemma}\label{local_degree}
Let $B$ be an $n$-ball in $M$ with $y \in \operatorname{int} B$, and $V$ a component of $f^{-1}(\operatorname{int} B)$ such that $f^{-1}(y)\cap V=\{x\}$.
Then, for any $z \in \operatorname{int} B$ with  $f^{-1}(z)\cap V$ finite  we have
$$\text{d}_x f = \sum_{x' \in  f^{-1}(z) \cap V}  \text{d}_{x'} f  =
 \sum_{x' \in  f^{-1}(z) \cap V \cap X_f }  \text{d}_{x'} f   $$
and, consequently,  $f^{-1}(z) \cap V \cap X_f \ne \emptyset$ if  $x$ is essential.
\end{lemma}
\begin{proof}
Let  us consider the following diagram:

\begin{table}[h]
\centering
\begin{tabular}{c} \xymatrix
{
 H^{n} (X;\mathcal{G}_f)  &  H^n(X, X \setminus V;\mathcal{G}_f) \ar[l]_{\hspace{-.6cm}H^{n}(i_V)} \ar[r]^{\hspace{-.2cm}H^{n}(j_V)} &
H^n(\overline{V},\overline{V} \setminus V;\mathcal{G}_f|\overline{V}) \\
  & H^n(M;\mathcal{G})   & \ar[l]^{\hspace{-.6cm}H^{n}(i_B)} H^n(M, M \setminus \operatorname{int} B;\mathcal{G})  \ar[u]^{H^n(f|\overline{V})}  \, ,
}
\end{tabular}
\end{table}

\noindent
where  $H^{n} (i_V))$  and  $ H^{n}(i_B)$  are the homomorphisms induced by the inclusions,
$H^{n} (j_V)$ is the excision isomorphism and $H^n(f|\overline{V})$ is the homeomorphism induced by
the restriction $f|\overline{V}$ of $f$.
One can show that
$$
\text{d}_x f =  \big( H^n(i_V) \circ (H^n(j_V))^{-1} \circ H^n(f|\overline{V}) \circ  (H^n(i_B))^{-1} \big) (g_M).
$$
The assertion of the lemma is  a consequence of the above equality.
\end{proof}

\begin{remark}\label{rem_cov} If  $p: \widetilde{M} \to M$ is a covering
and $\widetilde{f} : X \to  \widetilde{M}$ a lifting of $f$ then
\begin{enumerate}
\item[{\rm(a)}] $X_f=X_ {\widetilde{f}}$,
\item[{\rm(b)}] the local system $\mathcal{G}_p$  induced by $\mathcal{G}$ and $p$ is an orientation  system  on $\widetilde{M}$,
\item[{\rm(c)}] the local system  induced by  $\mathcal{G}_p$ and $\widetilde{f}$
  coincides with the local system $\mathcal{G}_f$, and
\item[{\rm(d)}] if $x \in X$ is an isolated point of $f^{-1}(f(x))$
then it is an  isolated point of $\widetilde{f}^{-1}(\widetilde{f}(x)) \subset X$ and
$\text{d}_x f = \text{d}_x \widetilde{f}$.
\end{enumerate}
\end{remark}

\subsection{Essentially deficient points}

We say that a point  $y \in M$  is {\it essentially $k$-deficient}  if $f^{-1}(y)$ is discrete and has fewer than $k$ essential points.
The set of all such points we denote by $E_{k,f}$, i.e.,
$$E_{k,f} = \{  y \in M : f^{-1}(y)\ {\rm  is \  discrete \ and} \  |f^{-1}(y) \cap X_f| <k \}. $$

\begin{remark}\label{max}
Let $T$ be an open subset in $M$ and suppose that $f^{-1}(y)$ is discrete for some $y \in T$.
 Then there exists an $n$-ball $B \subset T$ with $y \in \operatorname{int} B$ such that each component  of $f^{-1}(\operatorname{int} B)$
 contains at most one point of $f^{-1}(y)$.
In this case,   the   component  of $f^{-1}(\operatorname{int} B)$  containing $x\in f^{-1}(y)$  we denote  by $V_x$.
\end{remark}

The following lemma  is a modification of  Lemma 2.6 \cite{CT} and its proof  follows similar arguments.

\begin{lemma}\label{main}
Let $T$ be open in $M$, and let $A \subset E_{k,f} \cap T$ be nonempty.
Then there exists $y \in A$ such that, with the $B \subset T$ and $\{V_x\}_ {x \in f^{-1}(y)}$  as in Remark \ref{max},
we have:
\begin{enumerate}
\item[{\rm(1)}] $ X_f \cap f^{-1} (A \cap \operatorname{int} B ) \subset  \bigcup_{x \in f^{-1}(y) \cap X_f} V_x$,
\end{enumerate}
and for each $x \in f^{-1}(y) \cap X_f$
\begin{enumerate}
\item[{\rm(2)}]  the map $f_x : V_x \cap  X_f \cap f^{-1}(A) \to A \cap \operatorname{int}  B $ induced by $f$
is a homeomorphism, and
\item[{\rm(3)}] $V_x \cap  X_f \cap f^{-1}(A) $  is closed in $f^{-1}(A \cap \operatorname{int} B)$.
\end{enumerate}
\end{lemma}

\begin{proof}
 For each $y \in A$, $ f^{-1}(y)$ is finite and has $m(y)$
essential points, where $m(y) < k$.
Choose $y$ such that $m(y)$ is maximal.
Let $B \subset T$ and $ \{V_x\}_{x \in f^{-1}(y)}$  be as given by \ref{max}.
Then, by Lemma \ref{local_degree}, for each  $x \in f^{-1}(y) \cap X_f$ and for each $z \in A \cap \operatorname{int} B$, $f^{-1}(z)  \cap V_x$ has at least one essential point.
Thus, by the maximality property of $y$, we obtain
\begin{enumerate}
\item[{\rm (a)}] if  $x \in f^{-1}(y) \cap X_f$  and  $z \in A \cap \operatorname{int} B$  then $f^{-1}(z)  \cap V_x$
has exactly one essential point, and
\item[{\rm (b)}]  if  $x \in f^{-1}(y) \setminus X_f$ then $V_x \cap X_f = \emptyset$.
\end{enumerate}
Observe that (b) implies (1).

For each $x \in f^{-1}(y) \cap X_f$,   the function  $f_x : V_x \cap  X_f \cap f^{-1}(A) \to  A \cap \operatorname{int}  B$ in (2)
is continuous and by (a),  bijective .
Now, we show that  its inverse $g_x$ is continuous.
Take $z \in A \cap \operatorname{int} B$  and an arbitrary open neighborhood $W$ of $g_x(z)$ in $V_x$.
Then there exists an open $n$-ball  $D \subset \operatorname{int} B$ with $z \in  D$ such that the component $V$ of $f^{-1}( D)$
containing $g_x(z)$  is contained in $W$.
Since $g_x(z) \in X_f$, then one can observe that the homomorphism
$$
  H^n(V, V \setminus \{g_x(z)\};\mathcal{G}_f|V) \leftarrow  H^n(D, D \setminus \{z\};\mathcal{G}|D)
$$
induced by $f|V$  is nontrivial.  Thus $f(V)=\operatorname{int} D$.
Thus $g_x(A \cap \operatorname{int} D) = V \cap X_f \cap f^{-1}(A) \subset  W \cap X_f \cap f^{-1}(A)$.
It follows that $g_x$ is continuous, which proves (2).

By (2) there is a retraction of $f^{-1}(A \cap \operatorname{int} B)$ onto   $V_x \cap  X_f \cap f^{-1}(A)$, so (3) follows.
\end{proof}

\begin{corol}\label{cor1}
Suppose that $\dim E_{k,f}=n$ and let $T$ be an open nonempty  subset of $M$ contained in $ E_{k,f}$.
Then there exists $y \in T$ such that, with the $B \subset T$ and $\{V_x\}_ {x\in f^{-1}(y)}$  as in Remark \ref{max},
we have:

\begin{enumerate}
\item[{\rm(1)}] $ X_f \cap f^{-1}  ( \operatorname{int} B ) \subset  \bigcup_{x \in f^{-1}(y) \cap X_f} V_x$,
\end{enumerate}
and for each $x \in f^{-1}(y) \cap X_f$
\begin{enumerate}
\item[{\rm(2)}]  $f_x : V_x \cap  X_f  \to \operatorname{int}  B $ induced by $f$ is a homeomorphism, and
\item[{\rm(3)}]  $V_x \cap  X_f $  is closed in $V_x$.
\end{enumerate}
\end{corol}

\begin{lemma}[cf., Lemma 2.5 \cite{CT}] \label{discrete}
If $f$ is discrete then $E_{k,f}$ is closed.
\end{lemma}
\begin{proof}  Take an arbitrary $y \in M \setminus E_{k,f}$.
Since $f$ is discrete, there is an $n$-ball $B$ in $M$ with $y \in \operatorname{int} B$ and such that each component of $f^{-1} (\operatorname{int} B)$ contains at most one point of $f^{-1}(y)$.
By $V_x$ we denote the component of $f^{-1}(\operatorname{int} B)$ containing $x\in f^{-1}(y)$.
By Lemma \ref{local_degree}, given $z\in \operatorname{int} B$, for each essential point $x\in f^{-1}(y)$, $f^{-1}(z)\cap V_x \cap X_f \neq \emptyset$.
Hence, for each $z\in \operatorname{int} B$, $|f^{-1}(z) \cap X_f| \ge |f^{-1}(y) \cap X_f| \ge k$, so  $\operatorname{int} B \subset M \setminus E_{k,f}$.
Thus  $ M \setminus E_{k,f}$ is open, which proves the lemma.
\end{proof}

\subsection{Twisted degree} \label{twist}

From now, we additionally assume  that  $H^n(X;\mathcal{G}_f)$ is either an infinite cyclic group or a cyclic group of order 2.

Let  $g{_X}$ be a fixed generator of $H^n(X;\mathcal{G}_f)$.
Then {\it the twisted degree} of $f$  is the integer $\deg f$ such that
$$(H^n(f))(g_M) =( \deg f) g_X  ,$$ where in case  $H^n(X;\mathcal{G}_f)$ is the cyclic group of order 2, we let $\deg f$ be $0$ or $1$.

For $x \in X$, let  $k_x$ be the index  of the image of  $H^{n}(i)$ in the group $ H^{n} (X;\mathcal{G}_f)$,
where  $H^{n}(i): H^n(X, X \setminus \{x\};\mathcal{G}_f) \to H^{n} (X;\mathcal{G}_f)$ is the homomorphism induced by the inclusion,  if such homomorphism is non-trivial; otherwise, let $k_x=0$.

Then, by $k_f$ we denote  the maximum of $k_x$  over all   $x \in X$.
\medskip

We also assume that $p: \widetilde{M} \to M$ is a covering  with a finite number $j$ of sheets and
that $\widetilde{f} : X \to  \widetilde{M}$ is a lifting of $f$.

\begin{lemma}\label{lemma_cov}
Suppose  $k_f>0$ and let $y \in E_{k,f}$, where  $k = j \cdot |\deg {\widetilde{f}}| / k_f$.
Then there exists $x \in f^{-1}(y) \cap X_f$ such that $|\text{d}_x f| > k_f$.
\end{lemma}

\begin{proof}
Let $p^{-1}(y)=\{ {\widetilde{y}}_1, \cdots,  {\widetilde{y}}_j\}$.
Then ($\ast$)
$
f^{-1}(y)= \bigcup_{i\in\{1, \ldots , j\}}   {\widetilde{f}}^{-1}( {\widetilde{y}}_i)
$
and each  ${\widetilde{f}}^{-1}( {\widetilde{y}}_i)$ is finite as $ f^{-1}(y)$ is finite.
\smallskip

By Lemma \ref{degree}, for each $i \in \{1, \ldots , j\}$ we have
$$
|\deg   \widetilde{f}|=
\Big|\sum_{x \in  \widetilde{f}^{-1}( {\widetilde{y}}_i) \cap X_{{\widetilde{f}} } }  \text{d}_x {\widetilde{f}} \Big|  \le
  \sum_{x \in  {{\widetilde{f}}}^{-1}( {\widetilde{y}}_i) \cap X_{{\widetilde{f}}} }  |\text{d}_x {\widetilde{f}}| \ .
$$
Thus, by ($\ast$) and  Remark \ref{rem_cov} (a),
$ j \cdot |\deg   {\widetilde{f}}| \le
  \sum_{x \in  f^{-1}( y) \cap X_f}  |\text{d}_x {\widetilde{f}}|$.
Consequently, as  $k = j \cdot |\deg {\widetilde{f}}| / k_f$ and $y \in E_{k,f}$, we obtain
$$
 |f^{-1}( y) \cap X_f| \cdot  k_f  <
  \sum_{x \in  f^{-1}( y) \cap X_f}  |\text{d}_x {\widetilde{f}}| \ .
$$
So, $ k_f < |\text{d}_x {\widetilde{f}}| $ for some $ x \in  f^{-1}( y) \cap X_f $ and the conclusion follows since $d_xf = d_x \tilde{f}$ by Remark \ref{rem_cov} (d).
\end{proof}

\subsection{Dimensional properties of the set $E_{k,f}$ }

\begin{dfn} We say that a point of  a space  $X$ is $n${\it -Euclidean} if it has a neighborhood in $X$ homeomorphic to $\Bbb{R}^n$. By $\mathcal{E}_n(X)$ we denote the set of all $n$-Euclidean points of $X$.
Note that  $\mathcal{E}_n(X)$ is an open subset  of $X$.

\end{dfn}

Let $k_f$ be positive  and  let $k := j \cdot |\deg {\widetilde{f}}| / k_f$.

\begin{prop} [cf., Proposition 2.7 \cite{CT}]\label{prop1}
 If $\dim (X \setminus \mathcal{E}_n(X)) < n$ then  $\text{dim} \, E_{k,f} \leq n-1$.
\end{prop}

\begin{proof}
Suppose $\text{dim} \, E_{k,f} =n$. Then there is an open subset $T$ of $M$ contained in $E_{k,f}$.
Let $y \in T$,  $B \subset T$ and $\{V_x\}_{x \in f^{-1}(y)}$ be given as in
Corollary \ref{cor1}.

By (2) \ref{cor1}, for each $x \in f^{-1}(y) \cap X_f$, $f$ maps homeomorphically $V_x \cap X_f$ onto the open $n$-ball $\operatorname{int} B$.
Since  $\dim (X \setminus \mathcal{E}_n(X)) < n$,  it follows that $V_x \cap X_f \cap \mathcal{E}_n(X)$
is a non-empty open subset of $V_x \cap X_f \approx \operatorname{int} B$.
It follows that any $x'\in V_x \cap X_f \cap \mathcal{E}_n(X)$, we have $|d_{x'}f| \le k_f$.
Note  also that, $f^{-1}(f(x'))\cap V_x \cap X_f = \{x'\}$,  so $d_x f=d_{x'} f$, by Lemma \ref{local_degree}.
Thus $|d_{x}f| \le k_f$  for each $x \in f^{-1}(y) \cap X_f$, which contradicts  \ref{lemma_cov}.
So,  $\text{dim} \, E_{k,f} \le n-1$.
\end{proof}

\begin{prop} \label{prop2}
$ E_{k,f} $ does not contain a closed (in $M$) subset $F$ of dimension $n-1$ and disjoint with $\overline{f(X \setminus \mathcal{E}_n(X))}$.
\end{prop}

\begin{proof}
Suppose in contrary,
$ E_{k,f} $ contains  a closed (in $M$) subset $F$ of dimension $n-1$  disjoint with $\overline{f(X \setminus \mathcal{E}_n(X))}$.
Let $S$ be a closed (in $M$) subset of $F$  such that
\begin{enumerate}
\item[{\rm(a)}] for every open  $W \subset M$ with $S \cap  W \ne \emptyset$,   $\dim (S \cap  W) = n-1$.
\end{enumerate}

Let $T$ be an  open subset of $M$ with $S \cap  T \ne \emptyset$, and let $A = S \cap  T$.
By Lemma \ref{main}, there exists $y \in A$ such that,  with the $B \subset T$ and $\{V_x\}_ {x \in f^{-1}(y)}$  as in \ref{max},
for each $x \in f^{-1}(y) \cap X_f$ the conditions (1), (2) and (3) in  \ref{main} are satisfied.

Since $f^{-1}(A) \subset \mathcal{E}_n(X)$, we may choose the $n$-ball $B$ (with $y \in \operatorname{int} B$) so small that  $f^{-1}(B) \subset \mathcal{E}_n(X)$,
and moreover, that  each $V_x$  (a component of  $f^{-1}(\operatorname{int} B)$) is a connected  oriented $n$-manifold.
Thus each  $f_x : V_x \to \operatorname{int} B$, being the restriction of $f$,  is a proper map between oriented connected $n$-manifolds.

By Lemma \ref{lemma_cov}, there exists $x_0 \in f^{-1}(y) \cap X_f$ such that $|\text{d}_{x_0} f| > k_f$.
It follows that $|\deg  f_{x_0}| >1$.
Then, one can observe that $E_{f_{x_0}}$,  as defined in Theorem \ref{theoremCT},  contains $A$, a closed subset of $\operatorname{int} B$ of dimension $n-1$.
This contradicts  Theorem \ref{theoremCT},  which completes the proof.
\end{proof}

\begin{corol} \label{prop3}
If $f$ is discrete then $\dim \big(E_{k,f} \setminus \overline{f(X \setminus \mathcal{E}_n(X))}\big) \le n-2$.
\end{corol}
\begin{proof}
Let $\{U_i\}_{i=1}^\infty$ be a countable family of open subsets of $M$  such that $\bigcap U_i = \overline{f(X \setminus \mathcal{E}_n(X))}$.
Each $E_{k,f} \setminus U_i$, by Lemma \ref{discrete}, is  closed, so by Proposition \ref{prop2},  $\dim \big(E_{k,f} \setminus U_i ) \le n-2$.
Since $ E_{k,f} \setminus \overline{f(X \setminus \mathcal{E}_n(X))}$  is a union of a countable number of closed subsets $ (E_{k,f} \setminus U_i)$ of dimension $\le n-2$, we obtain that  $\dim \big(E_{k,f} \setminus \overline{f(X \setminus \mathcal{E}_n(X))}\big) \le n-2$.
\end{proof}

\subsection{Absolute degree and the main theorem } \label{absolute} Let
 $p: \widetilde{M} \to M$ be the covering  such that there is a lifting of $f: X \to M$ to $\widetilde{f} : X \to \widetilde{M}$
and that there is no covering of $\widetilde{M}$ with this property.
Note that  the homomorphism $\widetilde{f}_{\ast} : \pi_1 X \to \pi_1\widetilde{M}$ is onto.
Let $j= | \pi_1 M :f_{\ast}\pi_1 X|$.
Then  $p: \widetilde{M} \to M$ has $j$ sheets.

{\it The absolute degree} $A(f)$ of $f$  is the integer $|\deg \widetilde{f}| \cdot j$ if $j$ is finite
and it is $0$ if  $j$ is infinite.
If $X$ is a closed $n$-dimensional manifold  this notion coincides with the Hopf's absolute degree, see \cite{Olum} (16.5) and (17.7).

A point $y \in M$ is called {\it essentially deficient with respect} to $f$  if $f^{-1}(y)$ is discrete and
$|f^{-1}(y) \cap X_f| \cdot  k_f <  A(f)$. As in Lemma \ref{lemma_cov} and in Proposition \ref{prop1},  we assume $k_f$ positive.
The set of all essentially deficient  points (with respect to $f$)   is denoted by $E_f$, i.e.,
$$ E_f = \{y \in M :  |f^{-1}(y)| < \infty \ {\rm and} \  |f^{-1}(y) \cap X_f| \cdot  k_f <  A(f) \} \ .$$
Observe that if $k_f>0$ then $E_f=E_{k,f}$, where $k$ is the smallest integer greater than or equal to $A(f)/k_f$.

\medskip

By Proposition \ref{prop1},  Proposition \ref{prop2} and  Corollary \ref{prop3} we obtain

\begin{theorem}[cf., Propostion 5.13 \cite{CT}] \label{maintheorem}
Suppose that $A(f) \ne 0$ and $k_f>0$. Then
\begin{enumerate}
\item[{\rm(1)}]  If $\dim (X \setminus \mathcal{E}_n(X)) < n$ then  $\text{dim} \, E_f \leq n-1$.
\item[{\rm(2)}] $ E_f $ does not contain a closed (in $M$) subset $F$ of dimension $n-1$
                and disjoint with $\overline{f(X \setminus \mathcal{E}_n(X))}$, and
\item[{\rm(3)}] If $f$ is discrete then $\dim \big(E_f \setminus \overline{f(X \setminus \mathcal{E}_n(X))}\big) \le n-2$.
\end{enumerate}
\end{theorem}

\medskip

\noindent{\bf Example.}
Let $X$ be the space obtained by attaching to $S^1$ two $2$-cells, $e_1^2, e_2^2$, using maps of degree $2$ and $3$, respectively.  Let $S^1 \subset S^2$ be the equator of the sphere $S^2$ and let $f: X \to S^2$ given by: on the $1$-skeleton, $S^{1}$, it is the identity.  On $e_1^2$ it covers the north hemisphere and it is given by a map of the type $z \mapsto z^2$, and on $e_2^2$ it covers the south hemisphere and it is a map of the type $z \mapsto z^3$.
Then, $k_f=3$, $A(f)=6$ and $$E_f = \{ (x,y, 0) \in S^2\} \cup \{ (0,0,1), (0,0,-1)\}.$$ Hence, in this example, $\text{dim} \, E_f=1$.
This shows that the assumption in  Theorem \ref{maintheorem} (2), that $F$  is disjoint with $\overline{f(X \setminus \mathcal{E}_n(X))}$, is essential.

\section{Multiple points of maps on  a  complex}

 Recall that a point $x\in X$ is a multiple point of a function $f:X \to Y$ if $f^{-1}(f(x))\neq \{x\}$. We provide two results. The first result is in subsection 3.1, for maps $f: X \to M$ where $X$ and $M$ satisfies the hypotheses of the previous section.  In subsection 3.2, we will consider maps $f: X \to M$ for $X$ a more general space.

\subsection{Multiple points }

 We say that $X$ is {\it locally non-trivial with respect to a local system $\mathcal H$}  over $X$,  if the homomorphism $H^{n}(i): H^n(X, X \setminus \{x\};\mathcal H) \to H^{n} (X;\mathcal H)$ induced by the inclusion  is nontrivial for each $x \in X$.
\medskip

Let $f:X \to M$, $\mathcal{G}$ and $\mathcal{G}_f$ be as in Section 2.

\begin{theorem}\label{dominating}
Suppose that $X$  is locally non-trivial with respect to $\mathcal{G}_f$ and that the set of multiple points of $f$ is not dense in $X$.
Then $f_{\ast} : \pi_1 X \to \pi_1 M$ is onto
and $A(f)=|\deg f|$.  Consequently, $0 < A(f) \le k_f $.
\end{theorem}
\begin{proof} Since $\mathcal{M}(f)$, the set of multiple points of $f$, is not dense in $X$ there exists an open subset  $V$ of $X$ of single points.
Let $x\in V$.
Then, there exists a neighborhood $U$ of $f(x)$ such that $f: f^{-1}(U) \to U$ is a homeomorphism.

It follows that $f^{\ast} : H^n(M, M \setminus \{f(x)\}; \mathcal{G}) \to H^n(X, X \setminus \{x\}; \mathcal{G}_f)$ is an isomorphism. From the assumption that $X$ is locally non-trivial, we have that $H^{n}(i): H^n(X, X \setminus \{x\};\mathcal{G}_f) \to H^{n} (X;\mathcal{G}_f)$ is non-trivial. Thus, by the commutativity  of the diagram

\begin{table}[h]
\centering
\begin{tabular}{c} \xymatrix{ H^n (X, X \setminus \{x \}; \mathcal{G}_f)   \ar[r]^{\  \  \  \neq 0}& H^n(X; \mathcal{G}_f)  \\
H^n(M, M \setminus \{f(x)\}; \mathcal{G})  \ar[r]^{\  \  \  \  \ \simeq}   \ar[u]_{\simeq} & H^n(M, \mathcal{G}) \ar[u]}
\end{tabular}
\end{table}
\noindent  it follows that $f^{\ast} : H_n(M;\mathcal{G}) \to H^n(X,\mathcal{G}_f)$ is a non-trivial homomorphism.
Note also that \\
(i)  \ \ \  $  \,   |d_xf| = |k_x| > 0$.

Let $p: \widetilde{M} \to M$ be the covering  such that there is a lifting of $f: X \to M$ to $\widetilde{f} : X \to \widetilde{M}$
and that there is no covering of $\widetilde{M}$ with this property.

Since $f^{\ast}: H^n(M; \mathcal{G}) \to H^n(X, \mathcal{G}_f)$ is non-trivial and $f= p \circ \widetilde{f}$, $\widetilde{f}^{\ast}: H^n(\widetilde{M}; \widetilde{\mathcal{G}}) \to H^n(X; \mathcal{G}_f) $ is non-trivial. Therefore, $\widetilde{f}$ is surjective.
Thus, since  $f: f^{-1}(U) \to U$  is a bijection, $p$ is the identity.
Hence,  $f_{\ast} : \pi_1 X \to \pi_1 M$ is onto and \\
(ii) \ \   $A(f)=|\deg f|$.

By Lemma \ref{degree}, $|\deg f|= |d_x f|$.  Thus, by  (i) and  (ii), we obtain  $0 < A(f) \le k_f $.
\end{proof}

\begin{remark}  Note that the above theorem generalizes Theorem 2.1 b) of \cite{GonOre} because, in case of $X$ a manifold, $k_f=1$.

\end{remark}

\bigskip

\subsection{Case of  more general complexes}

In this subsection, by $H$ we denote the \u{C}ech cohomology functor with integer coefficients.

\

\begin{dfn} A space $X$ has dimension $\geq n$ at a point $x\in X$ if each neighborhood of $x$ $($in $X$$)$ has dimension $\geq n$. If, in addition, some neighborhood of $x$ has dimension $n$ then we say that $X$ has dimension $n$ at $x$.

\end{dfn}

\begin{theorem}\label{theorem1} Let $X$ be a compact metric space with dimension $n$ at each point. Then the following conditions are equivalent:
\begin{enumerate}
\item[a)] There is a map $f: X \to M$ from $X$ into a   $n$-manifold such that the induced homomorphism $H^{n}(f): H^n(M) \to H^n(X) $ is null and the set of multiple points $\mathcal{M}(f)$ is not dense in $X$;
\item[b)] $H^{n}(i): H^n(X) \to H^n(X \setminus int \, D^n)$ is an isomorphism for some $n$-disc $D^n \subset \mathcal{E}_n(X)$, where $i : X \setminus int \, D^n  \to X $ is the inclusion.
\end{enumerate}
\end{theorem}

\

Motivated by the above theorem, we define the following:

\begin{dfn} An $n$-dimensional space $X$ is called $n$-tight  if
there is {\bf no} $n$-disc $D^n \subset \mathcal{E}_n(X)$ such that  $H^{n}(i):
H^n(X) \to H^n(X \setminus int \, D^n)$ is an isomorphism,  where $i : X
\setminus int \, D^n  \to X $ is the inclusion.

\end{dfn}

 Theorem \ref{theorem1} is a consequence of the following two lemmas.

\begin{lemma}\label{lemma1} Let $X$ be an $n$-dimensional compact metric space. If there is an $n$-disc $D^n \subset \mathcal{E}_n(X)$ such that $H^{n}(i): H^n(X) \to H^n(X \setminus int \, D^n)$ is an isomorphism then there is a retraction $f: X \to D^n$ such that $f(X \setminus int \, D^n) \subset \partial D^n $.

\end{lemma}

\proof  Consider the following commutative diagram:

\begin{table}[h]
\centering
\begin{tabular}{c} \xymatrix{ H^n (X) \ar[d] & H^n(X, D^n) \ar[l]_{\simeq} \ar[d]_{\simeq} \\
H^n(X \setminus int \, D^n) & H^n(X \setminus int \, D^n , \partial D^n) \ar[l]}
\end{tabular}
\end{table}

\noindent where all homomorphisms are induced by inclusions. Note that the upper horizontal and the right arrows are isomorphisms. Since, by the assumption, the left arrow is also an isomorphism, it follows that the lower horizontal arrow is also an isomorphism. It follows that the coboundary homomorphism $H^{n-1}(\partial D^n) \to H^n(X \setminus int \, D^n, \partial D^n) $ is trivial. Thus, by the Hopf's extension theorem [see \cite{Engelking}, p. 94, (H)], there is a retraction $X \setminus int \, D^n \to \partial D^n$, which completes the proof. \qed

\begin{lemma}\label{lemma2} Let $X$ be a compact metric space of dimension $\geq  n$ at each point, and let $f :X \to M$ be a map into an  $n$-manifold $M$ such that $H^{n}(f): H^n(M) \to H^n(X) $ is null and the set of multiple points $\mathcal{M}(f)$ is not dense in $X$. Then there is an $n$-disc $D^n \subset \mathcal{E}_n(X)$ such that the homomorphism induced by the inclusion $H^{n}(i): H^n(X) \to H^n(X \setminus int \, D^n)$ is an isomorphism.
\end{lemma}
\proof Since $\mathcal{M}(f)$ is not dense in $X$, there is an open set $U \subset X$ such that $f$ maps homeomorphically $U$ onto $f(U)$ and $f^{-1}(f(U)) = U$. Since the dimension of $X$ at each point is $\geq n$, $dim \, U \geq n$. Consequently, $f (U )$ is an $n$-dimensional subset of $M$. By [\cite{Engelking}, Theorem 1.8.10, p. 76], the interior of $f(U)$ in $M$ is non-empty, so $f(U)$ contains an $n$-disc $B^n$. We set  $D^n := f^{-1}(B^n)$. Then $D^n \subset \mathcal{E}_n (X)$. We consider the following commutative diagram:

\begin{table}[h]
\centering
\begin{tabular}{c} \xymatrix{ H^{n-1} (\partial D^n) \ar[r]^{ \  \  \delta^\ast} & H^n(X) \ar[r]^{\hspace{-1.1cm}\vartheta} & H^n(X_D)\oplus H^n(D^n) \ar[r] & H^n(\partial D^n) \\
H^{n-1}(\partial  B^n) \ar[u] \ar[r] & H^n(M) \ar[u]^{H^{n}(f)} &  & }
\end{tabular}
\end{table}

\noindent where $X_D := X \setminus int \, D^n$,  the rows are parts of Mayer-Vietoris exact sequences, and the vertical homomorphisms are induced by the maps defined by $f$.

Since $H^n(\partial D^n) = 0$, $\vartheta$ is an epimorphism. Since $H^{n-1}(\partial B^n) \to H^{n-1}(\partial D^n)$ is an isomorphism and $H^{n}(f): H^n(M) \to H^n(X) $ is null, the homomorphism $\delta^\ast  : H^{n-1}(\partial D^n) \to H^n(X)$ is trivial, thus $\vartheta$ is a monomorphism. So, $\vartheta$ is an isomorphism. Consequently, since $H^n(D^n) = 0$, the homomorphism induced by the inclusion $H^n(X) \to H^n(X_D)$ is an isomorphism.  \qed

\

\noindent {\bf Proof of Theorem \ref{theorem1}:} From Lemma \ref{lemma1} we obtain that (b) implies (a).
 From Lemma \ref{lemma2}, (a) implies (b).

\

\begin{obs}
 Let $X$ be an $n$-dimensional compact metric space, $C$ a component of $\mathcal{E}_n(X)$ and $D^n \subset C$ an $n$-disc. Then,  $H^{n}(i): H^n(X) \to H^n(X \setminus int \, D^n)$ is an isomorphism
if and only if $H^{n}(i_C): H^n(X) \to H^n(X \setminus C)$ is an isomorphism.
Thus in the condition (b)  in Theorem~\ref{theorem1} and in the Definition~3.2,  $H^{n}(i)$ can be replaced by  $H^{n}(i_C)$.
\end{obs}

\proof Since $dim \, X \leq n$, both $H^{n}(i)$ and $H^{n}(i_C)$ are epimorphisms. Thus we need to show that
$H^{n}(i): H^n(X) \to H^n(X \setminus int \, D^n)$ is a monomorphism
if and only if $H^{n}(i_C): H^n(X) \to H^n(X \setminus C)$ is a monomorphism,
or equivalently, that
$H^{n}(j): H^n(X, X \setminus int \, D^n) \to H^n(X)$ is trivial
if and only if $H^{n}(j_C): H^n(X, X \setminus C) \to H^n(X)$ is trivial.
The later equivalence is a consequence of the fact that $$ H^{n}(\iota):  H^n(X, X \setminus int \, D^n) \to H^n(X, X \setminus C)$$ is an epimorphism and that $H^{n}(j)= H^{n}(j_C) \circ H^{n}(\iota)$. \qed

\bigskip

\begin{corol} \label{corol1}
Let $X$ be an $n$-tight compact metric space with dimension $n$ at each point and  $M$  an  $n$-manifold.
Then for every map $f: X \to M$  such that $H^{n}(f): H^n(M) \to H^n(X)$  is null the set of multiple points $\mathcal{M}(f)$ is dense in $X$.
In particular, if $X$ is a closed $n$-manifold and $H^{n}(f): H^n(M) \to H^n(X) $ is  null then the set of multiple points $\mathcal{M}(f)$ is dense in $X$.
\end{corol}

\

\begin{obs} In \cite{GonOre} it was proved that, given a map $f: M \to N$, where $M , N$ are manifolds of same dimension with $M$ closed, if the absolute degree of $f$ is different from $1$ then the set of multiple points of any map $g \in [f]$ is dense. Note that a closed manifold does not satisfy the condition (b) in Theorem \ref{theorem1}. Therefore, does not satisfy the condition (a).  So using   Theorem \ref{theorem1}, we conclude that for every map $f: M \to N$ such that  $H^{n}(f): H^n(N) \to H^n(M) $ is null then the set of multiple points $\mathcal{M}(f)$ is dense in $M$.

\end{obs}

\subsection{Construction of complexes that are not $n$-tight}

Here, we will analyze when a complex $K$ is not $n$-tight, i.e. when a complex $K$ satisfies the item (b) of theorem \ref{theorem1}. Let $K = K^{(n-1)} \cup e_1^n \cup \cdots \cup e_m^n$, where $K^{(n-1)}=S_1^{n-1} \vee  S_2^{n-1} \vee \cdots \vee S_k^{n-1}$ and the attaching map $ f_i: S_i \to S_1^{n-1} \vee  S_2^{n-1} \vee \cdots \vee S_k^{n-1}$ for the $n$-cell $e_i$ is given by the $k$-tuple of integers $(n_1^i, \ldots , n_k^i)$, $i=1, \ldots , m$. We want to determine if  $H^{n}(i): H^n(K) \to H^n(K  \setminus \stackrel{\circ}{D^n})$  is an isomorphism for some $n$-disc $D \subset \mathcal{E}_n(K)$. Note that it is the same than to determine if
$H^n(K \setminus \stackrel{\circ}{e}_i  \hookrightarrow K)  $ is an isomorphism for some $n$-cell $e_i$.

Let us focus on the $n$-cell $e_m$: Note that $$H^n(K) = \underbrace{\mathbb{Z} \oplus \cdots \oplus \mathbb{Z}}_{m-\text{times}} / \langle  \bar{n}_1 , \ldots , \bar{n}_k \rangle,$$ where $\bar{n}_1=(n_1^1, n_1^2, \ldots , n_1^{m-1}, n_1^m)$, $\bar{n}_2=(n_2^1, n_2^2, \ldots , n_2^{m-1}, n_2^m), \ldots , \\ \bar{n}_k=(n_k^1, n_k^2, \ldots , n_k^{m-1}, n_k^m)$, and $$H^n(K \setminus \stackrel{\circ}{e}_m) = \underbrace{\mathbb{Z} \oplus \cdots \oplus \mathbb{Z}}_{(m-1)-\text{times}} / \langle  \tilde{n}_1 , \ldots , \tilde{n}_k \rangle,$$ where $\tilde{n}_1=(n_1^1, n_1^2, \ldots , n_1^{m-1})$, $\tilde{n}_2=(n_2^1, n_2^2, \ldots , n_2^{m-1}), \ldots , \\\tilde{n}_k=(n_k^1, n_k^2, \ldots , n_k^{m-1})$. Moreover, the homomorphism $$ H^n(K) \to H^n (K \setminus \stackrel{\circ}{e}_m)$$ is given by the projection $$ \overline{ (a_1, \ldots , a_m)} \mapsto   \overline{ (a_1, \ldots , a_{m-1})}.$$ The above homomorphism is always onto and we want to characterize when it is also injective.

\begin{prop} For the complex $K$ defined above, the homomorphism $H^n(K) \to H^n (K \setminus \stackrel{\circ}{e}_m)$  is injective iff there are integers $\beta_1, \ldots , \beta_k $ such that
\begin{equation}\label{equation1}
\beta_1 \bar{n}_1 + \cdots + \beta_k \bar{n}_k = (0, \ldots , 0, 1).
\end{equation}

\end{prop}
\begin{proof} It is clear that the kernel of the homomorphism $H^n(K) \to H^n (K \setminus \stackrel{\circ}{e}_m)$ is generated by the class $\overline{ (0, \ldots , 0, 1)}$. Therefore $H^n(K) \to H^n (K \setminus \stackrel{\circ}{e}_m)$ is injective iff the class $\overline{ (0, \ldots , 0, 1)}$ is null in $\displaystyle H^n(K) = \underbrace{\mathbb{Z} \oplus \cdots \oplus \mathbb{Z}}_{m-\text{times}} / \langle  \bar{n}_1 , \ldots , \bar{n}_k \rangle$, which is equivalent to the existence of integers  $\beta_1, \ldots , \beta_k $ such that  $\beta_1 \bar{n}_1 + \cdots + \beta_k \bar{n}_k = (0, \ldots , 0, 1)$.

\end{proof}

\begin{obs} The equation (\ref{equation1}) has an integer solution iff we can get,  from the $m \times k$ matrix $$
\left[\begin{array}{cccc}
n_1^1&n_2^1&\ldots &n_k^1 \\
\vdots & \vdots & \vdots & \vdots \\
n_1^m & n_2^m & \ldots & n_k^m
\end{array}\right]
$$ by applying column elementary operations, a matrix such that the last column is of the form $
\left[\begin{array}{c}
0 \\
\vdots  \\
0\\
1
\end{array}\right]
$.

\end{obs}

\begin{corol} The complex $K$ defined above is not $n$-tight if there is $i\in \{1, \ldots , m\}$ such that the equation
\begin{equation}\label{equation2}
\beta_1 \bar{n}_1 + \cdots + \beta_k \bar{n}_k = (0, \ldots , 0, 1, 0, \ldots , 0)
\end{equation}
has integer solution.

\end{corol}

\section{Example of maps with the set of single points dense}

In \cite{GonOre},  it is constructed a map $g: D^2 \to \Bbb{R}^2$ such that the set of single points is dense in $D^2$ and $g$ is constant on the boundary of $D^2$.  Then, from $g$ it is obtained an example of a map $f: S^2 \to \Bbb{R}^2$ with the set of single points dense in $S^2$.
We noticed  that the techniques used by S. Orevkov  in his construction works to construct such maps $g: D^n \to \Bbb{R}^2$ for $n \geq 2$ and, therefore, to construct  maps $f: S^n \to \Bbb{R}^2$, $n \geq 2$, with dense set of single points.  In case of Orevkov's example, a crucial step is the existence of a map $\varphi : D^2 \to A$, where $A=\{ z\in \Bbb{R}^2 \ | \ a \leq |z| \leq b\}$ is a $2$-dimensional annulus ($0<a<b$), such that $\varphi(D^2)=A$ and $\varphi$ mapping the interior of $D^2$ homeomorphically onto a dense open subset of $A$.

Below, we prove the equivalent of the above assertion for the $n$-dimensional unitary disc $D^n$ and an $n$-dimensional annulus.

\begin{lemma}\label{lemma4.1} Let $D^n$ be the $n$-dimensional disc and $A^n=S^{n-1} \times I$ the $n$-annulus. There is a map $\varphi: D^n \to A^n$ such that $\varphi(D^n)=A^n$ and $\varphi$ maps the interior of $D^n$ homeomorphically onto an open dense subset of $A^n$.
\end{lemma}
\begin{proof}
Let's identify the disc $D^n$ with $D^{n-1}\times I$, and let $p: D^{n-1} \to S^{n-1}$ be the map that collapses the boundary of $D^{n-1}$ into a point.  Then, the map $\varphi: D^{n-1} \times I \to S^{n-1}\times I$ given by $\varphi(x,t)=(p(x), t)$ satisfy the conditions of the lemma.

\end{proof}

\

The same type of example given by S. Orevkov holds for maps from $S^n$ into $\Bbb{R}^2$ for $n\geq 2$.

\begin{theorem}\label{Orevkov} There is a map $g: D^n \to T \subset \Bbb{R}^2$ such that:
\begin{itemize}
\item $T$ is a fractal tree;
\item $g(S^{n-1})=\{0\}$; and
\item The set of single points of $g$ is dense in $D^n$.
\end{itemize}
\end{theorem}

\

\begin{corol} There is a map $f: S^n \to T \subset \Bbb{R}^2$ such that the set of single points of $f$ is dense in $S^n$.
\end{corol}
\begin{proof} The map $f: S^n \to \Bbb{R}^2$ is obtained from the map $g$ of the previous Theorem by collapsing the boundary of $D$ into a point since $g$ is constant on the boundary $\partial D$.

\end{proof}

\

More generally:

\begin{corol} Let $M^n$ be an $n$-dimensional connected manifold, $n \geq 2$. There is a map $f: M^n \to T \subset \Bbb{R}^2$ such that the set of single points of $f$ is dense in $M^n$.
\end{corol}
\begin{proof}From \cite{DyH}, $M=P^n \cup C$,   where $P^n$ is homeomorphic to the Euclidean $n$-space, $E^n$, and $C$ is a closed subset of $M^n$ of dimension at most $n-1$, and $P \cap C = \emptyset$. Let $h: P \to D^n - S^{n-1}$ be a homeomorphism and $g: D^n \to T \subset \Bbb{R}^2$ a map such that the set of single points of $g$ is dense in $D^n$ and $g(x)=0$ for all $x\in S^{n-1}$. Now, define $f: M \to T \subset \Bbb{R}^2$ by: $f(x)=g(h(x))$ if $x\in P$ and $f(x)=0$ if $x \in C$.

\end{proof}

\

\noindent {\it Proof of Theorem \ref{Orevkov}:} (Sketch) The construction of the map $g$ claimed in Theorem \ref{Orevkov} is obtained following the same steps as the map constructed by S. Orekov  in \cite[Appendix, Example]{GonOre}.  Consider  the following steps:

\begin{description}
\item[Step 1.] A decomposition of $D^n$ is defined;
\item[Step 2.] A particular tree $T \subset \Bbb{R}^2$ is considered;
\item[Step 3.] A uniformly Cauchy sequence of maps $g_m: D^n \to T$ is constructed in such way that, for each $m$, $g_m(\partial D)=0$;
\item[Step 4.] $g: D^n \to \Bbb{R}^2$ will be the limit of the sequence $\{g_m\}$.
\end{description}
\noindent where we briefly comment how to adapt the proof of the case $n=2$ for $n$ arbitrary.
\

The {\bf Step 1}(Construction of Annuli)  for $n=2$ uses  maps $\varphi: D^2\to  A_{\vec{b}}$ which satisfy
\begin{enumerate}
\item $\varphi_{\vec{b}}(0)=p_{\vec{b}}$
\item $\varphi_{\vec{b}}(D^2)=A_{\vec{b}}$
\item $\varphi_{\vec{b}}(0)$ maps $IntD^2$ homeomorphically onto a dense open subset of  $A_{\vec{b}}$.
\end{enumerate}

In our case such maps are replaced by the one given by the Lemma \ref{lemma4.1}, to obtain a similar decomposition
using $n$-dimensional annulus. Also the analogue of Lemma 2.2, \cite{GonOre}, page 371, holds in our case, namely
"$A$ and $P$ are dense in $D^n$" for the correspondent set $A$ in our case and $P$ is the same as in $n=2$.

The {\bf  Step 2},  the particular tree $T \subset \Bbb{R}^2$  considered is the same as in case $n=2$.
 For {\bf  Steps 3 and 4} the sequence of maps
are defined in a similar way as the maps $f_m$ as in the case $n=2$. So we obtain $g$ which is continuous, where the proof of the continuity is the same as for $f$ (see section 4. Construction of the Mapping  in  \cite{GonOre}, page 372).
This conclude the proof.
\qed

\

\begin{corol} \label{corol4.6} Let $X$ be an $n$-dimensional CW-complex with a finite number of $n$-cells, $e^n_1, \ldots , e^n_k$, attached to the $(n-1)$-skeleton $X^{(n-1)}$, $n \geq 2$. There is a map $f: X \to \Bbb{R}^2$ such that the set of single points of $f$ is dense in $X$.
\end{corol}
\begin{proof} Let $T_1, T_2, \ldots , T_k$ be copies of $T$ in $\Bbb{R}^2$ such that $T_i \cap T_j = \{ 0 \}$ for $i \neq j$. For the cell $e^n_i$, let $g_i : e^n_i \to T_i$ be a map such that $g_i$ restricts to the boundary $\partial e^n_i$  is constant equal zero, and the set of single points of $g_i$ is dense in $e^n_i$. Then, define $f: X \to \Bbb{R}^2$ by: $f(x)=g_i(x)$ if $x \in e^n_i$ and $f(x)=0$ if $x \in X^{(n-1)}$.
\end{proof}

It is natural to ask:   For which pairs of spaces $(X, \Bbb{R}^m)$, where $X$ is a finite CW-complex of dimension $n$ and $\Bbb{R}^m$ is the $m$-dimensional Euclidean space,   there exists  a map  $f:X \to \Bbb{R}^m$ such that  the set of single points of $f$ is  dense in $X$?  The examples above together with  few elementary remarks  show that we have a complete answer of the above question.

   \begin{remark}
\begin{enumerate}
\item  If $X$ is a graph, i.e., a CW-complex where  $dim(X)=1$, it is easy to see that such map $f: X \to \Bbb{R}$ exist if and only if $X$ is homeomorphic to the segment. This follows from the observation that the graph which is the letter $Y$ does not admit such map.

   \item If $X$ is a graph, certainly there exist a such map $X \to \Bbb{R}^2$.  Take as image of $X$ a bouquet of circle.

   \item  In the case  $m \geq 2$,   it suffices to construct such examples if $m=2$. Then the answer is yes,  and is obtained using the CW structure of $X$,  Corollary \ref{corol4.6} and item 2   above as follows: Write $X$ as the union (not disjoint union) of subcomplex where all  the maximal cell have the same dimension, then for each   such subcomplex apply either   Corollary \ref{corol4.6} or  item 2   above depending if the dimension of the subcomplex is $\geq 2$ or $1$, respectively.

   \item There is {\bf no} map $f: D^2 \to \Bbb{R}$ for which the set of single points is dense in $D^2$. Indeed, let $f: D^2 \to \Bbb{R}$ be a map and, without loss of generality, suppose $0\in D^2$ a single point of $f$ and $f(0)=0 \in \Bbb{R}$. Then, $f(S^1)$ is a connected compact subset of $\Bbb{R} \setminus \{0\}$ and, therefore, it is entirely contained in one of the components of $\Bbb{R} \setminus \{0\}$, say in $\Bbb{R}^+$. Let $d$ be the distance of $0$ to $f(S^1)$. Thus, $d>0$. The subset $f^{-1}((-d/2, d/2))$ is an open subset of $D^2$ containing the origin. Let $\delta > 0$ such that the open ball $B(0, \delta)$ is contained in $f^{-1}((-d/2, d/2))$. We state that none point of $B(0, \delta) \setminus \{0\}$ is a single point of $f$. Let $z_0\in B(0, \delta)$, $z_0 \neq 0$. Then, $0<|f(z_0)|<d/2$. Note that $f(z_0)$ must be positive because the image of the annulus $\{z\in D^2 \ | \ |z_0| \leq |z| \leq 1\}$ is a connected compact subset of $\Bbb{R} \setminus \{0\} $. Now, take any radius in $D^2$ that does not contain the point $z_0$. The image of such radius is an interval with initial point $0$ and end point a number bigger then $d$. Hence, the image of some point belonging to this radius coincides with $f(z_0)$.  Therefore, $z_0$ is not a single point of $f$.

   \item Similarly, there is {\bf no} map $f: D^n \to \Bbb{R}$ for which the set of single points is dense in $D^n$, $n \geq 2$.

 \end{enumerate}

   \end{remark}

   \begin{remark}  In \cite{B}, it was shown that for $m , n \ge 3$ there is a monotone surjection $f: S^m \to S^n$ such that the set of single points of $f$ is  dense in $S^m$, where a map is  called
monotone provided each point-inverse is compact and connected. Moreover, it was shown that for $3 \le n \le
   m \le 2n-3$, each element of $\pi_m(S^n) $ can be represented as a monotone surjection $f: S^m \to S^n$ with dense set of single points.

   Another natural question to ask is: For which pairs of spaces $(X, M)$ where $X$ is a finite CW-complex of dimension $n$ and $M$ is a $m$-dimensional manifold, there exists a surjective map $f: X \to M$ such that the set of single points of $f$ is  dense in $X$?
   \end{remark}

Algebraic Topology (math.AT); Dynamical Systems (math.DS)