On coprime percolation, the visibility graphon, and the local limit of the GCD profile

Colour an element of $\mathbb{Z}^d$ white if its coordinates are coprime and black otherwise. What does this colouring look like when seen from a"uniformly chosen"point of $\mathbb{Z}^d$? More generally, label every element of $\mathbb{Z}^d$ by its GCD: what do the labels look like around a"uniform"point of $\mathbb{Z}^d$? We answer these questions and generalisations of them, provide results of graphon convergence, as well as a"local/graphon"convergence. One can also investigate the percolative properties of the colouring under study.

Let d ≥ 2. Let F be a bounded subset of R d . For every r ∈ (0, ∞), set F r := {x ∈ Z d : r −1 x ∈ F }. Assume that |Fr| r d converges to a nonzero limit when r tends to infinity. Then, one has lim r→∞ |{x∈Fr : GCD(x1,...,x d )=1}| |Fr| = 1/ζ(d). (A) The study of coprime vectors of Z d , i.e. of the vectors x that satisfy GCD(x 1 , . . . , x d ) = 1, can be performed for its own sake. It may also be motivated by the reducibility of fractions (the probability that a random fraction is irreducible is 1/ζ(2) = 6 π 2 ) for d = 2 or by the visibility problem for arbitrary d. If x and y denote two distinct points of Z d , one says that x is visible from y if the line segment [x, y] intersects Z d only at x and y. This condition is equivalent to x − y having a GCD equal to 1. The set of coprime vectors (also called visible lattice points or primitive vectors) has been studied in various ways: see e.g. [1,2,5,10,14,15,16,19,23,24,27,30].
A classical corollary of (A) is the following stronger statement. Recall that the zeta distribution of parameter s > 1 is the probability distribution on N giving weight n −s ζ(s) to each n ∈ N .
Let d ≥ 2. Let F be a bounded subset of R d . For every r ∈ (0, ∞), set F r := {x ∈ Z d : r −1 x ∈ F }. Assume that |Fr| r d converges to a nonzero limit when r tends to infinity. Let Y r denote a random element of F r chosen uniformly at random (for every x ∈ F r , we have P(Y r = x) = 1/|F r |). Then, GCD(Y r ) converges in distribution to a zeta distribution of parameter d, as r goes to infinity.

(B)
In this paper, we are interested in the following two moral questions.
Colour an element of Z d white if its coordinates are coprime and black otherwise. What does this colouring look like when seen from a point of Z d chosen "uniformly at random"?
Label every element of Z d by its GCD. What do the labels look like around a point of Z d chosen "uniformly at random"?
Even though (Q2) is stronger than (Q1), it is fruitful to study both questions independently (why this is the case will be addressed in Remark 2.13). Let us now make these two questions precise. Let X be a Polish space. Denote by Ω X the space X Z d endowed with the product topology, which is also Polish. Let c be an element of Ω X . In (Q1), we will be interested in X = {0, 1} and c = cop := 1 coprime . In (Q2), we will be interested in X = N and c = gcd : x → GCD(x 1 , . . . , x d ).
If F is a nonempty finite subset of Z d , one defines the probability measure µ F,c as follows -it represents c seen from a uniform random point in F . For any y ∈ Z d and ω ∈ Ω X , define τ y ω ∈ Ω X by (τ y ω) x = ω x−y . Let Y be a random element of F chosen uniformly at random (for every x ∈ F , we have P(Y = x) = 1/|F |). We denote by µ F,c the (probability) distribution of the Ω X -valued random variable τ −Y c. In other words, µ F,c is the probability measure on Ω X defined by µ F,c = 1 |F | x∈F δ τ−xc . A third formulation goes as follows: for every Borel subset A of Ω X , we have µ F,c (A) = |{x ∈ F : τ −x c ∈ A}|/|F |. We want to describe the limit of µ Fn,c when c is a map of interest and (F n ) is a reasonable sequence of finite subsets of Z d , such as ( 1, (2) Limits are taken in the following sense: the space of probability measures on Ω X is endowed with the weak topology, namely the smallest topology such that for every bounded continuous map f : When X is discrete, µ n converges to µ if and only if for every cylindrical event Recall that a cylindrical event is an event of the form {ω ∈ Ω : ω |F ∈ A}, where F is a finite subset of Z d , ω |F stands for the restriction of ω to F , and A is some measurable subset of X F . When X is compact, the space of probability measures on X is compact for the weak topology.
Then, µ Fr,gcd converges to some explicit probability measure µ ∞,gcd when r goes to infinity.
The probability measure µ ∞,gcd is defined on page 5. It does not depend on F but only on d. Theorem 1 answers (Q2), hence (Q1). It can be seen as a generalisation of [27,Theorem 1]. Our arguments and those of [27] follow different approaches.
The remaining of the paper is organised as follows. Section 2 investigates (Q1) and (Q2). This section contains the proof of Theorem 1, as well as complementary results. The use of relevant arithmetic/probabilistic notions makes the core of the problem very apparent: see on pages 5 and 7. Section 3 provides several generalisations of these results.

Answers to (Q1) and (Q2)
In Section 2.1, we study (Q1). In Section 2.2, we investigate (Q2). Finally, in Section 2.3, we comment on the previous sections and explore some ergodic and percolative properties of µ ∞,cop .

The random coprime colouring
In this section, we answer (Q1) by proving Theorem 2. Let us define µ ∞,cop , which will turn out to be the limit of µ Fn,cop when (F n ) is a reasonable sequence of finite subsets of Z d . For every prime p, let W p denote a uniformly chosen coset of pZ d in Z d , i.e. one of the p d sets of the form x + pZ d . Do all these choices independently. We will be interested in the random set p (Z d \ W p ). One realisation of this random set has been simulated and depicted in white on page 1. By identifying this set with its indicator function, we can see it as an Ω {0,1} -valued random variable. It thus makes sense to define µ ∞,cop to be the (probability) distribution of this random variable. In other words, we consider the (2) This way of proceeding is closely related to local convergence and local weak convergence (also called Benjamini-Schramm convergence): see [3,4,12].  We will actually prove Proposition 2.2 instead of Theorem 2. Say that a sequence (F n ) of finite nonempty subsets of Z d is a Følner sequence if for every y ∈ Z d , one has |F n ∆(F n + y)| = o(|F n |). Theorem 2 immediately follows from (A) and Proposition 2.2: therefore, it is sufficient to prove Proposition 2.2. It will actually be deduced from the following stochastic domination result. If µ and ν denote two probability measures on Ω {0,1} ∼ = Subsets(Z d ), we say that µ is stochastically dominated by ν if there is a coupling (W, W ) of (µ, ν) such that W ⊂ W almost surely. Proposition 2.3. Let d ≥ 1 and let (F n ) be a Følner sequence of Z d . Assume that µ Fn,cop converges to some probability measure µ. Then, µ is stochastically dominated by µ ∞,cop .
The goal of the remaining of this section is to prove Propositions 2.2 and 2.3. Lemma 2.4. Let d ≥ 1, let N be a positive integer, and let π : Z d → (Z/N Z) d denote reduction modulo N . Let (F n ) be a Følner sequence of Z d , and let Y n denote a uniformly chosen element of F n . Then, π(Y n ) converges in distribution to the uniform measure on (Z/N Z) d .
For every n, say that an element x of F n is n-good if the box B containing it satisfies B ⊂ F n . Let Y n denote a uniformly chosen element of F n . Because (F n ) is a Følner sequence, the probability that Y n is n-good converges to 1 as n goes to infinity. But if Y n denotes a uniformly chosen n-good element of F n , then π(Y n ) is precisely uniform in (Z/N Z) d : one may generate Y n by picking independently a uniform element Y in 0, N − 1 d and a uniform element Y n in {x ∈ N Z d : x is n-good}, and then writing Y n = Y n + Y . The result follows.
We will need Lemma 2.5, which requires the following definitions. Let X = {0, 1} P . The map pcop : Z d → X is given by pcop(x) p = 1 x / ∈pZ d . Let us now define µ ∞,pcop . For every p ∈ P, pick a uniform coset W p of pZ d among the p d possible ones. Do this independently for every p. Define the random element W of But this continuity, equivalent to that of the min map defined from {0, 1} P to {0, 1}, does not hold. However, the min map is upper semicontinuous, which permits the proof of Proposition 2.3. Notice that there can be no way to do "as if" f was continuous. Indeed, if one makes no other assumption than (F n ) being Følner (which suffices for Lemma 2.5), then it is possible that µ Fn,cop does not converge to µ ∞,cop . The proof of this is deferred to Remark 2.12.
Proof of Proposition 2.3. Let us make the assumptions of Proposition 2.3. For Y n uniformly chosen in F n , let us consider (τ −Yn cop, 1} P is compact, up to passing to a subsequence, we may assume that the distribution of (τ −Yn cop, τ −Yn pcop) converges to some probability measure ρ on Ω {0,1} × Ω {0,1} P . Notice that for every x ∈ Z d and p ∈ P, one has Besides, for every x and p (which range over countable sets), the set Proof of Proposition 2.2. Let us make the assumptions of Proposition 2.2. Up to taking a subsequence of (F n ), we may assume that µ Fn,cop converges to some µ. We want to prove that µ = µ ∞,cop . By Proposition 2.3, there is a monotone coupling of (µ, µ ∞,cop ), i.e. some coupling ρ of (µ, µ ∞,cop ) such that for ρ-almost every (ω, ω ∞ ), one has ∀x, ω(x) ≤ ω ∞ (x). But by the 1/ζ(d)-assumption, one has As a result, for ρ-almost every (ω, ω ∞ ), one has ω( 0) = ω ∞ ( 0). The same argument applies for any x ∈ Z d instead of 0. Indeed, the probability measure µ ∞,cop is translation invariant by construction, and µ is translation invariant because (F n ) is a Følner sequence. Thus, µ is equal to µ ∞,cop and Proposition 2.2 is proved.

The random GCD labelling
In this section, we prove Theorem 1. Let us first define µ ∞,gcd . For every prime p, perform the following random choices: set W p 0 := Z d , and conditionally on (W p 0 , . . . , W p n−1 ), pick a uniform coset W p n of p n Z d among those lying inside W p n−1 . Do this independently for every p. We set the random p-adic valuation of a vertex x in Z d to be V p (x) := sup{n ∈ N : x ∈ W p n } ∈ 0, ∞ . We define the random GCD profile to be the random map x → p∈P p Vp(x) . (This occurs almost surely nowhere, but one should set p∈P p Vp(x) to be 0 whenever ∀p, V p (x) = ∞.) The distribution of the random GCD profile is denoted by µ ∞,gcd . It is a priori a probability distribution on Ω 0,∞ . By the Borel-Cantelli Lemma, for every d ≥ 2, it is also a probability distribution on Ω N , and it is as such that it will be considered from now on. We will prove the following proposition. Proposition 2.6. Let d ≥ 1 and let (F n ) be a Følner sequence of Z d . For every n, let Y n denote a uniformly chosen element of F n . Assume that the distribution of GCD(Y n ) is tight (which implies d ≥ 2). Then, µ Fn,gcd converges to µ ∞,gcd .
With the notation of Theorem 1, for any sequence (r n ) converging to infinity, (F rn ) is a Følner sequence. By (B), it is thus sufficient to prove Proposition 2.6 in order to get Theorem 1.
The forthcoming Lemma 2.7 uses the notion of profinite numbers. DefineẐ as π m,n denotes the morphism of reduction modulo m from Z/nZ to Z/mZ. One can see Z as a dense subgroup ofẐ via the injection Elements ofẐ are called profinite numbers. The topology onẐ is defined as follows.
Endow n≥1 Z/nZ with the product topology: this topology induces on the subsetŝ Z ⊂ n≥1 Z/nZ and Z ⊂Ẑ the so-called profinite topology. It makes (Ẑ, +) to be a metrisable compact topological group.
Recall that when p is a prime, the set of p-adic integers is defined by Z p = lim ← −n Z/p n Z. The Chinese Remainder Theorem implies thatẐ and p Z p are isomorphic as topological groups (and even as rings), an isomorphism being given bŷ In order to define a suitable probability measure µ ∞,prof , notice that there is a unique Haar measure on the compact groupẐ ∼ = p Z p , which corresponds to the product of Haar measures on Z p . A Haar-distributed element of Z p is a random p-adic integer (X n ) n≥0 such that for every n ≥ 1, conditionally on X n−1 , the element X n is uniform among the p elements of Z/p n Z that reduce to X n−1 modulo p n−1 .
Pick a Haar-distributed element Y ofẐ d , i.e. d independent Haar-distributed elements ofẐ. We denote by µ ∞,prof the distribution of the following random element of ΩẐ d : x → Y + prof(x). Lemma 2.7. Let d ≥ 1 and let (F n ) be a Følner sequence of Z d . Then, µ Fn,prof converges to µ ∞,prof .
Proof. AsẐ is compact, up to passing to a subsequence, we may assume that µ Fn,prof converges to some probability measure µ. Let Y n denote a uniformly chosen element of F n , and set X n := prof(Y n ). By Lemma 2.4, for every N , the (mod N )-component of X n converges in distribution to the uniform probability measure on (Z/N Z) d . As a result, X n converges in distribution to the Haar probability measure onẐ d . Therefore, if s is µ-distributed, then s(0) is Haar-distributed onẐ d . It thus suffices to prove that µ gives probability 1 to the following set: {σ ∈ ΩẐ d : ∀x ∈ Z d , σ(x) = σ( 0) + prof(x)}. But this is clear as it is closed and has probability 1 for every µ Fn,prof . As we are interested in the GCD of random elements of Z, it is useful to recall what the GCD of a profinite number is. While the GCD of an element of Z is a natural number (possibly 0), the GCD of a profinite number will be a supernatural number. The set of supernatural numbers is N := 0, ∞ P . The set 0, ∞ is endowed with the usual Local limit of the GCD profile topology: a set U is open if and only if for n large enough, n ∈ U ⇐⇒ ∞ ∈ U . The set N = 0, ∞ P is endowed with the product of these topologies. One can see any nonnegative integer n ∈ N as a supernatural number via the following injection: Ψ : n → (p → p-adic valuation of n).
Let super : Z d → N be defined by x → Ψ(GCD(x)). Given a Haar-distributed element Y ofẐ d , denote by µ ∞,super the distribution of the following random element of Ω N : x → GCD(Y + prof(x)). Lemma 2.9. Let d ≥ 1 and let (F n ) be a Følner sequence of Z d . Then, µ Fn,super converges to µ ∞,super .
Proof. As the GCD-map is continuous fromẐ to N, this follows directly from Lemma 2.7.
Notice that the conclusion of Lemma 2.9 is quite close to the one we have been looking for. Assume further that d ≥ 2. Then, as p∈P p −d < ∞, the Borel-Cantelli Lemma yields that if X is µ ∞,super -distributed, then almost surely, every x ∈ Z d satisfies X(x) ∈ Ψ(N ). Recall that Ψ(N ) consists in finitely supported elements of N = 0, ∞ P all the values of which are finite. If n ∈ Ψ(N ), then n = Ψ p∈P p np and we write χ(n) = p∈P p np ∈ N . The random variable (χ(X(x))) x∈Z d thus has distribution µ ∞,gcd .
If χ was continuous and defined everywhere on N, one could directly deduce from Lemma 2.9 that µ Fn,gcd converges to µ ∞,gcd ; but the actual properties of χ do not allow to perform this derivation, not even in an indirect manner. Indeed, (F n ) being Følner and d being at least 2 do not suffice to guarantee this convergence: these conditions do not even suffice to guarantee convergence of µ Fn,cop to µ ∞,cop . See Remark 2.12. We need the tightness assumption and this goes through the following easy lemma.
Denote by f ρ the pushforward by f of a given measure ρ. Lemma 2.10. Let X and Y be Polish spaces. Let f : X → Y be a continuous injective map that maps every Borel subset of X to a Borel subset of Y . Let (µ n ) n≤∞ denote a sequence of probability measures on X. For every integer n, set ν n := f µ n . Likewise, set ν ∞ := f µ ∞ . Assume that ν n converges to ν ∞ and that µ n converges to some probability measure µ. Then µ and µ ∞ are equal.
Proof. By continuity of f , the sequence ν n = f µ n converges to f µ. As this sequence also converges to f µ ∞ , we have f µ = f µ ∞ . By injectivity of f , we have µ( In Lemma 2.10, if one does not assume µ n to converge to some probability measure, one cannot deduce that µ n converges to µ ∞ : Take X = (0, 1], Y = R/Z, and set f : X → Y to be reduction modulo 1; for n ∈ N , set µ n = δ 1/n , and let µ ∞ = δ 1 . Proof of Proposition 2.6. Let (F n ) and (Y n ) be as in Proposition 2.6. By hypothesis, GCD(Y n ) is tight. Together with the assumption that (F n ) is a Følner sequence, this implies that d ≥ 2 and that for every x ∈ Z d , GCD(Y n + x) is tight. Therefore, the (N-indexed) sequence of random variables (GCD(Y n + x)) x∈Z d is tight. Up to passing to a subsequence, we may thus assume that its distribution converges to some probability measure µ on Ω N . Let X := Ω N and Y := Ω N . For n ∈ N, let µ n := µ Fn,gcd . Set µ ∞ := µ ∞,gcd , which is a well-defined probability measure on Ω N because of the Borel-Cantelli Lemma ( p∈P p −d < ∞). Let f : X → Y be defined by f (σ) = (Ψ(σ x )) x∈Z d . This map is injective, continuous, and maps Borel subsets of X to Borel subsets of Y . By Lemma 2.9, f µ n converges to f µ ∞ . As µ n converges to µ, Lemma 2.10 yields that µ n converges to µ ∞ , which is the desired result.

Remarks
In our results, we do not need any assumption of monotonicity regarding (F n ). Likewise, it may well be the case that n F n = Z d . The fact that |F n | tends to infinity is a consequence of being Følner.
Even though the conclusion of Proposition 2.6 implies that of Proposition 2.2, Proposition 2.2 cannot be derived from Proposition 2.6. Indeed, one has the following fact. Fact 2.11. For every d ≥ 1, there is a Følner sequence (F n ) of Z d such that the following conditions hold: if Y n denotes a uniform element of F n , the distribution of GCD(Y n ) is not tight; and the proportion of coprime vectors in F n converges to 1/ζ(d).
Proof. This fact can be derived from the Chinese Remainder Theorem or from the proof of Theorem 1. We will proceed in the second manner.
If d = 1, any Følner sequence automatically satisfies the desired properties. Thus, let us assume that d ≥ 2, so that p∈P p −d < ∞. Let ε > 0 and K ∈ N. One has By translation invariance, one has . Either by ergodicity (3) or because of Proposition 2.3, one can pick an arbitrarily large N such that this proportion has a positive probability to be ε-close to 1/ζ(d). Fixing such an N , one can thus find a deterministic subset U of 1, N d such that |U | N d − 1 ζ(d) ≤ ε and µ ∞,super ({σ : ∀x ∈ U, ∀p ∈ P, σ(x) p = 0}) > 0.
Recall that µ ∞,super is defined in terms of the cosets W n p . Let p denote an injective map from 1, N d to {p ∈ P : p ≥ P }. We will use this injection to modify s into a new random to contain x: do this independently of s and independently for every x ∈ 1, N d \U . The distribution of the ensuing random variable s has a density relative to µ ∞,super . As s almost surely satisfies the following conditions: the corresponding conditions are satisfied by s with positive probability. Denote the corresponding event by E. By Theorem 1, the proportion of x ∈ 1, n d such that τ −x super satisfies E converges to a positive number, hence is positive for n large enough. (3) Later in this section, we will see that µ∞,super is ergodic, i.e. that any translation invariant event has probability 0 or 1. One can then use an ergodic theorem such as Theorem 1.1 in [21].
In particular, there is some y ∈ Z d such that τ −y super satisfies E. We say that any such y is a (K, N, ε)-counterexample. For every n, pick some y n that is an (n, m n , 1/n)counterexample for some m n ≥ n: the sequence F n = d i=1 y n i + 1, y n i + m n satisfies the desired properties.
Remark 2.12. Likewise, the 1/ζ(d)-condition cannot be removed from Proposition 2.2: it is well-known that the Chinese Remainder Theorem implies that there are arbitrarily large boxes F n = x n + 0, N d in Z d devoid of coprime points. This also follows from Theorem 2, as µ ∞,cop has a positive probability to colour black the whole box 0, N d -use one prime per point of the box. Such a sequence (F n ) is Følner and yet µ Fn,cop converges δ 0 . The Følner condition cannot be removed from Proposition 2.2 either.
All the results in this paper concerning visibility extend to lattices in R d , as any such lattice may be mapped to Z d by a linear automorphism of R d , which preserves visibility.
Notice that µ ∞,cop and µ ∞,gcd are not only translation invariant but also GL d (Z)invariant. Even though cop and gcd are indeed GL d (Z)-invariant, the GL d (Z)-invariance of these measures does not follow from Theorems 1 and 2. One way to understand why goes as follows. Every orbit of the multiplicative group G generated by 1 1 0 1 contains a unique point inside A := {x ∈ Z 2 : 0 ≤ x 1 < |x 2 |} ∪ (Z × {0}). Consider the colouring of Z 2 which is defined as the chessboard colouring on A (say white if the sum of coordinates is odd and black otherwise), and take its unique G-invariant extension. For F n = A ∩ −n, n 2 , this colouring seen from a uniform point in F n converges to the unbiased choice of one of the two chessboard colourings of the plane: this probability measure is not G-invariant.

Remark 2.13.
Here are gathered several comments regarding how our theorems fit together, and how they do with the previous work of Pleasants and Huck [27]. The full statement of Theorem 1 of [27], which involves k-free points, is a particular case of our Theorem 1. It could also be obtained following the same lines as for the proof of our Theorem 2. Our approach to the question is really different from that of [27], in terms of technique and vocabulary. It further yields additional results -namely Propositions 2.2, 2.3, and 2.6. As for the opportunity to lead the investigation of Section 2.1 while Section 2.2 exists and does not rely on Section 2.1, the situation is as follows. Even though Theorem 2 is a particular case of Theorem 1, Proposition 2.2 does not follow from Proposition 2.6 or Theorem 1: see Fact 2.11. A last important point is that, contrary to [27,30], we are considering µ ∞,cop (resp. µ ∞,gcd ) as a fully-fledged probability measure on Ω {0,1} (resp. Ω N ): it is thus possible for us to make sense of µ ∞,cop (A) for any Borel subset of Ω {0,1} , where previous works would not go beyond cylindrical events. This opens up further fields of investigation, e.g. connected to ergodic theory or percolation theory. The remaining of this section is devoted to such questions.
Let us now mention a few questions that can be asked only with the formalism of local limits, i.e. with µ ∞,cop or µ ∞,gcd instead of simply one convergence result per cylindrical event. For every c ∈ {cop, gcd, prof, super}, we can ask whether the measure µ ∞,c is ergodic -i.e. if every translation invariant measurable subset has µ ∞,c -probability 0 or 1. These measures are indeed ergodic. For simplicity, we expose the argument for µ ∞,cop . The Chinese Remainder Theorem guarantees the following fact: if p 1 , . . . , p n denote the first n primes, and if for every i ≤ n, C i denotes a coset of p i Z d in Z d , then there is a translation mapping every C i to p i Z d . As a result, whenever we consider only finitely many primes, choosing one coset per prime yields a deterministic outcome up to translation. One concludes by noting that if a translation invariant probability measure on {0, 1} Z d ×P yields ergodic measures in projection to any {0, 1} Z d ×{p1,...,pn} , then the measure under study is itself ergodic. This is easily proved by martingale theory, and similar reasonings are classical in the study of profinite actions.
Considering Z d to be endowed with its usual (hypercubic) graph structure, one may also ask questions of percolation theory [17,22]: how many infinite white (resp. black) connected components does the colouring µ ∞,cop yield? By ergodicity, these numbers have to be deterministic outside some event of probability zero. One can derive from Theorem 1 and Theorem 3.3 in [30] that, for d = 2 hence for any d ≥ 2, there is at least one infinite white connected component almost surely. One can derive from Theorem 1 and Theorem 3.4 in [30] that, for d = 2, almost surely, every finite set is surrounded by a white cycle. As a result, in dimension 2, there is almost surely at most one infinite white connected component and no infinite black component. The corresponding statement in dimension d ≥ 2 is obtained via the following observation. For i ∈ 2, d , let π i : Z d → Z 2 be defined by π(x) = (x 1 , x i ). Let W be a random colouring of Z d with distribution µ ∞,cop -or µ (d) ∞,cop , if we want to be explicit about the dimension involved. Denote by W i the "π i -shadow of W", i.e. the colouring of Z 2 defined as follows: for any y ∈ Z 2 , one colours y in black if at least one element of π −1 i ({y}) is black for W, and one colours it white otherwise. Notice that W i is a random colouring of Z 2 with distribution µ (2) ∞,cop . As the 2-dimensional case has been treated, we know that for every i and every finite subset F of Z d , there is a finite subset of Z 2 that contains π(F ) and whose boundary is white for W i . Choosing such a finite subset with white boundary and naming it F i , we get that F is a subset of the finite set i π −1 i (F i ), whose boundary is white for W. The desired result follows.

Further generalisations of Theorem 1 3.1 Sampling along affine subspaces
Proposition 3.1 is the analog of Proposition 2.6 for an observer picked uniformly in an affine subspace of Z d rather than in the whole space Z d . Endow 0, ∞ with its usual topology. Define gcd ∞ ∈ Ω 0,∞ by setting gcd ∞ (x) := GCD(x). Let (µ n ) n≤∞ denote a sequence of probability measures on Ω 0,∞ . Let V ⊂ Z d and denote by π the projection from 0, ∞ Z d to 0, ∞ V . We say that µ n converges to µ ∞ on V if π µ n -the pushforward of µ n by π -converges to π µ ∞ when n goes to infinity.
Given Γ an infinite subgroup of Z d , one defines the probability measure µ Γ ∞,gcd ∞ by taking the definition of µ ∞,gcd but asking furthermore at every step that W p n intersects Γ. This corresponds to taking a Haar-distributed element in the closure of Γ inẐ d .
Finally, we say that a sequence (F n ) of nonempty finite subsets of Γ is a Følner sequence for Γ if for every y ∈ Γ, one has |F n ∆(F n + y)| = o(|F n |). Proposition 3.1. Let Γ denote a subgroup of Z d of rank k ≥ 1. Assume that it is maximal among subgroups of rank k, namely that every subgroup of Z d that contains Γ is either equal to Γ or has rank at least k + 1. Let (F n ) be a Følner sequence for Γ. Let Y n denote a uniform element of F n . Then, µ Fn,gcd ∞ converges to µ Γ Remark 3.2. The view from a "uniform point" in an affine subspace Γ + y is just the view seen from a "uniform point" in Γ shifted by −y. One may also notice that if one starts with a group Γ that is not maximal given its rank, then it lies in a unique such group, which is the intersection of its (rational or real) linear span with Z d : denote it byΓ. It follows from the proof of Proposition 3.1 that the following holds. Let (F n ) be a Følner sequence for Γ. Let Y n denote a uniform element of F n . Assume that for every y ∈Γ, GCD(Y n + y) is tight. Then µ Fn,gcd ∞ converges to µ Γ ∞,gcd ∞ . Actually, it suffices to make the assumption for a system of representatives of y ∈Γ for the equivalence relation "being equal modulo Γ", i.e. for finitely many y's. Corollary 3.3. Let Γ denote a subgroup of Z d of rank k ≥ 1 which is maximal among subgroups of rank k. Let F denote a bounded subset of the linear span of Γ. For every r ∈ (0, ∞), set F r := {x ∈ Γ : r −1 x ∈ F }. Assume that |Fr| r k converges to a nonzero limit when r tends to infinity and that (F n ) is a Følner sequence for Γ. Then, µ Fn,gcd ∞ converges to µ Γ ∞,gcd ∞ as n goes to infinity.
Proof of Proposition 3.1. Exactly as in Section 2.2, one defines µ Γ ∞,super and proves that µ Γ Fn,super converges to µ Γ ∞,super . Let d(·, Γ) be as in the conclusion of Lemma 3.4. Let X := x∈Z d \Γ ψ ( 1, d(x, Γ) ). As the closed subset X ⊂ Y := N Z d \Γ has probability 1 for every measure µ Γ Fn,super , it is the case that µ Γ ∞,super (X) = 1. Therefore, one can also consider these measures as probability measures on X: with this point of view, denote them by µ n , with n ≤ ∞. One has that µ n converges to µ ∞ -that is for the weak topology on probability measures on X. One way to see this is to notice that as X is compact, every subsequence of (µ n ) admits a converging subsequence and then to apply Lemma 2.10 to the restriction of the identity map from X to Y . As the map f : Let us now assume that k = 1. As p∈P 1 p = ∞, the second Borel-Cantelli Lemma yields that µ Γ ∞,super -almost every configuration gives the label ∞ to every element of Γ. If Y n denotes a uniformly chosen element of F n and y some element of Γ, as k is equal to 1, one has that GCD(Y n + y) converges in probability to ∞. Together with convergence on Z d \ Γ, this implies that µ Fn,gcd ∞ converges to µ Γ ∞,gcd ∞ . Instead of k = 1, now assume that GCD(Y n ) is tight. As (F n ) is a Følner sequence for Γ, one has that for every y ∈ Γ, the random variable GCD(Y n + y) is tight. Together with convergence on Z d \ Γ, this implies that the sequence µ Fn,gcd ∞ is tight. One then concludes as in the proof of Proposition 2.6. Proof. By a change of coordinates and by maximality of Γ, one may assume that Γ = Z k × {0 d−k }, in which case the lemma is clear (every element of GL d (Z) preserves N Z d ).
Proof of Corollary 3.3. Let Y n be a uniform element of F n . By Proposition 3.1, it suffices to assume that k ≥ 2 and to show that GCD(Y n ) is tight. Since GCD's are unchanged by GL d (Z), we may assume that Γ is equal to Z k × {0 d−k }, and tightness results from (B).
Then, the distribution of ψ n converges to that of ψ ∞ .
Remark 3.6. When one takes M = 1 and all R ≥ 1, Proposition 3.5 recovers exactly Proposition 2.2. Indeed, the convergence of probability measures on Ω {0,1} is defined as the convergence of probabilities of cylindrical events, and every cylindrical event A can be defined by looking only at the {0, 1}-colouring inside some −R, R d , for some R depending on A. A convergence as that of Proposition 2.2 is called a local convergence. On the other side, taking R = 0 and all M ≥ 1 would provide a graphon convergence [6,11]. More precisely, let G n denote the random graph with vertex-set F n and an edge between two distinct vertices if and only if the one is visible from the other. Consider the following standard probability space X := p∈P (Z/pZ) d , endowed with the product of uniform measures. Consider the measurable function δ : X 2 → [0, 1] defined by δ(x 1 , x 2 ) := 1 ∀p, x1(p) =x2(p) . Then, G n converges to the graphon represented by (X, δ). As Proposition 3.5 captures as particular cases some local convergence and some graphon convergence, we refer to such a statement as a "local-graphon convergence".
This proposition can be readily adapted to the whole GCD profile (one assumes tightness, considers maps to 0, ∞ rather than to {0, 1}, and predicts the GCD of (Y n m0 + y 0 ) − (Y n m1 + y 1 )) and the case of affine subspaces.
One might also be interested in other arithmetic conditions than coprimality: for example, saying that a number is k-free if no p k divides it, one may colour in white the k-free points of Z, or the points in Z d with k-free GCD. See [2,9,25,26,27]. One can generalise Proposition 3.5 to such contexts as follows. Recall that Z andẐ can be endowed with the profinite topology. Likewise, Z d andẐ d can be endowed with the product of profinite topologies, which we also refer to as the profinite topology. Let V ⊂ Z d , and let col V := 1 V . Let µ ∞,col V denote the distribution of x → 1 Y +x∈V , where Y is Haar-distributed inẐ d and V denotes the closure of the set V inẐ d . Proposition 3.8. Let d ≥ 1 and let (F n ) be a Følner sequence of Z d . Let V denote a subset of Z d . Assume that V is profinitely closed in Z d . Assume that |V ∩Fn| |Fn| converges to µ ∞,col V ({ω : 0 ∈ ω}). Let (X m ) denote a sequence of independent Haar-distributed elements ofẐ d . Let M ≥ 1 and R ≥ 1. For every n, let (Y n m ) 1≤m≤M denote M independent uniform elements in F n . Consider the following random maps: Then, the distribution of ψ n converges to that of ψ ∞ .