Degree of recurrence of generic diffeomorphisms

We study spatial discretizations of dynamical systems: is it possible to recover some dynamical features of a system from numerical simulations? Here, we tackle this issue for the simplest algorithm possible: we compute long segments of orbits with a fixed number of digits. We show that for every $r\ge 1$, the dynamics of the discretizations of a $C^r$ generic conservative diffeomorphism of the torus is very different from that observed in the $C^0$ regularity. The proof of our results involves in particular a local-global formula for discretizations, as well as a study of the corresponding linear case, which uses ideas from the theory of quasicrystals.


Introduction
This paper is concerned with the issue of numerical simulations of dynamical systems. Consider a discrete-time dynamical system f on the torus T n = R n /Z n endowed with Lebesgue measure 1 , and define some spatial discretizations of this system in the following way: let (E N ) N∈N be the collection of uniform grids on T n E N = i 1 N , · · · , i n N ∈ R n /Z n 1 ≤ i 1 , · · · , i n ≤ N , and take a Euclidean projection P N on the nearest point of E N ; in other words P N (x) is (one of) the point(s) of E N which is the closest from x. This projection allows one to define the discretizations of f .
This degree of recurrence D rec ( f N ) ∈ [0, 1] represents the loss of information induced by the iteration of the discretization f N (for example, if D rec ( f N ) = 1, then f N is a bijection). Also, a finite map with a degree of recurrence equal to 1 preserves the uniform measure on E N , and thus can be considered as conservative.
The goal of this paper is to study the behaviour of the degree of recurrence D rec ( f N ) as N goes to infinity and for a generic dynamics f of the torus T n , n ≥ 2. More precisely, on every Baire space B it is possible to define a good notion of genericity: a property on elements of B will be said generic if satisfied on at least a countable intersection of open and dense subsets of B.
For our purpose, the spaces Diff r (T n ) and Diff r (T n , Leb) of respectively C r -diffeomorphisms and Lebesgue measure preserving C r -diffeomorphisms of T n are Baire spaces for every r ∈ [0, +∞], when endowed with the classical metric on C r -diffeomorphisms 3 . Elements of Diff r (T n ) will be called dissipative and elements of Diff r (T n , Leb) conservative. Also, the spaces Diff 0 (T n ) and Diff 0 (T n , Leb) of homeomorphisms will be denoted by respectively Homeo(T n ) and Homeo(T n , Leb).
We will also consider the case of generic expanding maps of the circle. Indeed, for any r ∈ [1, +∞], the space D r (S 1 ) of C r expanding maps 4 of the circle S 1 , endowed with the classical C r topology, is a Baire space.
The study of generic dynamics is motivated by the phenomenon of resonance that appears on some very specific examples like that of the linear automorphism of the torus (x, y) → (2x + y, x + y): as noticed by É. Ghys in [9], the fact that this map is linear with integer coefficients forces the discretizations on the uniform grids to be bijections with a (very) small global order (see also [5] or the introduction of [10]). One can hope that this behaviour is exceptional; to avoid them, É. Ghys proposes to study the case of generic maps.
To begin with, let us recall what happens for generic homeomorphisms. The following consequence of [1] can be found in Section 5.2 of [11].
Theorem 3 (Guihéneuf). Let f ∈ Homeo(T n ) be a generic dissipative homeomorphism. Then This theorem expresses that there is a total loss of information when a discretization of a generic homeomorphism is iterated. This is not surprising, as a generic dissipative homeomorphism has an "attractor dynamics" (see [1]). The following result is the Corollary 5.24 of [10] (see also Section 4.3 of [11] and Proposition 2.2.2 of [27]).
Thus, the degree of recurrence of a generic conservative homeomorphism accumulates on the biggest set on which it can a priori accumulate. Then, the behaviour of this combinatorial quantity depends a lot on the order N of the discretization and not at all on the dynamics of the homeomorphism f . Moreover, as there exists a subsequence (N k ) k∈N such that D rec ( f N k ) → k→+∞ 0, there exist "a lot" of discretizations that do not reflect the conservative character of the homeomorphism.
In this paper, we study the asymptotic behaviour of the degree of recurrence in higher regularity. Our results can be summarized in the following theorem (see Corollary 42, Theorem 39 and Corollary 48).
Theorem A. Let r ∈ [1, +∞] and f be either • a generic dissipative C 1 -diffeomorphism of T n ; • a generic conservative C r -diffeomorphism of T n ; • a generic C r expanding map 5 of the circle S 1 ; Then The two last items of this theorem are in fact valid under much weaker assumptions than Baire genericity. They hold under a countable number of explicit positive codimension conditions over the sequence of the differentials of the map. More precisely, these items are valid as soon as Thom's transversality theorem holds (see Lemma 37); in particular they remain true for prevalent maps (see [19] for a definition of prevalence and results about the validity of Thom's theorem).
We must admit that the degree of recurrence gives only little information about the discretizations' dynamics. Our model does not take into account the fact that most of computations are done with floating point numbers. Actually, most of simulations of dynamical systems are performed using more sophisticated algorithms and allow to compute accurately stable manifolds, SRB measures etc. However, our work describes theoretically what happens in "most of cases" for the naive algorithm, which has been only little studied theoretically up to now.
Theorem A becomes interesting when compared to the corresponding case in C 0 regularity: in the conservative setting, it indicates that the bad behaviours observed for generic conservative homeomorphisms should disappear in any higher regularity: the behaviour of the rate of injectivity is less irregular for generic conservative C r diffeomorphisms than for generic conservative homeomorphisms (compare Theorems 4 and A). This big difference suggests that the wild behaviours of the discretizations global dynamics observed in [11] for generic conservative homeomorphisms may not appear in higher regularities.
More precisely, to any discretization f N and any x ∈ T n one can associate the measure µ f N x which is the uniform measure on the f N -periodic orbit in which the positive orbit of P N (x) eventually falls. Oxtoby-Ulam theorem states that a generic conservative homeomorphism is ergodic [32], and it has been conjectured by A. Katok that this result is still true in C 1 regularity. Thus, one can expect the measures µ f N x tend to Lebesgue measure for "typical" x ∈ T n . In [11] it is proved that for a generic conservative homeomorphism f and any x ∈ T n , these measures µ f N x accumulate (as N goes to infinity) on the whole set of f -invariant measures; in [14], it is proved that the same holds for generic conservative C 1 -diffeomorphisms. Hence, in both cases, the ergodic behaviour of a single orbit highly depends on the discretization order and do not tend to the "physical" dynamics of the map. For generic conservative homeomorphisms, the same result holds for the measures µ f N , which are the averages of the measures µ f N x over x ∈ E N . However, some simulations suggest that this should no longer be true for generic conservative C 1 -diffeomorphisms: the measures µ f N seem to tend to Lebesgue measure (see [14]). From this one can conjecture the following: the global dynamics of discretizations of generic conservative homeomorphism depends a lot on the order of discretization, but the global dynamics of discretizations of generic conservative C 1 -diffeomorphism tends to the physical dynamics of the diffeomorphism (the dynamics of Lebesgue almost every point).
A particular case of this conjecture is answered positively by Theorems 4 and A. This can be seen as an indication that the measures µ f N indeed tend to Lebesgue measure in the C r generic case, r ≥ 1.
Despite this, Theorem A shows that while iterating the discretizations of a generic conservative diffeomorphism, a great amount of information is lost. Although f is conservative, its discretizations tend to behave like dissipative maps. This can be compared with the work of P. Lax [24] (see also lemma 15 of [32]): for any conservative homeomorphism f , there is a bijective finite map arbitrarily close to f . Theorem A states that for a generic conservative C r diffeomorphism, the discretizations never possess this property.
However, the main interest of Theorem A certainly lies in the techniques used to prove it: we will link global and local behaviours of the discretizations, thus reduce the proof to that of a linear statement.
As it can be obtained as the decreasing limit of finite time quantities, the degree of recurrence is maybe the easiest combinatorial invariant to study: we will deduce its behaviour from that of the rate of injectivity.
Definition 5. Let n ≥ 1, f : T n → T n an endomorphism of the torus and t ∈ N. The rate of injectivity in time t and for the order N is the quantity Then, the upper rate of injectivity of f in time t is defined as and the asymptotic rate of injectivity of f is (as the sequence (τ t ( f )) t is decreasing, the limit is well defined).
The link between the degree of recurrence and the rates of injectivity is made by the trivial formula: for every t ∈ N, so considering the limit t → +∞, we get lim sup In particular, if we have an upper bound on τ ∞ ( f ), this will give a bound on lim sup N→+∞ D rec ( f N ). This reduces the proof of Theorem A to the study of the asymptotic rate of injectivity τ ∞ ( f ).
For generic dissipative C 1 -diffeomorphisms, the fact that the sequence D rec ( f N ) N converges to 0 (Theorem A) is an easy consequence of Equation (2) and of a theorem of A. Avila and J. Bochi (Theorem 40, extracted from [3]).
For conservative diffeomorphisms and expanding maps, the study of the rates of injectivity will be the opportunity to understand the local behaviour of the discretizations: we will "linearize" the problem and reduce it to a statement about generic sequences of linear maps.
Let us first define the corresponding quantities for linear maps: as in general a linear map does not send Z n into Z n , we will approach it by a discretization. For any A ∈ GL n (R) and any x ∈ Z n , A(x) is defined as the point of Z n which is the closest from A(x). Then, for any sequence (A k ) k of linear maps, the rate of injectivity τ k (A 1 , · · · , A k ) is defined as the density of the set ( A k • · · · • A 1 )(Z n ) (see Definition 7): Card Z n ∩ B(0, R) ∈]0, 1], and the asymptotic rate of injectivity τ ∞ ((A k ) k ) is the limit of τ k (A 1 , · · · , A k ) as k tends to infinity. These definitions are made to mimic the corresponding definitions for diffeomorphisms. The following statement asserts that that the rates of injectivity of a generic map are obtained by averaging the corresponding quantities for the differentials of the diffeomorphism, and thus makes the link between local and global behaviours of the discretizations (Theorem 28).
Then τ k ( f ) is well defined (that is, the limit superior in (1) is a limit) and satisfies: The same kind of result holds for generic expanding maps (see Theorem 33). The proof of this theorem is quite technical but its general idea is very simple: apply an order 1 Taylor expansion and use some continuity results of the map τ k . These continuity results are proved using the model set formalism which will be discussed soon.
As noticed by Lanford in [22], "this problem [of discretization] reminds me quite a lot the notoriously difficult one of deriving non equilibrium statistical mechanics from atomic physics". As suggested by Hilbert in the statement of his 6 th problem [18], a fruitful approach is to study what happens at an intermediate scale between atomic or microscopic one (which here corresponds to the scale of the grid) and the macroscopic one (which here is the scale where we see the dynamics of the map) 6 . This scale is called mesoscopic and for us it will be the scale at which the map f is almost affine: we will study discretizations of sequences of linear maps.
For conservative diffeomorphisms, the core of the proof of Theorem A is the study of the rate of injectivity of generic sequences of matrices with determinant 1, that we will conduct in Section 2. Indeed, applying Theorem B which links the local and global behaviours of the diffeomorphism, together with a transversality result (Lemma 37), we reduce the proof of Theorem A to the main result of Section 2 (see Theorem 20 for the statement we actually need to prove Theorem A).
Theorem C. For a generic sequence of matrices (A k ) k≥1 of ∞ (SL n (R)), we have The same conclusion holds for a sequence of random iid matrices (Corollary 22) and for the iterations of a single matrix (Corollary 23) in both groups SL n (R) and O n (R).
This linear statement has many consequences. First, it has nice applications to image processing. For example -the result remains true for a generic sequence of isometries -, it says that if we apply a naive algorithm, the quality of a numerical image will be necessarily deteriorated by rotating this image many times by a generic sequence of angles. This gives an alternative proof of the result of [12] 7 that may lead to new research directions for the field which studies discretizations of isometries of R n . For example, it could be used to set new discrete rotation algorithms, or to generalize the study of the local structure of the image sets to multiple iterations. See for instance [31,39,30,2,35]. Theorem C is also the central technical result of [14], where it is combined with perturbation results in C 1 topology 8 to study the physical measures of discretizations of generic conservative C 1 -diffeomorphisms.
The proof of Theorem C is the most difficult and original part of this article. It uses the nice formalism of model sets, developed initially for the study of quasicrystals. Unfortunately, the classical theory does not apply here: the common definition of a model set includes a hypothesis of injectivity of a projection, which is not satisfied in the present setting 9 (as this non injectivity is the very source of the discretizations' loss of injectivity). However, using an equidistribution property, the model set viewpoint allows to get a geometric formula for the computation of the rate of injectivity of a generic sequence of matrices (Proposition 9): the rate of injectivity of a generic sequence A 1 , · · · , A k of matrices of SL n (R) can be expressed in terms of areas of intersections of cubes in R nk . This formula, by averaging what happens in the image sets ( A k • · · · • A 1 )(Z n ), reflects the global behaviour of these sets. Also, it transforms the iteration into a passage in high dimension. This allows to prove Theorem C, using quite technical geometric considerations about the volume of intersections of cubes, without having to make "clever" perturbations of the sequence of matrices (that is, the perturbations made a each iteration are chosen independently from that made in the past or in the future).
Interestingly, Lanford notes in [22] that "The problem [of discretization] can probably be made much easier by the judicious introduction of a stochastic element in the microscopic evolution.[...] I think this is cheating." Indeed, the equidistribution property we will crucially use during the proofs is equivalent to the uniform distribution of roundoff errors; in that sense it can be said that discretizations behave like random perturbations. This idea will be developed in a forthcoming paper in collaboration with M. Monge [16], in which we will use crucially the ideas of the present article to study the ergodic global middle-term behaviour of the discretizations of generic expanding maps.
The end of this paper is devoted to the results of the simulations we have conducted about the degree of recurrence of C 1 -diffeomorphisms and expanding maps; it shows that in practice, the degree of recurrence tends to 0, at least for the examples of diffeomorphisms we have tested.
Recall that we will see in Appendix A that the quite restrictive framework of the torus T n equipped with the uniform grids can be generalized to arbitrary manifolds, provided that the discretizations grids behave locally (and almost everywhere) like the canonical grids on the torus.
To finish, we state some questions related to Theorem A that remain open.
• What is the behaviour of the degree of recurrence of discretizations of generic C r -expanding maps of the torus T n , for n ≥ 2 and r > 1? In the view of Theorem A, we can conjecture that this degree of recurrence tends to 0. To prove it we would need a generalization of Lemma 45 to higher dimensions.
• What is the behaviour of the degree of recurrence of discretizations of generic dissipative C rdiffeomorphisms of the torus T n for r > 1? This question could reveal quite hard, as it may require some perturbation results in the C r topology for r > 1.

Discretizations of sequences of linear maps
We begin by the study of the linear case, corresponding to the "local behaviour" of C 1 maps. We first define the linear counterpart of discretizations.
Definition 6. The map P : R → Z is defined as a projection from R onto Z. More precisely, for x ∈ R, P(x) is the unique 10 integer k ∈ Z such that k − 1/2 < x ≤ k + 1/2. This projection induces the map π : which is an Euclidean projection on the lattice Z n . For A ∈ M n (R), we denote by A the discretization of A, defined by This definition allows us to define the rate of injectivity for sequences of linear maps.
Definition 7. For a discrete subset E ⊂ R n , we denote 11 Let A 1 , · · · , A k ∈ GL n (R). The rate of injectivity of A 1 , · · · , A k is the asymptotic density 12 and for an infinite sequence (A k ) k≥1 of invertible matrices, as the previous quantity is decreasing in k, we can define the asymptotic rate of injectivity For a typical example of the sets ( A k • · · · • A 1 )(Z 2 ), see Figure 1. Finally, we define a topology on the set of sequences of linear maps. Definition 8. We fix once for all a norm · on M n (R). For a bounded sequence (A k ) k≥1 of matrices of SL n (R), we set In other words, we consider the space ∞ (SL n (R)) of uniformly bounded sequences of matrices of determinant 1 endowed with this classical metric. 10 The choice of where the inequality is strict or large is arbitrary. 11 By definition, B R = B ∞ (0, R), where the considered norm is x ∞ = max(|x 1 |, · · · , |x n |). Our results do not depend on the choice of the norm, but this one simplifies the computations. 12 In the sequel we will see that the lim sup is in fact a limit for a generic sequence of matrices. It can also be shown that it is a limit for any sequence of matrices, using the formalism developed hereafter and the classification of closed subgroups of T n . Figure 1: Successive images of Z 2 by discretizations of random matrices in SL 2 (R), a point is black if it belongs to ( A k • · · · • A 1 )(Z 2 ). The A i are chosen randomly and independently, using the singular value decomposition: they are chosen among the matrices of the form R θ D t R θ , with R θ the rotation of angle θ and D t the diagonal matrix Diag(e t , e −t ), the angles θ , θ being chosen uniformly in [0, 2π] and t uniformly in [−1/2, 1/2]. From left to right and top to bottom, k = 1, 3, 20.
We take advantage of the rational independence between matrix coefficients of a generic sequence to obtain geometric formulas for the computation of the rate of injectivity. The tool used is the formalism of model sets 13 (see for example [28] or [26] for surveys about model sets, see also [13] for the application to the specific case of discretizations of linear maps). Unfortunately, even if this viewpoint is very fruitful for the understanding of discretizations of linear maps, the classical theory of model sets do not apply here and we have to develop appropriate techniques for our specific setting.
Let us summarize the different notations we will use throughout this section. We will denote by 0 k the origin of the space R k , and W k =] − 1/2, 1/2] nk (unless otherwise stated). In this section, we will denote B R = B ∞ (0, R) and D c (E) the density of a "continuous" set E ⊂ R n , defined as (when the limit exists) while for a discrete set E ⊂ R n , the notation D d (E) will indicate the discrete density of E, defined as (when the limit exists) We will consider (A k ) k≥1 a sequence of matrices of SL n (R), and denote 13 Also called cut-and-project sets.
Also, Λ k will be the lattice M A 1 ,··· ,A k Z n(k+1) , with and Λ k will be the lattice Finally, we will denote the mean rate of injectivity in time k of A 1 , · · · , A k , and

A geometric viewpoint to compute the rate of injectivity in arbitrary times
We begin by motivating the introduction of model sets by giving an alternative construction of the image sets ( A k • · · · • A 1 )(Z n ) using this formalism.
In other words, denoting and p 2 (λ ) = x (where p 1 is the projection on the n first coordinates and p 2 the projection on the n last). Thus, Iterating this idea, we get that with p 1 the projection on the nk first coordinates and p 2 the projection on the n last coordinates. This allows us to see the set Γ k as a model set. Figure 2: Geometric construction to compute the rate of injectivity: the green points are the elements of Λ, the blue parallelogram is a fundamental domain of Λ and the grey squares are centred on the points of Λ and have radii 1/2. The rate of injectivity is equal to the area of the intersection between the union of the grey squares and the blue parallelogram.
In general, a model set is a set of the form p 2 (Λ ∩ (p −1 1 (W ))), with Λ a lattice of R m+n , p 1 : R m+n → R m and p 2 : R m+n → R n the canonical orthogonal projections and W some compact subset of R m . The classical definition also requires the injectivity of p 2|Λ and the density of p 1 (Λ), the first of these two conditions being false in our context as soon as one of the maps A i is non-injective.
Under generic conditions among sequences of matrices, the set p 1 (Λ k ) is dense (thus, equidistributed) in the image set im p 1 . In particular, the set {p 1 (λ ) | λ ∈ Λ k } is equidistributed in the window W k .
The following property makes the link between the density of Γ k -that is, the rate of injectivity of A 1 , · · · , A k -and the density of the union of unit cubes centred on the points of the lattice Λ k (see Figure 2). This formula seems to be very specific to the model sets defined by the matrix M A 1 ,··· ,A k and the window W k , it is unlikely that it could be generalized to other model sets.
Proposition 9. For a generic sequence of matrices (A k ) k of SL n (R) (resp. O n (R)), we have Remark that the density on the left of the equality is the density of a discrete set (that is, with respect to counting measure), whereas the density on the right of the equality is that of a continuous set (that is, with respect to Lebesgue measure). The two notions coincide when we consider discrete sets as sums of Dirac masses.
A more precise version of this proposition will be given by Lemma 38. In particular, it will imply that in the previous proposition, the generic sequence can be replaced by a sequence of iid random draws of law a probability measure whose support's interior is nonempty.
Corollary 10. For a generic sequence of matrices, the rate of injectivity τ k in time k coincides with the mean rate of injectivity τ k , which is continuous and piecewise polynomial of degree ≤ nk in the coefficients of the matrix.
Thus, the formula of Proposition 9 could be used to compute numerically the mean rate of injectivity in time k of a sequence of matrices: it is much faster to compute the volume of a finite number of intersections of cubes (in fact, a small number) than to compute the cardinalities of the images of a big set [−R, R] n ∩ Z n .
Proof of Proposition 9. We want to determine the density of Γ k . By Equation (6), we have Thus, x ∈ Γ k if and only if the projection of (0 (k−1)n , x) on R nk / Λ k belongs to Λ k − W k . Then, the proposition follows directly from the fact that, under generic conditions, the points of the form (0 To prove this equidistribution, we compute the inverse matrix of M A 1 ,··· ,A k : Thus, the set of points of the form (0 (k−1)n , x) in R nk / Λ k corresponds to the image of the action of Z n on the canonical torus R nk /Z nk . But this action is ergodic (even in restriction to the first coordinate) when the sequence of matrices is generic among SL n (R). Indeed, suppose that the restriction of this action to the first coordinate (i.e. to Z × 0 n−1 ) is ergodic in restriction to the n(k − 1) last coordinates. It suffices to consider a matrix A 1 such that the entries of the first column of A −1 1 are algebraically independent over the extension of Q generated by the coefficients of A −1 2 , · · · , A −1 k . One concludes by induction on k. For the case of O n (R), the same reasoning holds under the restriction that the Euclidean norm of the first column of A −1 1 is one. But this follows from the easy following fact: if F ⊂ R is a field and if x 1 , . . . , x n−1 ∈ R are algebraically independent over F and satisfy x 2 1 + · · · + x 2 n−1 ≤ 1, then there is no nontrivial linear Diophantine equation with coefficients in F satisfied by x 1 , · · · , x n , where x n is such that x 2 1 + · · · + x 2 n = 1.
As an application, a small geometric computation leads to an explanation of the figures [39, Figure  2.3] and [35, Figure 3.9].
Example 11. For θ ∈ [0, π/2], the mean rate of injectivity of a rotation of R 2 of angle θ is (see [10,Application 8.14 Recall the problem raised by Theorem C: we want to make τ k tend to 0 as k tends to infinity. By the equidistribution argument stated in Proposition 9, generically, it is equivalent to make the mean rate of injectivity τ k tend to 0 when k goes to infinity, by perturbing every matrix in SL n (R) of at most δ > 0 (fixed once for all). The conclusion of Theorem C is motivated by the phenomenon of concentration of the measure on a neighbourhood of the boundary of the cubes in high dimension.
The case of equality τ k = 1 is given by Hajós theorem.
Theorem 13 (Hajós, [17]). Let Λ be a lattice of R n . Then the collection of squares {B ∞ (λ , 1/2)} λ ∈Λ tiles R n if and only if in a canonical basis of R n (that is, permuting coordinates if necessary), Λ admits a generating matrix which is upper triangular with ones on the diagonal.  [20] that the conclusion of Hajós theorem is still true under this weaker hypothesis. This conjecture was proven to be true for n ≤ 6 by O. Perron in [33,34], but remained open in higher dimension until 1992, when J. C. Lagarias and P. W. Shor proved in [21] that Keller's conjecture is false for n ≥ 10 (this result was later improved by [25] which shows that it is false as soon as n ≥ 8; the case n = 7 is to our knowledge still open).
Combining Hajós theorem with Proposition 9, we obtain that the equality τ k = 1 occurs if and only if the lattice given by the matrix M A 1 ,··· ,A k satisfies the conclusions of Hajós theorem 14 . The heuristic suggested by the phenomenon of concentration of the measure is that if we perturb "randomly" any sequence of matrices, we will go "far away" from the lattices satisfying Hajós theorem and then the rate of injectivity will be close to 0.
In fact, the proof of Proposition 9 shows a more precise statement: if the image of (7) is δ -dense, . This leads to the following statement.
Proposition 15. Let n ≥ 2 and G be one of the groups GL n (R), SL n (R) or SO n (R). Then there exists a countable collection of positive codimension submanifolds V q of G such that for any ε > 0 and any time In particular, there exists a generic full measure subset of G on which τ k = τ k for any k ∈ N.
14 Of course, this property can be obtained directly by saying that the density is equal to 1 if and only if the rate of injectivity of every matrix of the sequence is equal to 1.
Proof of Proposition 15. By using Weyl's criterion (Proposition 35) and the proof of Proposition 9, it suffices to prove that for any ε > 0 and any k ∈ N, there exists C ∈ N and a locally finite collection of positive codimension submanifolds of G −1 = G on which at least one column of the matrix forms an "almost Q-free family", that is, is not a solution of any linear Diophantine equation with coefficients in {−C, · · · ,C}. Let V be the set of solutions of such an equation; as this equation is polynomial in the coefficients of A this is a subvariety of GL n (R). For G = GL n (R), this is also a positive codimension subvariety of G.
For the other cases, G is an irreducible variety; thus to prove that V ∩ G is a positive codimension subvariety of G it suffices to prove that the set G \V is nonempty (see for instance [29,Chap. III prop. 7]).
If G contains both the sets of diagonal and permutation matrices, it suffices to consider a diagonal matrix with a transcendent entry and conjugate it by a proper permutation matrix.
If G = SO n (R), Lindemann-Weierstrass theorem implies that for θ ∈ Q, one has no nontrivial linear Diophantine equation with rational coefficients satisfied by the numbers cos(kθ ) and sin(kθ ): if it was the case, e iθ would be a zero of a polynomial in (Q(i))[X], which would contradict the fact that Q(e iθ ) : Q = ∞. We then consider the matrix given by the diagonal blocks R θ and I n−2 and conjugate it by a proper permutation matrix; this gives us a matrix of SO n (R) which is not in V .
2.2 A first step: proof that the asymptotic rate of injectivity is generically smaller than 1/2 As a first step, we prove that rate of injectivity of a generic sequence of ∞ (SL n (R)) is smaller than 1/2.

Proposition 16.
There exists an open and dense subset of sequences of matrices in SL n (R) in which every sequence (A k ) k≥1 satisfies: there exists a parameter α ∈]0, 1[ such that for every k ≥ 1, we have To begin with, we give a lemma estimating the sizes of intersections of cubes when the mean rate of injectivity τ k is bigger than 1/2.
Proof of Lemma 17. We first remark that D c (Λ +W ) is equal to the volume of the projection of W on the quotient space R m /Λ. For every v ∈ R m , the projection of W + v on R m /Λ has the same volume; as this volume is greater than 1/2, and as the covolume of Λ is 1, the projections of W and W + v overlap, and the volume of the intersection is bigger than 2D c (W + Λ) − 1. Returning to the whole space R m , we get the conclusion of the lemma.
A simple counting argument leads to the proof of the following lemma.
Lemma 18. Let Λ 1 be a subgroup of R m , Λ 2 be such that Λ 1 ⊕ Λ 2 is a lattice of covolume 1 of R m , and C be a compact subset of R m . Let C 1 be the projection of C on the quotient R m /Λ 1 , and C 2 the projection of C on the quotient R m /(Λ 1 ⊕ Λ 2 ). We denote by In particular, the area of C 2 (the projection on the quotient by Λ 1 ⊕ Λ 2 ) is smaller than (or equal to) that of C 1 (the projection on the quotient by Λ 1 ). The loss of area is given by the following corollary.
Corollary 19. With the same notations as for Lemma 18, if we denote by Proof of Proposition 16. Let δ > 0 and M > 0. We proceed by induction on k and suppose that the following property is proved until a certain rank k ∈ N * : there exists α > 0, depending only on δ and M, such that for any sequence of matrices Let Λ k be the lattice spanned by the matrix M B 1 ,··· ,B k and W k =] − 1/2, 1/2] nk be the window corresponding to the model set Γ k modeled on Λ k (the lattice spanned by the matrix M B 1 ,··· ,B k , see Equations (3) and (4)).
We now choose a matrix B k+1 satisfying A k+1 − B k+1 ≤ δ , such that there exists x 1 ∈ Z n \ {0} such that B k+1 x 1 ∞ ≤ 1 − ε, with ε > 0 depending only on δ and M (and n): indeed, for every matrix B ∈ SL n (R), Minkowski theorem implies that there exists x 1 ∈ Z n \ {0} such that Bx 1 ∞ ≤ 1; it then suffices to modify slightly B to decrease Bx 1 ∞ . By the form of the matrix M B 1 ,··· ,B k+1 , we have the decomposition In particular, as | det(B k+1 )| = 1, this easily implies that How to read these figures : The top of the figure represents the set W k + Λ k by the 1-dimensional set [−1/2, 1/2] + νZ (in dark blue), for a number ν > 1. The bottom of the figure represents the set W k+1 + Λ k+1 ⊂ R n(k+1) by the set [−1/2, 1/2] 2 + Λ, where Λ is the lattice of R 2 spanned by the vectors (0, ν) and (1, 1 − ε) for a parameter ε > 0 close to 0. The dark blue cubes represent the "old" cubes, that is, the thickening W k+1 + ( Λ k , 0 n ) of the set W k + Λ k , and the light blue cubes represent the "added" cubes, that is, the rest of the set W k+1 + Λ k+1 .
v Figure 3: In the case where the rate is bigger than 1/2, some intersections of cubes appear automatically between times k and k + 1. Figure 4: In the case where the rate is smaller than 1/2, there is not necessarily new intersections between times k and k + 1.
What we need is a more precise bound. We apply Corollary 19 to Then, the decreasing of the rate of injectivity between times k and k + 1 is bigger than the C 1 defined in Corollary 19: using Lemma 17, we have On Figure 3, this corresponds to the restriction to the horizontal dashed line: on this subspace one can see the sets W k+1 + ( Λ k , 0 n ) (in dark blue) and W k+1 + ( Λ k , 0 n ) + v. The previous formula gives a lower bound of the horizontal size of the black rectangle. As x 1 ∞ < 1 − ε, the vertical size of this rectangle is bigger than ε n , which leads to a total area of the rectangle: From Corollary 19 we deduce that This proves the property for rank k + 1, by setting α = 1 − ε n . Finally, we have proved the following: for every δ > 0 and any M > 0, there exists a number α < 1 and a δ -dense open subset of sequences of matrices of SL n (R) of norm smaller than M on which τ k (B 1 , · · · , B k ) ≤ (α k + 1)/2. This gives the proposition.

Proof of Theorem C: generically, the asymptotic rate is zero
We now come to the proof of Theorem C. The strategy of proof is identical to that we used in the previous section to state that generically, the asymptotic rate is smaller than 1/2 (Proposition 16): we will use an induction to decrease the rate step by step. Recall that τ k (A 1 , · · · , A k ) indicates the density of the set W k+1 + Λ k .
Unfortunately, if the density of W k + Λ k -which is generically equal to the density of the k-th image A k • · · · • A 1 (Z n ) -is smaller than 1/2, then we cannot apply exactly the strategy of proof of the previous section (see Figure 4). For example, taking A 1 = diag(100, 1/100) and A 2 = diag(1/10, 10), one gets A 2 • A 1 (Z 2 ) = (10Z) 2 , and for every B 3 close to the identity, we have τ 3 (A 1 , A 2 , B 3 ) = τ 2 (A 1 , A 2 ) = 1/100. This example tells us that there exists an open set of ∞ (SL n (R)) on which the sequence τ k is not strictly decreasing.
Moreover, if we set A k = Id for every k ≥ 2, then we can set B 1 = A 1 , B 2 = A 2 and for each k ≥ 2 perturb each matrix A k into the matrix B k = diag(1 + δ , 1/(1 + δ )), with δ > 0 small. In this case, there exists a time k 0 (minimal) such that τ k 0 (B 1 , · · · , B k 0 ) < 1/100. But if instead of A k 0 = Id, we had A k 0 = diag(1/5, 5), this construction would not work anymore: we should have set B k = diag(1/(1 + δ ), 1 + δ ) instead. This suggests that we should take into account the next terms of the sequence (A k ) k to perform the perturbations. And things seems even more complicated when the matrices are no longer diagonal. . .
To overcome this difficulty, we use the same proof strategy than in the case where τ ≥ 1/2, provided we wait long enough: for a generic sequence of matrices (A k ) k≥1 , if τ k (A 1 , · · · , A k ) > 1/ , then τ k+ −1 (A 1 , · · · , A k+ −1 ) is strictly smaller than τ k (A 1 , · · · , A k ). More precisely, we consider the maximal number of disjoint translates of W k + Λ k in R nk : generalizing Lemma 17, we easily see that if the density of W k + Λ k is bigger than 1/ , then there cannot be more than disjoint translates of W k + Λ k in R nk (Lemma 24). At this point, Lemma 25 will state that if the sequence of matrices is generic, then either the density of W k+1 + Λ k+1 is smaller than that of W k + Λ k (Figure 5), or there cannot be more than − 1 disjoint translates of W k+1 + Λ k+1 in R n(k+1) (Figure 6). Applying this reasoning (at most) − 1 times, we obtain that the density of W k+ −1 + Λ k+ −1 is smaller than that of W k + Λ k . For example if D c W k + Λ k > 1/3, then D c W k+2 + Λ k+2 < D W k + Λ k (Figure 7). To apply this strategy in practice, we have to obtain quantitative estimates about the loss of density we get between times k and k + − 1.
Remark that with this strategy we do not need to make "clever" perturbations of the matrices: provided that the coefficients of the matrices are rationally independent, the perturbation of each matrix is made independently from that of the others. However, this reasoning does not tell us exactly when the rate of injectivity decreases (likely, in most of cases, the speed of decreasing of the rate of injectivity is much faster than the one obtained by this method), and does not say either where exactly the loss of injectivity occurs in the image sets.
We will indeed prove a more precise statement of Theorem C.
Theorem 20. For a generic sequence of matrices (A k ) k≥1 of ∞ (SL n (R)), and for every ε > 0, the set of (A k ) k≥1 ∈ ∞ (SL n (R)) such that τ ∞ (A k ) k≥1 < ε is open and dense. Moreover, for any > 0, there exists a locally finite number of positive codimension submanifolds V q of SL n (R) such that for any δ > 0, if (A k ) k≥1 ∈ ∞ (SL n (R)) is such that d A k , q V q > δ for a positive asymptotic density of integers k, then τ ∞ (A k ) k≥1 ≤ 1/ .
The existence of open and dense sets of sequences on which τ ∞ is smaller than ε is easily deduced from the first part of the theorem by applying the continuity of τ k . By using the continuity of τ on a generic subset (Corollary 10), one gets the same statement for τ. Remark 21. It is possible to prove that the intersection of the submanifold V q with O n (R) is again a positive codimension submanifold of O n (R). From this fact we deduce the fact announced in the introduction that Theorem 20 remains true for generic sequences of isometries (see also [12] for an alternative proof).
The last part of this theorem deals with τ; one can easily get a similar statement for τ by combining it with Lemma 38. This leads to the following consequence for sequences of random iid matrices.

Corollary 22.
Let µ be a measure on SL n (R) with nonempty interior support. Then, for almost every sequence (A k ) k≥1 of independent identically distributed matrices with distribution µ, we have τ ∞ (A k ) k≥1 = 0.
By applying Proposition 15, one gets the following corollary.
Corollary 23. Let n ≥ 2 and G be one of the groups GL n (R), SL n (R) or SO n (R). Then, for a generic/almost all A ∈ G, one has τ ∞ (A) = 0.
We now come to the proof of Theorem 20. The following lemma is a generalization of Lemma 17. It expresses that if the density of W k + Λ k is bigger than 1/ , then there cannot be more than disjoint translates of W k + Λ k , and gives an estimation on the size of these intersections.
Lemma 24. Let W =] − 1/2, 1/2] m and Λ ⊂ R m be a lattice with covolume 1 such that D c (W + Λ) ≥ 1/ . Then, for every collection v 1 , · · · , v ∈ R m , there exists i = i ∈ 1, such that Proof of Lemma 24. For every v ∈ R m , the density D c (W + Λ + v) is equal to the volume of the projection of W on the quotient space R m /Λ. As this volume is greater than 1/ , and as the covolume of Λ is 1, the projections of the W + v i overlap. Quantitatively, using Bonferroni inequality, one gets that there exists i = j such that Returning to the whole space R m , we get the conclusion of the lemma.
Proof of Theorem 20 will reduce to the following technical lemma.
Lemma 25. Fix M > 0 and L ≥ 2. Then there exists a finite collection (V q ) q of positive codimension submanifolds of SL n (R) such that for every δ > 0, there exists ε > 0 satisfying: For any k ≥ 0 and B 1 , · · · , B k ∈ SL n (R) such that there exist ≤ L and D k > 0 such that for every collection of vectors v 1 , · · · , v ∈ R n , there exists j = j ∈ 1, such that where Λ k is spanned by M B 1 ,··· ,B k (see (4)).
Then for every matrix B ∈ SL n (R) of norm smaller than M such that d(B,V q ) > δ for every q, if we denote by Λ k+1 the lattice spanned by the matrix M B 1 ,··· ,B k ,B , (2) or for every collection of vectors w 1 , · · · , w −1 ∈ R n , there exists i = i ∈ 1, − 1 such that Moreover, if = 2, then we have automatically the conclusion (1) of the lemma (as a particular case one gets Proposition 16).
Conclusion (1) says that the rate of injectivity decreases between times k and k + 1, and conclusion (2) expresses that the number of possible disjoint translates of W k + Λ k decreases between times k and k + 1. In a certain sense, conclusion (1) corresponds to an hyperbolic behaviour, and conclusion (2) to a diffusion between times k and k + 1. The same strategy of proof leads to the following variation of the lemma, which is true without condition on the matrix B.
Lemma 26. Fix M > 0 and ≥ 2. Then there exists ε > 0 such that for any k ∈ N, if D k > 0 is such that for every collection of vectors v 1 , · · · , v ∈ R n , there exists j, j ∈ 1, such that then for every matrix B ∈ SL n (R) of norm smaller than M, if we denote by Λ k+1 the lattice spanned by the matrix M B 1 ,··· ,B k ,B , then for every collection of vectors w 1 , · · · , w ∈ R n , there exists i = i ∈ 1, such that We begin by defining the sets V q . A collection of cubes of R n is called a k-fold tiling 15 if any point of R n belongs to exactly k different cubes, except from those belonging to the boundary of one cube.
Lemma 27. Let M > 0. For any matrix B ∈ SL n (R), consider the collection (Bv +W 1 ) v∈Z n of translates of the unit cube by the lattice spanned by B. Now, take − 1 vectors w 1 , · · · , w −1 ∈ R n and consider the collection (Bv + w i +W 1 ) v∈Z n , 1≤i≤ −1 (9) of translates of the first collection by the vectors w i . Then, the set of matrices B ∈ SL n (R) of norm ≤ M such that the collection (9) forms a − 1-fold tiling is contained in a finite union of positive codimension submanifolds of SL n (R), which we denote by V q .
Proof of Lemma 27. Indeed, consider a matrix B and w 1 , · · · , w −1 ∈ R n such that the collection (9) forms a − 1-fold tiling. Translating the whole family if necessary, one can suppose that w 1 = 0. Then, easy geometrical arguments show that for every i, there exists a cube W i of the collection (9) such that (−1/2 + i, 0, 0, . . . ) ∈ R n belongs to the left face of W i (with the convention W 0 = W 1 ). By the pigeonhole principle, two cubes of the collection (W i ) 0≤i≤ −1 belong to the same translated family of cubes: there exists i 0 ∈ 1, − 1 , v, v ∈ Z n and i = j ∈ 0, − 1 such that W i = Bv + w i 0 + W 1 and W j = Bv + w i 0 + W 1 . But W i and W j differ of a translation of the form ( j − i, * , * , . . . ), thus the first coordinate of B(v − v ) has to be an integer smaller than . Such a reasoning can be made on each coordinate, and the obtained conditions are about different coefficients of the matrix B. Hence, the set of matrices of norm ≤ M forming a − 1-fold tiling is contained in a finite union of codimension ≥ n submanifolds of M n (R), thus the restriction of it to SL n (R) is of codimension ≥ n − 1.
x y Figure 6: Second case of Lemma 25, in the case = 3: two distinct vertical translates of W k+1 + Λ k+1 intersect (the first translate contains the dark blue thickening of W k + Λ k , the second is represented in grey).
Proof of Lemma 25. Let δ > 0 and M > 0. We define O ε as the set of matrices B ∈ SL n (R) satisfying: for any w 1 , · · · , w −1 ∈ R n , there exists a set U ⊂ R n /BZ n of measure > ε such that every point of U belongs to at least different cubes of the collection (9). In other words, every x ∈ R n whose projection x on R n /BZ n belongs to U satisfies By definition, the (monotonic) union of O ε over ε > 0 is the complement of the union of the submanifolds V q . By compactness of the set of matrices of SL n (R) of norm smaller than M, and continuity of the map B → Leb(U), this implies the existence of ε = ε(δ , M, ) > 0 such that O = O ε is contained in the complement of the union over q of the δ -neighbourhoods of V q . We then choose B ∈ O and a collection of vectors w 1 , · · · , w −1 ∈ R n . Let x ∈ R n be such that x ∈ U. By hypothesis on the matrix B, x satisfies Equation (10), so there exists + 1 integer vectors v 1 , · · · , v and indices i 1 , · · · , i such that the couples (v j , i j ) are pairwise distinct and that The following formula makes the link between what happens in the n last and in the n penultimates coordinates of R n(k+1) : (we add a vector belonging to Λ k+1 ). We now apply the hypothesis of the lemma to the vectors −v 1 , · · · , −v : there exists j = j ∈ 1, such that Let y be a point belonging to this intersection. Applying Equations (11) and (13), we get that (y, x) ∈ W k+1 + Λ k , 0 n + 0 (k−1)n , −v j , w i j + Bv j (14) and the same for j (this means that the point (y, x) belongs to two different translates of the cube, see Figures 5 and 6). Two different cases can occur.
(i) Either i j = i j (that is, the translation vectors w i j and w i j are equal). As a consequence, applying Equation (14), we have This implies that the set W k+1 + Λ k+1 auto-intersects (see Figure 5).
(ii) Or i j = i j (that is, w i j = w i j ). Combining Equations (14) and (12) This implies that two distinct vertical translates of W k+1 + Λ k+1 intersect (see Figure 6).
We have built points in some intersections, we now estimate the size of these intersections. Again, we have two cases.
(1) Either for more than the half of x ∈ U (for Lebesgue measure), we are in the case (i). To each of such x corresponds a translation vector w i . We choose w i such that the set of corresponding x has the biggest measure; this measure is bigger than ε/ 2( − 1) ≥ ε/(2 ). Reasoning as in the proof of Proposition 16, and in particular using the notations of Corollary 19, we get that the density C 1 of the auto-intersection of W k+1 + Λ k+1 + (0, w i ) is bigger than D k ε/(2 ). This leads to (using Corollary 19) In this case, we get the conclusion (1) of the lemma.
(2) Or for more than the half of x ∈ U, we are in the case (ii). Choosing the couple (w i , w i ) such that the measure of the set of corresponding x is the greatest, we get .
In this case, we get the conclusion (2) of the lemma. Figure 7: Intersection of cubes in the case where the rate is bigger than 1/3. The thickening of the cubes of W k + Λ k is represented in dark blue and the thickening of the rest of the cubes of W k+1 + Λ k+1 is represented in light blue; we have also represented another cube of W k+2 + Λ k+2 in yellow. We see that if the projection on the z-axis of the centre of the yellow cube is smaller than 1, then there is automatically an intersection between this cube and one of the blue cubes.
We can now prove Theorem 20.
Proof of Theorem 20. As in the proof of Proposition 16, we proceed by induction on k. Suppose that Λ k is such that D c (W k + Λ k ) > 1/ . Then, Lemma 24 ensures that it is not possible to have disjoint translates of W k + Λ k . Applying Lemma 25, we obtain that either D c (W k+1 + Λ k+1 ) < D c (W k + Λ k ), or it is not possible to have − 1 disjoint translates of W k+1 + Λ k+1 . And so on, applying Lemma 25 at most − 1 times, there exists k ∈ k + 1, k + − 1 such that W k + Λ k has additional auto-intersections. Quantitatively, if we denote τ k = τ k (B 1 , · · · , B k ), by Lemma 25, either This leads to But Lemma 24 implies that This implies that for every > 0, the sequence of rates τ k is smaller than a sequence converging exponentially fast to 1/ : we get that In particular, the asymptotic rate of injectivity is generically equal to zero.
Finally, we quickly explain how to adapt these arguments to get the final part of the theorem. As d A k , q V q > δ for a positive asymptotic density d of integers k, for any k 0 ∈ N, there exists an integer m ∈ N such that 1 We get the conclusion by following the first part of the proof of the theorem, and using additionally Lemma 26 for the integers i such that d A i , q V q ≤ δ .

A local-global formula for generic expanding maps and generic diffeomorphisms
The goal of this section is to study the rate of injectivity of generic C r -expanding maps and C r -generic diffeomorphisms of the torus T n . Here, the term expanding map is taken from the point of view of discretizations: we say that a linear map A is expanding if there exist no distinct integer points x, y ∈ Z n such that A(x) = A(y). This condition is satisfied in particular if for every x = 0, we have Ax ∞ ≤ x ∞ ; thus when n = 1 this definition coincides with the classical definition of expanding map. The main result of this section is that the rate of injectivity of both generic C 1 -diffeomorphisms and generic C r -expanding maps of the torus T n is obtained from a local-global formula (Theorems 28 and 33). Let us begin by explaining the case of diffeomorphisms.
Theorem 28. Let r ∈ [1, +∞], and f ∈ Diff r (T n ) (or f ∈ Diff r (T n , Leb)) be a generic diffeomorphism. Then τ k ( f ) is well defined (that is, the limit superior in (1) is a limit) and satisfies: (with τ defined by Equation (5) page 10). Moreover, the function τ k is continuous at f .

The idea of the proof of this theorem is very simple: locally, the diffeomorphism is almost equal to a linear map. This introduces an intermediate mesoscopic scale on the torus:
• at the macroscopic scale, the discretization of f acts as f ; • at the intermediate mesoscopic scale, the discretization of f acts as a linear map; • at the microscopic scale, we are able to see that the discretization is a finite map and see the discreteness of the phase space.
This remark is formalized by Taylor's formula: for every ε > 0 and every x ∈ T n , there exists ρ > 0 such that f and its Taylor expansion at order 1 are ε-close on B(x, ρ). We then suppose that the derivative D f x is "good": the rate of injectivity of any of its C 1 -small perturbations can be seen on a ball B R of R n (with R uniform in x). Then, the proof of the local-global formula is made in two steps.
• Prove that "a lot" of maps of SL n (R) are "good". This is formalized by Lemma 34, which gives estimations of the size of the perturbations of the linear map allowed, and of the size of the ball B R . Its proof is quite technical and uses crucially the formalism of model sets, and an improvement of Weyl's criterion.
• Prove that for a generic diffeomorphism, the derivative satisfies the conditions of Lemma 34 at almost every point. This follows easily from Thom's transversality theorem.
As the case of expanding maps is more involved but similar, we will prove the local-global formula only for expanding maps; the adaptation of it for diffeomorphisms is straightforward.
Remark that the hypothesis of genericity is necessary to get Theorem 28. For example, it can be seen that if we set The definition of the linear analogue of the rate of injectivity of an expanding map in time k is more complicated than for diffeomorphisms: in this case, the set of preimages has a structure of d-ary tree. We define the rate of injectivity of a tree -with edges decorated by linear expanding maps -as the probability of percolation of a random graph associated to this decorated tree (see Definition 31). In particular, if all the expanding maps are equal, then the connected component of the root of this random graph is a Galton-Watson tree. We begin by the definition of the set of expanding maps.
Definition 29. For r ≥ 1 and d ≥ 2, we denote by D r (T n ) the set of C r "Z n -expanding maps" of T n for the infinite norm. More precisely, D r (T n ) is the set of maps f : T n → T n , which are local diffeomorphisms, such that the derivative f ( r ) is well defined and belongs to C r− r (T n ) and such that for every x ∈ T n and every v ∈ Z n \ {0}, we have D f x v ∞ ≥ 1.
In particular, for f ∈ D r (T n ), the number of preimages of any point of T n is equal to a constant, that we denote by d.
Remark that in dimension n = 1, the set D r (S 1 ) coincides with the classical set of expanding maps: f ∈ D r (S 1 ) if and only if it belongs to C r (S 1 ) and f (x) ≥ 1 for every x ∈ S 1 .
We now define the linear setting corresponding to a map f ∈ D(T n ).
The set I k is the linear counterpart of the set k m=1 f −m (y). Its cardinal is equal to d( Definition 31. Let k ∈ N. The complete tree of order k is the rooted d-ary tree T k whose vertices are the elements of I k together with the root, denoted by / 0, and whose edges are of the form (fat(i), i) i∈I k (see Figure 8).
Let (p i ) i∈I k be a family of numbers belonging to [0, 1]. These probabilities will be seen as decorations of the edges of the tree T k . We will call random graph associated to (p i ) i∈I k the random subgraph G (p i ) i of T k , such that the laws of appearance the edges (fat(i), i) of G (p i ) i are independent Bernoulli laws of parameter p i . In other words, G (p i ) i is obtained from T k by erasing independently each vertex of T k with probability 1 − p i .
We define the mean density D((p i ) i ) of (p i ) i∈I k as the probability that in G (p i ) i , there is at least one path linking the root to a leaf.
Definition 32. By the notation D((det D f −1 x ) x∈ f −m (y), 1≤m≤k ), we will mean that the mean density is taken with respect to the random graph G f ,y associated to the decorated tree whose vertices are the f −m (y) for 0 ≤ m ≤ k, and whose edges are of the form ( f (x), x) for x ∈ f −m (y) with 1 ≤ m ≤ k, each one being decorated by the number det D f −1 x (see Figure 9). Recall that the rates of injectivity are defined by (see also Definition 5) Theorem 33. Let r ≥ 1, f a generic element of D r (T n ) and k ∈ N. Then, τ k ( f ) is a limit (that is, the sequence (τ k ( f N )) N converges), and we have Moreover, the map f → τ k ( f ) is continuous at f .
The proof of Theorem 33 is mainly based on the following lemma, which treats the linear corresponding case. Its statement is divided into two parts, the second one being a quantitative version of the first.
Lemma 34. Let k ∈ N, and a family (A i ) i∈I k of invertible matrices, such that for any i ∈ I k and any v ∈ Z n \ {0}, we have A i v ∞ ≥ 1.
If the image of the map x projects on a dense subset of the torus R n Card I k /Z n Card I k , then we have More precisely, for every , c ∈ N, there exists a locally finite union of positive codimension submanifolds V q of (GL n (R)) Card I k satisfying: for every η > 0, there exists a radius R 0 > 0 such that if (A i ) i∈I k satisfies d((A i ) i ,V q ) > η for every q, then for every R ≥ R 0 , and every family (v i ) i∈I k of vectors of R n , we have 16 (the density of the image set is "almost invariant" under perturbations by translations), and for every m ≤ k and every i ∈ 1, d k , we have 17 16 The map π(A + v) is the discretization of the affine map A + v. The quantity D R is defined in Definition 7. 17 Where (Z n ) stands for the set of points of R n at least one coordinate of which belongs to Z + 1/2.
(there is only a small proportion of the points of the image sets which are obtained by discretizing points close to (Z n ) ).
Remark that this statement is purely linear: again, the difficulties of local-global formula's proof hold in the linear world.
The local-global formula (15) will later follow from this lemma, an appropriate application of Taylor's theorem and Thom's transversality theorem (Lemma 37).
The next lemma uses the strategy of proof of Weyl's criterion to get a uniform convergence in Birkhoff's theorem for rotations of the torus T n whose rotation vectors are outside of a neighbourhood of a finite union of hyperplanes.
Lemma 35 (Weyl). Let dist be a distance generating the weak-* topology on P the space of Borel probability measures on T n . Then, for every ε > 0, there exists a locally finite family of affine hyperplanes H i ⊂ R n , such that for every η > 0, there exists M 0 ∈ N, such that for every λ ∈ R n satisfying d(λ , H q ) > η for every q, and for every M ≥ M 0 , we have whereδ x is the Dirac measure of the projection of x on R n /Z n .
Proof of Lemma 35. As dist generates the weak-* topology on P, it can be replaced by any other distance also generating the weak-* topology on P. So we consider the distance dist W defined by: there exists K > 0 and ε > 0 such that if a measure µ ∈ P satisfies ∀k ∈ N n : 0 < k 1 + · · · + k n ≤ K, then dist(µ, Leb) < ε. For every k ∈ N n \ {0} and j ∈ Z, we set Remark that the family {H j k }, with j ∈ Z and k such that 0 < k 1 + · · · + k n ≤ K, is locally finite. We denote by {H q } q this family, and choose λ ∈ R n such that d(λ , H q ) > η for every q. We also take Thus, for every k ∈ N n such that k 1 + · · · + k n ≤ K, and every M ≥ M 0 , the measure By (19) and the fact that d(k · λ , Z) ≥ η, we deduce that Thus, the measure µ satisfies the criterion (18), which proves the lemma.
Proof of Lemma 34. To begin with, let us treat the case d = 1. Let A 1 , · · · , A k be k invertible matrices. We want to compute the rate of injectivity of A k • · · · • A 1 . Resuming the proof of Proposition 9, we see that x ∈ A k • · · · • A 1 (Z n ) if and only if (0 n(k−1) , x) ∈ W k + Λ k (see page 10 for the definitions of these notations). This implies the following statement.
where ν is the uniform measure on the submodule In particular, if the image of the map projects on a dense subset of the torus R nk /Z nk , then the quantity (20) is equal to the volume the projection of W k on R nk / Λ k (see the end of the proof of Proposition 9 and in particular the form of the matrix M −1 A 1 ,··· ,A k ). By the hypothesis made on the matrices A m -that is, for any v ∈ Z n \ {0}, A m v ∞ ≥ 1 -this volume is equal to 1 (simply because the restriction to W k of the projection R nk → R nk / Λ k is injective). Thus, the density of the set A k • · · · • A 1 (Z n ) is equal to 1/(det(A k · · · A 1 )) .
We now consider the general case where d is arbitrary. We take a family (A i ) i∈I k of invertible matrices, such that for any i ∈ I k and any v ∈ Z n \ {0}, we have if and only if there exists i ∈ 1, d k such that (0 m−1 , x) ∈ W k + Λ i . Equivalently, a point x ∈ Z n does not belong to the set (21) if and only if for every i ∈ 1, d k , we have (0 n(k−1) , x) / ∈ W k + Λ i . Thus, if the image of the map ( 2 ) Figure 10: Calculus of the density of the image set at the level k according to the density of its sons.
projects on a dense subset of the torus R n Card I k /Z n Card I k , then the events x ∈ S i , with are independent (see Figure 10), meaning that for every F ⊂ 1, d , we have Thus, by the inclusion-exclusion principle, we deduce that Moreover, the fact that for any i ∈ I k and any v ∈ Z n \ {0}, we have A i v ∞ ≥ 1 leads to These facts imply that the density we look for follows the same recurrence relation as D The second part of the lemma is an effective improvement of the first one. To obtain the bound (16), we combine Lemma 35 with Lemma 36 to get that for every ε > 0, there exists a locally finite collection of submanifolds V q of (GL n (R)) Card I k with positive codimension, such that for every η > 0, there exists R 0 > 0 such that if d((A i ) i ,V q ) > η for every q, then Equation (22) is true up to ε.
The other bound (17) is obtained independently from the rest of the proof by a direct application of Lemma 35 and of Lemma 36 applied to k = 1.
The following lemma is a direct application of Thom's transversality theorem.
Lemma 37 (Perturbations in C r topology). Let 1 ≤ r ≤ +∞ and f a generic element of D r (T n ). Then, for every k ∈ N, every ∈ N and every finite collection (V q ) of submanifolds of positive codimension of (GL n (R)) dm , there exists η > 0 such that the set , V q > η contains a finite disjoint union of cubes 18 , whose union has measure bigger than 1 − 1/ .
Proof of Lemma 37. By Thom's transversality theorem, for a generic map f ∈ D r (T n ), the set is a locally finite union of positive codimension submanifolds. Thus, the sets T η are compact sets and their (decreasing) intersection over η is a locally finite union of positive codimension submanifolds. So, there exists η > 0 such that T η is close enough to this set for Hausdorff topology to have the conclusions of the lemma.
We can now begin the proof of Theorem 33.
Proof of Theorem 33. Let f be a generic element of D r (T n ). The idea is to cut the torus T n into small pieces on which f is very close to its order 1 Taylor expansion.
Let m ∈ N and ∈ N * . We want to prove that the set of accumulation points of the sequence (τ m N ( f )) N is included in the ball of radius 1/ and centre (that is, the right side of Equation (15)).
To do that, we first set = 3 and c = d(1 − d k )/(1 − d) = Card(I k ), and use Lemma 34 to get a locally finite union of positive codimension submanifolds V q of (GL n (R)) Card(I k ) . We then apply 18 here, a cube is just any ball for the infinite norm. Lemma 37 to these submanifolds and to = 4 ; as f is generic this gives us a parameter η > 0 such that the set , V q < η is contained in a disjoint finite union C of cubes, whose union has measure smaller than 1/(4 ). Finally, we apply Lemma 34 to η = η/2; this gives us a radius R 0 > 0 such that if (A i ) i∈I k is a family of matrices of GL n (R) satisfying d((A i ) i ,V q ) > η/2 for every q, then for every R ≥ R 0 , and every family (v i ) i∈I k of vectors of R n , we have and for every i, j, Remark that if δ is small enough, then the set , V q > η/2 contains a set C , which is a finite union of cubes whose union has measure bigger than 1 − 1/(3 ). Let C be a cube of C , y ∈ C and x ∈ f −m (y), with 1 ≤ m ≤ k. We write the Taylor expansion of order 1 of f at the neighbourhood of x; by compactness we obtain Thus, for every ε > 0, there exists ρ > 0 such that for all x ∈ C and all z ∈ B(0, ρ), we have We now take R ≥ R 0 . We want to find an order of discretization N such that the error made by linearizing f on B(x, R/N) is small compared to N, that is, for every z ∈ B(0, R/N), we have To do that, we apply Bound (25) to to get a radius ρ > 0 (we can take ρ as small as we want), and we set N = R/ρ (thus, we can take N as big as we want). By (25), for every z ∈ B(0, R), we obtain the desired bound: Combined with (24), this leads to in other words, on every ball of radius R/N, the image of E N by f N and the discretization of the linearization of f are almost the same (that is, up to a proportion 1/(3 Card I k ) of points). We now set R 1 = R 0 f m ∞ , and choose R ≥ R 1 , to which is associated a number ρ > 0 and an order N = R/ρ , that we can choose large enough so that 2R/N ≤ f ∞ . We also choose y ∈ C. As and using the estimations (23) and (26), we get As such an estimation holds on a subset of T n of measure bigger than 1 − 1/(3 ), we get the conclusion of the theorem.
We can easily adapt the proof of Lemma 34 to the case of sequences of matrices, without expansiveness hypothesis.
Lemma 38. For every k ∈ N and every , c ∈ N, there exists a locally finite union of positive codimension submanifolds V q of (GL n (R)) k (respectively (SL n (R)) k ) such that for every η > 0, there exists a radius R 0 > 0 such that if (A m ) 1≤m≤k is a finite sequence of matrices of (GL n (R)) k (respectively (SL n (R)) k ) satisfying d((A m ) m ,V q ) > η for every q, then for every R ≥ R 0 , and every family (v m ) 1≤m≤k of vectors of R n , we have (the density of the image set is "almost invariant" under perturbations by translations), and for every m ≤ k, we have 19 (there is only a small proportion of the points of the image sets which are obtained by discretizing points close to (Z n ) ).
With the same proof as Theorem 33, Lemma 38 leads to the local-global formula for generic C rdiffeomorphisms (Theorem 28). 19 Recall that (Z n ) stands for the set of points of R n at least one coordinate of which belongs to Z + 1/2.

Asymptotic rate of injectivity for a generic conservative diffeomorphism
The goal of this section is to prove that for any r ≥ 1, the degree of recurrence of a generic conservative C r -diffeomorphism is equal to 0. more precisely, for every ε > 0, the set of diffeomorphisms f ∈ Diff r (T n , Leb) such that lim t→+∞ τ k ( f ) < ε is open and dense.
It will be obtained by using the local-global formula (Theorem 28) and the result about the asymptotic rate of injectivity of a generic sequence of matrices (Theorem 20). The application of the linear results will be made through Thom transversality arguments (Lemma 37).
Proof of theorem 39. Let ε > 0, r ∈ [0, +∞] and consider a generic element f of Diff r (T n , Leb). Applying the second part of Theorem 20, one gets a locally finite collection of submanifolds V q of SL n (R), which allow to define the set T η = y ∈ T n | ∀q, d D f y ,V q ≥ η .
Then, Birkhoff theorem (non-ergodic version) applied to Lebesgue measure implies that the set T ∞ η of points y ∈ T n such that has Lebesgue measure greater than 2 Leb(T η ) − 1. Now, Lemma 37 (transversality) implies that as f is a generic element of Diff r (T n , Leb), there exists η > 0 such that Leb(T η ) > 1 − ε, in particular Leb(T ∞ η ) > 1 − 2ε. Then, applying the second part of Theorem 20, we get that for all y ∈ T ∞ η , we have τ ∞ (D f f k (y) ) k ≤ ε. In particular, there exists k 0 ∈ N and T ⊂ T ∞ η , with Leb(T ) ≥ 1 − 3ε such that for all y ∈ T , we have τ k 0 (D f f k (y) ) k ≤ ε (as the sets of points y ∈ T ∞ η , such that τ k (D f f k (y) ) k ≤ ε have their increasing union over k equal to T ∞ η ). Applying Theorem 28, one gets that 20 Using Equation (2) page 5.

Asymptotic rate of injectivity for a generic dissipative diffeomorphism
Here we tackle the issue of the asymptotic rate of injectivity of generic dissipative diffeomorphisms. Again, we will consider the torus T n equipped with Lebesgue measure Leb and the canonical measures E N , see Section A for a more general setting where the result is still true. The study of the rate of injectivity for generic dissipative diffeomorphisms is based on the following theorem of A. Avila and J. Bochi.
Theorem 40 (Avila, Bochi). Let f be a generic C 1 maps of T n . Then for every ε > 0, there exists a compact set K ⊂ T n and an integer m ∈ N such that This statement is obtained by combining Lemma 1 and Theorem 1 of [3].
Remark 41. As C 1 expanding maps of T n and C 1 diffeomorphisms of T n are open subsets of the set of C 1 maps of T n , the same theorem holds for generic C 1 expanding maps and C 1 diffeomorphisms of T n (this had already been proved in the case of C 1 -expanding maps by A. Quas in [36]).
This theorem can be used to compute the asymptotic rate of injectivity of a generic diffeomorphism.
Corollary 42. The asymptotic rate of injectivity of a generic dissipative diffeomorphism f ∈ Diff 1 (T n ) is equal to 0. In particular, the degree of recurrence D rec ( f N ) of a generic dissipative diffeomorphism tends to 0 when N goes to infinity.
The same statement holds for generic C 1 expanding maps. where Int denotes the interior. Then, the union M∈N U M is increasing in M and we have M∈N U M = O. In particular, there exists M 0 ∈ N such that Leb(U M 0 ) > 1−ε, and as U M 0 ⊂ O, we also have Leb( f m (U M 0 )) < ε. We denote U = U M 0 . Finally, as U is a finite union of cubes, and as f is a diffeomorphism, there exists δ > 0 such that the measure of the δ -neighbourhood of f m (U) is smaller than ε. We denote by V this δ -neighbourhood.
As U is a finite union of cubes, there exists N 0 ∈ N such that if N ≥ N 0 , then the proportion of points of E N which belong to U is bigger than 1 − 2ε, and the proportion of points of E N which belong to V is smaller than 2ε. Moreover, if N 0 is large enough, then for every N ≥ N 0 , and for every x N ∈ E N ∩U, we have f m N (x N ) ∈ V . This implies that Card( f m N (E N )) Card(E N ) ≤ 4ε, which proves the corollary.
6 Asymptotic rate of injectivity of a generic expanding map In this section, we prove that the asymptotic rate of injectivity of a generic expanding map is equal to 0. Note that a local version of this result was already obtained by P.P. Flockermann in his thesis (Corollary 2 page 69 and Corollary 3 page 71 of [7]), stating that for a generic C 1+α expanding map f of the circle, the "local asymptotic rate of injectivity" is equal to 0 almost everywhere. Some of his arguments will be used in this section. Note also that in C 1 regularity, the equality τ ∞ ( f ) = 0 for a generic f is a consequence of Theorem 40 of A. Avila and J. Bochi (see also Corollary 42); the same theorem even proves that the asymptotic rate of injectivity of a generic C 1 endomorphism of the circle is equal to 0.
Definition 43. We define Z m as the number of children at the m-th generation in G f ,y (see Definition 32).
Proposition 44. For every r ∈]1, +∞], for every f ∈ D r (S 1 ) and every y ∈ S 1 , we have where L is the Ruelle-Perron-Frobenius associated to f and 1 denotes the constant function equal to 1 on S 1 . In particular, there exists a constant Σ 0 > 0 such that E(Z m ) ≤ Σ 0 for every m ∈ N.
The second part of the lemma is deduced from the first one by applying the theorem stating that for every C r expanding map f of S 1 (r > 1), the maps L m 1 converge uniformly towards a HÃ ¶lder map, which is the density of the unique SRB measure of f (see for example [6]). The first assertion of the lemma follows from the convergence of the operators f * N acting on P (the space of Borel probability measures) towards the Ruelle-Perron-Frobenius operator.
Definition 46. The transfer operator associated to the map f (usually called Ruelle-Perron-Frobenius operator), which acts on densities of probability measures, will be denoted by L f . It is defined by .
Lemma 45 follows directly from the following lemma.
Lemma 47. Denoting Leb N the uniform measure on E N , for every C 1 expanding map of S 1 and every fixed m ≥ 0, we have convergence of the measures ( f * N ) m (Leb N ) towards the measure of density L m f 1 (where 1 denotes the constant function equal to 1).
The proof of this lemma is straightforward but quite long. We sketch here this proof, the reader will find a complete proof using generating functions in Section 3.4 of [7] and a quantitative version of it in Section 12.2 of [10].
Sketch of proof of Lemma 47. As f is C 1 , by the mean value theorem, for every segment I small enough, we have Moreover, for every interval J, These two inequalities allows to prove the local convergence of the measures f * N (λ N ) towards the measure with density L f 1. The same kind of arguments holds in arbitrary times, and allows to prove the lemma.
Proof of Proposition 44. We fix ε > 0, and set K = Σ 0 /ε (the constant Σ 0 being given by Lemma 45) and a m = P(Z m = 0) , b m = P(0 < Z m ≤ K) , c m = P(Z m > K).  We want to prove that the sequence (a m ) m∈N tends to 1.
Of course, a m + b m + c m = 1 for any m. A generation with less than K children will give birth to zero child with positive probability: we have In other words, setting α = (1 − f −1 ∞ ) dK , we get a m+1 ≥ a m + αb m (see also Figure 11). Furthermore, by Markov inequality and Lemma 45, we have P(Z m ≥ Σ 0 /ε) ≤ ε, so c m ≤ ε.
In summary, we have    a m + b m + c m = 1 c m ≤ ε a m+1 ≥ a m + αb m .
Proof of Corollary 48. It is an easy consequence of the local-global formula (Theorem 33), Proposition 44 and the dominated convergence theorem. We have computed numerically the degree of recurrence of a diffeomorphism f , which is C 1 -close to Id. It is defined by f = Q • P, with P(x, y) = x, y + p(x) and Q(x, y) = x + q(y), y , p(x) = 1 209 cos(2π × 17x) + 1 271 sin(2π × 27x) − 1 703
On Figure 12, we have represented graphically the quantity D( f 128k ) for k from 1 to 150. It appears that, as predicted by Theorem 39, this degree of recurrence goes to 0. In fact, it is even decreasing, and converges quite fast to 0: as soon as N = 128, the degree of recurrence is smaller than 1/2, and if N 1000, then D( f N ) ≤ 1/10. Note that, contrary to what is predicted by theory, this phenomenon was already observed for examples of conservative homeomorphisms of the torus which have big enough derivatives not to be considered as "typical from the C 1 case" (see [11]).
We also present the results of the numerical simulation we have conducted for the degree of recurrence of the expanding map of the circle g, defined by g(x) = 2x + ε 1 cos(2πx) + ε 2 sin(6πx), with ε 1 = 0.127 943 563 72 and ε 2 = 0.008 247 359 61.
On Figure 13, we have represented the quantity D(g 128k ) for k from 1 to 1 000. It appears that, as predicted by Corollary 48, this degree of recurrence seems to tend to 0. In fact, it is even decreasing, and converges quite fast to 0: as soon as N = 128, the degree of recurrence is smaller than 1/5, and if N 25 000, then D(g N ) ≤ 1/50.