Shotgun reconstruction in the hypercube

Mossel and Ross raised the question of when a random colouring of a graph can be reconstructed from local information, namely the colourings (with multiplicity) of balls of given radius. In this paper, we are concerned with random $2$-colourings of the vertices of the $n$-dimensional hypercube, or equivalently random Boolean functions. In the worst case, balls of diameter $\Omega(n)$ are required to reconstruct. However, the situation for random colourings is dramatically different: we show that almost every $2$-colouring can be reconstructed from the multiset of colourings of balls of radius $2$. Furthermore, we show that for $q \ge n^{2+\epsilon}$, almost every $q$-colouring can be reconstructed from the multiset of colourings of $1$-balls.

multiset of balls of radius r? For graphs in which the vertices or edges are colored (not necessarily properly), when is it possible to reconstruct the colored graph from the multiset of colored r-balls? Motivated by the problems of reconstructing DNA sequences from "shotgunned" stretches of the sequence, as well as neural networks from local subnetworks, they called this type of problem shotgun reconstruction.
Mossel and Ross were particularly interested in reconstruction problems where the graph or coloring is random. Reconstructing random objects usually requires much less information than reconstructing in the worst case (see, e.g., [4,24]). Mossel and Ross [18] proved results on reconstructing sparse random graphs in the (n, p) model, while Mossel and Sun [19] proved rather sharp bounds on the smallest radius r needed to reconstruct random regular graphs. Mossel and Ross also considered the problem of reconstructing randomly colored trees, randomly colored lattices in any fixed number of dimensions, and the random jigsaw puzzle problem, in which the edges of the n × n square lattice are randomly colored with q colors, and the problem is to determine for which q it is possible to reconstruct the original jigsaw from the collection of 1-balls. The random jigsaw puzzle problem has since been studied by Bordenave, Feige, and Mossel [6], Nenadov, Pfister, and Steger [21], Balister, Bollobás, and Narayanan [2], and by Martinsson [16].
In this article, we will be interested in shotgun assembly for vertex-colorings of the n-dimensional hypercube Q n . We begin by discussing 2-colorings, or equivalently Boolean functions. In the worst case, it is easy to see that balls of radius at least n∕2 − O(1) are necessary (consider the two colorings where all points are in color 1, except for two points at Hamming distance either n or n − 1 which have color 2). However for random colorings, the situation is dramatically different. As we shall see, it is not hard to show that for a random 2-coloring, balls of radius 3 are almost surely enough for reconstruction, while balls of radius 1 are not. The first main result of this article is that balls of radius 2 are sufficient. Theorem 1.1. Almost every 2-coloring of the hypercube Q n is reconstructible from the multiset of its colored 2-balls.
In fact, we prove a stronger result (Theorem 1.4), which allows imbalanced colorings in which one color can have density as low as n −1∕4+o (1) .
We also consider colorings with more than two colors. In our other main result, we show that for sufficiently large q a random q-coloring can be reconstructed from its 1-balls (see Theorem 1.7 for a slightly stronger statement of this result). Theorem 1.2. Let > 0. For q ≥ n 2+ , almost every q-coloring of Q n is reconstructible from the multiset of its colored 1-balls.
It is easy to show that Ω(n) colors are required for a random coloring to be reconstructible with high probability, and it would be interesting to narrow the gap (see Sections 1.1 and 6 for further discussion).
The rest of this article is organized as follows. The remainder of this section contains definitions, as well as more formal statements of our results. In Section 2, we prove some probabilistic tools that we will use in our proofs. In Section 3, we prove an isoperimetric result as well as some other structural results regarding subgraphs of the hypercube. In Sections 4 and 5, we prove our main theorems, and we conclude this article in Section 6 with some discussion and open questions.

Definitions and results
For all positive integers n, we define the n-dimensional hypercube Q n = (V, E) where V = {0, 1} n and uv ∈ E if the two vertices differ in exactly one coordinate. This graph can also be thought of as a graph on the power set of [n], (n) = {A ⊆ [n]}, where two sets A, B are adjacent if they differ in exactly one element. Indeed, throughout this article, we interchangeably consider a vector u = (u 1 , … , u n ) ∈ {0, 1} n and its associated subset of [n], U = {i ∶ u i = 1}. For a vertex u ∈ V, we denote the neighborhood of u by Γ(u) = {v ∈ V ∶ uv ∈ E}. Further, we inductively let Γ 0 (u) = {u} and Γ k (u) = ⋃ v∈Γ k−1 (u) Γ(v)∖ ⋃ l<k Γ l (u) (so Γ k (v) is the set of vertices which have shortest path length exactly k to v). We will call Γ k (v) the kth neighborhood of v. For a subset of the vertices A ⊂ V, we also write Γ(A) = ⋃ v∈A Γ(v). With the natural understanding of a distance function, we define the r-ball B r (v) around a vertex v as the subgraph induced by the vertices at distance at most r from v (so, e.g., We will need some notions of distances between colorings. Suppose and are {0, 1}-colorings of the same graph G = (V, E), then we define For isomorphic graphs G and H, and for a coloring of G and of H, we define where the minimum is taken over all graph isomorphisms.
We say that two colorings and on G are equivalent ( ≅ ) if and only if ( , ) = 0, and we define the equivalence class [ ] of a coloring accordingly ( [ ] = { ∶ ≅ }). For a coloring c on V and a subset U ⊆ V, we denote by c| U the restriction of c to U. For a coloring and r ≥ 0, let (r) (v) = | B r (v) be the colored r-ball around v. We say that and are r-locally equivalent ( ≅ r ) if and only if there exists a bijection f ∶ V(G) → V(G) such that (r) (v) ≅ (r) (f (v)) for all v ∈ V.
We say that a coloring is r-distinguishable if there is no coloring such that ≅ r but ≇ , and we say is r-indistinguishable if it is not r-distinguishable. Thus is r-distinguishable if the collection of local colorings of r-balls determines the global coloring. Given r-locally equivalent colorings and of the vertices of the hypercube, there exists a bijection f such that (r) (v) ≅ (r) (f (v)) for all v ∈ V(Q n ). It is clear then that = •f −1 , and that ≅ if and only if f can be chosen to be a graph isomorphism. In what follows, we define f by f (v) = •f −1 (v). For a coloring of the hypercube Q n , let Isom (r) ( ) be the set of bijections f ∶ V(Q n ) → V(Q n ) such that (r) (v) ≅ ( f ) (r) (f (v)) for all v ∈ V(Q n ). So is r-indistinguishable if and only if there exists a bijection f ∈ Isom (r) ( ) which is not a graph automorphism. In other words, if is r-indistinguishable then there exists a bijection f ∈ Isom (r) ( ) and two nonadjacent vertices u, v ∈ V(Q n ) such that f (u)f (v) ∈ E(Q n ).
We will concern ourselves with the problem of whether random colorings of the hypercube are distinguishable. Definition 1.3. Let be a probability mass function on N. A random -coloring of the hypercube V(Q n ) is an independent collection of random variables ( (v)) v∈V(Q n ) each with distribution . For a natural number q, we will write q-coloring instead of Unif([q])-coloring.
We show that for r = 2 and p not too small, with high probability, a random (p, 1 − p)-coloring of the hypercube is 2-distinguishable. Theorem 1.4. Let > 0 and let p = p(n) ∈ (0, 1∕2] be a function on the natural numbers such that for sufficiently large n, p ≥ n −1∕4+ . Let be a random (p, 1 − p)-coloring of the hypercube Q n . Then with high probability, is 2-distinguishable.
It is natural to ask whether Theorem 1.4 extends to colorings with more colors. We note the following corollary of Theorem 1.4 for which we provide a brief proof. Corollary 1.5. Let > 0 and let n be a sequence of probability mass functions on the natural numbers such sup m n (m) ≤ 1 − n −1∕4+ for all sufficiently large n (i.e., there is no single color with probability mass too close to 1). Let be a random n -coloring of the hypercube Q n . Then with high probability, is 2-distinguishable.

Proof.
For each n ∈ N, partition N into two parts A n and B n so that n −1∕4+ ≤ n (A n ) ≤ n (B n ) for sufficiently large n. Then consider the coloring ′ where ′ = 0 when ∈ A n and ′ = 1 when ∈ B n . By Theorem 1.4, with high probability, we may reconstruct ′ . From there Lemma 2.3 tells us that the local ′ -colorings of 2-balls are unique. Finally, we can match ′ -colorings of 2-balls to -colorings of 2-balls to recover with high probability. ▪ A direct corollary of Theorem 1.4 is that random colorings of the hypercube are reconstructible with high probability from its r-balls for r ≥ 3. In this range, however, it is not hard to prove a stronger result. Theorem 1.6. Let > 0 and let p = p(n) ∈ (0, 1∕2] be a function on the natural numbers such that np log n → ∞ as n → ∞. Let be a random (p, 1 − p)-coloring of the hypercube Q n . Then with high probability, is 3-distinguishable.
The proof of Theorem 1.6 uses a standard approach (see, e.g., [18,19]), relying upon the uniqueness of 2-balls to align 3-balls centered on adjacent vertices.
When can we hope to reconstruct a coloring from 1-balls? It is not hard to see that Theorem 1.4 does not extend to 1-balls. Indeed, if the hypercube is q-colored where q = o(n), then there are asymptotically fewer collections of colorings of the 2 n 1-balls than there are q-colorings of the hypercube: let q(n) = n w(n) where w(n) → ∞ as n → ∞. Allowing for automorphisms, there are at least q 2 n 2 n n! = 2 2 n log 2 (q)(1+o(1)) possible colorings of the hypercube; on the other hand there are q ways of coloring a 1-ball (up to isomorphism). But and so q . Therefore, the number of possible collections of colorings of the 1-balls (assuming q > 2) is at most Therefore, at least Ω(n) colors are required. For the problem of reconstructing a coloring from the collection of 1-balls, we prove the following upper bound. Theorem 1.7. There exists some constant K > 0 such that the following holds. Let q ≥ n 2+Klog − 1 2 n and let be a random q-coloring of the hypercube Q n . Then with high probability, is 1-distinguishable.
The proof of Theorem 1.4 has some probabilistic elements but also uses some structural properties of the hypercube. We will need the following stability result for Harper's theorem for sets of size n. Theorem 1.8. Let s(n) be a function with s(n) → ∞ and s(n) = o(n) as n → ∞. Then there exists a constant C (which may depend on s(n)) such that the following holds: + ns(n), there exists some w ∈ V(Q n ) for which |Γ(w) ∩ A| ≥ n − Cs(n).
Two of the authors have generalized this result to sets of size for a range of k using different techniques [23,Theorem 1.2]. Since the proof for k = 1 is much simpler, we present it here. We remark that Keevash and Long [12] have independently proven a similar result.
We remark that this approach of combining probabilistic and structural elements is very natural and has been applied before, for example, in previous work (see [2,6,16,21]) considering the jigsaw puzzle. For jigsaws, a general approach has been to consider partial reconstructions of the edge-coloring in large "windows" of the form v where the edge-colors match up correctly. Through probabilistic arguments it is shown that the perimeter of the image f ([−k, k] 2 ) must be close to minimal for a set of size (2k + 1) 2 . Through structural arguments, it is shown that this is not possible if f picked a wrong neighbor of v, that is, it cannot be the case that f (e) ≠ v + e for any e ∈ {(−1, 0), (1, 0), (0, −1), (0, 1)}. From there, the coloring can be reconstructed neighbor-by-neighbor. This approach uses the fact that the degrees of the graph are small (at most 4) so that a single bad edge around a vertex leads to a poor isoperimetry.
In our setting, the degrees are large (logarithmic in the number of vertices) and so we try a different approach: A coloring of the hypercube is 2-indistinguishable if there is another coloring which is not a rotation of but has the same collection of 2-ball colorings. Recall that we may express as = f where f is a bijection on the hypercube which is not an automorphism. As previously noted we write Isom (2) ( ) for the collection of bijections f for which and f have the same collection of 2-ball colorings. We prove Theorem 1.4 by showing that with high probability every bijection in Isom (2) ( ) is an automorphism, and so no such can exist.
To do this, we first consider what sort of properties a function f ∈ Isom (2) ( ) would almost surely need to display. In Section 2, we look at the neighborhood Γ(v) of a vertex v, and consider how spread out its image f −1 (Γ(v)) is in the hypercube. We show that with high probability, for every vertex v, the second neighborhood Γ 2 (f −1 (Γ(v))) is not very large. From here we prove in Section 3 that f −1 (Γ(v)) must closely resemble a neighborhood of a vertex g(v) for each vertex v. It follows that with high probability, for each bijection f ∈ Isom (2) ( ), the inverse f −1 roughly maps neighborhoods to neighborhoods.
This rough mapping of neighborhoods forces a certain amount of rigidity of f −1 : around each vertex, there must be a large structure which is invariant under f −1 . If an f ∈ Isom (2) ( ) exists which is not an automorphism, then there must be two nonadjacent vertices u and v with f −1 (u) and f −1 (v) adjacent. But u and v each have a large structure around them invariant under f −1 . The colorings of these two large structures must then fit together. We show that the probability of this occurring is small. We may conclude that Isom (2) ( ) contains only automorphisms with high probability.
The proof of Theorem 1.7 is similar. This time, we show that with high probability, for every vertex v, the neighborhood Γ(f −1 (Γ(v))) is not very large. Since q is so large, with high probability, the colorings of 1-balls have very little overlap, and so it cannot be that f (Γ(v)) has large clusters around more than one vertex. We combine these to show that f (Γ(v)) has a large cluster around some vertex g(v) for each vertex v. The remainder of the proof mimics that of Theorem 1.4.

Notation
We record here for reference some notation that will be used later in the proofs. The reader may choose to skip some of these for now, as they will all be introduced in the sections to come.
• For i ∈ [n], we define e i ∈ {0, 1} n as the vector whose ith entry is 1 and whose other entries are 0. • For a set X and natural number r, we denote by X (r) the collection of subsets of X of size r. That is, X (r) = {A ⊆ X ∶ |A| = r}. • Given a coloring , we write (r) (v) for the restriction of to the r-ball around v.
• Given a coloring and a bijection f ∈ Bij, we define f by ) .
• Given a coloring , we define Isom (r) ( ) = (see Definition 2.5). Sometimes R will be complex so for ease of reading we also use the notation Cluster r (R) = Cluster r R . • Mono t s is the set of bijections f ∈ Cluster 1 s for which, for all v ∈ V(Q n ), there exists at most one vertex w ∈ V(Q n ) such that |f (Γ(v)) ∩ Γ(w)| > t (see Definition 3.7).
• Local s is the set of s-approximately local bijections (see Definition 3.1).

PROBABILISTIC ARGUMENTS
In this section, we show that we need only consider bijections f such that f −1 "behaves well" on neighborhoods: for every vertex v, the second neighborhood of is not too large. Before we do this, we show that under the assumptions of Theorems 1.4 and 1.7, the colorings of 2-balls and 1-balls, respectively, differ greatly from one another. To do this, we will need the following bounds on the tail of the binomial distribution (see [17] for the proof of Lemma 2.1).
By Taylor expansion of log(1 + x), Analogously, . Now (2) follows immediately by observing that for 0 ≤ t ≤ (np) 1 3 , . ▪ The next two lemmas show that with high probability the pairwise distances between colorings of the 2-balls around vertices are large. Lemma 2.3. Let p = p(n) ∈ (0, 1∕2] be such that pn log n → ∞. Let be a random (p, 1 − p)-coloring of the hypercube Q n . Then with high probability, there do not exist distinct vertices u, v ∈ V(Q n ) such that ( (2) (u), (2)

Proof.
Let be a random (p, 1 − p)-coloring of the hypercube Q n . Let u, v ∈ V(Q n ) be distinct vertices and let b ∶ B 2 (u) → B 2 (v) be an isomorphism. Ideally, we would argue that the colorings of B 2 (u) and B 2 (v) are completely independent. This is not the case as the 2-balls might intersect. As such ) be the set of overlap union the set which gets mapped to the overlap by b, and let Y = (B 2 (u)∖T)∪b(B 2 (v)∖T) be the remainder so that ( (w)) w∈Y is a collection of independent (p, 1 − p) random variables. Then ) .
Since distinct 2-balls overlap in at most 2n vertices, we have |T| ≤ 4n. Therefore for sufficiently large n, we may apply Lemma 2.1 to get Taking a union bound over all possible choices of vertices u, v and isomorphisms b, we obtain that the probability that there are distinct vertices u, v with ( (2) (u), (2) Proof. Let > 0 and let K > 4∕ . Let q ≥ n 1+ and let be a random q-coloring of the hypercube Let us first observe S and then set N = {w ∈ Γ(u) ∶ (w) ∈ S}. Note that N corresponds to vertices in Γ(u) whose color could be matched to a vertex in Γ(v). Therefore ( (1) (u), (1) (v)) ≤ n − |N| and so it suffices to bound the probability of |N| being at least ⌈ nK log n ⌉ . Conditional on S the probability that an arbitrary r-tuple of Y is a subset of N is (|S|∕q) r . Let We can apply a union bound to get Since |S|, |Y| ≤ n, for sufficiently large n we therefore have Taking a union bound over all possible pairs of distinct vertices u, v, we obtain that the probability that there exist distinct vertices u, v with ( (1) (u), (1) With the proofs of these lemmas in mind, there is an easy argument proving Theorem 1.6.
Sketch proof of Theorem 1.6. Following the proof of Lemma 2.3, one can show that the coloring of 2-balls are unique when pn log n → ∞. Let ( ) ∈[2 n ] be the collection of colorings of 3-balls. Without loss of generality, suppose that 1 is the coloring of the 3-ball around 0. Note then that for each i ∈ [n], the coloring of the 2-ball around e i is contained in 1 . Since the colorings of 2-balls are unique, we can then discern which ∈ [2 n ] correspond to neighbors of 0. We are then iteratively able to work out We now come to considering the local behavior of bijections of the hypercube. For this, we will need a notion for how spread out the image of a neighborhood is. Note that if h is an isomorphism then, for any vertex v, ) .

Definition 2.5. For natural numbers, r and R
We now show that if is a random 2-coloring and K > 0 is sufficiently large, then with high probability, every f ∈ Isom (2) ( ) satisfies f −1 ∈ Cluster 2 (Kn 2 p −1 log n). This means that in Theorem 1.4 we need only consider bijections f such that for every vertex v, the set f −1 (Γ(v)) has a second neighborhood that is close to minimal in size. Lemma 2.6. Let p = p(n) ∈ (0, 1∕2] be such that np log n → ∞. Then there exists a constant K > 0 such that the following holds: Let be a random (p, 1 − p)-coloring of the hypercube Q n . Then with high probability, every f ∈ Isom (2) The proof of Lemma 2.6 is a little involved so we provide a brief outline here. Let be a random . We bound the probability that this is possible by considering whether it is possible for ( (u)) u∈Γ 2 (f −1 (Γ(v))) to match up with any coloring of B 3 (v). If Γ 2 (f −1 (Γ(v))) is too large, then this happens with very small probability because we have to match up too many colors. Applying a union bound, we are able to conclude that Γ 2 (h −1 (Γ(x))) must be sufficiently small for any h ∈ Isom (2) ( ) and x ∈ V(Q n ).

Proof.
Let be a random (p, 1 − p)-coloring of the hypercube Q n . Suppose there exists an f ∈ for each i ∈ [n], where we carry out addition mod 2. Thus, there is a permutation i of [n] such that for all distinct j, k ∈ [n] + Kn 2 p −1 log n, and a family of permutations ( i ) i∈ [n] , which is compatible with ( (u)) u∈Γ 2 (A) . Fix a vertex v, a coloring c, a set A and a family of permutations Further fix this expression for w so that i is as small as possible and . Then if the vertex v, the coloring c, the set A, and the family of (Note that we are using the colors 0 and 1.) The right-hand product is the probability that a random (p, The number of choices for v, A, and the permutations ( i ) i∈ [n] is at most So the probability that ( (u)) u∈Γ 2 (A) is compatible with a fixed c and any such choice of v, A, and permutations ( i ) i∈ [n] is at most Finally, we sum over the colorings to get that the probability ( (u)) u∈Γ 2 (A) is compatible for any such choice of v, c, A, and permutations is at most exp In fact for any C > 1, if n is sufficiently large, then (5) holds, and so the result holds for any K > 2. A similar result holds for q-colorings of 1-balls.
. Then there exists a constant K > 0 such that the following holds: Let q ≥ Kn 1+ 1 2 (n) and let be a random q-coloring of the hypercube Q n . Then with high probability, every f ∈ Isom (1) ( ) satisfies f −1 ∈ Cluster 1 (n)n 2 .
In Theorem 1.7, we consider . The proof of Lemma 2.7 is much like the proof of Lemma 2.6 but in order to minimize the exponent in Theorem 1.7, we carefully bound the choice of permutations.
Proof of Lemma 2.7. Let = (n) be as above. Let K > 0 be a constant (which we will choose later) and let q ≥ Kn 1+ 1 2 . Let be a random q-coloring of the hypercube Q n . Suppose there exists an f ∈ Isom (1) Note that for each i ∈ [n], (1) + n 2 , and a family of permutations ( i ) i∈ [n] , which determines ( (u)) u∈Γ(A) . Fix a vertex v, a coloring c, a set A, and a family of permutations ( i ) i∈ [n] . Then the probability that There are 2 n choices for v, and q . For each i ∈ [n], pick an arbitrary permutation from each equivalence class to form a set of representatives P i . So then for all i ∈ [n] there must be a i ∈ P i such that c(v + e i + e k ) = (a i + e i (k) ) for all k ∈ [n]. Let Note that if we have picked permutations 1 , … , i−1 , then we have at most r i ! choices from P i for permutation i (since the colors of n − r i neighbors of a i have already been determined). We can therefore bound the total number of choices for the permutations (from the P i ) by By a union bound, the probability that ( (u)) u∈Γ(A) is compatible with any choice of v, c, A, and Recalling that q ≥ Kn 1+ 1 2 and that ≥ we see that this probability is at most If K is sufficiently large, then this upper bound is o(1) and we are done. ▪

STRUCTURAL RESULTS
In this section, we start by proving a stability result regarding the size of the neighborhood of A. We will also prove a slightly weaker stability result when the neighborhood of A is allowed to be quite large. This allows us to later deduce some properties of functions f ∈ Isom (r) ( ) where is a random coloring.
We call the function g a dual of f . If f has a unique dual g, then we write f ⋆ = g. Note that this will be the case when s < n 2 − 2 as neighborhoods overlap in at most two vertices. We also define Local s as the set of s-approximately local functions.
Note that if f is s-approximately local, then the set {f (w) ∶ w ∈ Γ(v)} is clustered around a vertex of Q n , although perhaps not around f (v). Note also that a bijection f being s-approximately local where s is small does not force f to be an automorphism. For example, the map on Q 2k that fixes vertices of even weight and maps vertices of odd weight to the antipodal point is 0-approximately local, the dual being the map itself, but not an automorphism.
For the proof of Theorem 1.8, we will need the following well-known result of Harper [10], which uses the power set (n) interpretation of the hypercube Q n .
An application of this theorem shows that for A ⊂ V(Q n ) with |A| ≤ n, .
The following result is a simple corollary of Theorem 3.2. Then there exists a constant C > 0 such that the following holds: The set S may be written as . By the local LYM inequality (see [15,Ex. 13.31(b)]), |T| ≥ n−r r+1 |S ′ |, and so |Γ(S) ∪ S| ≥ |B r (0)| + n−r r+1 |S ′ |. Therefore for sufficiently large n, For sufficiently large n, |S ′ | = |A| − |B r−1 (0)| > (C∕2)n r−2 s(n) and n−2r−1 r+1 ≥ n r+2 , and so So we see that if C ≥ 2(r + 2), then Γ(A) > ) + ns(n). Let = 1 100 . (6) implies that |Γ(D)| ≥ |D| n−1 2 . Applying this to Γ(A∖Y 1 ) gives ) + ns(n), we see that |Y 1 | ≤ (2∕ )s(n). Let A 1 = A∖Y 1 and consider the graph G = (V, E) where V = A 1 and uv ∈ E iff u and v differ in exactly two coordinates. We will write Γ G (v) for the neighborhood of a vertex V in the graph G, and reserve Γ for the neighborhood in Q n . In Q n , any two vertices have two common neighbors if they are at distance two, and no common neighbors otherwise. Therefore, for all v ∈ A 1 , Taking n large enough so that (2∕ )s(n) ≤ n, (7) gives This is a contradiction and so we see that |Y 2 | ≤ 4. Letting A 2 = A 1 ∖Y 2 we have that, for large enough n, |A 2 | ≥ n − (3∕ )s(n) since |Y 1 | ≤ (2∕ )s(n).
Consider distinct vertices u, v ∈ A 2 such that |Γ G (u) ∩ Γ G (v)| ≥ n. Taking n large enough so that n ≥ 7, we see that |Γ 2 Q n (u) ∩ Γ 2 Q n (v)| ≥ 7 and so u and v are at distance two in the hypercube. Note that if x is also at distance 2 from both u and v, then u, v, and x have a common neighbor.
without loss of generality, we may then assume that the hypercubeneighborhood of w 1 contains u, v, and at least n∕3 other vertices in A 2 .
Let B be the set of vertices in V(Q n ) with at least n∕3 neighbors in A 2 . Since for each vertex u in A 2 there exists a distinct vertex v ∈ A 2 with |Γ G (u) ∩ Γ G (v)| ≥ n, the above tells us that each vertex in A 2 has a neighbor in B. Suppose that B = {w 1 , … , w k }, then for ≤ k we have So if = ⌈6∕ ⌉, then we have |Γ({w 1 , … , w }) ∩ A 2 | > n for sufficiently large n. This is a contradiction since |A 2 | ≤ n, and so k ≤ 6∕ .
Reorder the w i so that w 1 has the largest neighborhood in A 2 . We show that w 1 satisfies the theorem statement. Recursively for i = 1, … , k, let C i = Γ(w i )∩A 2 ∖ ⋃ j<i Γ(w j ). Then since the C i partition A 2 , Fix i ∈ 2, … , k, and consider that |Γ If w i and w 1 are at distance at least 5 from each other, then there can be no u ∈ C i and v ∈ F i at distance two from each other. The same is true if w i and w 1 are an odd distance from one another (the hypercube is bipartite). Therefore, we need only consider the cases when w i and w 1 are distance 2 or 4 from each other.
First suppose that w i and w 1 are at distance 2 from each other and recenter the hypercube so that w i = 0 and w 1 = e 1 + e 2 . If e 1 ∈ A 2 , then e 1 ∈ C 1 ∩ Γ(w i ) and so e 1 ∉ F i and e 1 ∉ C i . On the other hand, if e 1 ∉ A 2 , then e 1 is not in any C j and so can be in neither C i nor F i . The same is true for e 2 and so e 1 , . Then for each element e t ∈ C i , the only possible vertex in F i at distance two from e t is e 1 + e 2 + e t . Therefore, Now suppose w i and w 1 are at distance 4 from each other and recenter the hypercube so that w i = 0 and w 1 = e 1 + e 2 + e 3 + e 4 . Then Putting (9) and (10) into (8), and using (6) gives Recall that n − (3∕ ) s (n) ≤ |A 2 | ≤ n. Therefore Since |C 1 | ≥ n∕3, we obtain We started off with the assumption that |Γ(A)| ≤ n 2 2 + ns(n) and so we see that n − |C 1 | = O(s(n)). Finally recall that C 1 = Γ(w 1 ) ∩ A 2 ⊆ Γ(w 1 ) ∩ A and so we are done. ▪ An application of Corollary 3.3 gives the following corollaries which will later be used in conjunction with Lemma 2.6. Proof.
We will prove this result by induction on r. The base case r = 1 is just Theorem 1.8 and so we just need to prove the inductive step. Let s(n) be a function with s(n) → ∞ and s(n) = o(n) as n → ∞, and let r > 1, and suppose |A| = n and |Γ r (A)| ≤ Proof. Let r ≥ 1, and let s(n) be a function with s(n) → ∞ and s(n) = o(n) as n → ∞. Suppose that |Γ r (f (Γ(v)))| ≤ ( n r+1 ) + n r s(n) for each vertex v ∈ V(Q n ). Applying Corollary 3.4 to A = f (Γ(v)), there exists a constant K > 0 such that for all v ∈ V(Q n ), there exists a g(v) ∈ V(Q n ) such that |Γ(g(v)) ∩ f (Γ(v))| ≥ n − Ks(n). Then g is the dual of f realizing that f ∈ Local Ks(n) . ▪ While Corollary 3.5 is needed for our proof of Theorem 1.4, it is not enough for Theorem 1.7 where we will need to allow s(n) = Θ(n). It would be helpful to have a result similar to Theorem 1.8 in this case. Here, we prove a result with the added condition that the set A does not cluster too much around two different vertices.

Lemma 3.6. Let t(n), s(n) be functions on the natural numbers such that for all n ∈ N, t(n) ≥ 5 and
) + s(n)n, and suppose there do not exist distinct w 1 , w 2 ∈ V(Q n ) such that |A ∩ Γ(w i )| > t(n) for i = 1, 2. Then there exists some w ∈ V(Q n ) for which

Proof.
Let G = (A, E) where uv ∈ E if and only if (u, v) = 2. Then a clique of size at least 5 in G corresponds to a collection of vertices in A in the Q n -neighborhood of a single vertex. Suppose that A 1 is a largest clique in G (or equivalently a largest instance of A ∩ Γ Q n (w) for a vertex w ∈ V(Q n )). By assumption all cliques other than A 1 have size at most t(n).
. We start by bounding the size of A ′ .
Suppose there exist distinct u, v ∈ A ′ with |Γ G (u) ∩ Γ G (v)| ≥ 2t(n). Since t(n) ≥ 5, we have |Γ G (u) ∩ Γ G (v)| ≥ 10, which corresponds to there being at least 10 vertices at distance 2 from both u and v in Q n . This is only possible if u and v are at distance 2 in Q n . Without loss of generality assume that u = ∅ and v = e 1 + e 2 . Then every vertex x ∈ Γ G (u) ∩ Γ G (v) is of the form e j + e k where j is 1 or 2, and k ∈ [n]∖{j}. So then x is a neighbor of either e 1 or e 2 in Q n , and by the pigeonhole principle one of e 1 and e 2 (without loss of generality assume e 1 ) has at least t(n) Q n -neighbors in A. But then these Q n -neighbors of e 1 plus u and v form a clique in G of size at least t(n) + 2. This cannot be since there is no clique of size t(n) + 2 not entirely contained in A 1 . Therefore So we see that if |Y| = ⌈ √ n∕t(n) ⌉ , then we have |Γ G (Y)| > n. This gives a contradiction, so we We can now give a lower bound for |Γ(A)| in terms of t(n) and |A 1 | by applying (6). Indeed, Recall that |Γ(A)| ≤ ( n 2 ) + s(n)n, and so Rearranging this gives .
Recalling that A 1 is contained in the Q n -neighborhood of a vertex, we are done by taking square roots. We then have the following direct corollary of Lemma 3.6.
Corollary 3.8. Let t(n), s(n) be functions on the natural numbers such that for all n ∈ N, t(n) ≥ 5 and 1 − 2s(n)n −1 − 14 √ t(n)∕n ≥ 0. Then Mono t(n) s(n)n ⊆ Local (n)n where Further, if (n)n < n − t(n), then a function f ∈ Mono t(n) s(n)n has at most one dual.

Proof.
Let t, s, and be as in the statement, and let f ∈ Mono t(n) s(n)n . Then for each vertex v ∈ V(Q n ), we have |Γ(f (Γ(v)))| ≤ + s(n)n and there exists at most one vertex w ∈ V(Q n ) such that |f (Γ(v))∩Γ(w)| > t(n). By Lemma 3.6, there exists a vertex g(v) such that |f (Γ(v))∩Γ(g(v))| ≥ n− (n)n for each v ∈ V(Q n ). Thus g is a dual for f and we have f ∈ Local (n)n . Now suppose (n)n < n − t(n) and there are two duals g 1 and g 2 . Fix v so that g 1 (v) ≠ g 2 (v). Then |f (Γ(v)) ∩ Γ(g i (v))| ≥ n − (n)n > t(n) for i = 1, 2. This is a contradiction as f ∈ Mono t(n) s(n)n and so there can be at most one vertex w with |f (Γ(v)) ∩ Γ(w)| > t(n). ▪ The following lemma shows that the inverse of an approximately local bijection is itself approximately local. Lemma 3.9. Let s be some natural number. If f ∈ Local s has a bijective dual g, then f −1 ∈ Local s and g −1 is a dual of f −1 .

Lemma 3.10. Let s(n) < n∕2 be a function with s(n) → ∞ and s(n) = o(n) as n → ∞. Then there exists some constant K > 0 such that for every s(n)-approximately local bijection f , the dual f ⋆ is Ks(n)-approximately local.
Proof. We will show that f −1 ⋆ is Ks(n)-approximately local and has a bijective dual, and then apply Lemma 3.9. Let s(n) < n∕2 be a function with s(n) → ∞ and s(n) = o(n) as n → ∞. Suppose that f ∈ Local s(n) and let g = f ⋆ (so that for all v ∈ V(Q n ), |f (Γ(v)) ∩ Γ(g(v))| ≥ n − s(n)). Fix some v ∈ V(Q n ). For each w ∈ Γ(v), writing w ′ = g −1 (w), we have |Γ(w) ∩ f (Γ(w ′ ))| ≥ n − s(n) and so Since f is a bijection, applying f −1 to both sides, we see that Since g −1 (Γ(v)) ⊆ V(Q n ) is a subset of size n, we may appeal to Theorem 1.8 to see that there exists some w ∈ V(Q n ) such that |Γ(w) ∩ g −1 (Γ(v))| = n − O(s(n)). Then g −1 is O(s(n))-approximately local. Since s(n) = o(n), it follows that g −1 must have a unique, bijective dual. By Lemma 3.9, we conclude that g is O(s(n))-approximately local. ▪ Definition 3.11. For an s(n)-approximately local bijection f , we say that f is diagonal if it is the dual of its dual, that is, For a natural number s (which may depend on n), let Diag s be the set of diagonal bijections in Local s . The next two results will show that an s(n)-approximately local diagonal bijection induces large rigid structures within the hypercube.

Then G has minimum degree at least n − Ks(n).
Proof. Let f be an s(n)-approximately local diagonal bijection. By Lemma 3.10, there exists some Noting that for sets A, B of size n we have |A∖B| = |B∖A|, this gives Since f ∈ Local s(n) and In the following lemma, for a vertex v and natural number i, we define the sets R i (v) as subsets of the layer of the hypercube at distance i from vertex v so that the structure of the set is preserved by f and f ⋆ .
Note that w ∈ R i (v) if and only if w is at distance i from v in the hypercube, and G contains all shortest vw paths found in the hypercube. for all k). The base case k = 1 follows directly from the minimum degree condition, giving Y 1 = 1.

Proof. We will show by induction on
So suppose the result holds for k ≤ m (so that , then either there is an edge missing between Γ m Q n (v) and x in G, or there is a vertex w ∈ Γ m Q n (v)∖R m (v) with x ∈ Γ Q n (w). We therefore have the following relation Recalling that G has minimum degree at least n − s(n), the inductive hypothesis then gives − en m s(n). ▪ Suppose that there is a coloring and an s(n)-approximately local bijection f such that f ∈ Isom (2) ( ). The next lemma shows that the -coloring of a 2-ball around a vertex v ∈ V(Q n ) differs by O(ns(n)) from the -coloring of the 2-ball around f −1 ⋆⋆ (f (v)). Note that there is no ambiguity in writing f −1 ⋆⋆ , as Lemma 3.9 tells us that (g ⋆ ) −1 = (g −1 ) ⋆ . This result will later allow us to consider only diagonal bijections. Lemma 3.14. Let s(n) be a function with s(n) → ∞ and s(n) = o(n) as n → ∞, and let f ∈ Local s(n) .
Proof. Let f be an s(n)-approximately local bijection and let = f −1 . Let g = ⋆ . By Lemmas 3.9 and 3.10, there is a K > 0 such that g is Ks(n)-approximately local. Let h = g ⋆ = ⋆⋆ be the dual of g.
For each i ∈ S, let T i = { j ∶ (w + e i + e j ) ∈ Γ(g(w + e i )) } . Note that |T i | ≥ n − s(n) for each i since is s(n)-approximately local. Then let i be a permutation on [n] such that (w + e i + e j ) = g(w + e i ) + e i (j) for all j ∈ T i .
If i ∈ S and j ∈ T i , then Analogously, if j ∈ S and i ∈ T j , then (w + e i + e j ) = h(w) + e ⋆ (j) + e j (i) . We then have e ⋆ (j) +e j (i) = e ⋆ (i) +e j (j) . Since e ⋆ (i) ≠ e ⋆ (j) , we must have e ⋆ (i) = e j (i) and e ⋆ (j) = e i (j) . Therefore (w + e i + e j ) = h(w) + e ⋆ (i) + e ⋆ (j) . Now, let If w + e i + e j ∉ W, then it must be that either i and j are not both in S, or i is not in T j , or j is not in T i . Hence, we can bound Γ 2 (w)∖W as follows.

PROOF OF THEOREM 1.4
In this section, we prove Theorem 1.4 by combining the probabilistic and structural results proved in Sections 2 and 3, respectively. Much of the work has already been done for this. Indeed, by Lemma 2.6 and Corollary 3.5, we may assume that if f ∈ Isom (2) ( ), then f is s(n)-approximately local, for some s(n) = o(n). For a graph G = (V, E), we say that a subset of the vertices A ⊆ V is t-spread if A ∩ B t−1 (u) = u for all u ∈ A (so then all pairs of vertices in A cannot be joined by a path of length t − 1 or less). We start with a simple proposition which allows us to cover a fraction of the 10th neighborhood of a vertex with 6-spread large sets.  Proof of Proposition 4.1. Define the graph G on the vertex set [n] (10) , where two vertices are connected if they are at Hamming distance at most five from one another. The G-neighborhood of a vertex v is contained within the Hamming 5-ball around v, and so the maximum degree in G is at most n 5 . Let k = ⌈ n 6 ⌉, and take n large enough so that k > n 5 . By Theorem 4.2, there exists a k-coloring with color classes C 1 , … , C k of size Each color class C i is a 6-spread subset of [n] (10) and has size at least ⌊( Proof. By Lemma 2.6, there is a K > 0 such that with high probability, for every f ∈ Isom (2) ( ) we have f −1 ∈ Cluster 2 (Kn 2 p −1 log n) = Cluster 2 (Kn 2 s). We have By Corollary 3.5, there exists a K ′ > 0 such that Cluster 2 (Kn 2 s) ⊆ Local K ′ s , so that Then by Lemma 3.9, we can express the structural property of the bijection in terms of f : Suppose that there exists such an f ∈ Local K ′ s ∖Diag K ′ s , and pick a vertex v ∈ V(Q n ) such that (2) ( ), then by Lemma 3.14, ( (2) (v), (2) (ns(n)). But by Lemma 2.3, the probability that there is a pair of distinct vertices x, y with ( (2) (x), (2) is o(1). Since s(n) = log n p and p ≥ n −1∕4 for sufficiently large n, we get that the probability we can Thus (1).
■ Suppose that f ∈ Isom (2) ( ) with f ∈ Diag K ′ s , and let g = f ⋆ . Recall that by Lemma 3.10, there exists a constant L > 0 such that g ∈ Local Ls . As in Corollary 3.12, we let Then G has minimum degree at least n − Ms for some constant M. Furthermore, define R k (w) as Lemma 3.13 (see (12)). So |R k (w)| ≥ − eMn k−1 s. We next show that there is a form of rigidity to f and g. Claim 4.4. For each u ∈ V(Q n ), let u be a permutation on [n] such that g(u + e j ) = f (u) + e u (j) for all j such that u + e j ∈ R 1 (u). Then for k ≥ 0 for all S ∈ [n] (2k) such that u + ∑ j∈S e j ∈ R 2k (u), and for all T ∈ [n] (2k+1) such that u + ∑ j∈T e j ∈ R 2k+1 (u).
We prove this claim by induction.
Proof. Consider that for k > 1 odd, for each w ∈ R k (u), the vertex g(w) is uniquely determined by the sequence (f (x)) x∈R k−1 (u) . Indeed, suppose that w = u + ∑ k j=1 e i j is in R k (u). Then Γ Q n (w) ∩ Γ k−1 Q n (u) = Γ G (w) ∩ R k−1 (u). Then for all ∈ [k], u + ∑ j∈[k]∖ e i j ∈ R k−1 (u) and g(w)f (u + ∑ j∈[k]∖ e i j ) ∈ E(Q n ). However, there is a unique vertex in the hypercube adjacent to f (u + ∑ j∈[k]∖ e i j ) for all ∈ [k], and so g(w) is determined by (f (x)) x∈R k−1 (u) . We may similarly say that when k > 1 is even, (f (w)) w∈R k (u) can be determined by (g(w)) w∈R k−1 (u) (note that when k = 2, there may be a choice of two vertices adjacent to both g(u + e i ) and g(u + e j ), but one of these is f (u)).
(E.g., if u + e 1 + e 2 + e 3 ∈ R 3 (u), then g(u + e 1 + e 2 + e 3 ) is adjacent to f (u + e 1 + e 2 ), f (u + e 1 + e 3 ), and f (u + e 2 + e 3 ). By the inductive hypothesis, f (u + e 1 + e 2 ) = f (u) + e u (1) + e u (2) , f (u + e 1 + e 3 ) = f (u) + e u (1) + e u (3) , and f (u + e 2 + e 3 ) = f (u) + e u (2) + e u (3) . There is only one vertex adjacent to all three, and so g(u + e 1 + e 2 + e 3 ) = f (u) + e u (1) + e u (2) + e u (3) . The same argument works for the next layer when f (u + e 1 + e 2 + e 3 + e 4 ) is the unique vertex in Γ 4 (f (u)) adjacent to each g(u + e i + e j + e k ) for {j, k, l} ∈ [4] (3) .) Fix two nonadjacent vertices u, v ∈ V(Q n ). Our goal is to show that f (u) and f (v) cannot be adjacent. We do this by first showing that if f (u) and f (v) are adjacent, then there are rigid structures around each which are adjacent. We then take substructures of these rigid structures which are 6-spread (this will allow us to say that the coloring of the 2-balls around the vertices of these substructures are independent from one another). Finally, we consider that if two vertices are adjacent, the color of one has to fit in with the coloring of the 2-ball around the other. We are then able to show that this cannot happen with high probability (helped greatly by the independence attained by restricting ourselves to the specified substructures).
Fixing our substructures. −2en 9 s. We now split into three cases depending on the distance between u and v. In each case, we define a subset C ′ ⊆ C, which we will exploit later.
Case A: u = v + e s + e t . In this instance, let Then |C ′ | ≥ ∑ j∈S e −1 v (j) ∶ S ∈ C ′ } then a and b are at an even distance at least two from each other. Case B: u = v + e s + e t + e r . In this instance, let In this case, let b a be this vertex and otherwise let b a be an arbitrary vertex at distance 3 from a. If a ∈ {u + ∑ j∈S e −1 u (j) ∶ S ∈ C ′ } and b ∈ {v+ ∑ j∈S e −1 v (j) ∶ S ∈ C ′ }∖{b a }, then the distance between a and b in the hypercube is at least 5 (as the distance between them is odd and greater than 3). Case C: u and v are at distance at least four from each other. In this instance, let s, t, r, y be such that the distance between u + e s + e t + e r + e y and v is four less than the distance between u and v. Then let Then |C ′ | ≥ ∑ j∈S e −1 v (j) ∶ S ∈ C ′ } then a and b are at a distance at least four from each other.
We now come to fixing our substructures. Let , > 0 be such that 2 < 1 10! and choose sets (A r ) r∈J (with |A r | = ⌈ n 4 ⌉ for each r, and |J| = ⌈ n 6 ⌉ ) as in Proposition 4.1. Note that | ⋃ r≤⌈ n⌉ A r | ≥ n 10 and so |( ⋃ r≤⌈ n⌉ A r ) ∩ C ′ | ≥ n 10 − O(n 9 s). By the pigeonhole principle there exists a j ∈ J such that |A j ∩ C ′ | ≥ n 4 − O(n 3 s). Let C ′′ = A j ∩ C ′ . This approach of appealing to Proposition 4.1 may seem unnecessary, but is important as it reduces the number of substructures we have to consider, in turn helping the union bound we take later. ■ We now give explicit events detailing how the colorings of our substructure have to "fit in" with one another. Roughly speaking, for adjacent vertices y and z, we consider that the first neighborhood of y is contained in the first neighborhood of the neighborhood of z.
Expressing how substructures fit together. For all vertices w ∈ V(Q n ), let (so that each (w) is a distributed like a normalized binomial random variable with mean 0), and then let (18) gives and ( for all S ∈ C ′′ . This means that (u + ∑ ∈S e −1 u ( ) ) ∈ Ψ(v + ∑ ∈S e −1 v ( ) ) for all S ∈ C ′′ . For permutations 1 , 2 and S ⊆ [n] (10) , let B 1 , 2 S be the event occurs for all S ∈ C ′′ . Considering as a fixed coloring, given j ∈ J and a pair of permutations 1 , 2 , we say that a subset C ′′ ⊆ A j of size n 4 − O(n 3 s) is a (j, 1 , 2 )-tester if j, 1 , 2 , C ′′ satisfy the properties outlined in Case A, Case B, or Case C as appropriate. Let T j ( 1 , 2 ) be the set of (j, 1 then there is a j ∈ J, pair of permutations 1 , 2 , and C ′′ ∈ T j ( 1 , 2 ) such that B We can then bound the probability that there exists an f ∈ Diag K ′ s for which f (u)f (v) ∈ E(Q n ) and f ∈ Isom (2) Note that we have exp {O (n log n)} choices for the permutations 1 and 2 . We then have |J| = , so that there are at most ( 2 ) . Therefore, if we found a uniform upper , we would have We now come to finding our uniform upper bound D.
We again have to split this up into the three cases. Case B is the hardest and the work covering this case also caters for Case A and Case C.
Proof. Note that for each w ∈ V(Q n ), (w) is determined by ( (x)) x∈Γ(w) , and Ψ(w) is determined by ( (x)) x∈Γ 2 (w)∪{w} . Since the sets in C ′′ are all at distance at least 6 from each other, (( (x)) x∈Γ(u+ ∑ i∈S e 1 (i) ) ) S∈C ′′ is a family of disjoint sets of random variables. This means that ( (u + ∑ j∈S e 1 (j) )) S∈C ′′ is a family of independent identically distributed random variables. Similarly, (Ψ(v + ∑ j∈S e 2 (j) )) S∈C ′′ is a family of independent identically distributed random variables. Case A: Suppose that C ′′ satisfies the properties outlined in Case A. Since all vertices a ∈ are an even distance at least 2 from each other, Γ(a) and Γ 2 (b) ∪ {b} do not intersect. Therefore, ( (u + ∑ j∈S e 1 (j) )) S∈C ′′ and (Ψ(v + ∑ j∈S e 2 (j) )) S∈C ′′ are independent families of random variables and so, picking an arbitrary S 0 ∈ C ′′ , Case C: Suppose that C ′′ satisfies the properties outlined in Case C. Since all vertices a ∈ ∑ j∈S e 1 (j) )) S∈C ′′ and (Ψ(v + ∑ j∈S e 2 (j) )) S∈C ′′ are independent families of random variables. Define the events Λ 1 , 2 . Then picking an arbitrary S 0 ∈ C ′′ , we obtain Note that, in fact, in Cases A and C, for any a ∈ { u + ∑ j∈S e 1 (j) ∶ S ∈ C ′′ } we could define b a to be an arbitrary vertex at distance 3 from a. Then, (21) is in fact an upper bound in all three cases; hence, we now focus on bounding that expression.
Let x = u + ∑ j∈S 0 e 1 (j) and y = v + ∑ j∈S 0 e 2 (j) . To get a lower bound for the probability of the complement event (Λ 1 , 2 S 0 ) C , we condition on the value of ′ (x) and then consider whether (z) − ′ (x) ∈ [−3, 3] for any z ∈ Γ(y). Note that we will just be considering atypical values of ′ (x). This means that our lower bound is very close to 0, but since we will be considering a large intersection of independent events, it suffices to give a lower bound that is not too close to 0. Let ) , so that 1 6 + c 2 2(1−p) < 1 and and then let M = c(np log(np)) 1 2 . Taking a union bound gives where z ′ ∈ Γ(y) is arbitrary, and where the last inequality follows from the fact that (x) is a normalized binomial random variable with mean 0. Since the same applies to ′ , and recalling that (3∕4 + )( 1+c 2 2 ) > 1 and p ≥ n −1∕4+ , we therefore appeal to Lemma 2.2 to get .
Putting this into (21), we see We have found our uniform upper bound D and so (19) gives Recall that s = p −1 log n = n 1−Δ log n and so We chose c so that 1 6 + c 2 2(1−p) < 1 and so n 4−Δ log 2 n = o . As we already observed, for •f −1 ≇ , there must be a pair of nonadjacent vertices u and v such that f (u)f (v) ∈ E(Q n ). We have fewer than 2 2n choices for u and v, and so taking a union bound gives Finally, we can conclude that P[ is 2-indistinguishable] = o(1). ▪

PROOF OF THEOREM 1.7
As with Theorem 1.4, we prove Theorem 1.7 by combining some of the probabilistic and structural results already proven. We start off with a lemma to discount bijections which map large parts of neighborhoods to neighborhoods. and a pair of nonadjacent vertices u, v such that It will be useful in the proof to introduce the following piece of notation: For a s(n)-approximately local bijection f , we say it is self-dual if it is its own dual and this dual is unique, that is, For a natural number s = s(n), let Self s be the set of self-dual bijections in Local s , that is, let Proof of Lemma 5.1. Let K > 0, let C > 0 be a constant to be defined later, and let q(n) ≥ n 2+Clog − 1 2 n .
For ease of notation, let M = n(1 − Klog − 1 2 n). Let be a random q-coloring of the hypercube Q n . First suppose that there exists a bijection f ∈ Local M ∖Self M such that f ∈ Isom (1) ( ). Let f ⋆ be a dual of f (note that since M > n∕2, there may not be a unique dual).
Since (1) f (f (v)) ≅ (1) (v), there exists a permutation such that (v + e (i) ) = f (f (v) + e i ) for all i ∈ [n]. But then (v + e (i w ) ) = f ( f (v) + e i w ) ∈ (Y) for all w ∈ U. Then there exists a set T U ⊆ [n] of size K 2 nlog − 1 2 n such that (v + e i ) ∈ (Y) for all i ∈ T U . Therefore Since Y and Γ(v) are disjoint, ( (v+e i )) i∈ [n] and ( (x)) x∈Y are independent families of independent Unif([q]) random variables and so for an arbitrary T ∈ [n] ( K We can take an expectation over (Y) to get We can then apply a union bound to (22) to get the following bound , a constant depending on K. Recall that q ≥ n 2+Clog −1∕2 n , and so the bound above is at most } .
Taking C sufficiently large we get We have fewer than 2 2n choices for nonadjacent vertices u and v and so by a union bound, (1). ▪

This upper bound is o(1) if C is large enough and so
We are now in a position to prove Theorem 1.7.
It cannot be the case that w 1 = w 2 = f −1 (v) and so we have found two vertices u ≠ x such that ( (1) (u), (1) (x)) ≤ n − K n log n . By Lemma 2.4, if K is sufficiently large, this occurs with probability o(1) and so In a similar fashion, we could show that with high probability there cannot exist vertices v 1 , v 2 , w such that v 1 ≠ v 2 and |f −1 (Γ(v i )) ∩ Γ(w)| > Knlog −1 n for i = 1, 2. Now, recall that by Corollary 3.8 ) .
So then if we take K 2 > 8K

SOME FURTHER QUESTIONS
In Theorem 1.4, we have the condition that p ≥ n −1∕4+ . How small can p be taken here? Is there a threshold function such that if p∕ → ∞, then a random (p, 1 − p)-coloring is 2-distinguishable with high probability, but the same is not true if p = o( )? More generally, given a function p, how large must r be so that a random (p, 1 − p)-coloring is r-distinguishable with high probability? It would be interesting to have better bounds on the values of q for which a random q-coloring is 1-distinguishable with high probability. We have an upper bound of the form n 2+o(1) and a lower bound of form Ω(n); we expect n 1+o(1) should be possible, and Lemma 2.4 shows that neighborhoods are unique down to this range. (It seems likely that this should be a monotone property, that is if a random q-coloring is 1-distinguishable with high probability then the same be true for a random (q + 1)-coloring, but we do not have a proof of this. Note that we cannot proceed as in Corollary 1.5 as Theorem 1.7 only deals with uniformly random colorings.) Another interesting question concerns a different type of random jigsaw puzzle. Question 6.1. Let q = q(n) be a positive integer, and let V(Q n ) = S 1 ∪ … ∪ S q be a partition of the vertices of the cube into q sets, chosen uniformly at random. Suppose we are given each set S i up to an isometry. When can the partition be reconstructed with high probability?