Documentation

ReflectiveSubsystems.ReadingWord

Cyclic words along an orbit: the decimation identity and the separating-set floor #

([Persistence] §8, Propositions 8.20 and 8.25)

Combinatorics on cyclic words over ZMod n, standing alone: no dependence on the persistence capacity machinery of ReflectiveSubsystems/PersistenceCapacity.lean or ReflectiveSubsystems/FrameItinerary.lean. The bridge from a world-and-lens pair (U, ℓ₀) to a cyclic word w along an orbit is NOT built here.

Two counting cores, over a reading's word w : ZMod n → α:

Decimation composes ([Persistence] §8, Proposition 8.42(ii)'s route): decimate (decimate w d) e = decimate w (d * e) (decimate_decimate) and decimate w 1 = w (decimate_one). Consequently, over a prime cycle, rMin of a d-decimation is at most the original word's own arc count (rMin_decimate_le) — undo the sampling at d⁻¹ — which is the mechanism behind Proposition 8.42(ii)'s negative half: the arc count a pattern DISPLAYS is not the statistic r(w) a reading is priced against, since a further decimation can collapse it back down (guard_arc_pattern_not_rMin, a concrete decimated interval at n = 11).

def ReflectiveSubsystems.mismatch {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] (w : ZMod n → α) (d : ZMod n) :

The mismatch set at shift d ([Persistence] §8, Proposition 8.20): the positions where the word disagrees with its own d-shift, M_d := {s : w s ≠ w (s + d)}.

Equations
Instances For
    def ReflectiveSubsystems.decimate {n : ℕ} {α : Type u_1} (w : ZMod n → α) (d : ZMod n) :
    ZMod n → α

    The d-decimation of a word ([Persistence] §8, Proposition 8.25): the word sampled every d steps, i ↦ w (i · d).

    Equations
    Instances For
      def ReflectiveSubsystems.decimateFrom {n : ℕ} {α : Type u_1} (w : ZMod n → α) (d a : ZMod n) :
      ZMod n → α

      The d-decimation started at a ([Persistence] §8, Proposition 8.32): the walk i ↦ w (a + i · d) — decimate is the case a = 0 (decimate_eq_decimateFrom_zero). Averaging the run count of decimateFrom w d a over every starting point a is what lets the decimation identity drop its unit hypothesis on d (sum_runs_decimateFrom).

      Equations
      Instances For
        theorem ReflectiveSubsystems.decimate_eq_decimateFrom_zero {n : ℕ} {α : Type u_1} (w : ZMod n → α) (d : ZMod n) :

        decimate is decimateFrom started at 0.

        theorem ReflectiveSubsystems.decimate_decimate {n : ℕ} {α : Type u_1} (w : ZMod n → α) (d e : ZMod n) :
        decimate (decimate w d) e = decimate w (d * e)

        Decimation composes by multiplying shifts ([Persistence] §8, Proposition 8.42(ii)'s route): sampling every e steps of a word already sampled every d steps is sampling every d · e steps of the original, decimate (decimate w d) e = decimate w (d * e).

        theorem ReflectiveSubsystems.decimate_one {n : ℕ} {α : Type u_1} (w : ZMod n → α) :
        decimate w 1 = w

        Decimating at shift 1 changes nothing.

        def ReflectiveSubsystems.runs {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] (v : ZMod n → α) :

        The number of runs of a cyclic word: the positions where a word disagrees with its successor, at any alphabet.

        Equations
        Instances For
          def ReflectiveSubsystems.arcs {n : ℕ} [NeZero n] (v : ZMod n → Bool) :

          The number of arcs a binary word occupies: the positions where the word reads true and its predecessor read false — the START of a maximal run of trues.

          Equations
          Instances For

            Proposition 8.32: the decimation identity at every shift, and Proposition 8.25(i) as its #

            unit-shift corollary

            theorem ReflectiveSubsystems.sum_runs_decimateFrom {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] (w : ZMod n → α) (d : ZMod n) :
            ∑ a : ZMod n, runs (decimateFrom w d a) = n * (mismatch w d).card

            The averaged decimation identity, at every shift ([Persistence] §8, Proposition 8.32): no hypothesis on d at all — not IsUnit, not d ≠ 0. Route: expand both runs and mismatch as Finset.card of filters, i.e. sums of 0/1 indicators; swap the order of summation over a and i; and for each fixed i, the map a ↦ a + i * d is a bijection of ZMod n (Equiv.addRight), so the inner sum over a collapses to |M_d| independent of i, leaving n copies.

            theorem ReflectiveSubsystems.decimation_runs_eq_mismatch {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] (w : ZMod n → α) {d : ZMod n} (hd : IsUnit d) :

            The decimation identity ([Persistence] §8, Proposition 8.25(i)): at any alphabet, the mismatch set at shift d has the same size as the run count of the d-decimation, whenever d is a unit — the gcd (d, n) = 1 instance of Proposition 8.32's general form. At a unit shift, runs (decimateFrom w d a) is the same for every a (runs_decimateFrom_const_of_isUnit), so sum_runs_decimateFrom's sum is n copies of runs (decimate w d) (decimateFrom at a = 0), and n ≠ 0 cancels against the n * |M_d| on the other side.

            theorem ReflectiveSubsystems.decimation_runs_eq_mismatch_of_prime {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] [Fact (Nat.Prime n)] (w : ZMod n → α) {d : ZMod n} (hd : d ≠ 0) :

            The decimation identity, prime case ([Persistence] §8, Proposition 8.25(i), the form the paper states): over a prime cycle every d ≠ 0 is a unit.

            The n = 4 guard word: true at 0, false elsewhere.

            Equations
            Instances For

              The unit hypothesis is load-bearing ([Persistence] §8, Proposition 8.25(i)'s hypothesis): at n = 4, d = 2 — not a unit, since 2 * 2 = 0 in ZMod 4 — w = ![true, false, false, false] has (mismatch w 2).card = 2 while runs (decimate w 2) = 4.

              The naive single-decimation binary reading is what a composite length breaks, not the identity itself ([Persistence] §8, Proposition 8.32's point): at the same n = 4, d = 2 witness, (mismatch guardWord 2).card = 2 while 2 * arcs (decimate guardWord 2) = 4 — the m_min = 2 · r(w) display fails when r(w) is read off a single decimation, exactly as guard_unit_load_bearing shows the run-count identity itself fails there; sum_arcs_decimateFrom's averaged form is what survives at this shift.

              Proposition 8.25(i)'s binary half #

              Proposition 8.25(i)'s binary half ([Persistence] §8): a binary word's run count is twice its arc count — needing no non-constancy hypothesis, since both sides vanish on a constant word. Route: split the mismatch set into descents and ascents, biject ascents with arcs by i ↦ i + 1, and match descents to ascents by counting each against the shared set of true positions from both sides.

              theorem ReflectiveSubsystems.sum_arcs_decimateFrom {n : ℕ} [NeZero n] (w : ZMod n → Bool) (d : ZMod n) :
              n * (mismatch w d).card = 2 * ∑ a : ZMod n, arcs (decimateFrom w d a)

              The averaged binary form, at every shift ([Persistence] §8, Proposition 8.32's binary half): off sum_runs_decimateFrom and runs_eq_two_mul_arcs applied pointwise at each starting point a, with no hypothesis on d. Stated multiplicatively — n * |M_d| = 2 * ∑ … rather than dividing by n — so the one display the paper quotes carries no ℕ-division wart.

              The statistic identity m_min = 2 · r(w), at every n > 1, and mMin_eq_two_mul_rMin as #

              its prime corollary

              The nonzero elements of ZMod n, as a Finset.

              Equations
              Instances For

                univNeZero n is nonempty when 1 < n.

                def ReflectiveSubsystems.mMin {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] [Fact (1 < n)] (w : ZMod n → α) :

                m_min, at any n > 1 ([Persistence] §8, Proposition 8.20): the least Hamming self-distance of the word, min_{d ≠ 0} |M_d|, taken with Finset.inf' over an explicit nonemptiness proof rather than sInf, whose value on a degenerate set would not be the intended minimum. Needs only n > 1, not primality: nonemptiness of the d ≠ 0 index set is all Finset.inf' asks for.

                Equations
                Instances For
                  def ReflectiveSubsystems.rMinGen {n : ℕ} [NeZero n] [Fact (1 < n)] (w : ZMod n → Bool) :

                  r(w), averaged over every decimation's starting point ([Persistence] §8, Proposition 8.32 at the minimizing d): min_{d ≠ 0} ∑ a, arcs (decimateFrom w d a), at any n > 1.

                  Equations
                  Instances For
                    def ReflectiveSubsystems.rMin {n : ℕ} [NeZero n] [Fact (Nat.Prime n)] (w : ZMod n → Bool) :

                    r(w), over a prime cycle ([Persistence] §8, Proposition 8.25): the least number of arcs occupied by any SINGLE decimation of the word, min_{d ≠ 0} arcs (decimate w d) — meaningful as the paper's r(w) only where every d ≠ 0 is a unit, since guard_composite_binary_load_bearing shows a single decimation is not faithful at a composite length; rMinGen is the statistic that survives there. [Fact (Nat.Prime n)] supplies [Fact (1 < n)] for univNeZero_nonempty automatically, via Mathlib's Nat.Prime.one_lt'.

                    Equations
                    Instances For
                      theorem ReflectiveSubsystems.mMin_eq_two_mul_rMinGen {n : ℕ} [NeZero n] [Fact (1 < n)] (w : ZMod n → Bool) :
                      n * mMin w = 2 * rMinGen w

                      The general statistic identity ([Persistence] §8, Proposition 8.32 at the minimizing d): n · m_min = 2 · r(w), averaged over decimations' starting points, at any n > 1 — no unit hypothesis on the minimizing d, unlike mMin_eq_two_mul_rMin. Route: sum_arcs_decimateFrom supplies the pointwise identity n * |M_d| = 2 * ∑ a, arcs (decimateFrom w d a) at every d; n • · and 2 • · each commute with a finite inf' (Finset.nsmul_inf'), so the two minima agree.

                      The statistic identity, over a prime cycle ([Persistence] §8, Proposition 8.25(i) at the minimizing d): m_min = 2 · r(w). Primality is what makes every d ≠ 0 a unit, so decimation_runs_eq_mismatch applies pointwise at each d; the minima then agree because n • · (here 2 • ·) commutes with a finite inf' (Finset.nsmul_inf').

                      Proposition 8.42(ii): a decimated pattern's own minimizing decimation can undo it #

                      theorem ReflectiveSubsystems.rMin_decimate_le {n : ℕ} [NeZero n] [Fact (Nat.Prime n)] (w : ZMod n → Bool) {d : ZMod n} (hd : d ≠ 0) :

                      A cheap-looking decimation can hide a cheaper one ([Persistence] §8, Proposition 8.42(ii)): rMin of a d-decimation is at most the word's own arc count. Route: write d as a unit u (isUnit_of_ne_zero_of_prime), instantiate rMin's inf' at ↑u⁻¹, and undo the sampling via decimate_decimate and decimate_one, using u * ↑u⁻¹ = 1. This is the mechanism behind Proposition 8.42(ii)'s negative half: the arc count of a pattern is not r(w), since decimating it again can collapse it back to fewer arcs.

                      theorem ReflectiveSubsystems.guard_arc_pattern_not_rMin :
                      arcs (decimate (fun (i : ZMod 11) => decide (i.val < 5)) 3) = 3 ∧ rMin (decimate (fun (i : ZMod 11) => decide (i.val < 5)) 3) = 1

                      A concrete decimated interval, at the arc count the pattern displays versus the arc count its own decimation reveals ([Persistence] §8, Proposition 8.42(ii)): at n = 11 (prime), the interval indicator v := 1_{[0, 5)} has arcs v = 1, while its 3-decimation u := decimate v 3 reads arcs u = 3 — three arcs by direct count — yet rMin u = 1, since u's own 3⁻¹-decimation undoes the sampling and recovers v. So the arc count a pattern DISPLAYS is not the statistic r(w) a reading is priced against; rMin_decimate_le is exactly why rMin u ≤ arcs v = 1.

                      Proposition 8.20's floor: separating sets #

                      def ReflectiveSubsystems.Separating {n : ℕ} {α : Type u_1} (w : ZMod n → α) (A : Finset (ZMod n)) :

                      A separating set ([Persistence] §8, Proposition 8.20): A separates every pair j, j + t for t ∈ A when the pattern map j ↦ (w (j − t))_{t ∈ A} is injective.

                      Equations
                      Instances For
                        theorem ReflectiveSubsystems.Separating.card_le {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] {w : ZMod n → α} {A : Finset (ZMod n)} (hA : Separating w A) {d : ZMod n} (hd : d ≠ 0) :
                        n ≤ A.card * (mismatch w d).card

                        The separating-set floor ([Persistence] §8, Proposition 8.20's proof, the double count): for any d ≠ 0, a separating set embeds ZMod n into A × M_d. A separates j from j + d exactly when some t ∈ A has j − t ∈ M_d, so j ↦ (t, j − t) is well defined onto A × M_d and surjective, giving n ≤ |A| · |M_d|.

                        theorem ReflectiveSubsystems.Separating.card_pow_le {n : ℕ} [NeZero n] {α : Type u_1} [Fintype α] {w : ZMod n → α} {A : Finset (ZMod n)} (hA : Separating w A) :

                        The counting floor: a separating set is a pigeonhole on the pattern map ([Persistence] §8, Proposition 8.40(ii)'s second bound): Separating is injectivity of the pattern map j ↦ (w (j − t))_{t ∈ A} into ↥A → α, so n ≤ |α| ^ |A| by a straight cardinality comparison — no double count needed, unlike Separating.card_le.

                        theorem ReflectiveSubsystems.Separating.card_le_mMin {n : ℕ} [NeZero n] {α : Type u_1} [DecidableEq α] [Fact (Nat.Prime n)] {w : ZMod n → α} {A : Finset (ZMod n)} (hA : Separating w A) :
                        n ≤ A.card * mMin w

                        The floor at the minimizing d ([Persistence] §8, Proposition 8.20, the m_min form): over a prime cycle, Separating.card_le holds at every d ≠ 0, so it holds in particular at the d achieving mMin w.

                        Axiom audit #

                        The guarded capstones above are #print axioms-clean on the standard triple, and the guards below make that build-enforced.