AFTD Auto-Formalizing Theoretical Domains

simple_graph_cycle_power_seven_cover_four_tight_dvd

theoremverified

A tight cover of C_n^7 (n ≥ 22) by 4 equivalence subgraphs (every distance-7, 6, 4 pair covered exactly once, every class spanned by a distance-7 pair) exists only when 8 divides n.

Statement

theorem simple_graph_cycle_power_seven_cover_four_tight_dvd (n : ℕ) [NeZero n] (hn : 22 ≤ n)
    (c : Fin 4 → ZMod n → ZMod n)
    (hc : ∀ s u v, u ≠ v → c s u = c s v → (simple_graph_cycle_power n 7).Adj u v)
    (hcov : ∀ u v, (simple_graph_cycle_power n 7).Adj u v → ∃ s, c s u = c s v)
    (h7 : ∀ i, ∃! s, c s i = c s (i + 7)) (h6 : ∀ i, ∃! s, c s i = c s (i + 6))
    (h4 : ∀ i, ∃! s, c s i = c s (i + 4))
    (hspan : ∀ s i, ∃ d : ℕ, d ≤ 7 ∧ c s (i - d) = c s (i - d + 7) ∧ c s (i - d) = c s i) :
    8 ∣ n
Source
the structural step of the k = 7 case of OP-205 (arXiv:2610.15635), research thread RT-1, case k = 7 (k + 1 = 8); the analogue of simple_graph_cycle_power_three_cover_three_tight_dvd (4 | n for k = 3)
Verified
23 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 10
Used by 1

The proof, explained

The proof shows that a tight 4-layer cover of C_n^7 (n ≥ 22) can only exist when 8 divides n. It first proves that distance-7 equivalence classes are rigid intervals of length 7, defining a unique layer map σ that assigns each distance-7 pair to its covering layer. By translating the exact coverage conditions for pairs at distances 4, 6, and 7 into a boolean indicator sequence x, the proof invokes classification results showing that the sequence x(p, 1) alternates with period 2. This structure imposes rigid distinctness constraints on the 4-colouring σ along an 8-cycle pattern, from which `cycle_power_seven_tight_layer_colouring_dvd` deduces that 8 divides n.

  1. Injectivity of modular reduction on integers and natural numbers with differences strictly less than n

    If two integers have difference with absolute value strictly less than n and are congruent modulo n, they are equal in ℤ by `zmod_intCast_eq_intCast_iff_of_abs_sub_lt`. Likewise, for natural numbers strictly less than n, their equality in ℤ/nℤ implies their equality in ℕ via `ZMod.natCast_eq_natCast_iff'` and `Nat.mod_eq_of_lt`.

    lines 9–15

    uses zmod_intCast_eq_intCast_iff_of_abs_sub_lt, abs_lt, ZMod.natCast_eq_natCast_iff', Nat.mod_eq_of_lt

      have hinj : ∀ a b : ℤ, a - b < n → b - a < n → (a : ZMod n) = (b : ZMod n) → a = b :=
        fun a b h1 h2 e => (zmod_intCast_eq_intCast_iff_of_abs_sub_lt n a b
          (by rw [abs_lt]; constructor <;> omega)).mp e
      have hnat : ∀ a b : ℕ, a < n → b < n → (a : ZMod n) = (b : ZMod n) → a = b := by
        intro a b ha hb e
        rw [ZMod.natCast_eq_natCast_iff'] at e
        rwa [Nat.mod_eq_of_lt ha, Nat.mod_eq_of_lt hb] at e
  2. Every vertex in an equivalence class spanned by p and p + 7 lies in the circular interval {p, p + 1, ..., p + 7}

    Suppose c(s, p) = c(s, p + 7) and c(s, p) = c(s, v). If v = p, the offset is 0. If v ≠ p, v is adjacent to p in C_n^7, so v = p + e with 1 ≤ |e| ≤ 7 by `simple_graph_cycle_power_seven_adj_iff`. If v = p + 7, the offset is 7. Otherwise, v is also adjacent to p + 7, so v = p + 7 + e' with |e'| ≤ 7. Modulo n this gives e = 7 + e', which holds over ℤ because n ≥ 22. Since e' ≥ -7, we obtain 0 ≤ e ≤ 7.

    lines 16–34

    uses simple_graph_cycle_power_seven_adj_iff, Ne.symm, abs_le, le_refl

      -- every member of a class containing p and p + 7 lies in p .. p + 7
      have hA : ∀ s p v, c s p = c s (p + 7) → c s p = c s v →
          ∃ e : ℤ, 0 ≤ e ∧ e ≤ 7 ∧ v = p + (e : ZMod n) := by
        intro s p v h1 h2
        by_cases hv : v = p
        · exact ⟨0, le_refl _, by norm_num, by simp [hv]⟩
        obtain ⟨e, he0, he7, rfl⟩ :=
          (simple_graph_cycle_power_seven_adj_iff n hn p v).mp (hc s p v (Ne.symm hv) h2)
        rw [abs_le] at he7
        by_cases hv7 : p + (e : ZMod n) = p + 7
        · have h' : (e : ZMod n) = ((7 : ℤ) : ZMod n) := by push_cast; linear_combination hv7
          have := hinj e 7 (by omega) (by omega) h'
          exact ⟨e, by omega, by omega, rfl⟩
        · obtain ⟨e', _, he'7, he'⟩ := (simple_graph_cycle_power_seven_adj_iff n hn (p + 7) (p + e)).mp
            (hc s (p + 7) (p + e) (Ne.symm hv7) (h1.symm.trans h2))
          rw [abs_le] at he'7
          have h' : (e : ZMod n) = ((7 + e' : ℤ) : ZMod n) := by push_cast; linear_combination he'
          have := hinj e (7 + e') (by omega) (by omega) h'
          exact ⟨e, by omega, by omega, rfl⟩
  3. Two distance-7 classes in the same layer that share a vertex are identical

    If classes spanned by (p, p + 7) and (q, q + 7) in layer s both contain w, then by the interval confinement property, q = p + e with 0 ≤ e ≤ 7, and q + 7 = p + e + 7 = p + e' with 0 ≤ e' ≤ 7. Since n ≥ 22, the modular equality e + 7 = e' forces e = 0 over ℤ, so p = q.

    lines 35–44

      -- two classes of one layer, each spanned by a distance-7 pair, that meet are the same
      have hE : ∀ s (p q w : ZMod n), c s p = c s (p + 7) → c s q = c s (q + 7) →
          c s p = c s w → c s q = c s w → p = q := by
        intro s p q w hp hq hpw hqw
        obtain ⟨e, he0, he7, rfl⟩ := hA s p q hp (hpw.trans hqw.symm)
        obtain ⟨e', he'0, he'7, he'⟩ := hA s p (p + e + 7) hp (hpw.trans (hqw.symm.trans hq))
        have h' : ((e + 7 : ℤ) : ZMod n) = (e' : ZMod n) := by push_cast; linear_combination he'
        have := hinj (e + 7) e' (by omega) (by omega) h'
        have he : e = 0 := by omega
        simp [he]
  4. Existence of the layer selector σ, containment of distance-d pairs in a distance-7 class, and shift injectivity

    By hypothesis h7, each distance-7 pair (i, i + 7) is covered by a unique layer, defining σ : ℤ/nℤ → Fin 4. For any pair at distance d ≤ 7 covered by layer s, the spanning hypothesis hspan gives a distance-7 class starting at u - d₀ containing u; by interval confinement, this class also contains u + d, with d₀ + d ≤ 7 and s = σ(u - d₀). Finally, `sub_right_injective` and `hnat` show that u - a = u - b with a, b ≤ 7 implies a = b.

    lines 45–59

    uses sub_right_injective

      have h7' : ∀ i, ∃ s, c s i = c s (i + 7) ∧ ∀ t, c t i = c t (i + 7) → t = s := fun i => h7 i
      choose σ hσ hσu using h7'
      -- a pair at distance d covered by layer s lies in the class starting at some u - a
      have hD : ∀ (s : Fin 4) (u : ZMod n) (d : ℕ), d ≤ 7 → c s u = c s (u + d) →
          ∃ a : ℕ, a + d ≤ 7 ∧ σ (u - a) = s ∧ c s (u - a) = c s u ∧ c s (u - a) = c s (u + d) := by
        intro s u d hd h
        obtain ⟨d0, hd0, hsp7, hspu⟩ := hspan s u
        have hs : s = σ (u - d0) := hσu (u - d0) s hsp7
        obtain ⟨e, he0, he7, he⟩ := hA s (u - d0) (u + d) hsp7 (hspu.trans h)
        have h' : ((d : ℤ) : ZMod n) = ((e - d0 : ℤ) : ZMod n) := by push_cast; linear_combination he
        have := hinj d (e - d0) (by omega) (by omega) h'
        exact ⟨d0, by omega, hs.symm, hspu, hspu.trans h⟩
      have hsub : ∀ (u : ZMod n) (a b : ℕ), a ≤ 7 → b ≤ 7 → u - (a : ZMod n) = u - (b : ZMod n) → a = b :=
        fun u a b ha hb e => hnat a b (by omega) (by omega) (sub_right_injective e)
    
  5. Definition of the indicator sequence x and uniqueness of covering classes for uniquely covered pairs

    We define x(p, j) ∈ Bool to indicate whether p and p + j belong to the same class in layer σ(p). If a pair (u, u + d) is covered by a unique layer, two classes starting at u - a and u - b (with a, b ≤ 7) that both cover this pair must belong to the same layer and meet at u, so they coincide by class uniqueness, implying a = b.

    lines 60–77

      obtain ⟨x, hx⟩ : ∃ x : ZMod n → Fin 8 → Bool,
          ∀ p j, x p j = decide (c (σ p) p = c (σ p) (p + ((j : ℕ) : ZMod n))) := ⟨_, fun _ _ => rfl⟩
      have hxs : ∀ (p : ZMod n) (j : Fin 8) (q : ZMod n), p + ((j : ℕ) : ZMod n) = q →
          (x p j = true ↔ c (σ p) p = c (σ p) q) := by
        intro p j q h; rw [hx, ← h]; simp
      -- σ is determined by any distance-7 pair
      have hσeq : ∀ s p, c s p = c s (p + 7) → σ p = s := fun s p h => (hσu p s h).symm
      -- two classes starting at u - a and u - b both containing u and u + d, with d covered once
      have hU : ∀ (u : ZMod n) (d a b : ℕ), a ≤ 7 → b ≤ 7 →
          (∀ s t, c s u = c s (u + d) → c t u = c t (u + d) → s = t) →
          c (σ (u - a)) (u - a) = c (σ (u - a)) u → c (σ (u - a)) (u - a) = c (σ (u - a)) (u + d) →
          c (σ (u - b)) (u - b) = c (σ (u - b)) u → c (σ (u - b)) (u - b) = c (σ (u - b)) (u + d) →
          a = b := by
        intro u d a b ha hb huniq h1 h2 h3 h4
        have hst : σ (u - a) = σ (u - b) := huniq _ _ (h1.symm.trans h2) (h3.symm.trans h4)
        have hb7 := hσ (u - b)
        rw [← hst] at hb7 h3
        exact hsub u a b ha hb (hE _ _ _ u (hσ _) hb7 h1 h3)
  6. Pairs at distance d ∈ {1, 2, 3, 5} are covered by some class

    For each d ∈ {1, 2, 3, 5}, the pair (u, u + d) is adjacent in C_n^7 by `simple_graph_cycle_power_seven_adj_iff`. By the cover hypothesis hcov, it is covered by some layer s, which by class containment lies in a class starting at u - a with a + d ≤ 7 and σ(u - a) = s, meaning x(u - a, a) = true and x(u - a, a + d) = true.

    lines 78–92

    uses simple_graph_cycle_power_seven_adj_iff, abs_le

      have hcov' : ∀ (d : ℕ) (u : ZMod n), d ∈ ({1, 2, 3, 5} : Finset ℕ) →
          ∃ j : Fin 8, ∃ hj : j.val + d ≤ 7, x (u - j.val) j = true ∧
            x (u - j.val) ⟨j.val + d, by omega⟩ = true := by
        intro d u hd
        have hd7 : d ≤ 7 := by simp at hd; omega
        have hadj : (simple_graph_cycle_power n 7).Adj u (u + (d : ZMod n)) := by
          rw [simple_graph_cycle_power_seven_adj_iff n hn]
          refine ⟨d, ?_, ?_, by push_cast; rfl⟩
          · simp at hd; omega
          · rw [abs_le]; constructor <;> omega
        obtain ⟨s, hs⟩ := hcov u _ hadj
        obtain ⟨a, ha, hσa, h1, h2⟩ := hD s u d hd7 hs
        refine ⟨⟨a, by omega⟩, ha, ?_, ?_⟩
        · rw [hxs _ _ u (by simp)]; rw [hσa]; exact h1
        · rw [hxs _ _ (u + d) (by simp; ring)]; rw [hσa]; exact h2
  7. Exact coverage of distance 6: x(u - 1, 1) + x(u, 6) = 1 automation

    The distance-6 pair (u, u + 6) is covered uniquely, so the covering class must start at u - a with a + 6 ≤ 7, meaning a = 0 or a = 1. The case a = 0 gives x(u, 6) = true, while a = 1 gives x(u - 1, 1) = true because (u - 1) + 7 = u + 6. Uniqueness prevents both from holding simultaneously. The finite boolean alternatives are resolved by `decide`, yielding the sum 1.

    lines 93–124

      have hd6' : ∀ u, (x (u - 1) 1).toNat + (x u 6).toNat = 1 := by
        intro u
        have e1 := hxs (u - 1) 1 u (by simp)
        have e6 := hxs u 6 (u + 6) (by show u + ((6 : ℕ) : ZMod n) = u + 6; push_cast; ring)
        obtain ⟨s0, hs0, hs0u⟩ := h6 u
        have huniq : ∀ s t, c s u = c s (u + ((6 : ℕ) : ZMod n)) → c t u = c t (u + ((6 : ℕ) : ZMod n)) → s = t := by
          intro s t hs ht; push_cast at hs ht; exact (hs0u s hs).trans (hs0u t ht).symm
        have P1 : x (u - 1) 1 = true ↔ (c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) (u + ((6 : ℕ) : ZMod n))) := by
          rw [e1]; push_cast
          constructor
          · intro h; refine ⟨h, (hσ (u - 1)).trans ?_⟩
            congr 1; ring
          · exact fun h => h.1
        have P6 : x u 6 = true ↔ (c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) (u + ((6 : ℕ) : ZMod n))) := by
          rw [e6]; push_cast; simp
        obtain ⟨a, ha, hσa, h1, h2⟩ := hD s0 u 6 (by norm_num) (by push_cast; exact hs0)
        have hex : x (u - 1) 1 = true ∨ x u 6 = true := by
          have : a ≤ 1 := by omega
          interval_cases a
          · right; rw [P6]; rw [hσa]; exact ⟨h1, h2⟩
          · left; rw [P1]; rw [hσa]; exact ⟨h1, h2⟩
        have hne : ¬ (x (u - 1) 1 = true ∧ x u 6 = true) := by
          rintro ⟨q1, q6⟩
          rw [P1] at q1; rw [P6] at q6
          have := hU u 6 1 0 (by norm_num) (by norm_num) huniq q1.1 q1.2 q6.1 q6.2
          omega
        revert hex hne
        generalize x (u - 1) 1 = b1; generalize x u 6 = b6
        revert b1 b6; decide
    
  8. Exact coverage of distance 4: x(u, 4) + (x(u - 1, 1) && x(u - 1, 5)) + (x(u - 2, 2) && x(u - 2, 6)) + x(u - 3, 3) = 1 automation

    The distance-4 pair (u, u + 4) is covered uniquely, so its covering class must start at u - a with a + 4 ≤ 7, giving four possibilities a ∈ {0, 1, 2, 3}. Uniqueness ensures that no two of these four conditions can hold at once. Finite boolean exhaustion via `decide` proves that exactly one holds, so their sum is 1.

    lines 125–180

    uses Bool.and_eq_true, Iff.rfl

      have hd4' : ∀ u, (x u 4).toNat + (x (u - 1) 1 && x (u - 1) 5).toNat +
          (x (u - 2) 2 && x (u - 2) 6).toNat + (x (u - 3) 3).toNat = 1 := by
        intro u
        obtain ⟨s0, hs0, hs0u⟩ := h4 u
        have huniq : ∀ s t, c s u = c s (u + ((4 : ℕ) : ZMod n)) → c t u = c t (u + ((4 : ℕ) : ZMod n)) → s = t := by
          intro s t hs ht; push_cast at hs ht; exact (hs0u s hs).trans (hs0u t ht).symm
        have P0 : x u 4 = true ↔ (c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by
          rw [hxs u 4 (u + 4) (by show u + ((4 : ℕ) : ZMod n) = u + 4; push_cast; ring)]; push_cast; simp
        have P1 : (x (u - 1) 1 && x (u - 1) 5) = true ↔ (c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by
          rw [Bool.and_eq_true, hxs (u - 1) 1 u (by simp),
            hxs (u - 1) 5 (u + 4) (by show u - 1 + ((5 : ℕ) : ZMod n) = u + 4; push_cast; ring)]
          push_cast; exact Iff.rfl
        have P2 : (x (u - 2) 2 && x (u - 2) 6) = true ↔ (c (σ (u - ((2 : ℕ) : ZMod n))) (u - ((2 : ℕ) : ZMod n)) = c (σ (u - ((2 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((2 : ℕ) : ZMod n))) (u - ((2 : ℕ) : ZMod n)) = c (σ (u - ((2 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by
          rw [Bool.and_eq_true, hxs (u - 2) 2 u (by show u - 2 + ((2 : ℕ) : ZMod n) = u; push_cast; ring),
            hxs (u - 2) 6 (u + 4) (by show u - 2 + ((6 : ℕ) : ZMod n) = u + 4; push_cast; ring)]
          push_cast; exact Iff.rfl
        have P3 : x (u - 3) 3 = true ↔ (c (σ (u - ((3 : ℕ) : ZMod n))) (u - ((3 : ℕ) : ZMod n)) = c (σ (u - ((3 : ℕ) : ZMod n))) u ∧
            c (σ (u - ((3 : ℕ) : ZMod n))) (u - ((3 : ℕ) : ZMod n)) = c (σ (u - ((3 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by
          rw [hxs (u - 3) 3 u (by show u - 3 + ((3 : ℕ) : ZMod n) = u; push_cast; ring)]
          push_cast
          constructor
          · intro h; refine ⟨h, (hσ (u - 3)).trans ?_⟩
            congr 1; ring
          · exact fun h => h.1
        have hR : ∀ a b : ℕ, a ≤ 3 → b ≤ 3 →
            (c (σ (u - a)) (u - a) = c (σ (u - a)) u ∧ c (σ (u - a)) (u - a) = c (σ (u - a)) (u + ((4 : ℕ) : ZMod n))) →
            (c (σ (u - b)) (u - b) = c (σ (u - b)) u ∧ c (σ (u - b)) (u - b) = c (σ (u - b)) (u + ((4 : ℕ) : ZMod n))) →
            a = b := fun a b ha hb ra rb => hU u 4 a b (by omega) (by omega) huniq ra.1 ra.2 rb.1 rb.2
        obtain ⟨a, ha, hσa, h1, h2⟩ := hD s0 u 4 (by norm_num) (by push_cast; exact hs0)
        have hex : x u 4 = true ∨ (x (u - 1) 1 && x (u - 1) 5) = true ∨
            (x (u - 2) 2 && x (u - 2) 6) = true ∨ x (u - 3) 3 = true := by
          have : a ≤ 3 := by omega
          interval_cases a
          · left; rw [P0, hσa]; exact ⟨h1, h2⟩
          · right; left; rw [P1, hσa]; exact ⟨h1, h2⟩
          · right; right; left; rw [P2, hσa]; exact ⟨h1, h2⟩
          · right; right; right; rw [P3, hσa]; exact ⟨h1, h2⟩
        have n01 : ¬ (x u 4 = true ∧ (x (u - 1) 1 && x (u - 1) 5) = true) := fun h =>
          absurd (hR 0 1 (by norm_num) (by norm_num) (P0.mp h.1) (P1.mp h.2)) (by norm_num)
        have n02 : ¬ (x u 4 = true ∧ (x (u - 2) 2 && x (u - 2) 6) = true) := fun h =>
          absurd (hR 0 2 (by norm_num) (by norm_num) (P0.mp h.1) (P2.mp h.2)) (by norm_num)
        have n03 : ¬ (x u 4 = true ∧ x (u - 3) 3 = true) := fun h =>
          absurd (hR 0 3 (by norm_num) (by norm_num) (P0.mp h.1) (P3.mp h.2)) (by norm_num)
        have n12 : ¬ ((x (u - 1) 1 && x (u - 1) 5) = true ∧ (x (u - 2) 2 && x (u - 2) 6) = true) := fun h =>
          absurd (hR 1 2 (by norm_num) (by norm_num) (P1.mp h.1) (P2.mp h.2)) (by norm_num)
        have n13 : ¬ ((x (u - 1) 1 && x (u - 1) 5) = true ∧ x (u - 3) 3 = true) := fun h =>
          absurd (hR 1 3 (by norm_num) (by norm_num) (P1.mp h.1) (P3.mp h.2)) (by norm_num)
        have n23 : ¬ ((x (u - 2) 2 && x (u - 2) 6) = true ∧ x (u - 3) 3 = true) := fun h =>
          absurd (hR 2 3 (by norm_num) (by norm_num) (P2.mp h.1) (P3.mp h.2)) (by norm_num)
        revert hex n01 n02 n03 n12 n13 n23
        generalize x u 4 = b0; generalize (x (u - 1) 1 && x (u - 1) 5) = b1
        generalize (x (u - 2) 2 && x (u - 2) 6) = b2; generalize x (u - 3) 3 = b3
        revert b0 b1 b2 b3; decide
  9. For every vertex u, exactly two interior classes cover u: ∑_{j=1}^6 x(u - j, j) = 2

    Vertex u belongs to the classes starting at u (layer σ(u)) and at u - 7 (layer σ(u - 7)), which are distinct since n ≥ 22. For the remaining 2 of the 4 layers, hspan guarantees each has a unique class containing u, starting at u - k for some k ∈ {1, ..., 6}. Using `Finset.card_bij`, we establish a bijection between K = {j ∈ {1,...,6} | x(u - j, j) = true} and the 2-element set of remaining layers T = {s ∈ Fin 4 | s ≠ σ(u), s ≠ σ(u - 7)}, showing |K| = 2.

    lines 181–252

    uses sub_add_cancel, Nat.eq_zero_or_pos, Finset.card_bij, Finset.mem_filter, Finset.mem_univ, true_and, Fin.ext, Finset.card_filter, Fin.sum_univ_eight

      have hcount' : ∀ u, (x (u - 1) 1).toNat + (x (u - 2) 2).toNat + (x (u - 3) 3).toNat +
          (x (u - 4) 4).toNat + (x (u - 5) 5).toNat + (x (u - 6) 6).toNat = 2 := by
        intro u
        have hQ : ∀ j : Fin 8, x (u - (j : ℕ)) j = true ↔
            c (σ (u - (j : ℕ))) (u - (j : ℕ)) = c (σ (u - (j : ℕ))) u := fun j => hxs _ _ u (by simp)
        have h7u : c (σ (u - 7)) (u - 7) = c (σ (u - 7)) u := by
          have := hσ (u - 7); rwa [sub_add_cancel] at this
        have hne_start : ∀ k : ℕ, 1 ≤ k → k ≤ 6 → c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - k) ≠ σ u := by
          intro k hk1 hk6 hq heq
          have h1 := hσ (u - k); rw [heq] at h1 hq
          have := hE (σ u) (u - k) u u h1 (hσ u) hq rfl
          have := hsub u k 0 (by omega) (by omega) (by simpa using this)
          omega
        have hne_end : ∀ k : ℕ, 1 ≤ k → k ≤ 6 → c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - k) ≠ σ (u - 7) := by
          intro k hk1 hk6 hq heq
          have h1 := hσ (u - k); rw [heq] at h1 hq
          have := hE (σ (u - 7)) (u - k) (u - 7) u h1 (hσ (u - 7)) hq h7u
          have := hsub u k 7 (by omega) (by omega) (by push_cast; exact this)
          omega
        have hse : σ u ≠ σ (u - 7) := by
          intro heq
          have h2 : c (σ (u - 7)) u = c (σ (u - 7)) (u + 7) := by rw [← heq]; exact hσ u
          have := hE (σ (u - 7)) (u - 7) u u (hσ (u - 7)) h2 h7u rfl
          have := hsub u 7 0 (by omega) (by omega) (by simpa using this)
          omega
        have hinjk : ∀ j k : ℕ, j ≤ 7 → k ≤ 7 → c (σ (u - j)) (u - j) = c (σ (u - j)) u →
            c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - j) = σ (u - k) → j = k := by
          intro j k hj hk qj qk heq
          have h1 := hσ (u - k); rw [← heq] at h1 qk
          exact hsub u j k hj hk (hE _ _ _ u (hσ _) h1 qj qk)
        have hsurj : ∀ s, s ≠ σ u → s ≠ σ (u - 7) → ∃ k : ℕ, 1 ≤ k ∧ k ≤ 6 ∧
            c (σ (u - k)) (u - k) = c (σ (u - k)) u ∧ σ (u - k) = s := by
          intro s hs1 hs2
          obtain ⟨d0, hd0, hsp7, hspu⟩ := hspan s u
          have hσd := hσeq s _ hsp7
          refine ⟨d0, ?_, ?_, by rw [hσd]; exact hspu, hσd⟩
          · rcases Nat.eq_zero_or_pos d0 with h | h
            · subst h; exfalso; apply hs1; rw [← hσd]; simp
            · omega
          · by_contra h
            have h7' : d0 = 7 := by omega
            subst h7'; apply hs2; rw [← hσd]; simp
        let K : Finset (Fin 8) := Finset.univ.filter (fun j => 1 ≤ j.val ∧ j.val ≤ 6 ∧ x (u - (j : ℕ)) j = true)
        let T : Finset (Fin 4) := Finset.univ.filter (fun s => s ≠ σ u ∧ s ≠ σ (u - 7))
        have hT : T.card = 2 := by
          have key : ∀ a e : Fin 4, a ≠ e → (Finset.univ.filter (fun s => s ≠ a ∧ s ≠ e)).card = 2 := by
            decide
          exact key _ _ hse
        have hKT : K.card = T.card := by
          refine Finset.card_bij (s := K) (t := T) (fun (j : Fin 8) _ => σ (u - ((j : ℕ) : ZMod n))) ?_ ?_ ?_
          · intro j hj
            simp only [K, Finset.mem_filter, Finset.mem_univ, true_and] at hj
            simp only [T, Finset.mem_filter, Finset.mem_univ, true_and]
            have hq := (hQ j).mp hj.2.2
            exact ⟨hne_start j hj.1 hj.2.1 hq, hne_end j hj.1 hj.2.1 hq⟩
          · intro j hj k hk heq
            simp only [K, Finset.mem_filter, Finset.mem_univ, true_and] at hj hk
            exact Fin.ext (hinjk j k (by omega) (by omega) ((hQ j).mp hj.2.2) ((hQ k).mp hk.2.2) heq)
          · intro s hs
            simp only [T, Finset.mem_filter, Finset.mem_univ, true_and] at hs
            obtain ⟨k, hk1, hk6, hq, hσk⟩ := hsurj s hs.1 hs.2
            refine ⟨⟨k, by omega⟩, ?_, hσk⟩
            simp only [K, Finset.mem_filter, Finset.mem_univ, true_and]
            exact ⟨hk1, hk6, (hQ ⟨k, by omega⟩).mpr hq⟩
        have hK : K.card = 2 := hKT.trans hT
        simp only [K] at hK
        rw [Finset.card_filter, Fin.sum_univ_eight] at hK
        simp at hK
        revert hK
        generalize x (u - 1) 1 = b1; generalize x (u - 2) 2 = b2; generalize x (u - 3) 3 = b3
        generalize x (u - 4) 4 = b4; generalize x (u - 5) 5 = b5; generalize x (u - 6) 6 = b6
        revert b1 b2 b3 b4 b5 b6; decide
  10. Endpoint indicators and layer weight implications for distances 5 and 2

    By definition of σ, x(p, 0) = true and x(p, 7) = true. Applying `simple_graph_cycle_power_seven_cover_four_layer_weight_eq` and `simple_graph_cycle_power_seven_layer_weight_eq_class_five_imp_one_two_imp_six`, the total weight equality forces any class containing p + 5 to also contain p + 1 (so x(p, 5) ⇒ x(p, 1)), and any class containing p + 2 to also contain p + 6 (so x(p, 2) ⇒ x(p, 6)).

    lines 253–268

    uses simple_graph_cycle_power_seven_cover_four_layer_weight_eq, simple_graph_cycle_power_seven_layer_weight_eq_class_five_imp_one_two_imp_six

      have hx0 : ∀ p, x p 0 = true := fun p => (hxs p 0 p (by simp)).mpr rfl
      have hx7 : ∀ p, x p 7 = true := fun p =>
        (hxs p 7 (p + 7) (by show p + ((7 : ℕ) : ZMod n) = p + 7; push_cast; ring)).mpr (hσ p)
      have hcls : ∀ p, (c (σ p) p = c (σ p) (p + 5) → c (σ p) p = c (σ p) (p + 1)) ∧
          (c (σ p) p = c (σ p) (p + 2) → c (σ p) p = c (σ p) (p + 6)) := fun p =>
        simple_graph_cycle_power_seven_layer_weight_eq_class_five_imp_one_two_imp_six n hn (c (σ p)) (hc (σ p)) (simple_graph_cycle_power_seven_cover_four_layer_weight_eq n hn c hc hcov (σ p)) p (hσ p)
      have h51' : ∀ p, x p 5 = true → x p 1 = true := by
        intro p h
        rw [hxs p 5 (p + 5) (by show p + ((5 : ℕ) : ZMod n) = p + 5; push_cast; ring)] at h
        rw [hxs p 1 (p + 1) (by simp)]
        exact (hcls p).1 h
      have h26' : ∀ p, x p 2 = true → x p 6 = true := by
        intro p h
        rw [hxs p 2 (p + 2) (by show p + ((2 : ℕ) : ZMod n) = p + 2; push_cast; ring)] at h
        rw [hxs p 6 (p + 6) (by show p + ((6 : ℕ) : ZMod n) = p + 6; push_cast; ring)]
        exact (hcls p).2 h
  11. Equality x(i, 1) = x(i, 6) and type sequence classification

    Applying `cycle_power_seven_tight_type_sequence_one_iff_six` establishes that x(i, 1) = x(i, 6) for all i. Then `cycle_power_seven_tight_type_sequence_types` proves that x(p, 1) alternates with period 2 (x(p + 1, 1) = !x(p, 1)) and completely classifies the remaining indicators x(p, j).

    lines 269–271

    uses cycle_power_seven_tight_type_sequence_one_iff_six, cycle_power_seven_tight_type_sequence_types

      have key := cycle_power_seven_tight_type_sequence_one_iff_six n x hx0 hx7 hcount' hd4' hd6' hcov' h51' h26'
      have key := cycle_power_seven_tight_type_sequence_one_iff_six n x hx0 hx7 hcount' hd4' hd6' hcov' h51' h26'
      have T := cycle_power_seven_tight_type_sequence_types n x hcount' hd4' hd6' hcov' h51' h26' key
  12. Shift injectivity within a layer and period-2 invariance x(q - 2, 1) = x(q, 1)

    If two vertices s and t satisfy s + j = t + k = u with j, k < 8 in the same layer σ(s) = σ(t), the classes intersect at u and hence must be identical by class uniqueness, forcing j = k via `add_left_cancel`. The alternation x(p + 1, 1) = !x(p, 1) applied twice gives x(q - 2, 1) = x(q, 1).

    lines 272–288

    uses add_left_cancel

      have hlay : ∀ (u s t : ZMod n) (j k : ℕ) (hj : j < 8) (hk : k < 8), s + (j : ZMod n) = u →
          t + (k : ZMod n) = u → x s ⟨j, hj⟩ = true → x t ⟨k, hk⟩ = true → σ s = σ t → j = k := by
        intro u s t j k hj hk hs ht xs xt hst
        have qs := (hxs s ⟨j, hj⟩ u hs).mp xs
        have qt := (hxs t ⟨k, hk⟩ u ht).mp xt
        rw [← hst] at qt
        have ht7 : c (σ s) t = c (σ s) (t + 7) := by rw [hst]; exact hσ t
        have hst' : s = t := hE (σ s) s t u (hσ s) ht7 qs qt
        subst hst'
        exact hnat j k (by omega) (by omega) (add_left_cancel (hs.trans ht.symm))
      have hN2 : ∀ q, x (q - 2) 1 = x q 1 := by
        intro q
        have a1 := (T (q - 2)).1
        have a2 := (T (q - 1)).1
        rw [show q - 2 + 1 = q - 1 by ring] at a1
        rw [show q - 1 + 1 = q by ring, a1] at a2
        rw [a2]; simp
  13. The 4-layer coloring satisfies all 9 pairwise distinctness conditions on vertices whenever x(p, 1) = true

    When x(p, 1) = true, setting X to be σ(p - 2) (if x(p - 2, 2) = true) or σ(p - 4) (otherwise), the contrapositive of shift injectivity ensures that classes meeting at a common vertex with different offsets must belong to distinct layers. Testing each configuration against the type classification verifies all 9 distinctness inequalities among σ(p), σ(p - 6), X, σ(p + 1), and σ(p - 7).

    lines 289–335

    uses Bool.false_eq_true, if_false, if_true

      have hP : ∀ p, x p 1 = true → ∀ X : Fin 4,
          X = (if x (p - 2) 2 = true then σ (p - 2) else σ (p - 4)) →
          σ p ≠ σ (p - 6) ∧ σ p ≠ X ∧ σ (p - 6) ≠ X ∧
          σ (p + 1) ≠ σ p ∧ σ (p + 1) ≠ σ (p - 6) ∧ σ (p + 1) ≠ X ∧
          σ (p - 7) ≠ σ p ∧ σ (p - 7) ≠ σ (p - 6) ∧ σ (p - 7) ≠ X := by
        intro p hp X hX
        have hp2 : x (p - 2) 1 = true := by rw [hN2]; exact hp
        have hp4 : x (p - 4) 1 = true := by rw [show p - 4 = p - 2 - 2 by ring, hN2]; exact hp2
        have hp6 : x (p - 6) 1 = true := by rw [show p - 6 = p - 4 - 2 by ring, hN2]; exact hp4
        obtain ⟨t32, -, -, t26⟩ := (T (p - 2)).2.2 hp2
        obtain ⟨-, t54, t4, -⟩ := (T (p - 4)).2.2 hp4
        rw [show p - 2 - 4 = p - 6 by ring] at t26
        rw [show p - 4 - 2 = p - 6 by ring, ← t26] at t4
        have x66 : x (p - 6) 6 = true := by rw [← key]; exact hp6
        have x0 : ∀ q, x q 0 = true := hx0
        have x7 : ∀ q, x q 7 = true := hx7
        have ne : ∀ (u s t : ZMod n) (j k : ℕ) (hj : j < 8) (hk : k < 8), j ≠ k → s + (j : ZMod n) = u →
            t + (k : ZMod n) = u → x s ⟨j, hj⟩ = true → x t ⟨k, hk⟩ = true → σ s ≠ σ t :=
          fun u s t j k hj hk hjk hs ht xs xt h => hjk (hlay u s t j k hj hk hs ht xs xt h)
        cases hA : x (p - 2) 2
        · simp only [hA, Bool.false_eq_true, if_false] at hX
          subst hX
          rw [hA] at t4
          rw [t4] at t54
          have x45 : x (p - 4) 5 = true := by rw [t54]; rfl
          have x44 : x (p - 4) 4 = true := by rw [t4]; rfl
          exact ⟨ne (p + 1) p (p - 6) 1 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp (x7 _),
            ne (p + 1) p (p - 4) 1 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp x45,
            ne (p + 1) (p - 6) (p - 4) 7 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x45,
            ne (p + 1) (p + 1) p 0 1 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) hp,
            ne (p + 1) (p + 1) (p - 6) 0 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) (x7 _),
            ne (p + 1) (p + 1) (p - 4) 0 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) x45,
            ne p (p - 7) p 7 0 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) (x0 _),
            ne p (p - 7) (p - 6) 7 6 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x66,
            ne p (p - 7) (p - 4) 7 4 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x44⟩
        · simp only [hA, if_true] at hX
          subst hX
          have x23 : x (p - 2) 3 = true := by rw [t32]; exact hA
          exact ⟨ne (p + 1) p (p - 6) 1 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp (x7 _),
            ne (p + 1) p (p - 2) 1 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp x23,
            ne (p + 1) (p - 6) (p - 2) 7 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x23,
            ne (p + 1) (p + 1) p 0 1 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) hp,
            ne (p + 1) (p + 1) (p - 6) 0 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) (x7 _),
            ne (p + 1) (p + 1) (p - 2) 0 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) x23,
            ne p (p - 7) p 7 0 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) (x0 _),
            ne p (p - 7) (p - 6) 7 6 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x66,
            ne p (p - 7) (p - 2) 7 2 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) hA⟩
  14. 8 divides n

    With the period-2 alternating predicate N(p) = x(p, 1), the invariant indicator a(p) = x(p, 2), and the verified distinctness conditions hP, invoking the theorem `cycle_power_seven_tight_layer_colouring_dvd` completes the proof that 8 ∣ n.

    lines 336–337

    uses cycle_power_seven_tight_layer_colouring_dvd

      exact cycle_power_seven_tight_layer_colouring_dvd n σ (fun p => x p 1) (fun p => x p 2)
        (fun p => (T p).1) (fun p hp => ((T p).2.2 hp).2.2.2) hP
zmod_intCast_eq_intCast_iff_of_abs_sub_lt
If the difference between two integers is strictly less than n in absolute value, their modular reductions modulo n are equal if and only if the integers themselves are equal.
abs_lt
The absolute value of a is strictly less than b if and only if -b < a and a < b.
ZMod.natCast_eq_natCast_iff'
Two natural numbers have equal reductions modulo c if and only if their remainders modulo c are equal.
Nat.mod_eq_of_lt
If a natural number a is strictly less than b, then a modulo b equals a.
simple_graph_cycle_power_seven_adj_iff
In the cycle power C_n^7 with n ≥ 22, two vertices u and v are adjacent if and only if v = u + e for some nonzero integer e with |e| ≤ 7.
Ne.symm
Symmetry of inequality: if a ≠ b, then b ≠ a.
abs_le
The absolute value of a is at most b if and only if -b ≤ a and a ≤ b.
le_refl
Reflexivity of the ordering: a ≤ a.
sub_right_injective
The subtraction map x ↦ b - x is injective.
Bool.and_eq_true
The boolean conjunction a && b is true if and only if both a and b are true.
Iff.rfl
Reflexivity of logical equivalence: P ↔ P.
sub_add_cancel
Subtracting and then adding b returns the original element: a - b + b = a.
Nat.eq_zero_or_pos
Every natural number is either zero or strictly positive.
Finset.card_bij
A bijection between two finite sets implies they have the same cardinality.
Finset.mem_filter
An element belongs to a filtered finite set if and only if it belongs to the base set and satisfies the predicate.
Finset.mem_univ
Every element of a finite type belongs to its universal Finset.
true_and
Conjunction with True simplifies to the proposition itself: True ∧ P ↔ P.
Fin.ext
Two elements of Fin n are equal if and only if their underlying natural values are equal.
Finset.card_filter
The cardinality of a filtered subset equals the sum of indicator values (1 if true, 0 if false) over the set.
Fin.sum_univ_eight
The sum of a function over Fin 8 equals the sum of its values at indices 0 through 7.
simple_graph_cycle_power_seven_cover_four_layer_weight_eq
In any 4-cover of C_n^7, the total layer weight (counting distance-7 pairs with weight 2, and distance-6 and distance-4 pairs with weight 1) equals n.
simple_graph_cycle_power_seven_layer_weight_eq_class_five_imp_one_two_imp_six
Under the layer weight identity, within any distance-7 class, containing distance 5 implies containing distance 1, and containing distance 2 implies containing distance 6.
cycle_power_seven_tight_type_sequence_one_iff_six
For any sequence x satisfying the tightness constraints on C_n^7, the indicator x(i, 1) equals x(i, 6) for all vertices i.
cycle_power_seven_tight_type_sequence_types
Classifies the type sequence x: x(p, 1) alternates with period 2, and all other indicators x(p, j) are uniquely determined by x(p, 1) and x(p, 2).
add_left_cancel
Left cancellation in an additive group: a + b = a + c implies b = c.
Bool.false_eq_true
The equality false = true simplifies to False.
if_false
An if-then-else on a false condition evaluates to the else branch.
if_true
An if-then-else on a true condition evaluates to the then branch.
cycle_power_seven_tight_layer_colouring_dvd
If a 4-layer coloring of C_n^7 satisfies the period-2 alternating condition and the 9 pairwise distinctness conditions across an 8-step cycle, then 8 divides n.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

Lean’s trace was cut to the first 400 of 596 tactics.

theorem simple_graph_cycle_power_seven_cover_four_tight_dvd (n : ℕ) [NeZero n] (hn : 22 ≤ n)    (c : Fin 4 → ZMod n → ZMod n)    (hc : ∀ s u v, u ≠ v → c s u = c s v → (simple_graph_cycle_power n 7).Adj u v)    (hcov : ∀ u v, (simple_graph_cycle_power n 7).Adj u v → ∃ s, c s u = c s v)    (h7 : ∀ i, ∃! s, c s i = c s (i + 7)) (h6 : ∀ i, ∃! s, c s i = c s (i + 6))    (h4 : ∀ i, ∃! s, c s i = c s (i + 4))    (hspan : ∀ s i, ∃ d : ℕ, d ≤ 7 ∧ c s (i - d) = c s (i - d + 7) ∧ c s (i - d) = c s i) :    8 ∣ n := by  have hinj : ∀ a b : ℤ, a - b < n → b - a < n → (a : ZMod n) = (b : ZMod n) → a = b :=    fun a b h1 h2 e => (zmod_intCast_eq_intCast_iff_of_abs_sub_lt n a b      (by rw [abs_lt]; constructor <;> omega)).mp e  have hnat : ∀ a b : ℕ, a < n → b < n → (a : ZMod n) = (b : ZMod n) → a = b := by    intro a b ha hb e    rw [ZMod.natCast_eq_natCast_iff'] at e    rwa [Nat.mod_eq_of_lt ha, Nat.mod_eq_of_lt hb] at e  -- every member of a class containing p and p + 7 lies in p .. p + 7  have hA : ∀ s p v, c s p = c s (p + 7) → c s p = c s v →      ∃ e : ℤ, 0 ≤ e ∧ e ≤ 7 ∧ v = p + (e : ZMod n) := by    intro s p v h1 h2    by_cases hv : v = p    · exact ⟨0, le_refl _, by norm_num, by simp [hv]⟩    obtain ⟨e, he0, he7, rfl⟩ :=      (simple_graph_cycle_power_seven_adj_iff n hn p v).mp (hc s p v (Ne.symm hv) h2)    rw [abs_le] at he7    by_cases hv7 : p + (e : ZMod n) = p + 7    · have h' : (e : ZMod n) = ((7 : ℤ) : ZMod n) := by push_cast; linear_combination hv7      have := hinj e 7 (by omega) (by omega) h'      exact ⟨e, by omega, by omega, rfl⟩    · obtain ⟨e', _, he'7, he'⟩ := (simple_graph_cycle_power_seven_adj_iff n hn (p + 7) (p + e)).mp        (hc s (p + 7) (p + e) (Ne.symm hv7) (h1.symm.trans h2))      rw [abs_le] at he'7      have h' : (e : ZMod n) = ((7 + e' : ℤ) : ZMod n) := by push_cast; linear_combination he'      have := hinj e (7 + e') (by omega) (by omega) h'      exact ⟨e, by omega, by omega, rfl⟩  -- two classes of one layer, each spanned by a distance-7 pair, that meet are the same  have hE : ∀ s (p q w : ZMod n), c s p = c s (p + 7) → c s q = c s (q + 7) →      c s p = c s w → c s q = c s w → p = q := by    intro s p q w hp hq hpw hqw    obtain ⟨e, he0, he7, rfl⟩ := hA s p q hp (hpw.trans hqw.symm)    obtain ⟨e', he'0, he'7, he'⟩ := hA s p (p + e + 7) hp (hpw.trans (hqw.symm.trans hq))    have h' : ((e + 7 : ℤ) : ZMod n) = (e' : ZMod n) := by push_cast; linear_combination he'    have := hinj (e + 7) e' (by omega) (by omega) h'    have he : e = 0 := by omega    simp [he]  have h7' : ∀ i, ∃ s, c s i = c s (i + 7) ∧ ∀ t, c t i = c t (i + 7) → t = s := fun i => h7 i  choose σ hσ hσu using h7'  -- a pair at distance d covered by layer s lies in the class starting at some u - a  have hD : ∀ (s : Fin 4) (u : ZMod n) (d : ℕ), d ≤ 7 → c s u = c s (u + d) →      ∃ a : ℕ, a + d ≤ 7 ∧ σ (u - a) = s ∧ c s (u - a) = c s u ∧ c s (u - a) = c s (u + d) := by    intro s u d hd h    obtain ⟨d0, hd0, hsp7, hspu⟩ := hspan s u    have hs : s = σ (u - d0) := hσu (u - d0) s hsp7    obtain ⟨e, he0, he7, he⟩ := hA s (u - d0) (u + d) hsp7 (hspu.trans h)    have h' : ((d : ℤ) : ZMod n) = ((e - d0 : ℤ) : ZMod n) := by push_cast; linear_combination he    have := hinj d (e - d0) (by omega) (by omega) h'    exact ⟨d0, by omega, hs.symm, hspu, hspu.trans h⟩  have hsub : ∀ (u : ZMod n) (a b : ℕ), a ≤ 7 → b ≤ 7 → u - (a : ZMod n) = u - (b : ZMod n) → a = b :=    fun u a b ha hb e => hnat a b (by omega) (by omega) (sub_right_injective e)  obtain ⟨x, hx⟩ : ∃ x : ZMod n → Fin 8 → Bool,      ∀ p j, x p j = decide (c (σ p) p = c (σ p) (p + ((j : ℕ) : ZMod n))) := ⟨_, fun _ _ => rfl⟩  have hxs : ∀ (p : ZMod n) (j : Fin 8) (q : ZMod n), p + ((j : ℕ) : ZMod n) = q →      (x p j = true ↔ c (σ p) p = c (σ p) q) := by    intro p j q h; rw [hx, ← h]; simp  -- σ is determined by any distance-7 pair  have hσeq : ∀ s p, c s p = c s (p + 7) → σ p = s := fun s p h => (hσu p s h).symm  -- two classes starting at u - a and u - b both containing u and u + d, with d covered once  have hU : ∀ (u : ZMod n) (d a b : ℕ), a ≤ 7 → b ≤ 7 →      (∀ s t, c s u = c s (u + d) → c t u = c t (u + d) → s = t) →      c (σ (u - a)) (u - a) = c (σ (u - a)) u → c (σ (u - a)) (u - a) = c (σ (u - a)) (u + d) →      c (σ (u - b)) (u - b) = c (σ (u - b)) u → c (σ (u - b)) (u - b) = c (σ (u - b)) (u + d) →      a = b := by    intro u d a b ha hb huniq h1 h2 h3 h4    have hst : σ (u - a) = σ (u - b) := huniq _ _ (h1.symm.trans h2) (h3.symm.trans h4)    have hb7 := hσ (u - b)    rw [← hst] at hb7 h3    exact hsub u a b ha hb (hE _ _ _ u (hσ _) hb7 h1 h3)  have hcov' : ∀ (d : ℕ) (u : ZMod n), d ∈ ({1, 2, 3, 5} : Finset ℕ) →      ∃ j : Fin 8, ∃ hj : j.val + d ≤ 7, x (u - j.val) j = true ∧        x (u - j.val) ⟨j.val + d, by omega⟩ = true := by    intro d u hd    have hd7 : d ≤ 7 := by simp at hd; omega    have hadj : (simple_graph_cycle_power n 7).Adj u (u + (d : ZMod n)) := by      rw [simple_graph_cycle_power_seven_adj_iff n hn]      refine ⟨d, ?_, ?_, by push_cast; rfl⟩      · simp at hd; omega      · rw [abs_le]; constructor <;> omega    obtain ⟨s, hs⟩ := hcov u _ hadj    obtain ⟨a, ha, hσa, h1, h2⟩ := hD s u d hd7 hs    refine ⟨⟨a, by omega⟩, ha, ?_, ?_⟩    · rw [hxs _ _ u (by simp)]; rw [hσa]; exact h1    · rw [hxs _ _ (u + d) (by simp; ring)]; rw [hσa]; exact h2  have hd6' : ∀ u, (x (u - 1) 1).toNat + (x u 6).toNat = 1 := by    intro u    have e1 := hxs (u - 1) 1 u (by simp)    have e6 := hxs u 6 (u + 6) (by show u + ((6 : ℕ) : ZMod n) = u + 6; push_cast; ring)    obtain ⟨s0, hs0, hs0u⟩ := h6 u    have huniq : ∀ s t, c s u = c s (u + ((6 : ℕ) : ZMod n)) → c t u = c t (u + ((6 : ℕ) : ZMod n)) → s = t := by      intro s t hs ht; push_cast at hs ht; exact (hs0u s hs).trans (hs0u t ht).symm    have P1 : x (u - 1) 1 = true ↔ (c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) u ∧        c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) (u + ((6 : ℕ) : ZMod n))) := by      rw [e1]; push_cast      constructor      · intro h; refine ⟨h, (hσ (u - 1)).trans ?_⟩        congr 1; ring      · exact fun h => h.1    have P6 : x u 6 = true ↔ (c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) u ∧        c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) (u + ((6 : ℕ) : ZMod n))) := by      rw [e6]; push_cast; simp    obtain ⟨a, ha, hσa, h1, h2⟩ := hD s0 u 6 (by norm_num) (by push_cast; exact hs0)    have hex : x (u - 1) 1 = true ∨ x u 6 = true := by      have : a ≤ 1 := by omega      interval_cases a      · right; rw [P6]; rw [hσa]; exact ⟨h1, h2⟩      · left; rw [P1]; rw [hσa]; exact ⟨h1, h2⟩    have hne : ¬ (x (u - 1) 1 = true ∧ x u 6 = true) := by      rintro ⟨q1, q6⟩      rw [P1] at q1; rw [P6] at q6      have := hU u 6 1 0 (by norm_num) (by norm_num) huniq q1.1 q1.2 q6.1 q6.2      omega    revert hex hne    generalize x (u - 1) 1 = b1; generalize x u 6 = b6    revert b1 b6; decide  have hd4' : ∀ u, (x u 4).toNat + (x (u - 1) 1 && x (u - 1) 5).toNat +      (x (u - 2) 2 && x (u - 2) 6).toNat + (x (u - 3) 3).toNat = 1 := by    intro u    obtain ⟨s0, hs0, hs0u⟩ := h4 u    have huniq : ∀ s t, c s u = c s (u + ((4 : ℕ) : ZMod n)) → c t u = c t (u + ((4 : ℕ) : ZMod n)) → s = t := by      intro s t hs ht; push_cast at hs ht; exact (hs0u s hs).trans (hs0u t ht).symm    have P0 : x u 4 = true ↔ (c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) u ∧        c (σ (u - ((0 : ℕ) : ZMod n))) (u - ((0 : ℕ) : ZMod n)) = c (σ (u - ((0 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by      rw [hxs u 4 (u + 4) (by show u + ((4 : ℕ) : ZMod n) = u + 4; push_cast; ring)]; push_cast; simp    have P1 : (x (u - 1) 1 && x (u - 1) 5) = true ↔ (c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) u ∧        c (σ (u - ((1 : ℕ) : ZMod n))) (u - ((1 : ℕ) : ZMod n)) = c (σ (u - ((1 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by      rw [Bool.and_eq_true, hxs (u - 1) 1 u (by simp),        hxs (u - 1) 5 (u + 4) (by show u - 1 + ((5 : ℕ) : ZMod n) = u + 4; push_cast; ring)]      push_cast; exact Iff.rfl    have P2 : (x (u - 2) 2 && x (u - 2) 6) = true ↔ (c (σ (u - ((2 : ℕ) : ZMod n))) (u - ((2 : ℕ) : ZMod n)) = c (σ (u - ((2 : ℕ) : ZMod n))) u ∧        c (σ (u - ((2 : ℕ) : ZMod n))) (u - ((2 : ℕ) : ZMod n)) = c (σ (u - ((2 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by      rw [Bool.and_eq_true, hxs (u - 2) 2 u (by show u - 2 + ((2 : ℕ) : ZMod n) = u; push_cast; ring),        hxs (u - 2) 6 (u + 4) (by show u - 2 + ((6 : ℕ) : ZMod n) = u + 4; push_cast; ring)]      push_cast; exact Iff.rfl    have P3 : x (u - 3) 3 = true ↔ (c (σ (u - ((3 : ℕ) : ZMod n))) (u - ((3 : ℕ) : ZMod n)) = c (σ (u - ((3 : ℕ) : ZMod n))) u ∧        c (σ (u - ((3 : ℕ) : ZMod n))) (u - ((3 : ℕ) : ZMod n)) = c (σ (u - ((3 : ℕ) : ZMod n))) (u + ((4 : ℕ) : ZMod n))) := by      rw [hxs (u - 3) 3 u (by show u - 3 + ((3 : ℕ) : ZMod n) = u; push_cast; ring)]      push_cast      constructor      · intro h; refine ⟨h, (hσ (u - 3)).trans ?_⟩        congr 1; ring      · exact fun h => h.1    have hR : ∀ a b : ℕ, a ≤ 3 → b ≤ 3 →        (c (σ (u - a)) (u - a) = c (σ (u - a)) u ∧ c (σ (u - a)) (u - a) = c (σ (u - a)) (u + ((4 : ℕ) : ZMod n))) →        (c (σ (u - b)) (u - b) = c (σ (u - b)) u ∧ c (σ (u - b)) (u - b) = c (σ (u - b)) (u + ((4 : ℕ) : ZMod n))) →        a = b := fun a b ha hb ra rb => hU u 4 a b (by omega) (by omega) huniq ra.1 ra.2 rb.1 rb.2    obtain ⟨a, ha, hσa, h1, h2⟩ := hD s0 u 4 (by norm_num) (by push_cast; exact hs0)    have hex : x u 4 = true ∨ (x (u - 1) 1 && x (u - 1) 5) = true ∨        (x (u - 2) 2 && x (u - 2) 6) = true ∨ x (u - 3) 3 = true := by      have : a ≤ 3 := by omega      interval_cases a      · left; rw [P0, hσa]; exact ⟨h1, h2⟩      · right; left; rw [P1, hσa]; exact ⟨h1, h2⟩      · right; right; left; rw [P2, hσa]; exact ⟨h1, h2⟩      · right; right; right; rw [P3, hσa]; exact ⟨h1, h2⟩    have n01 : ¬ (x u 4 = true ∧ (x (u - 1) 1 && x (u - 1) 5) = true) := fun h =>      absurd (hR 0 1 (by norm_num) (by norm_num) (P0.mp h.1) (P1.mp h.2)) (by norm_num)    have n02 : ¬ (x u 4 = true ∧ (x (u - 2) 2 && x (u - 2) 6) = true) := fun h =>      absurd (hR 0 2 (by norm_num) (by norm_num) (P0.mp h.1) (P2.mp h.2)) (by norm_num)    have n03 : ¬ (x u 4 = true ∧ x (u - 3) 3 = true) := fun h =>      absurd (hR 0 3 (by norm_num) (by norm_num) (P0.mp h.1) (P3.mp h.2)) (by norm_num)    have n12 : ¬ ((x (u - 1) 1 && x (u - 1) 5) = true ∧ (x (u - 2) 2 && x (u - 2) 6) = true) := fun h =>      absurd (hR 1 2 (by norm_num) (by norm_num) (P1.mp h.1) (P2.mp h.2)) (by norm_num)    have n13 : ¬ ((x (u - 1) 1 && x (u - 1) 5) = true ∧ x (u - 3) 3 = true) := fun h =>      absurd (hR 1 3 (by norm_num) (by norm_num) (P1.mp h.1) (P3.mp h.2)) (by norm_num)    have n23 : ¬ ((x (u - 2) 2 && x (u - 2) 6) = true ∧ x (u - 3) 3 = true) := fun h =>      absurd (hR 2 3 (by norm_num) (by norm_num) (P2.mp h.1) (P3.mp h.2)) (by norm_num)    revert hex n01 n02 n03 n12 n13 n23    generalize x u 4 = b0; generalize (x (u - 1) 1 && x (u - 1) 5) = b1    generalize (x (u - 2) 2 && x (u - 2) 6) = b2; generalize x (u - 3) 3 = b3    revert b0 b1 b2 b3; decide  have hcount' : ∀ u, (x (u - 1) 1).toNat + (x (u - 2) 2).toNat + (x (u - 3) 3).toNat +      (x (u - 4) 4).toNat + (x (u - 5) 5).toNat + (x (u - 6) 6).toNat = 2 := by    intro u    have hQ : ∀ j : Fin 8, x (u - (j : ℕ)) j = true ↔        c (σ (u - (j : ℕ))) (u - (j : ℕ)) = c (σ (u - (j : ℕ))) u := fun j => hxs _ _ u (by simp)    have h7u : c (σ (u - 7)) (u - 7) = c (σ (u - 7)) u := by      have := hσ (u - 7); rwa [sub_add_cancel] at this    have hne_start : ∀ k : ℕ, 1 ≤ k → k ≤ 6 → c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - k) ≠ σ u := by      intro k hk1 hk6 hq heq      have h1 := hσ (u - k); rw [heq] at h1 hq      have := hE (σ u) (u - k) u u h1 (hσ u) hq rfl      have := hsub u k 0 (by omega) (by omega) (by simpa using this)      omega    have hne_end : ∀ k : ℕ, 1 ≤ k → k ≤ 6 → c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - k) ≠ σ (u - 7) := by      intro k hk1 hk6 hq heq      have h1 := hσ (u - k); rw [heq] at h1 hq      have := hE (σ (u - 7)) (u - k) (u - 7) u h1 (hσ (u - 7)) hq h7u      have := hsub u k 7 (by omega) (by omega) (by push_cast; exact this)      omega    have hse : σ u ≠ σ (u - 7) := by      intro heq      have h2 : c (σ (u - 7)) u = c (σ (u - 7)) (u + 7) := by rw [← heq]; exact hσ u      have := hE (σ (u - 7)) (u - 7) u u (hσ (u - 7)) h2 h7u rfl      have := hsub u 7 0 (by omega) (by omega) (by simpa using this)      omega    have hinjk : ∀ j k : ℕ, j ≤ 7 → k ≤ 7 → c (σ (u - j)) (u - j) = c (σ (u - j)) u →        c (σ (u - k)) (u - k) = c (σ (u - k)) u → σ (u - j) = σ (u - k) → j = k := by      intro j k hj hk qj qk heq      have h1 := hσ (u - k); rw [← heq] at h1 qk      exact hsub u j k hj hk (hE _ _ _ u (hσ _) h1 qj qk)    have hsurj : ∀ s, s ≠ σ u → s ≠ σ (u - 7) → ∃ k : ℕ, 1 ≤ k ∧ k ≤ 6 ∧        c (σ (u - k)) (u - k) = c (σ (u - k)) u ∧ σ (u - k) = s := by      intro s hs1 hs2      obtain ⟨d0, hd0, hsp7, hspu⟩ := hspan s u      have hσd := hσeq s _ hsp7      refine ⟨d0, ?_, ?_, by rw [hσd]; exact hspu, hσd⟩      · rcases Nat.eq_zero_or_pos d0 with h | h        · subst h; exfalso; apply hs1; rw [← hσd]; simp        · omega      · by_contra h        have h7' : d0 = 7 := by omega        subst h7'; apply hs2; rw [← hσd]; simp    let K : Finset (Fin 8) := Finset.univ.filter (fun j => 1 ≤ j.val ∧ j.val ≤ 6 ∧ x (u - (j : ℕ)) j = true)    let T : Finset (Fin 4) := Finset.univ.filter (fun s => s ≠ σ u ∧ s ≠ σ (u - 7))    have hT : T.card = 2 := by      have key : ∀ a e : Fin 4, a ≠ e → (Finset.univ.filter (fun s => s ≠ a ∧ s ≠ e)).card = 2 := by        decide      exact key _ _ hse    have hKT : K.card = T.card := by      refine Finset.card_bij (s := K) (t := T) (fun (j : Fin 8) _ => σ (u - ((j : ℕ) : ZMod n))) ?_ ?_ ?_      · intro j hj        simp only [K, Finset.mem_filter, Finset.mem_univ, true_and] at hj        simp only [T, Finset.mem_filter, Finset.mem_univ, true_and]        have hq := (hQ j).mp hj.2.2        exact ⟨hne_start j hj.1 hj.2.1 hq, hne_end j hj.1 hj.2.1 hq⟩      · intro j hj k hk heq        simp only [K, Finset.mem_filter, Finset.mem_univ, true_and] at hj hk        exact Fin.ext (hinjk j k (by omega) (by omega) ((hQ j).mp hj.2.2) ((hQ k).mp hk.2.2) heq)      · intro s hs        simp only [T, Finset.mem_filter, Finset.mem_univ, true_and] at hs        obtain ⟨k, hk1, hk6, hq, hσk⟩ := hsurj s hs.1 hs.2        refine ⟨⟨k, by omega⟩, ?_, hσk⟩        simp only [K, Finset.mem_filter, Finset.mem_univ, true_and]        exact ⟨hk1, hk6, (hQ ⟨k, by omega⟩).mpr hq⟩    have hK : K.card = 2 := hKT.trans hT    simp only [K] at hK    rw [Finset.card_filter, Fin.sum_univ_eight] at hK    simp at hK    revert hK    generalize x (u - 1) 1 = b1; generalize x (u - 2) 2 = b2; generalize x (u - 3) 3 = b3    generalize x (u - 4) 4 = b4; generalize x (u - 5) 5 = b5; generalize x (u - 6) 6 = b6    revert b1 b2 b3 b4 b5 b6; decide  have hx0 : ∀ p, x p 0 = true := fun p => (hxs p 0 p (by simp)).mpr rfl  have hx7 : ∀ p, x p 7 = true := fun p =>    (hxs p 7 (p + 7) (by show p + ((7 : ℕ) : ZMod n) = p + 7; push_cast; ring)).mpr (hσ p)  have hcls : ∀ p, (c (σ p) p = c (σ p) (p + 5) → c (σ p) p = c (σ p) (p + 1)) ∧      (c (σ p) p = c (σ p) (p + 2) → c (σ p) p = c (σ p) (p + 6)) := fun p =>    simple_graph_cycle_power_seven_layer_weight_eq_class_five_imp_one_two_imp_six n hn (c (σ p)) (hc (σ p)) (simple_graph_cycle_power_seven_cover_four_layer_weight_eq n hn c hc hcov (σ p)) p (hσ p)  have h51' : ∀ p, x p 5 = true → x p 1 = true := by    intro p h    rw [hxs p 5 (p + 5) (by show p + ((5 : ℕ) : ZMod n) = p + 5; push_cast; ring)] at h    rw [hxs p 1 (p + 1) (by simp)]    exact (hcls p).1 h  have h26' : ∀ p, x p 2 = true → x p 6 = true := by    intro p h    rw [hxs p 2 (p + 2) (by show p + ((2 : ℕ) : ZMod n) = p + 2; push_cast; ring)] at h    rw [hxs p 6 (p + 6) (by show p + ((6 : ℕ) : ZMod n) = p + 6; push_cast; ring)]    exact (hcls p).2 h  have key := cycle_power_seven_tight_type_sequence_one_iff_six n x hx0 hx7 hcount' hd4' hd6' hcov' h51' h26'  have key := cycle_power_seven_tight_type_sequence_one_iff_six n x hx0 hx7 hcount' hd4' hd6' hcov' h51' h26'  have T := cycle_power_seven_tight_type_sequence_types n x hcount' hd4' hd6' hcov' h51' h26' key  have hlay : ∀ (u s t : ZMod n) (j k : ℕ) (hj : j < 8) (hk : k < 8), s + (j : ZMod n) = u →      t + (k : ZMod n) = u → x s ⟨j, hj⟩ = true → x t ⟨k, hk⟩ = true → σ s = σ t → j = k := by    intro u s t j k hj hk hs ht xs xt hst    have qs := (hxs s ⟨j, hj⟩ u hs).mp xs    have qt := (hxs t ⟨k, hk⟩ u ht).mp xt    rw [← hst] at qt    have ht7 : c (σ s) t = c (σ s) (t + 7) := by rw [hst]; exact hσ t    have hst' : s = t := hE (σ s) s t u (hσ s) ht7 qs qt    subst hst'    exact hnat j k (by omega) (by omega) (add_left_cancel (hs.trans ht.symm))  have hN2 : ∀ q, x (q - 2) 1 = x q 1 := by    intro q    have a1 := (T (q - 2)).1    have a2 := (T (q - 1)).1    rw [show q - 2 + 1 = q - 1 by ring] at a1    rw [show q - 1 + 1 = q by ring, a1] at a2    rw [a2]; simp  have hP : ∀ p, x p 1 = true → ∀ X : Fin 4,      X = (if x (p - 2) 2 = true then σ (p - 2) else σ (p - 4)) →      σ p ≠ σ (p - 6) ∧ σ p ≠ X ∧ σ (p - 6) ≠ X ∧      σ (p + 1) ≠ σ p ∧ σ (p + 1) ≠ σ (p - 6) ∧ σ (p + 1) ≠ X ∧      σ (p - 7) ≠ σ p ∧ σ (p - 7) ≠ σ (p - 6) ∧ σ (p - 7) ≠ X := by    intro p hp X hX    have hp2 : x (p - 2) 1 = true := by rw [hN2]; exact hp    have hp4 : x (p - 4) 1 = true := by rw [show p - 4 = p - 2 - 2 by ring, hN2]; exact hp2    have hp6 : x (p - 6) 1 = true := by rw [show p - 6 = p - 4 - 2 by ring, hN2]; exact hp4    obtain ⟨t32, -, -, t26⟩ := (T (p - 2)).2.2 hp2    obtain ⟨-, t54, t4, -⟩ := (T (p - 4)).2.2 hp4    rw [show p - 2 - 4 = p - 6 by ring] at t26    rw [show p - 4 - 2 = p - 6 by ring, ← t26] at t4    have x66 : x (p - 6) 6 = true := by rw [← key]; exact hp6    have x0 : ∀ q, x q 0 = true := hx0    have x7 : ∀ q, x q 7 = true := hx7    have ne : ∀ (u s t : ZMod n) (j k : ℕ) (hj : j < 8) (hk : k < 8), j ≠ k → s + (j : ZMod n) = u →        t + (k : ZMod n) = u → x s ⟨j, hj⟩ = true → x t ⟨k, hk⟩ = true → σ s ≠ σ t :=      fun u s t j k hj hk hjk hs ht xs xt h => hjk (hlay u s t j k hj hk hs ht xs xt h)    cases hA : x (p - 2) 2    · simp only [hA, Bool.false_eq_true, if_false] at hX      subst hX      rw [hA] at t4      rw [t4] at t54      have x45 : x (p - 4) 5 = true := by rw [t54]; rfl      have x44 : x (p - 4) 4 = true := by rw [t4]; rfl      exact ⟨ne (p + 1) p (p - 6) 1 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp (x7 _),        ne (p + 1) p (p - 4) 1 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp x45,        ne (p + 1) (p - 6) (p - 4) 7 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x45,        ne (p + 1) (p + 1) p 0 1 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) hp,        ne (p + 1) (p + 1) (p - 6) 0 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) (x7 _),        ne (p + 1) (p + 1) (p - 4) 0 5 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) x45,        ne p (p - 7) p 7 0 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) (x0 _),        ne p (p - 7) (p - 6) 7 6 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x66,        ne p (p - 7) (p - 4) 7 4 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x44⟩    · simp only [hA, if_true] at hX      subst hX      have x23 : x (p - 2) 3 = true := by rw [t32]; exact hA      exact ⟨ne (p + 1) p (p - 6) 1 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp (x7 _),        ne (p + 1) p (p - 2) 1 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) hp x23,        ne (p + 1) (p - 6) (p - 2) 7 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x23,        ne (p + 1) (p + 1) p 0 1 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) hp,        ne (p + 1) (p + 1) (p - 6) 0 7 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) (x7 _),        ne (p + 1) (p + 1) (p - 2) 0 3 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x0 _) x23,        ne p (p - 7) p 7 0 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) (x0 _),        ne p (p - 7) (p - 6) 7 6 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) x66,        ne p (p - 7) (p - 2) 7 2 (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) (by push_cast; ring) (x7 _) hA⟩  exact cycle_power_seven_tight_layer_colouring_dvd n σ (fun p => x p 1) (fun p => x p 2)    (fun p => (T p).1) (fun p hp => ((T p).2.2 hp).2.2.2) hP
See it in the graphDiscuss this resultChallenge it