RATIONAL DIGIT SYSTEMS

JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

Abstract. Let A be a d × d matrix with rational entries which has no eigenvalue λ ∈ C of absolute value |λ| < 1 and let Zd[A] be the smallest nontrivial A-invariant Z-module. We lay down a theoretical framework for the construction of digit systems (A, D), where D ⊂ Zd[A] finite, that admit finite expansions of the form `−1 x = d0 + Ad1 + ··· + A d`−1 (` ∈ N, d0,..., d`−1 ∈ D) for every element x ∈ Zd[A]. We put special emphasis on the explicit computation of small digit sets D that admit this property for a given matrix A, using techniques from matrix theory, convex , and the Smith Normal Form. Moreover, we provide a new proof of general results on this finiteness property and recover analogous finiteness results for digit systems in number fields a unified way.

1. Introduction and main results Let A ∈ Qd×d be an with rational entries. It is easy to see that the smallest nontrivial A-invariant Z-module containing Zd is given by the set Zd[A] of vectors x ∈ Qd that can be written as k−1 x = x0 + Ax1 + ··· + A xk−1, (1.1) d where k ∈ N and x0,..., xk−1 ∈ Z , i.e., ∞ [ Zd[A] := Zd + AZd + ··· + Ak−1Zd . k=1 Thus Zd[A] is the set of all vectors that can be expanded in terms of positive powers of A with vectors as coefficients. Motivated by the existing vast theory and many practical applications of number systems, it is natural to ask the following question. Is there a finite set D ⊂ Zd[A], such that every vector x ∈ Zd[A] has an expansion of the arXiv:2107.14168v1 [math.NT] 29 Jul 2021 form `−1 x = d0 + Ad1 + ··· + A d`−1, (1.2)

2010 Subject Classification. 11A63, 11C20, 11H06, 11P21, 15A30, 15B10, 52A40, 90C05. Key words and phrases. Digit expansion, matrix number systems, dynamical systems, convex digit sets, lattices. The post-doctoral position of the first author at Montanuniversit¨atLeoben in 2018-2021 was supported by the Austrian Science Fund (FWF) project M2259 Digit Systems, Spectra and Rational Tiles under the Lise Meitner Program. The second author is supported by project I 3466 GENDIO funded by the Austrian Science Fund (FWF). 1 2 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

where ` ∈ N and d0,..., d`−1 ∈ D. To put this in another way: can one find a finite digit set D ⊂ Zd[A] such that Zd[A] = D[A], (1.3) where ∞ [ D[A] := D + AD + ··· + A`−1D . (1.4) `=1 A lot of work related to this problem has been done in the context of number systems in number fields (cf. [10, 13, 29, 30]), polynomial rings (see [3,4, 41] and the survey [8]), lattices (see e.g. [25, 49]), and rational bases (cf. [2]). Moreover, it is intimately related to the study of self-affine tiles (see [24, 33, 45]) and the so-called height reducing property (cf. [1,5,6,22]). As we will see below, the problem of the existence of such a set D can be restated in terms of a so-called finiteness property of general digit systems. It is the aim of the present paper to construct sets D that satisfy (1.3). Here we strive for very general theory on the one side while paying attention to algorithmic issues on the other side. The pair (A, D) is called a matrix digit system or simply a digit system. The matrix A is then called the base of this digit system and the elements of D are called its digits. We say that (A, D) has the finiteness property in Zd[A] (or Property (F) for short), if every vector x ∈ Zd[A] has a finite expansion of the form (1.2), i.e., if (1.3) holds. It is easily seen that the requirement that D contains a complete system of residue class representatives of Zd[A]/AZd[A] is a necessary, but in general not sufficient, condition for (A, D) to have the finiteness property. One also says that (A, D) possesses the uniqueness property, or Property (U), if two different finite radix expressions in (1.4) always yield different vectors of Zd[A]. For the number systems that already possess Property (F), a necessary and sufficient condition to have Property (U) is |D| = |Zd[A]/AZd[A]|. Digit systems that possess both properties (F) and (U) are called standard. Frequently, one additional requirement is imposed on standard digit systems: a zero vector 0d must belong to D (which enables natural positional arithmetics). Standard digit systems in Zd in integer matrix bases have been studied extensively in the literature. Clearly, matrix digit systems are modeled after the usual number systems in Z (see [19] for the negative case). Concerning rational matrices, in dimension d = 1 one recovers the p p 1 base A = q ∈ Q, with p ∈ Z, q ∈ N, gcd(p, q) = 1. In this case, Z[ q ] = Z[ q ] is the set of all rational fractions with denominators that divide some power of q, and the submodule p p 1 q Z[ q ] = pZ[ q ] represents fractions with numerators divisible by p; so that D{0, 1, . . . , p−1} p p d p p is a complete set of coset representatives of Z[ q ] modulo q Z [ q ]. The pair ( q , D) then is a 1 rational matrix number system in Z[ q ]. Such systems have been studied in [2]. If A ∈ Zd×d is an integer matrix, the module Zd[A] reduces to the lattice Zd. Digit systems in lattices with expanding base matrices were introduced by Vince [48–50] and studied extensively in connection with fractal tilings. Indeed, a tiling theory for the stan- dard digit systems with expanding integral base matrices was worked out by Gr¨ochenig and Haas [18], and Lagarias and Wang [31–33]. A corresponding theory for tilings produced by rational algebraic number base systems was developed by Steiner and Thuswaldner [45]. RATIONAL MATRIX DIGIT SYSTEMS 3

When trying to study the finiteness property of digit systems (A, D) for large classes of base matrices A and digits sets D, new challenges of geometrical and arithmetical nature arise. First, if A is allowed to have eigenvalues λ ∈ C of absolute value |λ| = 1, then A−1 is no longer a contracting linear mapping. If such λ are not roots of unity, then there n −n ∞ exist points x ∈ R with infinite, non-periodic orbits (A x)n=1. Even worse, if A has a Jordan block of order ≥ 2 corresponding to the eigenvalue λ on the complex unit circle in its Jordan decomposition, then A−nx can diverge to ∞, as it is easily seen from the simple 1 1 0 2 × 2 example A = by taking x = . These situations require careful control 0 1 1 of vectors in certain directions when multiplication by A−1 is performed. Aside from the issues of geometric nature, arithmetics in Zd[A] is also more difficult when A has rational entries: even the computation of the residue class for the expansions in base A is no longer trivial and causes significant problems. As a result of the aforementioned challenges, properties (F) and (U) no longer go well together: we typically need more than [Zd[A]: AZd[A]] digits to address all possible issues. In this situation, one is forced to make a choice, which property, (F) or (U), must be sacrificed to reinforce another. We make the choice in the favor of Property (F): it is often important to have multiple digital expressions for every x ∈ Zd[A], rather than leave some x with no such expression whatsoever while trying to preserve (U). The aim of the present paper is to “build up” digit sets with Property (F) in an explicit and algorithmic way. We reveal the dynamical systems underlying the digit systems (A, D) and interpret the finiteness property in terms of their attractors. The properties of these dynamical systems are investigated in Section2. After that, we decompose a given rational matrix A into “generalized Jordan blocks”, called the hypercompanion matrices, build digits systems for each such block separately, and then patch them together (see Section4). In these building blocks, generalized rotation matrices play a crucial role in order to treat the eigenvalues of modulus 1. These matrices and their digit sets are thoroughly studied in Section3. The decomposition of A has the advantage that we get much better hold on the size and structure of the digit sets than in previous papers (like [5,22]). This can be used to give new proofs of the main results of [5, 22] which can easily be turned in algorithms in order to construct convenient digit sets for any given matrix A (see Section5). The algorithmic nature of our approach is exploited in the discussion of various examples. In particular, in Section6 we use the Smith Normal Form in order to get results on the size of certain residue class rings that are relevant for the construction of digit sets with finiteness property. In Section7 these results are combined with our general theory in order to construct examples of small digit sets for matrices with particularly interesting properties. Summing up, in the present paper we lay down a comprehensive (and much simplified) theory for the finiteness property in digit systems with rational matrix bases. Our con- struction of the digit sets is based on the theory of matrices, convex geometry and Smith Normal Form representations of lattice bases; these proofs are independent from the previ- ous constructions of [5,22], that were based on digit systems in number fields. In fact, we show that our finiteness result on matrix-base digit systems implies the according result 4 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

on digit systems in number fields, thereby demonstrating that these two finiteness results are of the same strength.

2. Arithmetics of matrix digit systems In this section we discuss discrete dynamical systems associated that represent ’the re- mainder division’ in the module Zd[A]. If these dynamical systems have finite attractors, this enables us to construct a digit system (A, D) with Property (F). We also consider certain restrictions of these dynamical mappings to the integer lattice Zd and their subse- quent extensions to the whole module Zd[A] which appear to be very useful in the practical computations.

2.1. Classical remainder division. Let ∈ Qd×d be given and let D ⊂ Zd[A] be a digit set. We take a closer look at the arithmetics of Zd[A], in particular, the division with remainder. Associated with the digit system (A, D) is the procedure of division with remainder in Zd[A]. As usual, a mapping d : Zd[A] → D is called a digit function if d(x) ≡ x (mod AZd[A]), i.e. if d(x) − x ∈ AZd[A]. Thus, using d we can define the dynamical system Φ: Zd[A] → Zd[A], Φ(x) := A−1(x − d(x)). (2.1) As we allow A ∈ Qd×d to have non-integral coefficients, our first step is to show that division with remainder works essentially in the same way, as in the classical case. In this context, the following definition is of importance. Definition 1 (Attractor of Φ). Let A ⊂ Zd[A] be the set with the property that every d n x ∈ Z [A], there exists n(x) ∈ N, such that Φ (x) ∈ A for every n ≥ n0(x). The intersection AΦ of all such sets A with this property is called the attractor of Φ. The finiteness of the attractor of Φ can be used to obtain a digits system digit system (A, D) that satisfies Property (F).

Proposition 2. Suppose that the quotient function Φ has a finite attractor AΦ. Then, for d n ∞ every x ∈ Z [A], the orbit (Φ (x))n=1 is eventually periodic, with only a finite number of possible periods. In particular, the digit system (A, D ∪ AΦ) has the finiteness property. Proof of Proposition2. By the assumptions of Proposition2, for each x ∈ Zd[A], there is n−1 n n n = n(x) ∈ N, such that x = ε0 + Aε1 + ··· + εn−1A + A Φ (x), with ε1,..., εn−1 ∈ D n d and Φ (x) ∈ AΦ. Thus Z [A] = (D ∪ AΦ)[A] and, hence, (A, D ∪ AΦ) has the finiteness property. As the value of Φn+1(x) depends only on Φn(x), the statement on the ultimate periodicity and periods follows from the finiteness of AΦ.  Suppose that (A, D) is a digit system. Then we can use the dynamical system Φ in order to generate expansions of x ∈ Zd[A]. Indeed, by the definition of Φ there are uniquely defined elements d0, d1,... ∈ D satisfying n−1 n n x = ε0 + Aε1 + ··· + A εn−1 + A Φ (x)(n ∈ N). RATIONAL MATRIX DIGIT SYSTEMS 5

d If the attractor of Φ is {0d} this implies that for each x ∈ Z [A] there is n ∈ N such that n−1 x = ε0 + Aε1 + ··· + A εn−1. (2.2) In this case we say that (2.2) is a finite expansion of x generated by Φ. For number systems in Zd with integer matrices as base it is well-known that a number system (A, D) with an expanding matrix A ∈ Zd×d and a digit set D ⊂ Zd has a finite attractor (see e.g. [49, Section 5]). Our next goal is to show that the same result holds in our more general context. Let A ∈ Qd×d be an invertible rational matrix. As the entries of the vectors in Zd[A] may have arbitrarily large denominators, Zd[A], in general, does not possess any finite Z-basis. This entails that our proofs become a bit more complicated than in the integer case. In particular we will frequently need the following sequence of rational lattices. Starting with the lattice Zd and repeatedly multiplying its vectors by A, k = 1, 2,... times, one defines d d d k−1 d Zk[A] := Z + AZ + ··· + A Z . d d Since Zk[A] ⊂ Zk+1[A], these rational lattices form a nested chain. We need two preparatory lemmas. Lemma 3. If A ∈ Qd×d is invertible, then Zd[A]/AZd[A] is a finite . More- over, there exists k := kA ∈ N, such that d d d d d  d d d d  Z ∩ AZ [A] = Z ∩ AZk[A], and Z [A] AZ [A] = Z Z ∩ AZk[A] . (2.3) In particular, representatives for Zd[A]/AZd[A] can be chosen from Zd. Proof of Lemma3. As Zd[A] = Zd+AZd[A], the Second Isomorphism Theorem for modules yields Zd[A]AZd[A] = Zd + AZd[A] AZd[A] ' Zd Zd ∩ AZd[A] . (2.4) Since A is invertible, Zd ∩ AZd[A] is a d-dimensional additive subgroup of Zd. Hence, it is a lattice and has a finite index in Zd. Therefore, Zd[A]/AZd[A] is a finite Abelian group. Now, consider the nested chain of lattices d d d d d d d d d Z ∩ AZ1[A] ⊂ · · · ⊂ Z ∩ AZj [A] ⊂ Z ∩ AZj+1[A] ⊂ · · · ⊂ Z ∩ AZ [A] ⊂ Z . d d d Since the index Z ∩ AZj [A] in Z cannot decrease indefinitely, the chain must eventually d d d d stabilize, hence, there is a constant k = kA such that Z ∩ AZj+1[A] = Z ∩ AZj [A] holds for j ≥ k. This yields the first identity in (2.3). Thus in order to establish the second identity it is sufficient to prove equality (instead of isomorphy) in (2.4). From Zd[A] = Zd + AZd[A] and Zd = R + Zd ∩ AZd[A], where R is a complete set of coset representatives of Zd/(Zd ∩ AZd[A]), it follows that Zd[A] = R + AZd[A]. Thus, R contains all coset representatives of Zd[A]/AZd[A]. |R| = |Zd[A]/AZd[A]| by (2.4), these representatives also must be different modulo AZd[A]. Therefore, the isomorphism “'” symbol in (2.4) can indeed be replaced with “=”.  Lemma 4. There exists l := l(A, D) ∈ N, such that, for every x ∈ Zd[A] and sufficiently n d large n ≥ nx, Φ (x) ∈ Zl [A]. 6 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

d d Proof of Lemma4. According to Lemma3, there exists k = kA, such that Z ∩ AZ [A] = d d d Z ∩ AZk[A]. Choose the smallest integer l ≥ kA, such that D ⊂ Zl [A]. Assume that m−1 d x = x0 + Ax1 + ··· + A xm−1, with x0,..., xm−1 ∈ Z . Because d(x) ∈ D there l−1 are ε0,..., εl−1 ∈ Z such that d(x) = ε0 + Aε1 + ··· + A εl−1. Therefore we have d d x−d(x) ∈ (x0 −ε0 +AZi [A])∩AZ [A], with i = max{l−1, m−1} from which we conclude d d d d d d that x0 − ε0 ∈ Z ∩ AZ [A] = Z ∩ AZk[A] ⊂ AZl [A]. This implies that Φ(x) ∈ Zj [A], n d where j = max{l, m − 1}. By iteration, eventually Φ (x) ∈ Zl [A].  We are now in a position to prove that expanding matrices lead to finite attractors. Proposition 5. If A ∈ Qd×d is expanding and D is a digit set, then the quotient function d Φ of (A, D) has a finite attractor AΦ ⊂ Z [A]. Consequently, the digit system (A, D ∪ AΦ) has the finiteness property in Zd[A].

n d Proof of Proposition2. By Lemma4, there exists l ∈ N, such that Φ (x) ∈ Zl [A] for every n−1 n n n ≥ n1(x). From x = ε0 + Aε1 + ··· + εn−1A + A Φ (x), ε0,..., εn−1 ∈ D, one deduces n −n −1 −2 −n Φ (x) = A x − A εn−1 − A εn−2 − · · · − A ε0. Since A is expanding, the operator P∞ −n n norm series n=0 kA k∞ < CA < ∞. It means kΦ (x)k ≤ CA max{kεk : ε ∈ D}. As d d Zl [A] is a lattice, Zl [A] ∩ B(0d, r) must be finite. Therefore, Φ has a finite attractor d AΦ ⊂ Zl [A] ∩ B(0d, r). It remains to apply Proposition2.  2.2. Auxiliary lattice and division with remainder with respect to it. Let (A, D) be a digit system. A necessary condition for (A, D) to have the finiteness property is the fact that D contains a complete set of residue class representatives of the group Zd[A]/AZd[A]. Thus it is desirable to shed some light on this group. While in the case of an integer matrix A we have | det A| = |Zd[A]/AZd[A]|, for a rational matrix A the group Zd[A]/AZd[A] and its size is not so easy to. In order to get information on Zd[A]/AZd[A], one must obtain d×d d d the base matrix L ∈ Q for the rational lattice AZk[A] = LZ with k = kA described in Lemma3. Unfortunately, no satisfactory representation theory for the nested lattices d d Zk[A] in Z [A] is yet available for the determination of the required index k = kA in Lemma 3 where the nested chain of lattices stabilizes. Another drawback is that, in general, Zd is not be preserved when doing division with remainder modulo AZd[A]. In order to deal with these issues, in this subsection we introduce an auxiliary lattice and a division with remainder with respect to this lattice, that eventually can be used for the computation of digital expansions in Zd[A]. Indeed, it turns out that complete sets of residue classes are easy to deal with in this auxiliary lattice. Moreover, they contain complete sets of residue classes of Zd[A]/AZd[A]. Definition 6. The lattice Zd ∩ AZd will be referred as the auxiliary lattice of the matrix A ∈ Qd×d. If A is invertible, Zd∩AZd is a full-rank sublattice of Zd, hence, in this case Zd/ Zd ∩ AZd is a finite group. Furthermore, we have the following result. Lemma 7. Let A ∈ Qd×d be given. Then Zd[A]/AZd[A] is isomorphic to a subgroup of Zd Zd ∩ AZd. RATIONAL MATRIX DIGIT SYSTEMS 7

Proof of Lemma7. By applying the 3rd Isomorphism theorem to nested modules Zd ∩ AZd ⊂ Zd ∩ AZd[A] ⊂ Zd, we obtain Zd Zd ∩ AZd Zd ' ' Zd[A]/AZd[A], (Zd ∩ AZd[A])  (Zd ∩ AZd) Zd ∩ AZd[A] where the last isomorphism comes from Lemma3.  An advantage in using the auxiliary lattice Zd ∩ AZd for arithmetics comes from the fact that is base matrix can be computed directly from the base matrix A using its Smith Normal Form, see Section6. We will now develop a special kind of division with remainder based on this auxiliary lattice and its residue group. The first step of this construction is to restrict our division to Zd according to the following definition. d Definition 8. Let Dr ⊂ Z be a finite digit set that contains a complete set of coset d d d d representatives of Z /(Z ∩ AZ ). A restricted digit function is a mapping dr : Z → Dr d d with the homomorphism property dr(x) ≡ x (mod Z ∩ AZ ). To this restricted setting we d d −1 associate the dynamical system Φr : Z → Z given by Φr(x) := A (x − dr(x)). d The attractor AΦr ⊂ Z of the dynamical system Φr is defined analogously to the at- tractor of Φ. In the second step of our construction we extend this restricted division procedure to the full module Zd[A]. For any x ∈ Zd[A], there always exists a smallest k ∈ N, such that d x ∈ Zk[A]. That is, there exists a shortest expansion of the form k−1 x = x0 + Ax1 + ··· + A xk−1, (2.5) d with x0,..., xk−1 ∈ Z . In general, such expressions (even the shortest ones) are not d d unique: for instance, one can modify x0 by adding any element v ∈ Z ∩ AZ to it, and −1 then subtracting A v from x1. However, we re-impose the uniqueness by introducing arbitrary (lexicographic) order O on k-tuples of vectors from Zd, for k ∈ N, and then always picking the expansion (2.5) whose set of vectors (x0,..., xk−1) is the smallest w.r.t. this lexicographic order. Note that the definition of such an order is always possible, since S∞ d×k the set of of all such representations (2.5) is set-isomorphic to the countable set k=1 Z . This order enables us to define a dynamical system Ψ : Zd[A] → Zd[A]. Indeed, let (2.5) be the minimal expansion of x ∈ Zd[A] w.r.t. the order O. Then Ψ is given by −1 k−2 Ψ(x) := A (x − dr(x0)) = (Φr(x0) + x1) + Ax2 + ··· + A xk−1. (2.6)

The attractors AΦr and AΨ of the dynamical systems Φr and Ψ, respectively, are defined analogously to the attractor of Φ. Let A ∈ Qd×d be given. The following lemma shows that it suffices to look at the d dynamical system Φr acting on Z in order to construct a digit system in the larger space Zd[A] that enjoys the finiteness property. d×d d Lemma 9. Let A ∈ Q and let Dr ⊂ Z be a finite set that contains a complete set d d d d of coset representatives of Z /(Z ∩ AZ ). If Φr in Z has a finite attractor AΦr , then d d AΦr = AΨ. In particular, if Φr is ultimately zero in Z , then Ψ is ultimately zero in Z [A] and the digit system (A, Dr ∪ AΦr ) has the finiteness property. 8 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

d d d Proof of Lemma9. As Ψ maps Zj [A] to Zj−1[A], for every x ∈ Z [A], there exists k = k(x), k d n+k n k such that Ψ (x) ∈ Z . Thus, by the definition of Ψ in (2.6) we gain Ψ (x) = Φr (Ψ (x)) for each n ≥ 0. Thus, one eventually ends up with an expansion of an integral vector k d Ψ (x) ∈ Z . This proves that AΦr = AΨ. The remaining assertions immediately follow from this identity.  d d d d d By using Z ,Φr, Dr, and Z ∩ AZ in place of Z [A], Φ, D, and AZ [A] in the proof of Proposition5 we obtain immediately that, for every expanding matrix A ∈ Qd×d, dynamical d system Φr has a finite attractor AΦr in Z . By Lemma9, the same set AΦr then is a finite attractor of the extended remainder division Ψ in Zd[A]. In a similar way, one can replace Φ with Ψ in Proposition5 and prove that the periodicity and finiteness properties of Ψ are completely analogous to those of Φ. Thus, in most cases Ψ can replace the classical remainder division Φ when performing arithmetics in Zd[A]. d In the same way as in (2.2) we define finite expansions of Z generated by Φr as well as finite expansions of Zd[A] generated by Ψ. Using this terminology we get the following corollary. Corollary 10. If A ∈ Qd×d is expanding, then one can always find a digit set D ⊂ Zd, such that the following assertions hold. d a) every x ∈ Z has a finite expansion in D[A] generated by Φr. b) every x ∈ Zd[A] has a finite expansion generated by Ψ. This implies that (A, D) has the finiteness property. Thus, the dynamical system Ψ allows to do radix expansions in Zd[A], while preserving Zd. This feature is extremely handy in constructing “twisted sums” of digit systems in a way that avoids “mixing” the arithmetics of Zd[A] and Zd[B], for different matrices A 6= B. We will come back to this in Section4.

3. The finiteness property for generalized rotations A matrix in Rd×d that is similar to some in Rd×d is called a generalized rotation. These matrices will be of importance when we have to deal with eigenvalues of modulus one in general matrices. In this section we will show how to get small digit sets that ensure the finiteness property for the rational matrices that are generalized rotations. 3.1. Compactness criterion for solutions to a norm inequality. An important prop- erty of the digit sets D we are dealing with will be the fact that the cone of certain subsets of D is the whole space. In this subsection we will study this property. Equip the space d d R with the usual Euclidean norm k·k and let S = {v1, v2,..., vs} be a finite subset of R . Recall that the cone generated by vectors from S is defined as

Cone (S) = {t1v1 + t2v2 + ··· + tsvs : tj ≥ 0, 1 ≤ j ≤ s} , It will turn out that the condition Cone (S) = Rd will be an important property of certain subsets of the digit sets of generalized rotations. One can show that Cone (S) = Rd is equivalent to the fact that 0d is an inner point of the convex hull of D. We give some examples for this property that will be useful latter. RATIONAL MATRIX DIGIT SYSTEMS 9

d Example 11. Let e1, ... , ed be a standard basis of R . Define the set S = {v1,..., vd+1} by ( ej, for 1 ≤ j ≤ d vj := −e1 − · · · − ed, for j = d + 1. d Since {vj, 1 ≤ j ≤ d} is the standard basis of R , and d+1 X −vk = vj, j=1 j6=k one sees immediately that Cone (S) = Rd. Example 12. Let S ⊂ Rd be finite and suppose that the matrix M ∈ Rd×d is invert- ible. If Cone (S) = Rd, then, for every sufficiently large λ > 0, so does the set set Cone (λMS + v) = Rd, where v ∈ Rd for each fixes vector v. We need to restate previous definitions in terms of matrices. Recall that, for any two vectors v, w of equal dimensions with real entries, one writes v ≤ w if every coordinate of v is less or equal than the corresponding coordinate of w: vk ≤ wk. In particular, w ≥ 0 means that all coordinates of w are non-negative. Let M ∈ Rs×d be the matrix whose T rows consist of vectors from S, that is M := (v1 v2 ... vs). If one defines the 1-norm of s v = (t1, . . . , ts) ∈ R by kvk1 = |t1|+···+|ts|, then one can rewrite the previous definitions in equivalent dual form Cone (S) = {M T u : u ∈ Rs, u ≥ 0}. Now we can prove an important criterion on the compactness of the set solutions to the matrix inequality in terms of the dual condition on M T .

s×d d Lemma 13. Let M ∈ R be a real matrix with row vectors S = {v1,..., vs} ∈ R and fix a vector b ∈ Rs, with b ≥ 0. Then the subset V := {x ∈ Rd : Mx ≤ b} of Rd is compact if and only if Cone (S) = Rd. Proof of Lemma 13. “⇐”: Suppose that Cone (S) = Rd. Obviously, V is closed in Rd and 0 ∈ V. Let x ∈ V be arbitrary. Since Cone (S) = Rd, for each standard basis vector d s T T ej ∈ R , 1 ≤ j ≤ d, one can find vectors yj ≥ 0, zj ≥ 0 in R , such that yj M = ej , T T zj M = −ej . The left-multiplication on left and right sides of Mx ≤ bs by yj and by zj, respectively, yields T T T T T T xj := ej x = (yj M)x ≤ yj b, and − xj = ej (−x) = (zj M)x ≤ zj b. T T As the coordinates xj of x are bounded by −zj b ≤ xj ≤ yj b, the set V must be compact. “⇒”: By contradiction, suppose that V is compact but S has no proper enclosure. Since Cone (S) 6= Rd, there exists c ∈ Rd, such that the linear problem M T y = c has no solution y ∈ Rs with y ≥ 0. Then, by Farkas lemma (named after [14], in modern form, stated in [15, Lemma 1 on p. 318]), the dual linear problem Mx ≥ 0 has a non-zero solution x = n ∈ Rd, such that nT c < 0, (geometrically, a hyper-plane with the normal vector 10 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

n ∈ Rd through the origin separates c from Cone (S)). Since b ≥ 0, this means one can find arbitrarily large solutions to the system Mx ≤ b by taking x = −λn ∈ V and arbitrarily large λ > 0. This contradicts the compactness of V.  An easy consequence of Lemma 13 is the following: Remark 14. If the set of solutions V := {x ∈ Rd : Mx ≤ b} is compact, then the set S = Columns(M T ) ⊂ Rd contains at least s ≥ d + 1 vectors, and some d of these are linearly independent among each other. Lemma 13 is the main ingredient of the following result, which will have very important application later. Corollary 15. Suppose that S ⊂ Rd is finite. Then the set of vectors x ∈ Rd which, for every v ∈ S, satisfy kx − vk ≥ kxk is compact if and only if Cone (S) = Rd. Proof of Corollary 15. The inequality is equivalent to kxk2 − 2vT x + kvk2 ≥ kxk2, or, T 1 2 s×d v x ≤ 2 kvk , for each v ∈ S. Suppose that S = {v1,..., vs} and define M ∈ R matrix T T T by M = (v1 ,..., vs ). One obtains a system of linear inequalities Mx ≤ b where the s 2 non-negative vector b ∈ R is defined by bj := 1/2 kvjk . Now apply Lemma 13.  3.2. Generalized rotation and its invariant norm. We now give the formal definition of the main objects of the present section. Definition 16 (Generalized rotation). A real square matrix M ∈ Rd×d is called generalized rotation, if M is similar to some orthogonal matrix R. It is known that matrices M ∈ Rd×d that are diagonalizable over C, with all eigenvalues λ ∈ C of absolute value |λ| = 1 are general rotations; see, for instance [16, [Chapter 9, Section 13, Equations (102)–(106)]]. For a general rotation M there always exists an invertible real transformation T ∈ Rd×d, such that M := TRT −1 takes a block-diagonal form with 1 × 1 blocks (±1) or 2 × 2 blocks cos θ − sin θ , θ ∈ [0, 2π) sin θ cos θ that correspond to eigenvalues λ = eiθ. Such R is a composition of mutually orthogonal T rotations and is itself an orthogonal matrix, i.e., R R = 1d. Details of such decomposition are outlined in [16, Chapter 9, Section 13]), equations (112)–(113) therein. Furthermore, orthogonal matrices R can be parametrized using Cayley formulas [16, Chapter 9, equations (123)–(126)] (cf. [34, 42]). Explicit parametrization formulas in small dimensions d = 3, 4 are available [11,12,35,39,44]. If M is a general rotation, then there exist an M-invariant norm on Rd. Indeed, let T be the aforementioned transformation that brings M to its rotational form R. Define −1 d kxkM := kT xk, where k·k is the usual Euclidean norm in R . Then −1 −1 −1 −1 −1 kMxkM = T Mx = (T MT )T x) = RT x = T x = kxkM , RATIONAL MATRIX DIGIT SYSTEMS 11

since R is orthogonal, and kRyk = kyk for any y ∈ Rd. One important fact that we will need in the sequel: Corollary 15 of previous Section 3.1 still holds true if one replaces the Euclidean norm k·k by this new norm k·kM . Corollary 17. Suppose that the set M ∈ Rs×d is a general rotation and let S ⊂ Rd be d finite. Then the set of vectors x ∈ R which, for every v ∈ S, satisfy kx − vkM ≥ kxkM d n in M-invariant norm k·kM of R is compact if and only if Cone (S) = R . Proof of Corollary 17. The M-invariant norm inequality reads kT −1x − T −1vk ≥ kT −1xk in Euclidean norm, where T ∈ Rd×d is invertible. By continuity, T −1 and T both preserve −1 the open inclusion of 0d between S and T S, as well as the compactness. Hence, Corollary 15 applies.  3.3. Finiteness property for generalized rotations. In this section, we assume that A ∈ Qd×d is a generalized rotation, characterized in Definition 16 of Section 3.2. Gener- alized rotations serve as a fundamental building block to construct digit systems with the finiteness property for general rational matrix with eigenvalues of absolute value = 1. For general rotation bases, we introduce digit sets with special geometric properties. Definition 18 (Good enclosure). The digit set D ⊂ Zd[A] is said to have a good enclosure, if, for each coset representative x ∈ Zd[A]/AZd[A], the subset D(x) := d ∈ D : d ≡ x (mod AZd[A]) n satisfies Cone (D(x)) = R , or, equivalently: the origin 0d always lies in the interior of the convex hull of D(x) for any given residue class modulo (mod AZd[A]). If A is general rotation, then A−1 is also general rotation. Pick an A−1-invariant norm d k·kA−1 in R , defined in Section 3.2. Enumerate the digits D = {d1,..., dk} and define the digit function d : Zd[A] → D by  d ≡ x (mod AZd[A]),  j d(x) := dj ∈ D, such that dj minimizes kx − djkA−1 in D, (3.1) the index j is the smallest possible. The smallest index condition is to impose uniqueness in cases where the norm-minimum d d is achieved for several dj ∈ D(x). The quotient function Φ : Z [A] → Z [A] used in the division with remainder for the digit sets with good enclosures is defined as in (2.1). Now comes the most important result of this section. Theorem 19. Let A ∈ Qd×d be a generalized rotation. If D has a good enclosure, then the remainder division Φ: Zd[A] → Zd[A] with the digit function from (3.1) has a finite d attractor set AΦ ⊂ Z [A]. In particular, Φ is ultimately periodic mapping with a finite number of possible smallest periods.  d Proof of Theorem 19. First we show that the set V := x ∈ Z [A]: kΦ(x)kA−1 ≥ kxkA−1 d −1 is bounded in R . By A -invariance, kΦ(x)kA−1 = kx − d(x)kA−1 . For each x ∈ V, D(x) 6= ∅ by Definition 18 and kx − djkA−1 ≥ kxkA−1 holds for each digit dj ∈ D(x) by (3.1). Since 12 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

D(x) has good enclosure, by Corollary 17, the set of vectors x ∈ Rd that satisfy the last stated norm inequality for each dj ∈ D(x) must be compact. Therefore V must be bounded, and we can define the critical radius r := r(V, D) := supx∈V kxkA−1 + maxd∈D kdkA−1 . n ∞ By Lemma4, there exists l ∈ N, such that the orbit {xn := Φ (x)}n=1 of every point d d d x ∈ Z [A] eventually reaches and then stays in the lattice Zl [A]. Since Zl [A] is a lattice, one cannot have kxn+1k < kxnk for every n > n0. Therefore, kxn+1k ≥ kxnk occurs d infinitely many times. For such n, one must have xn ∈ V ∩ Zl [A]. At the next step after such occurrence, we have

kxn+1kA−1 = kΦ(xn)kA−1 = kxn − d(xn)kA−1 ≤ kxnkA−1 + kd(xn)kA−1 ≤ r(V, D).

In subsequent iterations, we have either xj+1 ∈ V again, or the kxj+1kA−1 < kxjkA−1 . n Therefore, Φ (x) ultimately enters the ball BA−1 (0, r) and then never leaves it. Since d d Zl [A] is a lattice, BA−1 (0, r) ∩ Zl [A] must be finite. Hence, Φ has a finite attractor set d AΦ ⊂ BA−1 (0, r) ∩ Zl [A]. The last statement of Theorem 19 follows from the fact that n+1 n Φ (x) is uniquely determined by Φ (x).  Corollary 20. For every general rotation A ∈ Qd×d, there exists a digit set D ⊂ Zd[A] of the size #D = (d + 1) Zd[A]: AZd[A], such that the division mapping Φ: Zd[A] → Zd[A] is ultimately periodic and has finite attractor. In particular, one can find such digit sets in Zd. Proof of Corollary 20. Let R be a complete set of residue class representatives of the d d d residue class ring Z /(Z ∩ AZk[A]) and take S = {e1,..., ed, −e1 − · · · − ed} from Ex- ample 11 of Section 3.1. For every sufficiently large integer s ∈ N, that is divisible by all denominators of the rational entries of the matrix A, the digit set D := sAS + R ⊂ Zd contains all residue classes (mod AZd[A]) and satisfies the conditions of Theorem 19, as explained in Example 12 of Section 3.1. Now apply Theorem 19.  Corollary 21. For every generalized rotation A ∈ Qd×d, there exist digit sets D ⊂ Zd[A] (and even D ⊂ Zd), such that the digit system (A, D) has the finiteness property in Zd[A]. Proof of Corollary 21. Consider the digit set D0 used in Corollary 20 and apply the second 0 part of Proposition2 to D := D ∪ AΦ.  Remark 22. All results of Section3 for generalized rotations A ∈ Qd×d remain true for d d d Φr in Z with respect to auxiliary lattice Z ∩ AZ , provided that one defines the good arithmetical enclosure property in Zd (mod Zd ∩ AZd) instead of (mod AZd[A]) 18 in Definition 18 and Eq.(3.1), and substitutes Zd in place of Zd[A] where appropriate.

4. Twisted digits systems for hypercompanion matrices In the present section we show how we can build up number systems with property (F) from simple building blocks. We develop a certain version of a direct sum that generalizes the notion of simultaneous digit systems previously considered by K´ovacs [26–28]; see also [43, Section 3] and [47] for related products of number systems in polynomial rings. This will enable us to construct digit sets with Property (F) for the hypercompanion block matrices. RATIONAL MATRIX DIGIT SYSTEMS 13

First, let us recall the notations of ’the direct sum’ of vectors and matrices. For two x vectors x ∈ Qm and y ∈ Qn, their direct sum is a block vector x ⊕ y := ∈ Qm+n. This y notation extends to the sets of vectors S ⊂ Qm, T ⊂ Qn by S ⊕ T := {x ⊕ y : x ∈ S, y ∈ Y}, for instance, Qm ⊕ Qn = Qm+n. Secondly, the direct sum of two matrices, say, A ∈ Qm×m and B ∈ Qn×n is defined as the AO  A ⊕ B = OB.

4.1. Semi–direct (twisted) sums of digit systems. Let A, B be two invertible rational matrices of dimensions m × m, n × n, respectively, let O be the m × n zero-matrix, and C be an n × m integer matrix. By block multiplication we see that the partitioned matrices AO  A−1 O  M = ,M −1 = , CB −B−1CA−1 B−1 are inverse to each other. We will call the partioned matrix M the sum of A and B, twisted by C (a semi–direct sum, or a twisted sum for short). This will be abbreviated as M := A ⊕C B. m n m m m Suppose that DA ∈ Z and DB ∈ Z are the digit sets satisfying Z /(Z ∩ AZ ) ⊂ DA n m m and Z /(Z ∩ BZ ) ⊂ DB. This containment can be strict: digit sets are allowed to be larger than residue sets. Associated with (A, DA) and (B, DB) are the corresponding restricted digit functions together with the dynamical systems m d d dr,A :Z → DA, dr,A(x) ≡ x (mod Z ∩ AZ ), (4.1) m m −1 Φr,A :Z → Z , Φr,A(x) = A (x − dr,A(x)), (4.2) n d d dr,B : Z 7→ DB, dr,B(y) ≡ y (mod Z ∩ BZ ), (4.3) n n −1 Φr,B : Z 7→ Z , Φr,B(y) = B (y − dr,B(y)), (4.4) for x ∈ Zm and y ∈ Zn. They perform division with remainder in the lattices Zm and Zn, respectively; see Definition8 in Section2. We will build the corresponding digit set and restricted remainder division by M in Zm ⊕ Zn = Zm+n modulo the sublattice Zm+n ∩ MZm+n. To account for the carry from the first component to the second, we first set up a modified m+n m+n n digit function der,B : Z → DB and an associated dynamical system Φer,B : Z 7→ Z for the division with remainder (mod Zn ∩ BZn) on the second component of z by

−1   der,B(z) := dr,B (y − C · Φr,A(x)) , Φer,B(z) := B y − C · Φr,A(x) − der,B(z)

The function der,B(z) is well-defined, since C is integral and its dimensions n × m match with the dimensions m × 1 of Φr(x). The function Φer,B(z) is also well-defined, since 14 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

n n −1 y − C · Φr,A(x) − der,B(z) ≡ 0 (mod Z ∩ BZ ), so the multiplication by B produces a vector in Zn. We are now in the position to define the twisted restricted division with remainder by m+n M. Let the twisted digit function dr,M : Z → DA ⊕ DB be given by       dr,A(x) dr,A(x) dr,M (z) := (dr,A ◦ πA)) ⊕ der,B (z) = = , (4.5) der,B(z) dr,B (y − C · Φr,A(x)) x where π : Zm+n 7→ Zm is simply a projection of the first component π = x. It will A A y be abbreviated as dr,M = dr,A ⊕C dr,B. Then we define the associated dynamical system in the usual way by setting m+n m+n −1 Φr,M : Z → Z , Φr,M (z) := M (z − dr,M (z)).

This construction will be abbreviated as Φr,M := Φr,A ⊕C Φr,B. One verifies easily that  −1    A O x − dr,A(x) Φr,M (z) = −1 −1 −1 = −B CA B y − der,B(z)

−1 ! A (x − dr,A(x)) = −1  −1  = B −CA (x − dr,A(x)) + y − der,B(z)   Φr,A(x)   = = (Φr,A ◦ πA) ⊕ Φer,B (z). Φer,B(z)

Thus, Φr,M is defined correctly. Since z = dr,M (z) + MΦr,M (z), we obtain that z ≡ m+n m+n dr,M (z) (mod Z ∩MZ ). This last congruence implies that the mapping z 7→ dr,M (z) (mod Zm+n/(Zm+n ∩ MZm+n)) is a homomorphism from Zm+n to Zm+n/(Zm+n ∩ MZm+n). m+n m+n m+n In particular, Dr,A⊕Dr,B must contain all the representatives of Z /(Z ∩MZ ). By m m m (4.5), dr,M (z) attain all possible values in DA ⊕DB as x and y run through Z /(Z ∩AZ ) and Zn/(Zm ∩ BZm), respectively.

Lemma 23. If 0m ∈ DA, 0n ∈ DB and attractors of Φr,A and Φr,B consist only of a zero m n vectors in Z and Z , respectively, then Φr,M = Φr,A ⊕C Φr,B has attractor {0m+n} in m+n m+n Z . In this case, the digit system (M, DA ⊕ DB) in Z [M], where M = A ⊕C B, has the finiteness property. Proof of Lemma 23. Notice that  k    k Φr,A(x) 0m Φr,M (z) = k−1 = k−1 Φer,B(Φr,M (z)) Φer,B(Φr,M (z))

for k ≥ k0 = k0(x). When the first component x of z is 0, then Φr,M reduces to Φr,B, i.e., dr,M (z) = dr,B(y) and Φer,B(z) = Φr,B(y). Thus,     k 0m 0m Φr,M (z) = k−k0 k0 = , for k ≥ k0 + k1, k1 = k1(z). Φr,B (πB ◦ Φr,M (z)) 0n RATIONAL MATRIX DIGIT SYSTEMS 15

m+n Thus, Φr,M is ultimately zero in Z . To show that (M, DA ⊕ DB) has the finiteness n+m property in Z [M], apply Lemma9 with Ψ M (which is defined in terms of Φr,M ).  4.2. Hypercompanion bases. Equipped with the twisted sums of digit systems we can establish the finiteness result for generalized Jordan blocks matrices. Recall that the com- panion matrix C(f) ∈ Qd×d of a monic polynomial d d−1 f(x) = x + ad−1x + ··· + a1x + a0 ∈ Q[x] of degree d := deg f ≥ 1 is defined by

0 0 ... 0 0 −a0  1 0 ... 0 0 −a1    0 1 ... 0 0 −a2  C(f) = ......  . ......    0 0 ... 1 0 −ad−2 0 0 ... 0 1 −ad−1 Following the notation in [40, Section 8.9, pp. 161–163], we define the the hypercompanion matrix Hk := Hk(f) of f(x) of order k. For k = 1, it is simply equal to H1 := C(f), while, for k ≥ 2, it is defined by k × k block structure C(f) O ··· OO   NC(f) ··· OO   .   ..  Hk(f) :=  ON OO  . (4.6)  . . .   . . .. C(f) O  OO ··· NC(f) d×d Here, N ∈ Z has 1 in its top–right corner and all other entries 0. Clearly, Hk ∈ Qkd×kd. In our paper, we use the transposed form of [40], due to our choice of matrix- vector multiplication. An alternative form of hypercompanion matrices, where N t would appear above the principal diagonal is used in Jacobson [21, [p. 72]. In the literature, the hypercompanion matrices also appear under the names of the (primary) rational canonical form [20], or the generalized Jordan block [9]: in the special case d = 1, Hk is simply the classical Jordan block with a rational eigenvalue of multiplicity k. Lemma 24. Let f ∈ Q[x] of degree d be monic and irreducible over Q, with the associated n×n hypercompanion matrix Hk = Hk(f) ∈ Q of order k and dimension dk. If all the zeros of f(x) in C are of absolute value ≥ 1, then there exists a digit set DHk , containing the dk zero vector, a restricted digit function dr,Hk : Z → DHk with associated dynamical system dk dk Φr,Hk : Z → Z , such that Φr,Hk has attractor {0dk}.

Proof of Lemma 24. Consider the case k = 1. Then H = H1(f) is the of f. Since f is irreducible over Q, there are two possibilities: either f has all roots of absolute value > 1, or all roots of absolute value = 1. In the first case, H−1 is a contraction, 0 and we can take the digit set DH which is a complete set of coset representatives of the d d d residue class ring Z /(Z ∩ HZ ) which leads to a finite attractor of ΦH1,r. In the second 16 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

case, H is a generalized rotation, so according to the Remark 14, there exists a digit set 0 d d d DH that contains all coset representatives of Z /(Z ∩HZ ) and that has a good enclosure. −1 d 0 In both cases, the division mapping Φr,H (x) = H (x − dr,H (x)), where dr,H : Z → DH d d satisfies dr,H (x) ≡ x (mod Z ∩HZ ) is ultimately periodic by Remark 10 and Remark 14. 0 Now take DH to be the union of DH , the zero digit 0n and the points from the attractor d of ΦH in Z , and modify the digit function dr,H so that it dr,H (x) = x for x = 0n or x in the attractor. Clearly, Φr,H has attractor {0n}. Hence, (H, Dr,H ) now has Property (F) in Zd[H]. Assume that the lemma is true for all hypercompanion matrices of order ≤ k, and that

we already have the digit sets DHk and functions dr,Hk ,Φr,Hk with the required properties. Notice that, by denoting the d × d(k + 1) block matrix G = (O...ON) with integer

entries, one can write Hk+1 is a twisted sum Hk+1 = Hk ⊕G H1. By Lemma 23, the

dynamical system Φr,Hk+1 := Φr,Hk ⊕G Φr,H1 with the digit set DHk ⊕ DH1 and the digit

function dr,Hk+1 := dr,Hk ⊕G dr,H1 has attractor {0} and, hence, (Hk+1, DHk ⊕ DH1 ) has the d(k+1) finiteness property in Z [Hk+1]. 

5. Applications to the general theory In this section we use our theory in order to give new proofs of some general character- ization results of Property (F) established in [5] and [22]. The advantage of these proofs is the fact that they are more algorithmic and allow good control on the size of the digit sets. In [22], we have proved the following result. Theorem 25 (Jankauskas and Thuswaldner [22]). Let A be an d × d matrix with rational entries. There is a digit set D ⊂ Zd[A] that makes (A, D) a digit system in Zd[A] with finiteness property if and only if A has no eigenvalue λ with |λ| < 1. The digit set D can even be chosen to be a subset of Zd. The proof Theorem 25 in [22] essentially builds on the following theorem. Theorem 26 (Akiyama et al. [5]). Let α ∈ C. Then, there is a finite subset F of Z, such that Z[α] = F [α], if and only if α is an algebraic number whose conjugates, over Q, are all of modulus one, or all of modulus greater than one. In order to prove Theorem 25 in [22], the main result of [5], Theorem 26, was translated into the polynomial ring setting and formulated in terms of a finiteness property for the representations of polynomials in the quotient ring Z[x]/(f), where f = f(x) ∈ Z[x]. Then, it was shown that this finiteness property can be transferred from these intermediate polynomial rings to companion matrices of powers of irreducible factors of f(x). The last step was to “assemble” the finite representations together through the Frobenius normal form of A. While our approach in [22] resulted in a very concise proof of Theorem 25, the introduction of intermediate algebraic structures make the practical computation of the radix expansions extremely complicated. First key moment – the control on the orbit of A−nx in the directions of eigenvectors with |λ| = 1 – is achieved through the embedding RATIONAL MATRIX DIGIT SYSTEMS 17

d Q into a more complicated representation space R × p Qp (an open subset of an ad`elering) in the proof of Theorem 26 in [5]. The second key moment – control over the behavior of A−nx in the directions that correspond to Jordan blocks of order m ≥ 2 – is performed in [22] by convolving the finite representations in the intermediate rings Z[x]/(f m). This obscures the dynamics of the radix expansion process. Another side effect is, that the introduction of the intermediate structures and the subsequent process of assembling the finite representations typically blows out the sizes of the digit sets. All factors combined, the proof of 25 in [22] does not translate in a straightforward way into a practical algorithm and makes the computation of radix expansions in (A, D) rather complicated. These drawbacks are no longer there in the proofs of these theorems we will now provide.

Proof of Theorem 25. We first prove the sufficiency: if all the eigenvalues of A are of absolute value ≥ 1, there exists (A, D) with the finiteness property in Zd[A]. By [40, Chapter 8, p. 162, Theorem 8.10] there exists an invertible matrix T ∈ Qd×d, −1 r such that B = T AT takes a block diagonal form B = ⊕j=1Hj, where each block Hj = dj ×dj Hkj (fj) ∈ Q , 1 ≤ j ≤ r, 1 ≤ dj ≤ d, d1 + ··· + dr = d, is a hypercompanion matrix of order kj of a monic irreducible polynomial fj(x) ∈ Q[x] that divides the characteristic −1 −1 polynomial Φr(x) of A. Since for any t ∈ Z,(tT )A(tT ) = T AT , we can assume that T ∈ Zd×d. First, we will construct the digit system with the finiteness property for the module Zd[B]. By assumption, A ∈ Qd×d has no eigenvalues λ ∈ C of absolute value |λ| < 1. By the irreducibly of fj, all eigenvalues of Hj are of absolute value > 1, or all of them are of absolute value = 1. We consider two possibilities: a) every Hj either is expanding, or has order kj = 1; b) some Hj of order kj ≥ 2 are not expanding, that is, have only unimodular eigenvalues.

Case a) according to Proposition5 (for expanding matrices Hj) and by Corollary 21 (for dj dj generalized rotation matrices Hj), there exists digit sets Dj ⊂ Z [Hj] (and even Dj ⊂ Z ), dj such that each digit system (Hj, Dj) has the finiteness property in Z [Hj]; each such digit dj dj system is equipped with the dynamical system Φj : Z [Hj] → Z [Hj], each of which dj has attractor {0dj } in Z [Hj]. In order to compensate for the different lengths of radix expansions across all blocks, we need 0dj ∈ Dj (or simply adjoin the zero vectors to the r r digit sets). Then we take their catesian product D := ⊕j=1Dj. Since B = ⊕j=1Hj, one d r dj readily verifies Z [B] = ⊕j=1Z [Hj]. By the finiteness property of (Hj, Dj), for each j, dj n 1 ≤ j ≤ r, Z [Hj] = Dj[Hj]. By collecting terms with equal powers of matrices Hj in the same vectors and use padding with zero vectors in each factor, if necessary, when exchanging ⊕ and the P in radix expansions (see [22, (5),(6)]), one obtains

d r r r Z [B] = ⊕j=1Dj[Hj] = (⊕j=1Dj)[⊕j=1Hj] = D[B]. (5.1)

r r In other words, the digit system (⊕j=1Hj, ⊕j=1Dj) = (B, D), and it has the finiteness d r property in Z [B]. The dynamical system Φ = ⊕j=1Φj then performs the division with remainder by B in Zd[B]. 18 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

Case b) is more subtle. By Lemma 24, for each non-expanding Hj of order kj ≥ 2 and dj dimension dj ×dj, there exists an integer digit set Dj ⊂ Z containing 0dj , and a restricted dj dj dj dynamical system Φr,Hj : Z → Z , that has attractor {0dj } in Z . Then, one constructs dj the extended division function Ψj in Z [Hj], as in (2.6), that performs division with dj dj remainder by Hj in Z [Hj] with respect to Dj. Then Ψj has attractor {0dj } in Z [Hj], dj and Dj[Hj] = Z [Hj] by Lemma9. From that point on, one takes the direct sum (5.1) dj over every Dj[Hj] as in case (a), only using the the extended division Ψj in Z [Hj] in the place of Φj, whenever kj ≥ 2 and Hj is not expanding. Thus, in both cases (a) or (b), one arrives to the situation Zd[B] = D[B], for some finite digit set D ⊂ Zd[A], which can be also be selected from Zd, if necessary. The last step is the same as in the proof of [22, Theorem 2, p. 357], after conjugating with T ∈ Zd×d, and using TBT −1 = A, one obtains (T Zd)[A] = D0[A], with D0 = T D. As T Zd ⊂ Zd is a sublattice, a set of residue class representatives R of Zd/T Zd is finite, and Zd = TZd + R. This gives Zd[A] = (T Zd + R)[A] = (T Zd)[A] + R[A] = D0[A] + R[A] = D00[A], for the finite digit set D00 := D0 + R. For the converse part of the Theorem 25, we proceed as in [48], [17], or [22]. Assume k that (A, D) has the finiteness property. Pick arbitrary z = d0 + Ad1 + ··· + A dk ∈ D[A] d t t t t t k t and let v ∈ C satisfy v A = λv . If |λ| < 1, then v z = v d0 + λv d1 + . . . λ v dk, As D is finite, pick C > 0, such that |vtd| < C, for every d ∈ D. Then, t t t k (

k k d ! k+d min{d,i}  k+d X i X i X j−1 X i−1 X X i−1 z = A di = A dijA e1 = A  di−j,je1 = fiA e1, j=0 i=0 j=1 i=1 j=1 j=1 RATIONAL MATRIX DIGIT SYSTEMS 19

Pmin{d,i} where fi := j=1 di−j,j ∈ F . Hence, D[A] ⊂ F [A]e1. In view of (5.2), Z[A]e1 ⊆ F [A]e1 ⊆ Z[A]e1, since F ⊂ Z. Therefore, Z[A]e1 = F [A]e1. Now pick the right eigen- d t vector v ∈ C of A, such that v e1 6= 0 (such v exists, because the companion matrix A of the minimal polynomial of α 6= 0 is diagonalizable over C and invertible). Then t 0 0 t 0 t v A = α v, where α is algebraically conjugate to α over Q. Since v Z[A]e1 = Z[α ]v e1, t 0 t t 0 0 v F [A]e1 = F [α ]v e1, v e1 6= 0, we obtain Z[α ] = F [α ]. By applying the Galois auto- morphism α0 7→ α, we find that Z[α] = F [α]. Conversely, assume that Z[α] = F [α] for some finite set F ∈ C. Then, F is a subset of Z[α] itself. Suppose that α has an algebraic conjugate over Q of absolute value < 1. We proceed in the same way as in the lattice digit system case. By taking Galois automorphism α 7→ α0, we see that Z[α0] = F 0[α0], for some finite set F 0 ⊂ Z[α0]. Therefore, we can assume that α itself is of the absolute value < 1. Then, an arbitrary element of β ∈ F [α], n β = f0 + f1α + ··· + fnα , fj ∈ F is of absolute value at most |β| ≤ C(1 + |α| + ··· + |αn|) < C/(1 − |α|), where C = maxf∈F |f|. This shows that F [α] is a bounded subset of C, which is impossible, because it contains Z, if F [α] = Z[α]. 

6. Maximal integral sublattice of a rational lattice For practical computations in Section7, the auxiliary lattice of the form L = Zd ∩ AZd (that is, ‘the integral part’ of AZd), where A is an invertible rational matrix, and the group of its coset representatives Zd/L) play very important roles. In particular, Zd/L can be viewed as ’the approximation of the first order’ to the group AZd[A]/Zd[A], hypothetically the smallest necessary subset of digits needed to represent elements of Zd[A]. Since it is desirable to control the size of a digit set we will need a formula for the basis matrix and the coset representatives of this auxiliary lattice L in Zd.

6.1. Review of lattices. We recall basic facts on lattices. An additive subgroup L ⊂ Rd is called a lattice, if L is a uniformly discrete and relatively dense subset of Rd. In this case, L is a free Z- module of rank d and there exists a set {v1, v2,..., vd} of d linearly d independent (over R) vectors in R that generate L over Z, so that L = Zv1+Zv2+···+Zvd ([36]Proposition 4.2 of Section 4) . This can be also written as L = LZd, where L ∈ Rd×d d×d d×d denotes the basis matrix with columns v1, ... , vd. In particular, if L ∈ Q or L ∈ Z , then L is called rational, or integral lattice, respectively. The matrix L is not unique and depends on the choice of the basis for L. Two lattices L = LZd and M = MZd, L, M ∈ Rd, are nested L ⊂ M if and only if L is left divisible by M in Zd×d, i.e., if there exist an integer matrix Q ∈ Zd×d, such that L = MQ. In particular, L = M if and only if Q is a , that is, det(Q) = ±1; in that case M = LQ−1. In particular, for any unimodular Q ∈ Zd×d, one has QZd = Zd. From the theory of the Smith Normal Form (SNF) [37, 38], for an arbitrary invertible matrix B ∈ Zd×d there exist unimodular matrices P,Q ∈ Zd×d, such that B = PDQ−1, 20 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

where D = SNF(B) is the unique ,

n1 0 ... 0   0 n2 ... 0  D =  . . . .  , (6.1)  . . .. .  0 0 . . . nd

whose entries n1, ... , nd, called the elementary divisors, are positive satisfying the divisibility properties n1 | n2, n2 | n3, ... , nd−1 | nd. The matrices P , Q, and D can be found by reducing the rows and columns of B through the integer division with remainder (which corresponds to invertible base transformations of in Zd and L = BZd). A few other facts on SNF that we will need further are summarized in Proposition 27. Proposition 27. Let L = LZd, L ∈ Zd×d be a lattice that has a SNF factorization L = PDQ−1. Then Zd = LZd + R, where the R is the full set of coset representatives

( d ) X S := jiP ei, 0 ≤ ji ≤ ni − 1 . (6.2) i=1

d Here, ei, i = 1, . . . , d is the standard basis of Z and ni are the elementary divisors from d D = SNF(L). Consequently, [Z : L] = |R| = n1 ··· nd = |det(D)| = |det(L)|.

d d Proof of Proposition 27. As D is diagonal, Z /DZ ' Zn1 ⊕ Zn2 ⊕ · · · ⊕ Znd with the nPd o d d set of representatives T := i=1 jiei, 0 ≤ j ≤ ni − 1 . Hence, Z = DZ + T . By the unimodularity of P and Q, Zd = P Zd = PDZd + P T = PDQ−1Zd + P T . Setting S := P T we obtain Zd = PDQ−1Zd + P T = LZd + S. Notice that P x ∈ Zd belongs to LZd = PDQ−1Zd = PDZd if and only if x ∈ DZd, therefore Zd/DZd and Zd/LZd are isomorphic. The last statement follows. 

6.2. A result on rational lattices. We turn our attention to rational lattices L = AZd, where A ∈ Qd×d is invertible. Let q ∈ N be a common denominator to the fractions that appear in the entries of A (not necessary the smallest one). Then A = q−1B, where B ∈ Zd×d. We are interested in the largest integral sub-lattice Zd ∩ L = Zd ∩ (q−1B)Zd. Theorem 28. Let B ∈ Zd×d have SNF factorization B = PDQ−1, with elementary divisors 0 −1 −1 n1, ... , nd, and let q ∈ N. Then the matrices L = PN and L = LQ = PNQ , with

n1/ gcd(q, n1) 0 ... 0   0 n2/ gcd(q, n2) ... 0  N =  . . . .   . . .. .  0 0 . . . nd/ gcd(q, nd) where n1, n2, ... , nd stands for the elementary divisors of D = SNF (B), are two possible basis matrices for the maximal integral sub-lattice Zd∩L of a rational lattice L := q−1BZd ⊂ RATIONAL MATRIX DIGIT SYSTEMS 21

Qd. The set ( d ) X S = jiP ei, 0 ≤ ji < ni/ gcd(ni, q) i=1 consists of all distinct coset representatives of Zd/(Zd ∩ L). Proof of Theorem 28. Consider the scaled lattice M := q · Zd ∩ L = qZd ∩ BZd. Then M0 := P −1M = (qP −1)Zd ∩ (P −1B)Zd = (qP −1Zd) ∩ (P −1B)Zd = qZd ∩ (P −1B)Zd, since P −1Zd = Zd. Also, (P −1B)Zd = P −1BQZd = DZd. Therefore, M0 = qZd ∩ DZd. As qZd consists of vectors whose entries are divisible by q and DZd consists of vectors whose d d i-th entry is divisible by ni by (6.1), 1 ≤ i ≤ d, qZ ∩ DZ consists of vectors whose i-th 0 d entry is divisible by lcm(q, ni). In other words M = CZ , where C is

lcm(q, n1) 0 ... 0   0 lcm(q, n2) ... 0  C =  . . . .  .  . . .. .  0 0 ... lcm(q, nd) Scaling back, Zd ∩ L = q−1M = P (q−1C)Zd = PNZd = PNQ−1Zd. Therefore, one can take L := PN orL0 = PNQ−1 to be the basis matrix of Zd ∩ L. Coset representatives are obtained from (6.2) in Proposition 27.  In order to state the next result, recall that the content [7] of the polynomial f(x) = d adx + ··· + a1x + a0 ∈ Z[x] is defined by c(f) := gcd(|a0| , |a1| ,..., |an|). By the Gauss Lemma [7], for any two polynomials f, g ∈ Z[x], one has C(f · g) = C(f) ·C(g). Theorem 29. Let B ∈ Zd×d be invertible and q ∈ N. The index of the maximal integral sublattice Zd ∩ L of L = q−1BZdin Zd is |det(B)| [Zd : Zd ∩ L] = , C (ϕD(qx))

where and ϕD(x) is a characteristic polynomial of D = SNF(B). Proof of Theorem 29. By Theorem 28, d Y nj |det(B)| [Zd :(Zd ∩ L)] = det N = = . gcd(q, n ) Qd j=1 j j=1 gcd(q, nj) Qd The content of nj − qx is exactly gcd(q, nj). Since ϕD(x) = j=1(nj − x), one has Qd Qd j=1 gcd(q, nj) = j=1 C(nj − qx) = C (ϕD(qx)). 

7. Numerical examples We illustrate the main features of the theory of digit systems developed so far with examples. 22 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

7.1. Rotation digit system associated to smallest Pythagorean triple. Consider the 2 × 2 matrix 3/5 −4/5 A = , 4/5 3/5 that corresponds to the Pythagorean triple 32 + 42 = 52. This is a rotation by the angle θ = 53.1301023542 ...◦. We shall construct a small digit set D, such that (A, D) in Z2[A] has the finiteness property. First, we determine the basis for the auxiliary lattice L := Z2 ∩ AZ2. Let 3 −4 B := 5A = . 4 3

2 2 1 2 2 −1 Then, L = Z ∩ AZ = 5 (5Z ∩ BZ ). The SNF decomposition yields B = PDQ with 1 0  7 1  1 3 D = ,P = ,Q = . 0 25 1 0 −1 −4 with det P = det Q = −1. According to Theorem 28, L = LZd with the basis matrix 7 1 1/gcd(5, 1) 0  7 1 1 0 7 5 L = PN = · = · = . 1 0 0 25/gcd(5, 25) 1 0 0 5 1 0 One possible set of coset representatives of Z2 modulo L (equivalent to the one given in Theorem 28) is 2 S = Z /L = {0P e1 + 0P e2, 0P e1 + 1P e2, 0P e1 + 2P e2, 0P e1 + 3P e2, 0P e1 + 4P e2} = 0 1 2 3 4 = , , , , = 0 0 0 0 0

After translating S by −2e1, we obtain an equivalent set of representatives with reduced coordinates: −2 −1 0 1 2 R := S − 2e = U −1 = , , , , = 1 0 0 0 0 0

= {−2e1, −e1, 0, e1, 2e1}. Next, we construct a pre-periodic digit set D0 that has a good convex enclosure with respect to R as depicted as points in Fig. 7.1. Notice that the residues e1 and 2e1 are the inner points of a triangle with vertices 0 2  3 T = , , ⊂ L. 1 0 1 −1

Likewise, −e1, −2e1 are the inner points of the triangle with vertices in −T1. The last residue 02 is an inner point of the triangle with vertices −2 −1  3 T = , , ⊂ L. 2 −1 2 −1 RATIONAL MATRIX DIGIT SYSTEMS 23

3

2

1

3 2 1 1 2 3

1

2

3

Figure 1. Points from L = Z2 ∩ AZ2 (blue) and from R = Z2/L (green). Two small dark grey triangles, namely, T1 and −T1 (grey) and one big light grey triangle T2 with vertices in L enclose elements of R.

Define the sets 2  1 −3 D(0) := 0 − T = , , , 2 1 −2 1 −1 1 −2 D(e ) := e − T = , , , 1 1 1 −1 0 1 −1  2 1 D(−e ) := −e + T = , , . 1 1 1 0 −1 1  0 2 −1 D(2e ) := 2e − T = , , , 1 1 1 −1 0 1 −2  1 0 D(−2e ) := −2e + T = T , , . 1 1 1 0 −1 1

Therefore, 02 is an inner point of these sets. Therefore, their union [ D0 = D(x) x∈R has good enclosure with respect to R. By Theorem 19 and Remark 22, the division −1 0 2 mapping Φr(x) = A (x − dr(x)) with the digit dr(x) ∈ D , restricted to Z , has a finite 24 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

1 3

2 2 1 1 2

1 1

2 2 1 1 2

3 1

(a) x = (−2, 0)T (b) x = (2, 0)T

2 4

1 3

2 1.0 0.5 0.5 1.0 1.5 2.0

1 1

2 2 1 1 2

3 1

4 2

(c) x = (−1, 0)T (d) x = (1, 0)T

4

3

2

1

3 2 1 1 2 3

1

2

3

(e) x = (0, 0)T

Figure 2. Repeller points RepΦr (x) (in red) inside the regions of repelling 2 action of Φr (in grey), for each residue class x ∈ Z /L. Green colored are the remaining points from the same residue class x + L. RATIONAL MATRIX DIGIT SYSTEMS 25

2 attractor AΦr in Z . To compute the set AΦr , first notice that our present matrix A is already in the required orthogonal rotation: by taking the T = 12 in the definition of A–invariant norm form on p.11, one obtains that the usual Euclidean norm −1 k... k2 is A and A –invariant. To determine the attractor set AΦr , one needs to find the 2 repeller points x ∈ Z , such that kΦr(x)k −1 ≥ kxk −1 and then determine their orbits. A A S In our case, we need to compute all the integral points in the feasible regions x∈R V(x), such that V(x) := {y ∈ Rn : kx − dk ≥ kxk , ∀d ∈ D0(x)}. By Corollary 17 the feasible regions V(x) are compact since D has good enclosure with respect to R. For each x ∈ R, we write down and solve the linear program that corresponds to V(x), as in the proof of Corollary 17. We use SAGE [46] Polyhedron and Mixed Integer Linear Programming (MILP) modules in a combination with PPL solver to explicitly solve for the feasible regions and enumerate the sets of contained integer points

RepΦr (x) := V(x) ∩ (x + L), refer to Figure 7.1. Our calculations yield: −1 1 Rep (−2e ) = , Rep (2e ) = , Φr 1 −2 Φr 1 2

 0 0 Rep (−e ) = , Rep (e ) = , Φr 1 −2 Φr 1 2 and −1 0 −2 Rep (0) = , , . Φr 2 0 −1 The last step is to optimize the digit set by picking upt the minimal possible number of

representatives from the periods in orbits of points in RepΦr (x). To find this minimal set, we compute the images 0 0 1  0 −2 −1 Φ = Φ = , Φ = Φ = , r 0 r 2 2 r −2 r −1 −2

−1  2  2 0 Φ = , Φ = r 2 −1 r −1 0 and, 1 1 −1 −1 Φ = , Φ = . r 2 2 r −2 −2 Therefore, any orbit of a point x ∈ Z2 eventually hits the set 1 −1 P = , . 2 −2 For the final digit set, we take D = D0 ∪ P. 26 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

2

1

3 2 1 1 2

1

2

Figure 3. The digit set D: the initial digits D0 (violet) and additional

points from AΦr (orange) that represent periods; notice that 02 6∈ D.

It consists of 17 digits, all depicted in Figure in 7.1. Any Z2 vector has a finite radix expansion in base A with digits D. For instance, the radix expansion of (−6, 7)t ∈ Z2 is

 6  1  1 −2 −1 0 1 = + A + A2 + A3 + A4 + A5 ∈ D[A]. −7 −2 −1 0 1 1 2

It is remarkable that non-trivial rotational digit systems that possess the finiteness prop- erty in principle do not require zero digit 0d ∈ D. In the present example, the zero vector 02 is represented in D[A] as

0 2 −2 = + A . 0 1 1

In some situations (like taking the twisted sums of the rotational digit systems), the arti- ficial inclusion of 0d in D might be necessary, see Section 7.2. The finite digital expansions of vectors from lattice from Z2 in the digit system (A, D) yield the finite expansions of vectors from module Z2[A]. Let us illustrate the expansion process for the vector

−156/25 −3 0 −1 v = = + A · + A2 ∈ Z2[A]. −8/25 0 2 2 RATIONAL MATRIX DIGIT SYSTEMS 27

−3 −1 −2 By applying the mappings D ,Φ , one expresses = + A and then A r 0 1 1 −2 0 carrying forward and adding to yields 1 2 −1 −2 −1 v = + A · + A2 1 3 2 −2 −1 1 Similarly, = + A gives 3 1 2 −1 −1 0 v = + A · + A2 1 1 4 0 By replacing in D[A] with its expansion in D[A], one finds 4 −156/25 −1 −1 −1 1  2 = + A · + A2 + A3 + A4 ∈ D[A]. −8/25 1 1 1 0 −1 It should be noted that, for this process to work, one must know at least one arbitrary Pk−1 j 2 (not necessarily the shortest one) representation of the form j=0 A zj, zj ∈ Z [A] of the vector v ∈ Z2[A] to perform the subsequent digital expansion.

7.2. Twisted sum of a rotational digit system with itself. Consider the matrix 0 −1  A = , 1 −1/2

2 that is a companion matrix to its characteristic polynomial ϕA(x) = x +1/2x+1. It is easy to see this is a generalized rotation: it is similar to via the transformation √  −1/4 − 15/4 4 0  √ T = √ ,T −1AT = 15/4 −1/4 1 15   .

2 −1 −1 The R norm kxkA−1 = kT xkeuclidean is then A invariant. Calculations similar to the ones in Section 7.1 yield the residue group with respect of the lattice 2 2 L = Z2 ∩ AZ2 = LZ2,L = 1 0 is 0 1 R = Z2/L = , . 0 0 By by enclosing these residue vectors inside the trianlges with vertices −2 2  2 0 2  2 T := , , , T := , , , 1 0 1 −1 2 0 1 −1 28 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

1.0

0.5

2 1 1 2

0.5

1.0

Figure 4. Points from L = Z2 ∩ AZ2 (blue) and from R = Z2/L (green). T Two small dark grey triangles, namely, T1 and T2 (light grey) enclose (0, 0) and (0, 1)T , the elements of R. as depicted in Figure 7.2, one finds the pre–periodic digit set 0 0 1 1 D := − T , D := − T , 0 0 1 0 0 2 0 [ 1 2 −2 −2 1 −1 −1 D0 = D D = , , , , , . 0 0 0 −1 1 0 −1 1 −1 2 Then Φr(x) = A (x − dr(x)) is ultimately periodic in Z . The subsequent analysis of the repeller points, similar to the one in Section 7.1 carried out by solving corresponding linear programs yields 11 integral repeller points  0  0  0  0 0 0 0 2 2 −1 1 Rep := , , , , , , , , , , , Φr −4 −3 −2 −1 0 1 2 4 5 0 2 as illustrated in Figure 7.2, (a) and (b). It turns out, the orbits of each repeller point already contains at least one digit of D0 that is depicted in 7.2. Therefore, the digit system (A, D0) with 6 digits already has the finiteness property in Z2[A]. 0 Next we append the zero vector D = D0 ∪ . in order to construct the twisted 0 sum if this digit system with itself. Consider the twisted sum M = A ⊕N A, where 0 −1 0 0     0 1 AO2×2 1 −1/2 0 0 N = ,M := A ⊕N A = =   . 0 0 NA 0 1 0 −1 0 0 1 −1/2 RATIONAL MATRIX DIGIT SYSTEMS 29

6 2.5

2.0 4 1.5

2 1.0

0.5

2 1 1 2 3 1.0 0.5 0.5 1.0

2 0.5

1.0 4

1.5

(a) x = (0, 0)T (b) x = (1, 0)T

Figure 5. Repeller points RepΦr (x) (in red) inside the regions of repelling 2 action of Φr (in grey), for each residue class x ∈ Z /L. Remaining points x + L are colored green.

1.0

0.5

2 1 1 2

0.5

1.0

Figure 6. The digit set D0 for which (A, D0) has finiteness property in 2 0 Z [A]. Notice again that 02 6∈ D . 30 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

The matrix M = H2(ϕA) is an order–2 hypercompanion matrix to the polynomial ϕA(x). 2 Then the digit system (A ⊕N A, D ⊕ D) has the finiteness property in Z [A] by Lemma 23: 2 the radix expansions in Z are done using the mapping Φr,M described in Section 4.1. For instance,  1  1 2 0  0 0  2  0 0 2 0 3  0 4 0   =   + M   + M   + M   + M   −3 −1 2 1 −2 1 4 1 0 0 −1 0 The finiteness property of (M, D) extends to the whole module Z2[A] through the mapping ΨM (2.6) by Corollary 10. The digit set D × D is not the smallest possible digit set for which the digit system that has M as its base matrix retains the finiteness property. It can be shown that it is 0 possible to minimize the digit set size further by using the digits D1 = D ⊕ R for vectors 0 x ⊕ y ∈ Z4 until x 6= 0 and switching to digits D = ⊕ D0 after x ∈ Z2 part of 2 2 0 00 x ⊕ y becomes = 02 in the dynamical system Φr,M . Such a digit system (A, D ) with the 00 2 digit set D = D1 ∪ D2 consists of 18 digits and has the finiteness porperty in Z [A]. It’s highly likely 18 is the minimal possible digit set size for which the finiteness property still holds in this particular base M. The code for the examples provided in Section 7.1 and 7.2 is available to download online from [23].

8. Concluding remarks We would like to conclude this paper by adding two open problems to the list of questions posed in [22] on the arithmetics of module Zd[A]. Problem 30. Let x ∈ Qd be such that every prime factor p ∈ N of the least common denominator of its coordinates divide the least common denominator of the entries in the matrix A. Is it true that such x ∈ Zd[A]? Note that if there exists a prime number p ∈ N, such that p divides the least common denominator of the coordinates of x and p does not divide the denominator of any entry of A ∈ Qd×d then it is clear that x 6∈ Zd[A]. Problem 31. Let A ∈ Qd×d be non–degenerate. How to compute the stabilization index kA in Lemma3, namely, the smallest integer k := kA, such that d d d d d d d k−1 d Z ∩ AZ [A] = Z ∩ Zk[A] = Z ∩ Z + AZ + ··· + A Z ?

We know how to find such kA for certain classes of matrices A, but the general case seems to be tied deeply to the representations of lattices (i.e. discrete subgroups) in locally compact groups. Let us conclude with one final remark. If (A, D) is the classical standard digit system in Zd for some expanding base matrix A ∈ Zd×d and some digit set D ⊂ Zd, then the RATIONAL MATRIX DIGIT SYSTEMS 31

knowledge of the number of digits in the set D (which can be determined by observing the number of different symbols used in strings corresponding to radix expansions of random vectors) immediately yields the value of |det A|. Thus, it determines the possible conjugacy classes of A in the group GL(d, Z). In contrast, for the rotational digit systems (A, D), A ∈ Qd×d with Property (F), described in Section3, the size of the digit set depends on the attractor set AΦr , which in turn depends (in a complicated way) on the choice of the coset representatives and their convex enclosures. Therefore, the size of D alone does not reveal so much information about the base matrix A or its main characteristics, like the or the dimension of A. It would be interesting to know if this could be useful in cryptography applications (in particular, for scrambling the messages and encoding data streams).

References [1] Shigeki Akiyama, Paulius Drungilas, and Jonas Jankauskas, Height reducing problem on algebraic integers, Funct. Approx. Comment. Math. 47 (2012), no. part 1, 105–119. MR2987115 [2] Shigeki Akiyama, Christiane Frougny, and Jacques Sakarovitch, Powers of rationals modulo 1 and rational base number systems, Israel J. Math. 168 (2008), 53–91. MR2448050 [3] Shigeki Akiyama and Attila Peth˝o, On canonical number systems, Theoret. Comput. Sci. 270 (2002), no. 1-2, 921–933. [4] Shigeki Akiyama and Hui Rao, New criteria for canonical number systems, Acta Arith. 111 (2004), no. 1, 5–25. [5] Shigeki Akiyama, J¨orgM. Thuswaldner, and Toufik Za¨ımi, Comments on the height reducing property II, Indag. Math. (N.S.) 26 (2015), no. 1, 28–39. MR3281687 [6] Shigeki Akiyama and Toufik Zaimi, Comments on the height reducing property, Cent. Eur. J. Math. 11 (2013), no. 9, 1616–1627. MR3071928 [7] D. D. Anderson, GCD domains, Gauss’ lemma, and contents of polynomials, Non-Noetherian com- mutative ring theory, pp. 1–31. [8] Guy Barat, Val´erieBerth´e,Pierre Liardet, and J¨orgThuswaldner, Dynamical directions in numera- tion, Ann. Inst. Fourier (Grenoble) 56 (2006), no. 7, 1987–2092. Num´eration, pavages, substitutions. [9] Phani Bhushan Bhattacharya, Surender Kumar Jain, and SR Nagpaul, Basic abstract algebra, Cam- bridge University Press, 1994. [10] Horst Brunotte, On trinomial bases of radix representations of algebraic integers, Acta Sci. Math. (Szeged) 67 (2001), no. 3-4, 521–527. [11] John Cremona, Letter to the editor, The American Mathematical Monthly 94 (1987), no. 8, 757–758, available at https://doi.org/10.1080/00029890.1987.12000713. [12] Patrick Du Val, Homographies, quaternions and rotations, Oxford Mathematical Monographs, Claren- don Press, Oxford, 1964. MR0169108 [13] J.-H. Evertse, K. Gy˝ory,A. Peth˝o,and J. M. Thuswaldner, Number systems over general orders, Acta Math. Hungar. 159 (2019), no. 1, 187–205. MR4003703 [14] Julius Farkas, Theorie der einfachen Ungleichungen, J. Reine Angew. Math. 124 (1902), 1–27. MR1580578 [15] David Gale, Harold W. Kuhn, and Albert W. Tucker, Linear programming and the theory of games, Activity Analysis of Production and Allocation, 1951, pp. 317–329. MR0046018 [16] F. R. Gantmacher, The theory of matrices. Vols. 1, 2, Translated by K. A. Hirsch, Chelsea Publishing Co., New York, 1959. MR0107649 [17] William J. Gilbert, Radix representations of quadratic fields, J. Math. Anal. Appl. 83 (1981), no. 1, 264–274. 32 JONAS JANKAUSKAS AND JORG¨ M. THUSWALDNER

[18] Karlheinz Gr¨ochenig and Andrew Haas, Self-similar lattice tilings, J. Fourier Anal. Appl. 1 (1994), no. 2, 131–170. MR1348740 [19] V Gr¨unwald, Intorno all’aritmetica dei sistemi numerici a base negativa con particolare riguardo al sistema numerico a base negativo-decimale per lo studio delle sue analogie coll‘aritmetica (decimale), Giornale di Matematiche di Battaglini 23 (1885), 203–221. Errata, p. 367. [20] Robert E. Hartwig, Roth’s removal rule and the rational canonical form, Amer. Math. Monthly 103 (1996), no. 4, 332–335. MR1383670 [21] Nathan Jacobson, Lectures in abstract algebra. Vol. II. Linear algebra, D. Van Nostrand Co., Inc., Toronto-New York-London, 1953. MR0053905 [22] J. Jankauskas and J. M. Thuswaldner, Characterization of rational matrices that admit finite digit representations, Linear Algebra Appl. 557 (2018), 350–358. MR3848275 [23] Jonas Jankauskas, DigitSystems, a GitHub repository, [email protected]:jonas-jankauskas/ DigitSystems.git, 2021. [24] Ibrahim Kirat, Ka-Sing Lau, and Hui Rao, Expanding polynomials and connectedness of self-affine tiles, Discrete Comput. Geom. 31 (2004), no. 2, 275–286. [25] A. Kov´acs, Number expansions in lattices, Math. Comput. Modelling 38 (2003), no. 7-9, 909–915. Hungarian applied mathematics and computer applications. MR2025177 [26] Attila Kov´acs, Algorithmic construction of simultaneous number systems in the lattice of Gaussian integers, Ann. Univ. Sci. Budapest. Sect. Comput. 39 (2013), 279–290. MR3045613 [27] , Simultaneous number systems in the lattice of Eisenstein integers, Ann. Univ. Sci. Budapest. Sect. Comput. 41 (2013), 43–55. [28] , Number system constructions with block diagonal bases, Numeration and substitution 2012, 2014, pp. 205–213. MR3330567 [29] B. Kov´acsand A. Peth˝o, Canonical systems in the ring of integers, Publ. Math. Debrecen 30 (1983), no. 1-2, 39–45. MR733070 [30] , Number systems in integral domains, especially in orders of algebraic number fields, Acta Sci. Math. (Szeged) 55 (1991), no. 3-4, 287–299. MR1152592 [31] Jeffrey C. Lagarias and Yang Wang, Integral self-affine tiles in Rn. I. Standard and nonstandard digit sets, J. London Math. Soc. (2) 54 (1996), no. 1, 161–179. MR1395075 [32] , Self-affine tiles in Rn, Adv. Math. 121 (1996), no. 1, 21–49. MR1399601 [33] , Integral self-affine tiles in Rn. II. Lattice tilings, J. Fourier Anal. Appl. 3 (1997), no. 1, 83–102. MR1428817 [34] Hans Liebeck and Anthony Osborne, The generation of all rational orthogonal matrices, Amer. Math. Monthly 98 (1991), no. 2, 131–133. MR1089458 [35] Johan E. Mebius, A matrix-based proof of the quaternion representation theorem for four-dimensional rotations (unpublished electronic notes) (200502). [36] J¨urgenNeukirch, Algebraic number theory, Grundlehren der Mathematischen Wissenschaften [Funda- mental Principles of Mathematical Sciences], vol. 322, Springer-Verlag, Berlin, 1999. Translated from the 1992 German original and with a note by Norbert Schappacher, With a foreword by G. Harder. MR1697859 [37] Morris Newman, Integral matrices, Academic Press, New York-London, 1972. Pure and Applied Math- ematics, Vol. 45. MR0340283 [38] , The Smith normal form, Proceedings of the Fifth Conference of the International Linear Algebra Society (Atlanta, GA, 1995), 1997, pp. 367–381. MR1436687 2 2 2 [39] Gordon Pall, On the rational automorphs of x1 + x2 + x3, Ann. of Math. (2) 41 (1940), 754–766. MR2349 [40] Sam Perlis, Theory of matrices, Dover Publications, Inc., New York, 1991. Reprint of the 1958 edition. MR1215486 [41] A. Peth¨o, On a polynomial transformation and its application to the construction of a public key cryptosystem, Computational number theory (Debrecen, 1989), 1991, pp. 31–43. RATIONAL MATRIX DIGIT SYSTEMS 33

[42] Olav Reiersø l, Rational orthogonal matrices, Amer. Math. Monthly 70 (1963), 63–65. MR146193 [43] Klaus Scheicher, Paul Surer, J¨orgM. Thuswaldner, and Christiaan E. Van de Woestijne, Digit systems over commutative rings, Int. J. Number Theory 10 (2014), no. 6, 1459–1483. MR3248166 [44] Marlow Sholander, Rational orthogonal matrices, Amer. Math. Monthly 68 (1961), 350. MR124332 [45] Wolfgang Steiner and J¨orgM. Thuswaldner, Rational self-affine tiles, Trans. Amer. Math. Soc. 367 (2015), no. 11, 7863–7894. MR3391902 [46] The Sage Developers, Sagemath, the Sage Mathematics Software System (Version 9.2.), 2021. https: //www.sagemath.org. [47] Christiaan E. van de Woestijne, Number systems and the chinese remainder theorem, 2011. [48] Andrew Vince, Radix representation and rep-tiling, Proceedings of the Twenty-fourth Southeastern International Conference on Combinatorics, , and Computing (Boca Raton, FL, 1993), 1993, pp. 199–212. MR1267355 [49] , Replicating tessellations, SIAM J. Discrete Math. 6 (1993), no. 3, 501–521. MR1229702 [50] , Rep-tiling Euclidean space, Aequationes Math. 50 (1995), no. 1-2, 191–213. MR1336867

(J.J.) Faculty of Mathematics and Informatics, Institute of Mathematics, Vilnius Uni- versity, Naugarduko g. 24, LT 03225, Vilnius, Lithuania

(J.J and J.M.T.) Mathematik und Statistik, Montanuniversitat¨ Leoben, Franz Josef Straße 18, A-8700 Leoben, Austria Email address: [email protected] Email address: [email protected]