Documentation

LeanPool.CutAndProject.Basic

Period lengths of rational cut-and-project gap sequences #

For coprime α, β : ℕ and a window parameter ω ≥ 0, the accepted lattice points (x, y) ∈ ℤ² with y ∈ [(α/β)(x-ω), (α/β)x + ω] project onto the line f(x) = (α/β)x; sorting the projections yields a periodic sequence of consecutive gaps. Writing N = ⌊ωα⌋ + ⌊ωβ⌋ + 1 and D = α² + β², this file proves the closed-form minimal periods for the residue model of that construction: the paper's strip-to-residue reduction — enumerate N consecutive residue classes modulo D under the multiplier m = -α·β⁻¹ and sort the hits — is taken here as the definition of the gap sequence (differenceSequenceUnit), not derived from the lattice points. For it, counting with multiplicity the period is N if D ∤ N and N / D if D ∣ N (main_theorem_geometric_concrete), while discarding multiplicities it is N if N < D and 1 otherwise (set_main_theorem_geometric_concrete).

The geometric data is threaded through the GeometricProjection typeclass, whose concrete instance GeometricProjectionConcrete discharges its four hypotheses; the identification of the residue model with the sorted lattice projections is not formalised here. The irrational-slope case (LeanPool.CutAndProject.Irrational) is built from the lattice directly.

theorem CutAndProject.coprime_alpha_D (α β : ) (h : α.Coprime β) :
α.Coprime (α ^ 2 + β ^ 2)

Lemma 4.1 from the paper. Given α, β ∈ ℕ with gcd(α, β) = 1, we have gcd(α, α ^ 2 + β ^ 2) = 1.

theorem CutAndProject.coprime_beta_D (α β : ) (h : α.Coprime β) :
β.Coprime (α ^ 2 + β ^ 2)

Symmetric part of Lemma 4.1.

theorem CutAndProject.D_pos (α β : ) (h : α.Coprime β) :
0 < α ^ 2 + β ^ 2
def CutAndProject.betaUnit (α β : ) (h : α.Coprime β) :
(ZMod (α ^ 2 + β ^ 2))ˣ

The image of β as a unit of ZMod (α ^ 2 + β ^ 2); well-defined because β is coprime to α ^ 2 + β ^ 2.

Equations
Instances For
    def CutAndProject.alphaUnit (α β : ) (h : α.Coprime β) :
    (ZMod (α ^ 2 + β ^ 2))ˣ

    The image of α as a unit of ZMod (α ^ 2 + β ^ 2); well-defined because α is coprime to α ^ 2 + β ^ 2.

    Equations
    Instances For
      def CutAndProject.multiplier (α β : ) (h : α.Coprime β) :
      (ZMod (α ^ 2 + β ^ 2))ˣ

      The geometric multiplier m = -α · β⁻¹, as a unit of ZMod (α ^ 2 + β ^ 2).

      Equations
      Instances For
        def CutAndProject.residueBijection (α β : ) (h : α.Coprime β) :
        ZMod (α ^ 2 + β ^ 2) ZMod (α ^ 2 + β ^ 2)

        Multiplication by multiplier as a permutation of ZMod (α ^ 2 + β ^ 2).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def CutAndProject.countHits (D r0 N : ) (x : ZMod D) :

          countHits D r0 N x counts the number of times the residue x (modulo D) is hit by the arithmetic progression r0, r0+1, ..., r0+N-1 of length N. The residue distribution theorem (residue_distribution, Lemma 4.3 in the paper) describes the multiset of multiplicities.

          Equations
          Instances For
            theorem CutAndProject.count_hits_D (D : ) [NeZero D] (r0 : ) (x : ZMod D) :
            countHits D r0 D x = 1
            theorem CutAndProject.count_hits_lt_D (D : ) [NeZero D] (r0 N : ) (h : N < D) (x : ZMod D) :
            countHits D r0 N x 1
            theorem CutAndProject.sum_count_hits (D : ) [NeZero D] (r0 N : ) :
            x : ZMod D, countHits D r0 N x = N
            theorem CutAndProject.count_hits_succ (D : ) [NeZero D] (r0 N : ) (x : ZMod D) :
            countHits D r0 (N + 1) x = countHits D r0 N x + if r0 + N = x then 1 else 0
            theorem CutAndProject.count_hits_add (D : ) [NeZero D] (r0 N M : ) (x : ZMod D) :
            countHits D r0 (N + M) x = countHits D r0 N x + countHits D (r0 + N) M x
            theorem CutAndProject.count_hits_mul_D (D : ) [NeZero D] (r0 q : ) (x : ZMod D) :
            countHits D r0 (q * D) x = q
            theorem CutAndProject.count_hits_eq (D : ) [NeZero D] (r0 N : ) (x : ZMod D) :
            countHits D r0 N x = N / D + countHits D (r0 + N / D * D) (N % D) x
            theorem CutAndProject.residue_distribution (D : ) [NeZero D] (r0 N : ) :
            have q := N / D; have s := N % D; {x : ZMod D | countHits D r0 N x = q + 1}.card = s {x : ZMod D | countHits D r0 N x = q}.card = D - s
            theorem CutAndProject.non_uniform_residue_distribution_of_not_dvd (D : ) [NeZero D] (r0 N : ) (h : ¬D N) :
            have q := N / D; have s := N % D; 0 < s {x : ZMod D | countHits D r0 N x = q + 1}.card = s {x : ZMod D | countHits D r0 N x = q}.card = D - s

            Specialisation of residue_distribution to the genuinely non-uniform case D ∤ N: here s = N % D is positive, so the heavy classes form a non-empty proper subset of ZMod D.

            theorem CutAndProject.count_hits_zero (D : ) [NeZero D] (r0 : ) (x : ZMod D) :
            countHits D r0 0 x = 0
            theorem CutAndProject.uniform_residue_distribution (D : ) [NeZero D] (r0 N : ) (h : D N) (x : ZMod D) :
            countHits D r0 N x = N / D

            Lemma (Degenerate Case): Uniform residue distribution. If D ∣ N, then every residue class is hit exactly N / D times.

            def CutAndProject.countHitsUnit (D : ) (u : (ZMod D)ˣ) (r0 N : ) (x : ZMod D) :

            countHitsUnit D u r0 N x is the unit-aware variant of countHits: it counts how many i ∈ Finset.range N satisfy (u : ZMod D) * (r0 + i) = x.

            This corresponds to the geometric residue map r ↦ m * r (mod D) from the paper, where m = -α · β⁻¹ ∈ (ZMod D)ˣ is the multiplier introduced via multiplier. For u = 1 it reduces to countHits (count_hits_unit_one); in general it reduces to countHits after applying u⁻¹ to the target residue (count_hits_unit_eq_count_hits).

            Equations
            Instances For
              theorem CutAndProject.count_hits_unit_eq_count_hits (D : ) [NeZero D] (u : (ZMod D)ˣ) (r0 N : ) (x : ZMod D) :
              countHitsUnit D u r0 N x = countHits D r0 N (u⁻¹ * x)

              Transfer lemma: counting hits of the multiplier-twisted progression u * (r0 + i) against the target x equals counting hits of the plain progression r0 + i against u⁻¹ * x. Multiplication by a unit is a bijection of ZMod D, so the two counts agree pointwise.

              theorem CutAndProject.count_hits_unit_one (D : ) [NeZero D] (r0 N : ) (x : ZMod D) :
              countHitsUnit D 1 r0 N x = countHits D r0 N x

              Specialisation of count_hits_unit_eq_count_hits to u = 1: the unit-aware count with trivial multiplier reduces to countHits.

              theorem CutAndProject.residue_distribution_unit (D : ) [NeZero D] (u : (ZMod D)ˣ) (r0 N : ) :
              have q := N / D; have s := N % D; {x : ZMod D | countHitsUnit D u r0 N x = q + 1}.card = s {x : ZMod D | countHitsUnit D u r0 N x = q}.card = D - s

              Unit-aware analogue of residue_distribution (Lemma 4.3): the multiset of multiplicities of countHitsUnit D u r0 N agrees with that of countHits D r0 N. Multiplication by u : (ZMod D)ˣ is a bijection of ZMod D, so the cardinalities of the level sets {x | count = k} are preserved.

              theorem CutAndProject.uniform_residue_distribution_unit (D : ) [NeZero D] (u : (ZMod D)ˣ) (r0 N : ) (h : D N) (x : ZMod D) :
              countHitsUnit D u r0 N x = N / D

              Unit-aware analogue of uniform_residue_distribution: in the degenerate case D ∣ N, every residue class is hit exactly N / D times under the multiplier-twisted progression u * (r0 + i).

              def CutAndProject.cyclicInterval (D s : ) (x0 : ZMod D) :

              The cyclic interval of length s based at x0: the image of {0, …, s - 1} under `i ↦ x0

              • iinZMod D`.
              Equations
              Instances For
                theorem CutAndProject.cyclic_interval_mem (D s : ) [NeZero D] (x0 x : ZMod D) :
                x cyclicInterval D s x0 i < s, x = x0 + i
                theorem CutAndProject.count_hits_lt_D_eq_one (D s : ) [NeZero D] (r0 : ) (h_s_lt : s < D) (x : ZMod D) :
                countHits D r0 s x = 1 x cyclicInterval D s r0
                theorem CutAndProject.heavy_set_is_cyclic_interval (D : ) [NeZero D] (r0 N : ) :
                have q := N / D; have s := N % D; ∀ (x : ZMod D), countHits D r0 N x = q + 1 x cyclicInterval D s ↑(r0 + q * D)
                theorem CutAndProject.heavy_set_unit_is_cyclic_interval (D : ) [NeZero D] (u : (ZMod D)ˣ) (r0 N : ) :
                have q := N / D; have s := N % D; ∀ (x : ZMod D), countHitsUnit D u r0 N x = q + 1 u⁻¹ * x cyclicInterval D s ↑(r0 + q * D)

                Unit-aware analogue of heavy_set_is_cyclic_interval: under the unit-twisted count countHitsUnit D u r0 N, the heavy residues are precisely those x for which u⁻¹ * x lies in the cyclic interval describing the heavy residues of the untwisted countHits D r0 N. Equivalently, the unit-twisted heavy set is the image of the untwisted heavy cyclic interval under multiplication by u.

                Proof: direct corollary of the transfer lemma count_hits_unit_eq_count_hits and heavy_set_is_cyclic_interval.

                theorem CutAndProject.right_boundary_exists (D s : ) [NeZero D] (x0 : ZMod D) (h_s_pos : 0 < s) (h_s_lt : s < D) :
                x0 + ↑(s - 1) cyclicInterval D s x0 x0 + ↑(s - 1) + 1cyclicInterval D s x0
                theorem CutAndProject.right_boundary_unique (D s : ) [NeZero D] (x0 : ZMod D) (h_s_pos : 0 < s) (_h_s_lt : s < D) (y : ZMod D) (hy_in : y cyclicInterval D s x0) (hy_next_notin : y + 1cyclicInterval D s x0) :
                y = x0 + ↑(s - 1)
                theorem CutAndProject.cyclic_interval_stabilizer_trivial (D s : ) [NeZero D] (x0 τ : ZMod D) (h_s_pos : 0 < s) (h_s_lt : s < D) (h_inv : ∀ (x : ZMod D), x cyclicInterval D s x0 x + τ cyclicInterval D s x0) :
                τ = 0

                Lemma (Minimality): A cyclic interval of length s with 0 < s < D cannot be invariant under any non-zero translation τ.

                def CutAndProject.IsPeriod (s : ) (L : ) :

                Definition of a sequence having a period L.

                Equations
                Instances For

                  HasPeriodLength s L states that L is the least positive period of the sequence s.

                  Equations
                  Instances For
                    class CutAndProject.GeometricProjection (α β : ) (ω : ) (s : ) [NeZero (α ^ 2 + β ^ 2)] :

                    Abstract interface for the combinatorial residue model obtained by reducing the cut-and-project geometry to the distribution of N consecutive residue classes modulo D = α² + β². The four axioms are periodic-combinatorial in nature; the geometric construction is not formalised from first principles. Concrete instances are built from the geometric data via GeometricProjectionConcrete.

                    Instances
                      theorem CutAndProject.generic_minimality (α β : ) (ω : ) (seq : ) [NeZero (α ^ 2 + β ^ 2)] [GeometricProjection α β ω seq] :
                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; ¬D NL > 0, IsPeriod seq LN L
                      noncomputable def CutAndProject.cumulativeHits (α β : ) (ω : ) (x : ) :

                      Running total of countHits over Finset.range (x + 1): the number of projected points with index in [0, x].

                      Equations
                      Instances For
                        noncomputable def CutAndProject.V (α β : ) (ω : ) (k : ) :

                        The k-th sorted index: the least x whose cumulative hit count exceeds k.

                        Equations
                        Instances For
                          noncomputable def CutAndProject.sortedMultiset (α β : ) (ω : ) (i : ) :

                          The i-th value of the sorted multiset of projected residues, extended D-periodically to all of .

                          Equations
                          Instances For
                            noncomputable def CutAndProject.differenceSequence (α β : ) (ω : ) (i : ) :

                            The concrete difference sequence of the normalized residue model (u = 1). differenceSequenceUnit with u = multiplier α β h is the residue-model counterpart of the geometric gap sequence in the paper (the identification is the paper's strip-to-residue reduction, stated as a definition here, not proved); the two have the same period length but differ as sequences in general.

                            Equations
                            Instances For
                              noncomputable def CutAndProject.cumulativeHitsUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (x : ) :

                              Unit-aware concrete construction. cumulativeHitsUnit α β ω u x is the total number of hits in the integer range [0, x] of the multiplier-twisted arithmetic progression u * (r0 + i) for i ∈ [0, N). With u = 1 it reduces to cumulativeHits (cumulative_hits_unit_one); with u = multiplier α β h it realises the geometric residue map c_{r0+i} ≡ -αβ⁻¹·(r0 + i) (mod D), i ∈ [0, N), from the paper.

                              Equations
                              Instances For
                                noncomputable def CutAndProject.VUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (k : ) :

                                Unit-twisted analogue of V, built from cumulativeHitsUnit.

                                Equations
                                Instances For
                                  noncomputable def CutAndProject.sortedMultisetUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) :

                                  Unit-twisted analogue of sortedMultiset, built from VUnit.

                                  Equations
                                  Instances For
                                    noncomputable def CutAndProject.differenceSequenceUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) :

                                    Unit-aware concrete difference sequence. With u = multiplier α β h_coprime this is the residue-model counterpart of the geometric gap sequence in the paper (the strip-to-residue identification is definitional, not proved).

                                    Equations
                                    Instances For
                                      theorem CutAndProject.cumulative_hits_unit_one (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (x : ) :
                                      cumulativeHitsUnit α β ω 1 x = cumulativeHits α β ω x

                                      u = 1 specialisation: the unit-aware cumulative count agrees with cumulativeHits.

                                      theorem CutAndProject.N_pos_concrete (α β : ) (ω : ) (h_ω : 0 ω) :
                                      0 < (ω * α + ω * β + 1).toNat
                                      theorem CutAndProject.period_N_concrete (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                      have N := (ω * α + ω * β + 1).toNat; IsPeriod (differenceSequence α β ω) N
                                      theorem CutAndProject.sorted_multiset_add_N (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (i : ) :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; sortedMultiset α β ω (i + N) = sortedMultiset α β ω i + D

                                      Helper: sortedMultiset shifts by D when index shifts by N.

                                      theorem CutAndProject.sorted_multiset_unit_add_N (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; sortedMultisetUnit α β ω u (i + N) = sortedMultisetUnit α β ω u i + D

                                      Unit-aware analogue of sorted_multiset_add_N. Purely structural — only uses the q*N + r decomposition that defines sortedMultisetUnit.

                                      theorem CutAndProject.sorted_shift_constant (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (L : ) (hL : IsPeriod (differenceSequence α β ω) L) (i : ) :
                                      sortedMultiset α β ω (i + L) - sortedMultiset α β ω i = sortedMultiset α β ω L - sortedMultiset α β ω 0

                                      Helper: If the difference sequence has period L, the sortedMultiset shift by L is constant (independent of i).

                                      Proof idea: Define f(i) = sortedMultiset(i+L) - sortedMultiset(i). Then f(i+1) - f(i) = differenceSequence(i+L) - differenceSequence(i) = 0 by periodicity. So f is constant = f(0).

                                      theorem CutAndProject.shift_times_N_eq (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (L : ) (hL : IsPeriod (differenceSequence α β ω) L) :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; have σ := sortedMultiset α β ω L - sortedMultiset α β ω 0; N * σ = L * D

                                      Helper: N * shift = L * D. From sortedMultiset(i+N) = sortedMultiset(i) + D and sortedMultiset(i+L) = sortedMultiset(i) + σ, applied NL times both ways.

                                      theorem CutAndProject.shift_nonneg (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (L : ) (hL_pos : 0 < L) (hL : IsPeriod (differenceSequence α β ω) L) :
                                      0 sortedMultiset α β ω L - sortedMultiset α β ω 0

                                      Helper: the shift σ is nonneg (sortedMultiset is non-decreasing).

                                      theorem CutAndProject.sorted_multiset_add_mul_N (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (i : ) (m : ) :
                                      sortedMultiset α β ω (i + m * (ω * α + ω * β + 1).toNat) = sortedMultiset α β ω i + m * ↑(α ^ 2 + β ^ 2)

                                      Generalization of sorted_multiset_add_N to multiple N-steps: sortedMultiset(i + mN) = sortedMultiset(i) + mD.

                                      theorem CutAndProject.sorted_multiset_mod_D_eq (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (k L : ) :
                                      (sortedMultiset α β ω ↑(k + L)) = (sortedMultiset α β ω ↑((k + L) % (ω * α + ω * β + 1).toNat))

                                      sortedMultiset mod D depends only on the index mod N.

                                      theorem CutAndProject.sorted_shift_constant_unit (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) (hL : IsPeriod (differenceSequenceUnit α β ω u) L) (i : ) :
                                      sortedMultisetUnit α β ω u (i + L) - sortedMultisetUnit α β ω u i = sortedMultisetUnit α β ω u L - sortedMultisetUnit α β ω u 0

                                      Unit-aware analogue of sorted_shift_constant. Structural — identical to the untwisted proof with differenceSequenceUnit/sortedMultisetUnit substituted.

                                      theorem CutAndProject.shift_times_N_eq_unit (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) (hL : IsPeriod (differenceSequenceUnit α β ω u) L) :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; have σ := sortedMultisetUnit α β ω u L - sortedMultisetUnit α β ω u 0; N * σ = L * D

                                      Unit-aware analogue of shift_times_N_eq.

                                      theorem CutAndProject.shift_nonneg_unit (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) (hL_pos : 0 < L) (hL : IsPeriod (differenceSequenceUnit α β ω u) L) :
                                      0 sortedMultisetUnit α β ω u L - sortedMultisetUnit α β ω u 0

                                      Unit-aware analogue of shift_nonneg.

                                      theorem CutAndProject.sorted_multiset_unit_add_mul_N (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) (m : ) :
                                      sortedMultisetUnit α β ω u (i + m * (ω * α + ω * β + 1).toNat) = sortedMultisetUnit α β ω u i + m * ↑(α ^ 2 + β ^ 2)

                                      Unit-aware analogue of sorted_multiset_add_mul_N.

                                      theorem CutAndProject.sorted_multiset_unit_mod_D_eq (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (k L : ) :
                                      (sortedMultisetUnit α β ω u ↑(k + L)) = (sortedMultisetUnit α β ω u ↑((k + L) % (ω * α + ω * β + 1).toNat))

                                      Unit-aware analogue of sorted_multiset_mod_D_eq.

                                      theorem CutAndProject.sorted_residue_shift (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (L : ) (hL : IsPeriod (differenceSequence α β ω) L) (j : ) :
                                      have D := α ^ 2 + β ^ 2; have σ_ℤ := sortedMultiset α β ω L - sortedMultiset α β ω 0; (sortedMultiset α β ω ↑((j + L) % (ω * α + ω * β + 1).toNat)) = (sortedMultiset α β ω j) + σ_ℤ

                                      Key residue shift: sortedMultiset((j+L)%N) ≡ sortedMultiset(j) + σ (mod D).

                                      theorem CutAndProject.count_hits_eq_sorted_count (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; have r0 := (↑(-ω * β)).val; ∀ (x : ZMod D), countHits D r0 N x = {kFinset.range N | (sortedMultiset α β ω k) = x}.card

                                      Bridge lemma: countHits via the arithmetic progression equals counting sortedMultiset residues over one period.

                                      theorem CutAndProject.count_hits_shift_invariant (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (L : ) (hL_pos : 0 < L) (hL : IsPeriod (differenceSequence α β ω) L) :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; have σ := (sortedMultiset α β ω L - sortedMultiset α β ω 0).toNat; have r0 := (↑(-ω * β)).val; ∀ (x : ZMod D), countHits D r0 N (x + σ) = countHits D r0 N x
                                      theorem CutAndProject.sorted_residue_shift_unit (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) (hL : IsPeriod (differenceSequenceUnit α β ω u) L) (j : ) :
                                      have D := α ^ 2 + β ^ 2; have σ_ℤ := sortedMultisetUnit α β ω u L - sortedMultisetUnit α β ω u 0; (sortedMultisetUnit α β ω u ↑((j + L) % (ω * α + ω * β + 1).toNat)) = (sortedMultisetUnit α β ω u j) + σ_ℤ

                                      Unit-aware analogue of sorted_residue_shift.

                                      theorem CutAndProject.count_hits_eq_sorted_count_unit (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) :
                                      have N := (ω * α + ω * β + 1).toNat; let D := α ^ 2 + β ^ 2; have r0 := (↑(-ω * β)).val; ∀ (x : ZMod D), countHitsUnit D u r0 N x = {kFinset.range N | (sortedMultisetUnit α β ω u k) = x}.card

                                      Unit-aware analogue of count_hits_eq_sorted_count.

                                      theorem CutAndProject.count_hits_shift_invariant_unit (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) (hL_pos : 0 < L) (hL : IsPeriod (differenceSequenceUnit α β ω u) L) :
                                      have N := (ω * α + ω * β + 1).toNat; let D := α ^ 2 + β ^ 2; have σ := (sortedMultisetUnit α β ω u L - sortedMultisetUnit α β ω u 0).toNat; have r0 := (↑(-ω * β)).val; ∀ (x : ZMod D), countHitsUnit D u r0 N (x + σ) = countHitsUnit D u r0 N x

                                      Unit-aware analogue of count_hits_shift_invariant.

                                      theorem CutAndProject.sigma_of_period_concrete (α β : ) (_h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (L : ) :
                                      L > 0IsPeriod (differenceSequence α β ω) L∃ (σ : ), σ * (ω * α + ω * β + 1).toNat = L * (α ^ 2 + β ^ 2) ∃ (r0 : ), ∀ (x : ZMod (α ^ 2 + β ^ 2)), countHits (α ^ 2 + β ^ 2) r0 (ω * α + ω * β + 1).toNat (x + σ) = countHits (α ^ 2 + β ^ 2) r0 (ω * α + ω * β + 1).toNat x
                                      theorem CutAndProject.period_degenerate_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                      have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; D NHasPeriodLength (differenceSequence α β ω) (N / D)
                                      theorem CutAndProject.GeometricProjectionConcrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :

                                      The concrete residue-model instance built from the difference sequence: discharges the four hypotheses of GeometricProjection for coprime α, β and window parameter ω ≥ 0. Supplied explicitly at each use site (the coprimality and nonnegativity hypotheses cannot be found by synthesis).

                                      theorem CutAndProject.main_theorem (α β : ) (h_coprime : α.Coprime β) (ω : ) (_h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] [GeometricProjection α β ω (differenceSequence α β ω)] :
                                      have N_int := ω * α + ω * β + 1; have N := N_int.toNat; have D := α ^ 2 + β ^ 2; have L := if D N then N / D else N; HasPeriodLength (differenceSequence α β ω) L

                                      Theorem 3.1: Period length formula.

                                      Set-valued period (Phase A: countHits dichotomy) #

                                      The two lemmas count_hits_lt_D (already proved above) and count_hits_ge_D (below) furnish the structural dichotomy underlying the set-valued period theorem: under N < D the multiplicity function takes values in {0,1} (so the gap multiset coincides with the gap set), while under N ≥ D every residue class is hit (so the underlying set is all of ℤ and the set-valued period collapses to 1).

                                      theorem CutAndProject.count_hits_ge_D (D : ) [NeZero D] (r0 N : ) (h : D N) (x : ZMod D) :
                                      1 countHits D r0 N x

                                      Lower bound on countHits: if N ≥ D, every residue class is hit at least once. Structural complement to count_hits_lt_D.

                                      Set-valued period (Phase B: dichotomy theorem, abstract form) #

                                      Together with count_hits_lt_D and count_hits_ge_D (Phase A), this section gives the abstract version of the set-valued period theorem: λ_set = N if N < D, else 1. The dichotomy is reduced to two hypotheses on the candidate set sequence — pointwise agreement with the multiset gap sequence (when N < D), respectively constancy at 1 (when N ≥ D) — which a concrete construction would discharge.

                                      theorem CutAndProject.HasPeriodLength_const_one (s : ) (h : ∀ (i : ), s i = 1) :

                                      A sequence that is identically 1 has minimal period 1.

                                      theorem CutAndProject.set_main_theorem (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) (set_seq : ) [NeZero (α ^ 2 + β ^ 2)] [GeometricProjection α β ω (differenceSequence α β ω)] (h_lt : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2∀ (i : ), set_seq i = differenceSequence α β ω i) (h_ge : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat∀ (i : ), set_seq i = 1) :
                                      HasPeriodLength set_seq (if (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2 then (ω * α + ω * β + 1).toNat else 1)

                                      Set-valued period theorem (abstract form).

                                      If set_seq : ℤ → ℤ agrees pointwise with differenceSequence whenever N < D, and is constantly 1 whenever N ≥ D, then its minimal period is N in the first case and 1 in the second.

                                      The two hypotheses are exactly what the structural dichotomy (count_hits_lt_D / count_hits_ge_D) lets a concrete enumeration of the underlying point set verify.

                                      Set-valued period (Phase C: concrete construction) #

                                      Concrete enumeration of the underlying set { z ∈ ℤ | countHits D r0 N (z mod D) ≥ 1 }, mirroring the multiset's V / sortedMultiset machinery but with multiplicities flattened to {0,1} via the indicator. The resulting setDifferenceSequence discharges the abstract hypotheses h_lt and h_ge of set_main_theorem.

                                      noncomputable def CutAndProject.setIndicator (α β : ) (ω : ) (y : ) :

                                      Set indicator: 1 if residue (y : ZMod D) is hit at least once, else 0. Flattens multiplicities of the multiset to {0,1}.

                                      Equations
                                      Instances For
                                        noncomputable def CutAndProject.setCumulativeHits (α β : ) (ω : ) (x : ) :

                                        Cumulative count of hit residues over [0, x]. Set analogue of cumulativeHits.

                                        Equations
                                        Instances For
                                          noncomputable def CutAndProject.setV (α β : ) (ω : ) (k : ) :

                                          Set-convention analogue of V: the least x whose set-cumulative hit count exceeds k.

                                          Equations
                                          Instances For
                                            noncomputable def CutAndProject.setSize (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] :

                                            Number of distinct residues hit, i.e. |set ∩ [0, D)|.

                                            Equations
                                            Instances For
                                              noncomputable def CutAndProject.setSorted (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (i : ) :

                                              Bi-infinite enumeration of the underlying set, lifted via setSize.

                                              Equations
                                              Instances For
                                                noncomputable def CutAndProject.setDifferenceSequence (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (i : ) :

                                                Concrete set-valued gap sequence.

                                                Equations
                                                Instances For

                                                  Phase C, branch N < D: agreement with differenceSequence #

                                                  theorem CutAndProject.set_indicator_eq_count_hits_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (y : ) :
                                                  setIndicator α β ω y = countHits (α ^ 2 + β ^ 2) (↑(-ω * β)).val (ω * α + ω * β + 1).toNat y

                                                  Under N < D, the indicator and the multiplicity coincide pointwise.

                                                  theorem CutAndProject.set_cumulative_hits_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (x : ) :
                                                  setCumulativeHits α β ω x = cumulativeHits α β ω x

                                                  Under N < D, setCumulativeHits and cumulativeHits agree.

                                                  theorem CutAndProject.set_V_eq_V_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (k : ) :
                                                  setV α β ω k = V α β ω k

                                                  Under N < D, setV and V agree.

                                                  theorem CutAndProject.set_size_eq_N_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) :
                                                  setSize α β ω = (ω * α + ω * β + 1).toNat

                                                  Under N < D, setSize = N.

                                                  theorem CutAndProject.set_sorted_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (i : ) :
                                                  setSorted α β ω i = sortedMultiset α β ω i

                                                  Under N < D, setSorted = sortedMultiset pointwise.

                                                  theorem CutAndProject.set_difference_sequence_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (i : ) :

                                                  Discharge of h_lt: under N < D, the concrete set sequence agrees pointwise with differenceSequence.

                                                  Phase C, branch D ≤ N: constant-1 set sequence #

                                                  theorem CutAndProject.set_indicator_eq_one_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (y : ) :
                                                  setIndicator α β ω y = 1

                                                  Under D ≤ N, every residue is hit, so the indicator is constantly 1.

                                                  theorem CutAndProject.set_cumulative_hits_eq_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (x : ) :
                                                  setCumulativeHits α β ω x = x + 1

                                                  Under D ≤ N, the cumulative count is just x + 1.

                                                  theorem CutAndProject.set_V_eq_id_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (k : ) :
                                                  setV α β ω k = k

                                                  Under D ≤ N, setV k = k.

                                                  theorem CutAndProject.set_size_eq_D_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) :
                                                  setSize α β ω = α ^ 2 + β ^ 2

                                                  Under D ≤ N, setSize = D (every residue is hit).

                                                  theorem CutAndProject.set_size_pos (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                                  0 < setSize α β ω

                                                  The set size is positive in either branch of the dichotomy: it equals N when N < D (and N ≥ 1 from N_pos_concrete), and equals D when N ≥ D (and D ≥ 1 from NeZero). Hence the modulo arithmetic in setSorted is well-defined as a period-block enumeration.

                                                  theorem CutAndProject.set_sorted_eq_id_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (i : ) :
                                                  setSorted α β ω i = i

                                                  Under D ≤ N, setSorted i = i.

                                                  theorem CutAndProject.set_difference_sequence_eq_one_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (i : ) :

                                                  Discharge of h_ge: under D ≤ N, the concrete set sequence is constantly 1.

                                                  Phase C, concrete instantiation of both period theorems #

                                                  For symmetry between the two branches: each wrapper internally discharges the [GeometricProjection ...] instance via GeometricProjectionConcrete, so neither requires its caller to provide it.

                                                  theorem CutAndProject.main_theorem_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                                  HasPeriodLength (differenceSequence α β ω) (if α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat then (ω * α + ω * β + 1).toNat / (α ^ 2 + β ^ 2) else (ω * α + ω * β + 1).toNat)

                                                  Concrete multiset-valued period theorem. Wrapper around main_theorem (line 1903) that internalises the GeometricProjectionConcrete instance, so callers only need h_coprime and h_ω.

                                                  theorem CutAndProject.period_N_unit_concrete (α β : ) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) :
                                                  have N := (ω * α + ω * β + 1).toNat; IsPeriod (differenceSequenceUnit α β ω u) N

                                                  Unit-aware analogue of period_N_concrete.

                                                  theorem CutAndProject.sigma_of_period_unit_concrete (α β : ) (_h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (L : ) :
                                                  L > 0IsPeriod (differenceSequenceUnit α β ω u) L∃ (σ : ), σ * (ω * α + ω * β + 1).toNat = L * (α ^ 2 + β ^ 2) ∃ (r0 : ), ∀ (x : ZMod (α ^ 2 + β ^ 2)), countHitsUnit (α ^ 2 + β ^ 2) u r0 (ω * α + ω * β + 1).toNat (x + σ) = countHitsUnit (α ^ 2 + β ^ 2) u r0 (ω * α + ω * β + 1).toNat x

                                                  Unit-aware analogue of sigma_of_period_concrete.

                                                  theorem CutAndProject.period_degenerate_unit_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) :
                                                  have N := (ω * α + ω * β + 1).toNat; have D := α ^ 2 + β ^ 2; D NHasPeriodLength (differenceSequenceUnit α β ω u) (N / D)

                                                  Unit-aware analogue of period_degenerate_concrete. In the degenerate case the unit-twisted sequence equals the untwisted one (difference_sequence_unit_eq_difference_sequence_of_dvd), so the period result transfers directly from period_degenerate_concrete.

                                                  theorem CutAndProject.main_theorem_unit_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) :
                                                  HasPeriodLength (differenceSequenceUnit α β ω u) (if α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat then (ω * α + ω * β + 1).toNat / (α ^ 2 + β ^ 2) else (ω * α + ω * β + 1).toNat)

                                                  Unit-aware concrete main theorem. Combines the period-N and degenerate cases plus the minimality argument from heavy_set_unit_is_cyclic_interval. For u = multiplier α β h_coprime, this is the geometric main theorem (main_theorem_geometric_concrete below).

                                                  theorem CutAndProject.main_theorem_geometric_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                                  HasPeriodLength (differenceSequenceUnit α β ω (multiplier α β h_coprime)) (if α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat then (ω * α + ω * β + 1).toNat / (α ^ 2 + β ^ 2) else (ω * α + ω * β + 1).toNat)

                                                  Geometric concrete main theorem. Specialises main_theorem_unit_concrete to the geometric multiplier u = multiplier α β h_coprime, so the period result holds for the residue-model enumeration carrying the geometric residues c_{r0+r} ≡ -αβ⁻¹ · (r0 + r) (mod D) (paper §9.3, Layer 2; the reduction from the lattice strip is not formalised — see the module docstring).

                                                  def CutAndProject.cR (α β : ) (h_coprime : α.Coprime β) (r : ) :
                                                  ZMod (α ^ 2 + β ^ 2)

                                                  The geometric residue of the integer point indexed by r, as defined in equation eq:residue of the paper: cR ≡ -α · β⁻¹ · r (mod D).

                                                  This formalises the residue-class formula used by Section 3 of the paper (strip-to-residue reduction). The function below is just multiplier · r in ZMod D; the bridge lemma c_r_eq_multiplier_mul_r makes the equation to the paper explicit, and count_hits_unit_multiplier_eq_c_r_count shows that the unit-twisted hit-counter used in differenceSequenceUnit α β ω (multiplier α β h_coprime) precisely counts integer indices i ∈ [0, N) with c_{r0 + i} ≡ x (mod D).

                                                  Equations
                                                  Instances For
                                                    theorem CutAndProject.c_r_eq_multiplier_mul_r (α β : ) (h_coprime : α.Coprime β) [NeZero (α ^ 2 + β ^ 2)] (r : ) :
                                                    cR α β h_coprime r = -(alphaUnit α β h_coprime) * (betaUnit α β h_coprime)⁻¹ * r

                                                    Bridge lemma to the paper's cR formula. The Lean multiplier equals -α · β⁻¹ as a unit in ZMod D, so cR α β h r = -α · β⁻¹ · r (mod D) matches equation eq:residue of the paper verbatim.

                                                    theorem CutAndProject.count_hits_unit_multiplier_eq_c_r_count (α β : ) (h_coprime : α.Coprime β) [NeZero (α ^ 2 + β ^ 2)] (r0 N : ) (x : ZMod (α ^ 2 + β ^ 2)) :
                                                    countHitsUnit (α ^ 2 + β ^ 2) (multiplier α β h_coprime) r0 N x = {iFinset.range N | cR α β h_coprime ↑(r0 + i) = x}.card

                                                    Bridge from the paper's residue map to the unit-twisted hit counter. countHitsUnit (α^2+β^2) (multiplier α β h_coprime) r0 N x is exactly the cardinality of {i ∈ [0, N) : c_{r0+i} ≡ x (mod D)}, where c_{r0+i} is the geometric residue from the paper. This makes the formalisation of main_theorem_geometric_concrete an honest statement about the geometric cR enumeration.

                                                    theorem CutAndProject.set_main_theorem_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                                    HasPeriodLength (setDifferenceSequence α β ω) (if (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2 then (ω * α + ω * β + 1).toNat else 1)

                                                    Concrete set-valued period theorem. The setDifferenceSequence defined above realises the abstract set_main_theorem, closing the asymmetry between the multiset side (main_theorem, line 1903 — instantiated via GeometricProjectionConcrete) and the set side.

                                                    noncomputable def CutAndProject.setIndicatorUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (y : ) :

                                                    Unit-aware set indicator: 1 if residue (y : ZMod D) is hit at least once under the multiplier-twisted progression, else 0.

                                                    Equations
                                                    Instances For
                                                      noncomputable def CutAndProject.setCumulativeHitsUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (x : ) :

                                                      Unit-twisted set-convention analogue of cumulativeHits.

                                                      Equations
                                                      Instances For
                                                        noncomputable def CutAndProject.setVUnit (α β : ) (ω : ) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (k : ) :

                                                        Unit-twisted set-convention analogue of setV.

                                                        Equations
                                                        Instances For
                                                          noncomputable def CutAndProject.setSizeUnit (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) :

                                                          Unit-twisted set-convention analogue of setSize (number of distinct residues hit).

                                                          Equations
                                                          Instances For
                                                            noncomputable def CutAndProject.setSortedUnit (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) :

                                                            Unit-twisted set-convention analogue of setSorted.

                                                            Equations
                                                            Instances For
                                                              noncomputable def CutAndProject.setDifferenceSequenceUnit (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (i : ) :

                                                              Unit-aware concrete set-valued gap sequence. With u = multiplier α β h_coprime this is the residue-model counterpart of the geometric set enumeration (identification definitional, not proved).

                                                              Equations
                                                              Instances For

                                                                Unit-aware Phase C, branch N < D: agreement with differenceSequenceUnit #

                                                                theorem CutAndProject.set_indicator_unit_eq_count_hits_unit_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (y : ) :
                                                                setIndicatorUnit α β ω u y = countHitsUnit (α ^ 2 + β ^ 2) u (↑(-ω * β)).val (ω * α + ω * β + 1).toNat y
                                                                theorem CutAndProject.set_cumulative_hits_unit_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (x : ) :
                                                                setCumulativeHitsUnit α β ω u x = cumulativeHitsUnit α β ω u x
                                                                theorem CutAndProject.set_V_unit_eq_V_unit_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (k : ) :
                                                                setVUnit α β ω u k = VUnit α β ω u k
                                                                theorem CutAndProject.set_size_unit_eq_N_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) :
                                                                setSizeUnit α β ω u = (ω * α + ω * β + 1).toNat
                                                                theorem CutAndProject.set_sorted_unit_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (i : ) :
                                                                setSortedUnit α β ω u i = sortedMultisetUnit α β ω u i
                                                                theorem CutAndProject.set_difference_sequence_unit_eq_of_lt (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2) (i : ) :

                                                                Discharge of h_lt for the unit case: under N < D, the unit set sequence agrees pointwise with differenceSequenceUnit.

                                                                Unit-aware Phase C, branch D ≤ N: constant-1 set sequence #

                                                                theorem CutAndProject.set_indicator_unit_eq_one_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (y : ) :
                                                                setIndicatorUnit α β ω u y = 1
                                                                theorem CutAndProject.set_cumulative_hits_unit_eq_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (x : ) :
                                                                setCumulativeHitsUnit α β ω u x = x + 1
                                                                theorem CutAndProject.set_V_unit_eq_id_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (k : ) :
                                                                setVUnit α β ω u k = k
                                                                theorem CutAndProject.set_size_unit_eq_D_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) :
                                                                setSizeUnit α β ω u = α ^ 2 + β ^ 2
                                                                theorem CutAndProject.set_sorted_unit_eq_id_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (i : ) :
                                                                setSortedUnit α β ω u i = i
                                                                theorem CutAndProject.set_difference_sequence_unit_eq_one_of_ge (α β : ) (ω : ) [NeZero (α ^ 2 + β ^ 2)] (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (h : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat) (i : ) :

                                                                Discharge of h_ge for the unit case: under D ≤ N, the unit set sequence is constantly 1.

                                                                theorem CutAndProject.set_main_theorem_unit (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) (u : (ZMod (α ^ 2 + β ^ 2))ˣ) (set_seq : ) [NeZero (α ^ 2 + β ^ 2)] (h_lt : (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2∀ (i : ), set_seq i = differenceSequenceUnit α β ω u i) (h_ge : α ^ 2 + β ^ 2 (ω * α + ω * β + 1).toNat∀ (i : ), set_seq i = 1) :
                                                                HasPeriodLength set_seq (if (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2 then (ω * α + ω * β + 1).toNat else 1)

                                                                Unit-aware abstract set-valued period theorem. Parallel to set_main_theorem but uses main_theorem_unit_concrete (the unit-aware multiset main theorem) for the N < D branch.

                                                                theorem CutAndProject.set_main_theorem_geometric_concrete (α β : ) (h_coprime : α.Coprime β) (ω : ) (h_ω : 0 ω) [NeZero (α ^ 2 + β ^ 2)] :
                                                                HasPeriodLength (setDifferenceSequenceUnit α β ω (multiplier α β h_coprime)) (if (ω * α + ω * β + 1).toNat < α ^ 2 + β ^ 2 then (ω * α + ω * β + 1).toNat else 1)

                                                                Geometric concrete set-valued main theorem. Specialises set_main_theorem_unit to u = multiplier α β h_coprime and discharges the dichotomy axioms via the unit-aware Phase C lemmas.