Tilings of the infinite $p$-ary tree and Cantor homeomorphisms

We define a notion of tiling of the full infinite $p$-ary tree, establishing a series of equivalent criteria for a subtree to be a tile, each of a different nature; namely, geometric, algebraic, graph-theoretic, order-theoretic, and topological. We show how these results can be applied in a straightforward and constructive manner to define homeomorphisms between two given spaces of $p$-adic integers, $\mathbb{Z}_{p}$ and $\mathbb{Z}_{q}$, endowed with their corresponding standard non-archimedean metric topologies.


Introduction.
This paper arose out of curiosity regarding how easily one might write down an explicit homeomorphism between two given spaces of p-adic integers, Z p and Z q , for two primes p, q, including auto-homeomorphisms when p = q. The existence of a homeomorphism follows from the fact that they are Cantor spaces (compact, metrizable, totally disconnected, perfect topological spaces). However, such maps cannot preserve the algebraic structure. 1 Robert in [5,Ch. 2] describes various ways of mapping Z p homeomorphically to a fractal subset of a Euclidean space R n , beginning with the well-known correspondence between Z 2 and the classical Cantor set C, with a view towards geometric visualization.
Of course, having fixed a homeomorphism Z p → Z q , any other is given by composition with an auto-homeomorphism of Z p , so in principle we could just study these, and similarly, fixing homeomorphisms Z p → C and Z q → C, we would be looking at the auto-homeomorphism group of C, which has been extensively studied in the literature, especially that relating to dynamical systems (e.g. [1,2]).
However, our interest was more down to earth, in the sense that we were looking to explicitly "directly connect" two different primes p, q, somewhat in the spirit of [5, §2.6] which gives a map Z 2 × Z 2 → Z 3 , and to do so in as simple a manner as possible, whatever that might actually turn out to mean. A different example of an explicit auto-homeomorphism of C can be found in [4].
The eventual solution was formulated, somewhat to our surprise, in terms of tilings of the full infinite p-ary tree T p . That T p should be involved is not the surprising part, since the construction of Z p as the inverse limit lim ← − Z/p n Z under the mod p n reduction maps leads to Hensel's representation of a padic integer by an infinite series ∞ n=0 a n p n where a n ∈ {0, 1, . . . , p − 1} and geometrically this may be visualized as a path in T p , in much the same way that the base-p expansion of a real number determines a sequence of nested intervals collapsing to a point.
In the course of discovering and proving the main results, we found it useful to relate the geometry of such tilings to operations in the monoid of words over the alphabet with p symbols, and finally to the special characteristics of the p-adic topology.
To our knowledge, the results presented here are new. A few similar constructions, arising from the relation of Cantor spaces to inverse limit spaces via sequences of nested refinements of a partition, can be found in [2], although the theme of that paper is the graph-theoretic structure of the auto-homeomorphism group of C.
In much of the discussion, it is not necessary that p be a prime, but when considering the topology, it is convenient to have the standard p-adic metric on hand to relate words with p-adic balls and partitions formed by them.
In Section 2, we give our definition and classification of tilings for the full infinite p-ary tree, which we hope will be interesting in itself. Our main result is Theorem 2.3, which establishes the equivalence of various properties which are a priori of a different nature; namely, the geometric property of being a tile (Definition 2.3), the graph-theoretic property of fullness, the order property of leaf-comparability (Lemma 2.2), an algebraic property of unique factorization and finally, the topological property of being a partition (Theorem 3.4).
In Section 3, we interpret the main result in terms of the p-adic topology and use such tilings to fulfill our promise of a relatively easy construction of explicit homeomorphisms between Z p and Z q . We will conclude with some examples, including auto-homeomorphisms of Z 2 .  . The first few levels of the binary tree T 2 , representing both Z 2 and the Cantor set C (after mapping the ternary digit 2 to 1).

Tilings of the full infinite p-ary tree
Given a graph G, let V (G) and E(G) denote its vertex and edge sets respectively. Since we will be concerned with rooted trees, we will also refer to nodes, children and parents, etc. In particular for a subtree S we will denote by L(S) its collection of leaves, that is to say, the childless nodes of S. Recall that a p-ary tree is one in which each node has at most p children. The case where every non-leaf node has the maximum possible number of children is particularly important.
Definition 2.1. A p-ary tree is full if every node has either no children or the maximum number p of possible children. In the latter case we shall say that the node splits completely.
We are primarily interested in the full infinite p-ary rooted tree T p . For our purposes it will be convenient to identify the vertex set V (T p ) with the set of p-ary words Σ * p , consisting of finite strings over the alphabet Σ p = {0, 1, 2, . . . , p − 1}, as we see in Figure 1 for p = 2. Thus the set of edges E(T p ) consists of pairs e = (w, wc) where w ∈ Σ * p and c ∈ Σ p is a single character. The root of T p is the empty word ǫ. We will then refer to depth or level in relation to ǫ, considered as level 0, and accordingly we may speak of the top or root node of a subtree.
It is well-known that Σ * p is a cancellative monoid with respect to concatenation, denoted by juxtaposition, with ǫ as identity element. We will denote the length of a word w by |w|, with |ǫ| = 0. The length is a monoid morphism Σ * p → N 0 , namely |vw| = |v| + |w|. Recall that v is a prefix of w if w = vw ′ for some word w ′ , i.e. if v is a left factor of w. The empty word is a prefix of every word. The prefix relation is a partial order on words which we will denote by ≤.
In our model of T p , the prefix relation coincides with the ancestor relation, namely v ≤ w if and only if v is an ancestor of w, or equivalently w is a descendant of v. In particular, if w = c 0 c 1 · · · c n−1 ∈ Σ * p , the unique path from w to the root node ǫ is obtained by removing one character at a time from w proceeding from right to left: c 0 · · · c n−1 → c 0 · · · c n−2 → . . . → c 0 → ǫ (see Figure 1).
Note that Σ * p acts on T p on the left via prefixing, i.e. left multiplication on itself as vertex set, with the induced action on edges, w(v, v ′ ) = (wv, wv ′ ). We will refer to this action as left translation or simply translation. Definition 2.2. We will say that two subgraphs of a graph are almost disjoint if they do not share a common edge. Definition 2.3. A tiling of the full p-ary infinite tree T p is a pair (S, Ω) consisting of: p such that T p is the almost disjoint union of the translates ωS for ω ∈ Ω. We will denote this by Note that this means that both every vertex of T p , i.e. every word w, is of the form w = ωs where ω ∈ Ω and s ∈ V (S), and also every edge of T p is of the form ωe where ω ∈ Ω and e ∈ E(S). Proof. In a tiling, since the empty word ǫ must also have the form ωs, we must have ǫ ∈ Ω ∩ V (S). In particular a tile S is necessarily a subtree rooted at ǫ, and therefore for any v ∈ V (S), the unique path from v to the root node is contained in S. In terms of words, this means S is closed under prefixes.
Lemma 2.2. For a nontrivial subtree S of T p which is rooted at ǫ, the following properties are equivalent: A tree S satisfying these equivalent properties will be called leaf-comparable 2 .
Proof. If ℓ ≤ w for some ℓ ∈ L(S), there is nothing to show; otherwise, observe that by Lemma 2.1, if w < ℓ for some ℓ ∈ L(S), then w ∈ V (S)\L(S) and conversely, if w ∈ V (S) \ L(S) then, since S is a finite subtree, any path in S starting at w and formed by succesive descendants eventually ends in a leaf ℓ, in which case w < ℓ. Theorem 2.3. For a nontrivial finite subtree S of T p which is rooted at ǫ, the following properties are equivalent: (1) S is a tile in some tiling (S, Ω).
(2) S is full, i.e., all p child nodes of any non-leaf node of S belong to S.
(3) S is leaf-comparable, i.e. for any word w there is a leaf ℓ of S such that either ℓ ≤ w or w ≤ ℓ. (4) Any p-ary word w has a unique factorization w = ℓ 1 · · · ℓ n s, where {ℓ 1 , ℓ 2 , . . . , ℓ n } is a (possibly empty) set of leaves of S and s is a non-leaf node of S. Moreover, if these properties hold, then Ω may be chosen to be the submonoid Λ of Σ * p generated by the set L(S) of leaves of S, that is, (S, Λ) is a tiling. Proof.
• (1) =⇒ (2): Suppose that S is a tile which is not full. Then some non-leaf node s ∈ V (S) \ L(S) does not split completely in S, i.e. sc / ∈ V (S) for some character c ∈ Σ p . Choose such an s having minimal length. Thus, if σ ∈ V (S) \ L(S) with |σ| < |s| then σ must split completely in S.
Then S being nontrivial and full ensure that c 0 ∈ V (S). We conclude if c 0 is a leaf; otherwise fullness implies c 0 c 1 ∈ V (S). Arguing recursively, we are left with the case that all of the c 0 c 1 · · · c i , with i < n, lie in V (S) \ L(S). But then w ∈ V (S), and there is a path wc n+1 c n+2 · · · in S which, since S is finite, eventually exits S at a node with no children, i.e. at a leaf, of which w is a prefix. Thus S is leaf-comparable. (4): For the existence of the factorization, we may assume we are done, otherwise there is some ℓ 2 ∈ L(S) such that ℓ 2 ≤ w 1 and then w = ℓ 1 ℓ 2 w 2 for some w 2 . Since this process cannot continue ad infinitum, we eventually arrive at a factorization w = ℓ 1 · · · ℓ n s with ℓ i ∈ L(S) and s ∈ V (S) \ L(S).
For uniqueness, suppose we have two factorizations where n, m ≥ 0, each ℓ i , ℓ ′ j ∈ L(S), and each s j ∈ V (S) \ L(S). We imitate the proof of unique factorization of integers into primes. If m = n = 0 the conclusion is obvious. Suppose now that m, n ≥ 1. Without loss of generality, we may assume that |ℓ 1 | ≤ |ℓ ′ 1 |. Comparing the leftmost parts of both sides of ( * ), we conclude that in fact ℓ 1 ≤ ℓ ′ 1 and, since both are leaves of S, ℓ 1 = ℓ ′ 1 . Cancelling these terms leaves a shorter relation. We must have n = m, otherwise eventually we would arrive at a relation of the form s 1 = ℓ ′′ 1 · · · ℓ ′′ k s 2 or s 2 = ℓ ′′ 1 · · · ℓ ′′ k s 1 with k ≥ 1 and ℓ ′′ j ∈ L(S), which also correspond to the cases where m = 0 or n = 0 but not both. In the first case ℓ ′′ 1 ≤ s 1 , which, since ℓ ′′ 1 ∈ L(S) and s 1 ∈ V (S), can only hold if ℓ ′′ 1 = s 1 , contradicting s 1 / ∈ L(S), and similarly in the second case. Thus n = m in all cases and successive cancellations lead to ℓ j = ℓ ′ j for all j and s 1 = s 2 . Given a word w, if its factorization begins with some leaf ℓ, then ℓ ≤ w.
Otherwise w ∈ V (S) \ L(S), in which case following a path downward (away from the root node ǫ) from w we eventually exit S at a leaf node ℓ, hence w ≤ ℓ. • (3) =⇒ (2): Suppose that S is leaf-comparable but not full. Let s be a non-leaf node of S which does not split completely. Suppose c ∈ Σ p with w = sc / ∈ V (S). If w ≤ ℓ for some leaf ℓ of S, then the unique path from s to ℓ is not contained in S, contradicting connectedness. If ℓ ≤ w, then in fact ℓ ≤ s, but this forces ℓ = s, contradicting that s is not a leaf. Thus w is a word which is not comparable to any leaf, contradicting (3). • (4) =⇒ (1): Finally, we show that if unique factorization holds, then in fact (S, Λ) is a tiling, where Λ is the submonoid of Σ * p generated by L(S). Let w ∈ Σ * p be any word and consider any edge (w, wc) ∈ E(T p ), with c ∈ Σ p . We have already seen that S must be full. Write w = λs with λ ∈ Λ and s ∈ V (S) \ L(S). Fullness implies sc ∈ V (S), hence w ∈ λV (S) and (w, wc) = λ(s, sc) ∈ λE(S).

We end this section by showing that, although in the definition of a tiling (S, Ω) (Definition 2.3)
, Ω is only assumed to be a subset of the monoid of words Σ * p , in fact Ω is uniquely determined by S as its "monoid of leaves", namely, the submonoid Λ of Σ * p generated by the set L(S) of leaves of S. Proposition 2.4. If (S, Ω) is a tiling of T p , then in fact Ω must be the submonoid Λ of Σ * p generated by the set L(S) of leaves of S. Proof. Let Λ be the submonoid of Σ * p generated by the leaves of S. By Theorem 2.3, we know that T p = λ∈Λ λS. We have to show that Λ is the only subset of Σ * p that satisfies this. • It is enough to show that Ω ⊆ Λ. Assume that this is the case. Then given λ ∈ Λ, choose any character c ∈ Σ p . There is some ω ∈ Ω such that (λ, λc) ∈ ωE(S). Write (λ, λc) = ω(s, sb) with (s, sb) ∈ E(S). Thus s ∈ V (S) \ L(S). Then λ = ωs and by unique factorization (Theorem 2.3 (4)), we must have s = ǫ, so that λ = ω ∈ Ω. Hence Λ ⊆ Ω.

Homeomorphisms of p-adic spaces
A Cantor space is a compact, metrizable, totally disconnected, perfect topological space. The classification theorem for Cantor spaces is due to Brouwer, who proved that all Cantor spaces are homeomorphic to the classical Cantor set [3]. In particular, any two Cantor spaces are homeomorphic.
Brouwer's Theorem can be proved in a fairly constructive way by associating an infinite tree to a given Cantor space. The construction may be understood in two steps, the first of which is to exhibit a homeomorphism of a given Cantor space with a tree, and then using this to relate two given Cantor spaces to each other.
Assigning a tree to a Cantor space relies on the existence of finite clopen partitions of its nonempty clopen subsets. 3 Such a set has a clopen partition with any given number n of elements. Choosing a large enough n, the diameters (with respect to a metric inducing the topology) of the sets in the partition may be taken to be arbitrarily small.
With this in mind, for a given Cantor space X, one can recursively construct a sequence of finite clopen partitions U n such that each U n refines U n−1 and the maximum diameter of the sets in U n tends to 0 as n → ∞. A point x ∈ X then has a unique associated "container sequence" (U 0 , U 1 , . . .) such that x ∈ U n ∈ U n , with {x} = ∞ n=0 U n . Considering each U n as a finite topological space with the discrete topology, the inverse limit space U ∞ = lim ← − U n with respect to the container maps c n : U n → U n−1 sending a set U ∈ U n to its unique container V ∈ U n−1 , is homeomorphic to X. Clearly U ∞ is an infinite tree, with vertices the sets in the partitions and edges given by the containment relations among these.
Given two Cantor spaces X, Y , we can recursively construct two such sequences of partitions, one for each space respectively, not only having the same number of elements at each step, but also isomorphic inclusion relations, i.e., the partitions have associated graphs which are isomorphic, and hence define a homeomorphism of X and Y by choosing compatible bijections between the partitions at each level. 4 The p-adic integers Z p , for a given prime p, provide concrete examples of Cantor spaces having additional algebraic structure. From our point of view, they are convenient because the p-adic metric on the integers is easy to describe, and the correspondence between Cantor spaces and trees can be easily seen to pair Z p with the full infinite p-ary tree T p . The results of Section 2 yield a constructive method for obtaining homeomorphisms between Z p and Z q for any pair of primes p, q. Thus, from now on we shall assume that p is prime for simplicity. 5 Remark 3.1. The reader may have noticed that the primality of p is not necessary. Indeed everything holds for a-ary trees where a is a natural number ≥ 2. The Chinese Remainder Theorem and general properties of inverse limits show that Z a = lim ← − Z/a n Z is isomorphic to p|a Z p over prime divisors of a. In particular, Z p ℓ is isomorphic to Z p for primes p. The latter isomorphism corresponds to considering a p ℓ -adic digit as a block of ℓ p-adic digits. On trees this means mapping a given p ℓ -adic subtree to the p-adic subtree determined by expanding into blocks and filling in with all ancestors. In this sense the prime case is enough to understand the rest.
A well-known method of proving Brouwer's Theorem and other universality results involving the Cantor set is to use inverse limit spaces and may be found in many sources, for example [6]. Following the proof, which we have sketched above, we will construct such an explicit homeomorphism by means of tilings of the trees T p and T q . Let us start with the topological interpretation of the results from section 2.
To a word w = a 0 a 1 · · · a n−1 ∈ Σ * p we associate the natural number N (w) = a 0 + a 1 p + · · · + a n−1 p n−1 ∈ [0, p n ) and the p-adic ball B w = B(N (w), p −|w|+1 ) in Z p . The empty word ǫ is assigned the ball B ǫ = Z p . It can be easily shown that every p-adic ball is of the form B w for some word w ∈ Σ * p (see [5]). The relevance of word operations to the problem of constructing covers by balls is a consequence of the following simple observation.
The particular case follows from the fact that two non-disjoint p-adic balls satisfy an inclusion relation. Proof. Assume that {B ℓ : ℓ ∈ L(S)} is a partition of Z p and let us show that the property (1a) from Lemma 2.2 holds. Let w ∈ Σ * p . Since B w ⊆ Z p = ℓ∈L(S) B ℓ , we must have B w ∩ B ℓ = ∅ for some ℓ ∈ L(S), hence either w ≤ ℓ or ℓ ≤ w.
Conversely, the union U = ℓ∈L(S) B ℓ is a clopen subset of Z p . If U Z p , then B w ∩ U = ∅ for some w ∈ Σ * p . Since B w ∩ B ℓ = ∅ for every ℓ ∈ L(S), neither w ≤ ℓ nor ℓ ≤ w for every leaf ℓ ∈ L(S). Proof. This is an immediate corollary of Lemma 3.3 and Theorem 2.3.
We end this section by showing how these equivalences allow us to build an inverse system of partitions from a given tile and, in turn, to construct a homeomorphism between Z p and Z q based on two systems of partitions with isomorphic inclusion relations.
Consider now a tile S of T p . By Theorem 3.4, the set of balls corresponding to leaves, {B ℓ : ℓ ∈ L(S)}, form a partition of Z p with cardinality #L(S) = 1 + (p − 1)s for some s ∈ Z >0 . This follows because S must be full, and a full subtree can be built recursively by choosing at each step which old leaves split completely to form p new leaves at the next level. Each lost old leaf gives rise to p new leaves, thus adding p − 1 leaves to the overall count. Here s is the number of nodes which have split during this process and also the final number of non-leaf nodes in S: s = #(V (S) \ L(S)).
The translates of S by the monoid Λ generated by L(S) form a tilling of Z p , and it is easy to see that for each n ≥ 1 the tree S n := {ℓ 1 ℓ 2 · · · ℓ i w : 1 ≤ i < n, ℓ j ∈ L(S), w ∈ S} is again a tile of Z p with L(S n ) = {ℓ 1 · · · ℓ n : ℓ 1 , . . . , ℓ n ∈ L(S)} by unique factorization (Theorem 2.3), in particular #L(S n ) = (#L(S)) n . In terms of balls, this means that the partition {B λ : λ ∈ L(S n+1 )} of Z p is obtained from {B λ : λ ∈ L(S n )} by subdividing each ball B λ with λ ∈ L(S n ) into #L(S) smaller balls, namely into {B λℓ : ℓ ∈ L(S)}.
Suppose that we are given primes p and q and tiles S of T p and S ′ of T q such that #L(S) = #L(S ′ ). This is always possible since the Diophantine equation 1 + (p − 1)s = 1 + (q − 1)s ′ always admits a solution for integers p, q. Let us choose a bijection f : L(S) → L(S ′ ). Then f clearly extends to a bijection f n : L(S n ) → L(S ′ n ) for all n ≥ 1 by setting f n (ℓ 1 ℓ 2 · · · ℓ n ) := f (ℓ 1 )f (ℓ 2 ) · · · f (ℓ n ), which in turn defines bijections g n between the partitions {B ℓ : ℓ ∈ L(S n )} of Z p and {B ℓ ′ : ℓ ′ ∈ L(S ′ n )} of Z q for all n ≥ 1 by setting g n (B ℓ ) := B fn(ℓ) .
Notice that the bijections g n preserves inclusions, namely given ℓ ∈ L(S n ) and k ∈ L(S n+1 ), then by Lemma 3.3 we have that This property ensures that the bijections g n define a homeomorphism between Z p and Z q .

Examples
We conclude with several examples of tilings inducing homeomorphisms between p-adic spaces, applying the results of the previous section and giving the corresponding action on digits.
We begin by exhibiting a concrete homeomorphism between Z 2 and Z 3 arising from the tiles S and S ′ shown in Figures 3 and 4. The sets of leaves are L(S) = {λ 1 = 00, λ 2 = 01, λ 3 = 1} ⊂ Σ * 2 and L(S ′ ) = {µ 1 = 0, µ 2 = 1, µ 3 = 2} ⊂ Σ * 3 . Figures 5 and 6 shows how the translates of S and S ′ by the monoids Λ and Λ ′ generated by the respective sets of leaves L(S) and L(S ′ ), cover the trees T 2 and T 3 respectively.    Consider now the bijection f : L(S) → L(S ′ ) with f (λ i ) = µ i for i = 1, 2, 3, which defines a homeomorphism φ : Z 2 → Z 3 . In concrete terms,  Figure 6. Part of the tilling of T 3 by S ′ given x ∈ Z 2 we consider its 2-adic expansion w, which is an infinite string in the alphabet Σ 2 , then the 3-adic expansion of φ(x) is obtained from w by applying f to its prefixes λ i . In other words, one must identify inside w the blocks of digits corresponding to each of the words λ i , and transform these blocks according to f . For example, the image of w = 0001101 . . . = λ 1 λ 2 λ 3 λ 2 . . . is µ 1 µ 2 µ 3 µ 2 . . . = 0121 . . . Finally, we give example of several auto-homeomorphisms of Z 2 arising from choosing different tilings of T 2 . Recall that, since p = 2, #L(S) = 1 + s with s = #(V (S) \ L(S)) ∈ Z >0 . If we take s = 2, there are only two such tiles, shown in Figures 7 and 8, which moreover are isomorphic as trees. Taking for example the bijection f (λ i ) = µ i , we obtain the homeomorphism of Z 2 mapping the blocks: 00 to 11, 01 to 10 and 1 to 0; which is nothing but the transposition of the digits 0 and 1. If we take the bijection f (λ 1 ) = µ 2 , f (λ 2 ) = µ 1 and f (λ 3 ) = µ 3 , the corresponding homemorphism is no longer a permutation since on blocks it maps 00 to 10, 01 to 11 and 1 to 0. For s = 3, we can consider the tiles from Figures 9 and 10, which are no longer isomorphic as trees. Choosing f (λ i ) = µ i , we get the map on blocks of digits given by: 00 to 000, 01 to 001, 10 to 01 and 11 to 1. For example, λ 1 λ 2 λ 3 λ 4 λ 2 . . . = 0001101101 . . . is mapped to µ 1 µ 2 µ 3 µ 4 µ 2 . . . = 000001011001 . . .