AFTD Auto-Formalizing Theoretical Domains

cycle_power_dyadic_regular_continuation_right_next_paired_high

theoremverified

Part of the rightward continuation, uniform in the exponent. Let t ≥ 2 and D = 2^(t+1). In a tight, exactly dyadically covered, fully covered integer Boolean class model at exponent t+1 with exactly t+2 active classes at every vertex, suppose that for every root r with p0 - 3·2^t ≤ r ≤ p0: if p0 - r is even, the class rooted at r contains offset 1 and its offsets come in consecutive pairs (2i and 2i+1 both in or both out, i < 2^t); if p0 - r is odd, that class consists of its two endpoints only, and suppose the class rooted at p0+1 consists of its two endpoints only. Then for every 1 ≤ i ≤ t the class rooted at p0+2 contains offset D - 2^i exactly when it contains offset D - 2^i + 1.

Statement

theorem cycle_power_dyadic_regular_continuation_right_next_paired_high (t : ℕ) (ht : 2 ≤ t)
    (x : ℤ → ℕ → Bool)
    (htight : ∀ p, cycle_power_dyadic_class_weight (t+1) (x p) =
      (Finset.range (2^(t+1))).sum (fun a => (x p a).toNat))
    (hexact : ∀ i < t+1, ∀ v : ℤ, (Finset.range (2^i)).sum (fun a =>
      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+2^(t+1)-2^i)).toNat) = 1)
    (hcover : ∀ d : ℕ, 1 ≤ d → d < 2^(t+1) → ∀ v : ℤ,
      ∃ a : ℕ, a < 2^(t+1)-d ∧ x (v-(a : ℤ)) a = true ∧
        x (v-(a : ℤ)) (a+d) = true)
    (hcount : ∀ v : ℤ, (Finset.range (2^(t+1))).sum (fun a =>
      (x (v-(a : ℤ)) a).toNat) = (t+1)+1)
    (p0 : ℤ)
    (hreg : ∀ r : ℤ, p0 - 3*2^t ≤ r → r ≤ p0 →
      ((p0 - r) % 2 = 0 → x r 1 = true ∧ ∀ i < 2^t, x r (2*i) = x r (2*i+1)) ∧
      ((p0 - r) % 2 = 1 → ∀ a, 0 < a → a < 2^(t+1) - 1 → x r a = false))
    (hend1 : ∀ a, 0 < a → a < 2^(t+1) - 1 → x (p0+1) a = false) :
    ∀ i, 1 ≤ i → i ≤ t → x (p0+2) (2^(t+1) - 2^i) = x (p0+2) (2^(t+1) - 2^i + 1)
Source
Helper step for the main statement of OP-205 (arXiv:2610.15635, the case k+1 = 2^m, n even, (k+1) not dividing n, left open there); it concerns the integer Boolean class models that optimal (m+1)-layer covers give. Partial result towards the stated cycle_power_dyadic_regular_continuation_right_next_paired: the pairs (D - 2^i, D - 2^i + 1), 1 ≤ i ≤ t, of the class at p0+2 (these include the pair at D/2).
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • cycle_power_dyadic_regular_continuation_right_bit_oneFirst part of the rightward continuation, for every exponent t+1 ≥ 3, without the coverage hypothesis. In a tight, exactly dyadically…
  • cycle_power_dyadic_class_weightThe weighted number of pairs in a dyadic arc: the endpoint pair has weight two, and distances 2^m-2^j for 1≤j<m have weight one.
  • cFor a group $G$ and an element $s \in G$, the local count $c_G(s)$ is the cardinality of the set of elements $g \in G$ such that…
Used by 1

The proof, explained

To show that the offsets D - 2^i and D - 2^i + 1 (with D = 2^(t+1)) have equal truth values in the class rooted at p0+2, the proof case-splits on their four possible truth assignments. The two cases where both are equal are immediate. If offset D - 2^i were false and D - 2^i + 1 were true, exact dyadic coverage at p0+2 would force an active contributor at an even offset a ≥ 2, whose pairing would combine with the active offset 1 at p0+2 to give two distinct owners for the rank-i dyadic pair at vertex p0+3, contradicting uniqueness. Symmetrically, if D - 2^i were true and D - 2^i + 1 were false, the required coverage of distance D - 2^i + 1 at vertex p0+2 would yield a second owner at vertex p0+2 in addition to root p0+2 itself, again contradicting uniqueness.

  1. A sum of a non-negative function over a finite set containing two distinct elements of value 1 is at least 2.

    The pair {a, b} is a subset of s because both a and b belong to s (Finset.mem_insert, Finset.mem_singleton). By monotonicity of summation over subsets for non-negative integers (Finset.sum_le_sum_of_subset), the sum over s is bounded below by the sum over {a, b}. Since a ≠ b, the sum over {a, b} equals f(a) + f(b) = 1 + 1 = 2 (Finset.sum_pair).

    lines 3–10

    uses Finset.mem_insert, Finset.mem_singleton, Finset.sum_le_sum_of_subset, Finset.sum_pair

      have hsub : ({a, b} : Finset ℕ) ⊆ s := by
        intro c hc; simp only [Finset.mem_insert, Finset.mem_singleton] at hc
        rcases hc with rfl | rfl
        · exact ha
        · exact hb
      have := Finset.sum_le_sum_of_subset (f := f) hsub
      rw [Finset.sum_pair hab, hfa, hfb] at this
      exact this
  2. Introduce rank i and establish basic numeric relations for D = 2^(t+1) and I = 2^i.

    Fix 1 ≤ i ≤ t. Abbreviating T = 2^t and I = 2^i, we have D = 2^(t+1) = 2T (pow_succ), I ≤ T (Nat.pow_le_pow_right), I = 2 · 2^(i-1) is even (pow_succ'), and 2 ≤ I. We also prove a helper stating that equal roots and offsets yield equal evaluations in x.

    lines 29–41

    uses pow_succ, Nat.pow_le_pow_right, pow_succ'

      intro i hi1 hit
      obtain ⟨T, hT⟩ : ∃ T : ℕ, T = 2^t := ⟨_, rfl⟩
      obtain ⟨I, hI⟩ : ∃ I : ℕ, I = 2^i := ⟨_, rfl⟩
      have hD : (2:ℕ)^(t+1) = 2*T := by rw [hT, pow_succ]; ring
      have hIT : I ≤ T := by rw [hI, hT]; exact Nat.pow_le_pow_right (by norm_num) hit
      obtain ⟨I', hI'⟩ : ∃ I' : ℕ, I = 2 * I' := ⟨2^(i-1), by rw [hI, ← pow_succ']; congr 1; omega⟩
      have hI2 : 2 ≤ I := by
        rw [hI]
        calc 2 = 2^1 := by norm_num
          _ ≤ 2^i := Nat.pow_le_pow_right (by norm_num) hi1
      have hTz : ((2:ℤ))^t = (T:ℤ) := by rw [hT]; push_cast; rfl
      have hx : ∀ (q q' : ℤ) (a a' : ℕ), q = q' → a = a' → x q a = x q' a' := by
        intro q q' a a' h1 h2; rw [h1, h2]
  3. Every integer root has both of its endpoints active in the model.

    Specializing the exact dyadic coverage hypothesis to rank 0 at any root v, the sum over range(2^0) = range(1) = {0} contains only the term for offset 0 (pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero, Nat.zero_add). Since the sum equals 1, the boolean conjunction of x(v, 0) and x(v, 2^(t+1)-1) must be 1, so both endpoint offsets are true.

    lines 42–50

    uses pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero, Nat.zero_add

      have hends : ∀ v : ℤ, x v 0 = true ∧ x v (2^(t+1) - 1) = true := by
        intro v
        have h := hexact 0 (by omega) v
        simp only [pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero,
          Nat.zero_add] at h
        revert h
        generalize x v 0 = u
        generalize x v (2^(t+1) - 1) = w
        cases u <;> cases w <;> simp
  4. Offset 1 is active at root p0+2, and exact dyadic coverage at rank i holds at vertices p0+2 and p0+3.

    We apply the prior continuation theorem cycle_power_dyadic_regular_continuation_right_bit_one to deduce that x(p0+2, 1) = true. We also specialize the exact coverage hypothesis at rank i to vertices p0+2 and p0+3, recording that their dyadic sums each equal 1.

    lines 51–56

    uses cycle_power_dyadic_regular_continuation_right_bit_one

      have hb1 := (cycle_power_dyadic_regular_continuation_right_bit_one t ht x htight hexact hcount
        p0 hreg).2
      rw [← hI]
      have h2 := hexact i (by omega) (p0+2)
      have h3 := hexact i (by omega) (p0+3)
      rw [← hI] at h2 h3
  5. If both offsets 2^(t+1) - I and 2^(t+1) - I + 1 are false at root p0+2, they are equal.

    We perform a case split on the truth values of x(p0+2, 2^(t+1) - I) and x(p0+2, 2^(t+1) - I + 1). When both are false, the required equality holds by reflexivity.

    lines 57–58

      cases hA : x (p0+2) (2^(t+1) - I) <;> cases hB : x (p0+2) (2^(t+1) - I + 1)
      · rfl
  6. It is impossible for offset 2^(t+1) - I to be false while 2^(t+1) - I + 1 is true at root p0+2.

    Suppose for contradiction that offset 2^(t+1) - I is false and 2^(t+1) - I + 1 is true at root p0+2. Since the rank-i dyadic sum at vertex p0+2 is 1 ≠ 0, some offset a < I contributes to it (Finset.exists_ne_zero_of_sum_ne_zero, Finset.mem_range). If a = 0, offset 2^(t+1) - I would be true at root p0+2, a contradiction. If a = 1, offset 1 would be true at root p0+1, contradicting the hypothesis hend1 that root p0+1 contains only endpoints. Thus a ≥ 2 (Nat.lt_or_ge), so root r = p0 + 2 - a lies in the regularity interval [p0 - 3·2^t, p0]. By parity of a (Nat.mod_two_eq_zero_or_one): if a is odd, r has only endpoints, contradicting that offset a is active; if a is even, r is regular and paired, so its offsets a+1 and a+1+2^(t+1)-I are also active, meaning r contributes to the rank-i dyadic sum at vertex p0+3 at offset a+1. But root p0+2 also contributes to vertex p0+3 at offset 1 because offsets 1 and 2^(t+1) - I + 1 are both active at p0+2. Since 1 ≠ a+1, vertex p0+3 has at least two distinct active dyadic contributors, so its rank-i sum is at least 2 (cpd_next_paired_high_two_le, Finset.mem_range.mpr), contradicting that the sum is 1.

    lines 59–95

    uses Finset.exists_ne_zero_of_sum_ne_zero, Finset.mem_range, Nat.lt_or_ge, Nat.mod_two_eq_zero_or_one, cpd_next_paired_high_two_le, Finset.mem_range.mpr

      · -- the class at p0+2 owns the rank-i pair at p0+3; any owner at p0+2 gives a second one
        exfalso
        have hne : (Finset.range I).sum (fun a =>
            (x (p0+2-(a : ℤ)) a && x (p0+2-(a : ℤ)) (a+2^(t+1)-I)).toNat) ≠ 0 := by omega
        obtain ⟨a, ha, hfa⟩ := Finset.exists_ne_zero_of_sum_ne_zero hne
        rw [Finset.mem_range] at ha
        have hfa' : x (p0+2-(a:ℤ)) a = true ∧ x (p0+2-(a:ℤ)) (a+2^(t+1)-I) = true := by
          revert hfa
          cases x (p0+2-(a:ℤ)) a <;> cases x (p0+2-(a:ℤ)) (a+2^(t+1)-I) <;> simp
        rcases Nat.lt_or_ge a 2 with hlt | hge
        · rcases (show a = 0 ∨ a = 1 by omega) with rfl | rfl
          · rw [hx _ (p0+2) (0+2^(t+1)-I) (2^(t+1)-I) (by simp) (by omega), hA] at hfa'
            exact absurd hfa'.2 (by decide)
          · rw [hx _ (p0+1) 1 1 (by push_cast; ring) rfl, hend1 1 (by omega) (by omega)] at hfa'
            exact absurd hfa'.1 (by decide)
        · have hr := hreg (p0+2-(a:ℤ)) (by rw [hTz]; omega) (by omega)
          rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar
          · have hp := (hr.1 (by omega)).2
            have e1 := hp (a/2) (by omega)
            have e2 := hp ((a+2^(t+1)-I)/2) (by omega)
            rw [hx _ _ (2*(a/2)) a rfl (by omega)] at e1
            rw [hx _ _ (2*((a+2^(t+1)-I)/2)) (a+2^(t+1)-I) rfl (by omega)] at e2
            have := cpd_next_paired_high_two_le (Finset.range I) (fun a =>
              (x (p0+3-(a : ℤ)) a && x (p0+3-(a : ℤ)) (a+2^(t+1)-I)).toNat) 1 (a+1)
              (Finset.mem_range.mpr (by omega)) (Finset.mem_range.mpr (by omega)) (by omega)
              (by
                show (x (p0+3-((1:ℕ):ℤ)) 1 && x (p0+3-((1:ℕ):ℤ)) (1+2^(t+1)-I)).toNat = 1
                rw [hx _ (p0+2) 1 1 (by push_cast; ring) rfl,
                  hx _ (p0+2) (1+2^(t+1)-I) (2^(t+1)-I+1) (by push_cast; ring) (by omega), hb1, hB]; rfl)
              (by
                show (x (p0+3-((a+1:ℕ):ℤ)) (a+1) && x (p0+3-((a+1:ℕ):ℤ)) (a+1+2^(t+1)-I)).toNat = 1
                rw [hx _ (p0+2-(a:ℤ)) (a+1) (2*(a/2)+1) (by push_cast; ring) (by omega),
                  hx _ (p0+2-(a:ℤ)) (a+1+2^(t+1)-I) (2*((a+2^(t+1)-I)/2)+1) (by push_cast; ring) (by omega),
                  ← e1, ← e2, hfa'.1, hfa'.2]; rfl)
            omega
          · rw [hr.2 (by omega) a (by omega) (by omega)] at hfa'
            exact absurd hfa'.1 (by decide)
  7. It is impossible for offset 2^(t+1) - I to be true while 2^(t+1) - I + 1 is false at root p0+2.

    Suppose for contradiction that offset 2^(t+1) - I is true and 2^(t+1) - I + 1 is false at root p0+2. Since offset 0 is an endpoint and offset 2^(t+1) - I is true, root p0+2 contributes to the rank-i dyadic sum at vertex p0+2 at offset 0. By the full coverage hypothesis, distance d = 2^(t+1) - I + 1 must be covered at vertex p0+2 by some offset a. If a = 0, offset d would be true at root p0+2, a contradiction. If a = 1, offset 1 would be true at root p0+1, contradicting hend1. Thus a ≥ 2 (Nat.lt_or_ge), so root r = p0 + 2 - a lies in the regularity interval. By parity of a (Nat.mod_two_eq_zero_or_one): if a is odd, r has only endpoints, a contradiction; if a is even, r is paired, and since d is odd, the offset a + d - 1 = a + 2^(t+1) - I is even and paired with a + d, so both a and a + 2^(t+1) - I are active in r. This gives a second contributor at offset a for vertex p0+2. Since 0 ≠ a, the rank-i dyadic sum at vertex p0+2 is at least 2 (cpd_next_paired_high_two_le, Finset.mem_range.mpr), contradicting that it equals 1.

    lines 96–120

    uses Nat.lt_or_ge, Nat.mod_two_eq_zero_or_one, cpd_next_paired_high_two_le, Finset.mem_range.mpr

      · -- the class at p0+2 owns the rank-i pair at p0+2; the cover of D - I + 1 there gives another
        exfalso
        obtain ⟨a, ha, h1, h2'⟩ := hcover (2^(t+1) - I + 1) (by omega) (by omega) (p0+2)
        have hown : (x (p0+2-((0:ℕ):ℤ)) 0 && x (p0+2-((0:ℕ):ℤ)) (0+2^(t+1)-I)).toNat = 1 := by
          rw [hx _ (p0+2) 0 0 (by simp) rfl, hx _ (p0+2) (0+2^(t+1)-I) (2^(t+1)-I) (by simp) (by omega),
            (hends _).1, hA]; rfl
        rcases Nat.lt_or_ge a 2 with hlt | hge
        · rcases (show a = 0 ∨ a = 1 by omega) with rfl | rfl
          · rw [hx _ (p0+2) (0 + (2^(t+1)-I+1)) (2^(t+1)-I+1) (by simp) (by omega), hB] at h2'
            exact absurd h2' (by decide)
          · rw [hx _ (p0+1) 1 1 (by push_cast; ring) rfl, hend1 1 (by omega) (by omega)] at h1
            exact absurd h1 (by decide)
        · have hr := hreg (p0+2-(a:ℤ)) (by rw [hTz]; omega) (by omega)
          rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar
          · have e2 := (hr.1 (by omega)).2 ((a+2^(t+1)-I)/2) (by omega)
            rw [hx _ _ (2*((a+2^(t+1)-I)/2)) (a+2^(t+1)-I) rfl (by omega),
              hx _ _ (2*((a+2^(t+1)-I)/2)+1) (a + (2^(t+1)-I+1)) rfl (by omega), h2'] at e2
            have := cpd_next_paired_high_two_le (Finset.range I) (fun a =>
              (x (p0+2-(a : ℤ)) a && x (p0+2-(a : ℤ)) (a+2^(t+1)-I)).toNat) 0 a
              (Finset.mem_range.mpr (by omega)) (Finset.mem_range.mpr (by omega)) (by omega) hown
              (by show (x (p0+2-(a:ℤ)) a && x (p0+2-(a:ℤ)) (a+2^(t+1)-I)).toNat = 1
                  rw [h1, e2]; rfl)
            omega
          · rw [hr.2 (by omega) a (by omega) (by omega)] at h1
            exact absurd h1 (by decide)
  8. If both offsets 2^(t+1) - I and 2^(t+1) - I + 1 are true at root p0+2, they are equal.

    In the remaining case where both offsets evaluate to true, equality holds by reflexivity.

    line 121

      · rfl
Finset.mem_insert
An element belongs to the insertion of b into a set s if and only if it equals b or belongs to s.
Finset.mem_singleton
An element belongs to the singleton set {a} if and only if it equals a.
Finset.sum_le_sum_of_subset
If s ⊆ t and the summands are non-negative, the sum over s is at most the sum over t.
Finset.sum_pair
For distinct elements a ≠ b, the sum of a function over {a, b} equals f(a) + f(b).
pow_succ
In a monoid, a^(n+1) = a^n * a.
Nat.pow_le_pow_right
For a positive natural number n, if i ≤ j then n^i ≤ n^j.
pow_succ'
In a monoid, a^(n+1) = a * a^n.
pow_zero
Any base raised to the power 0 equals 1.
Finset.range_one
The range of length 1 consists solely of the element 0.
Finset.sum_singleton
The sum of a function over a singleton set {a} equals f(a).
Nat.cast_zero
The natural number 0 casts to 0 in any additive monoid with one.
sub_zero
Subtracting 0 leaves an element unchanged.
Nat.zero_add
Adding 0 on the left leaves a natural number unchanged: 0 + n = n.
cycle_power_dyadic_regular_continuation_right_bit_one
Under the model hypotheses and regularity on [p0 - 3·2^t, p0], offset 1 is false at root p0+1 and true at root p0+2.
Finset.exists_ne_zero_of_sum_ne_zero
If the sum of non-negative elements over a finite set is non-zero, at least one element has a non-zero value.
Finset.mem_range
A natural number m is in range(n) if and only if m < n.
Nat.lt_or_ge
For any natural numbers n and m, either n < m or n ≥ m.
Nat.mod_two_eq_zero_or_one
Any natural number modulo 2 is either 0 or 1.
cpd_next_paired_high_two_le
If a finite set s contains two distinct elements where a non-negative function evaluates to 1, its sum over s is at least 2.
Finset.mem_range.mpr
If m < n, then m is an element of range(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

theorem cpd_next_paired_high_two_le (s : Finset ℕ) (f : ℕ → ℕ) (a b : ℕ) (ha : a ∈ s) (hb : b ∈ s)    (hab : a ≠ b) (hfa : f a = 1) (hfb : f b = 1) : 2 ≤ s.sum f := by  have hsub : ({a, b} : Finset ℕ) ⊆ s := by    intro c hc; simp only [Finset.mem_insert, Finset.mem_singleton] at hc    rcases hc with rfl | rfl    · exact ha    · exact hb  have := Finset.sum_le_sum_of_subset (f := f) hsub  rw [Finset.sum_pair hab, hfa, hfb] at this  exact thistheorem cycle_power_dyadic_regular_continuation_right_next_paired_high (t : ℕ) (ht : 2 ≤ t)    (x : ℤ → ℕ → Bool)    (htight : ∀ p, cycle_power_dyadic_class_weight (t+1) (x p) =      (Finset.range (2^(t+1))).sum (fun a => (x p a).toNat))    (hexact : ∀ i < t+1, ∀ v : ℤ, (Finset.range (2^i)).sum (fun a =>      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+2^(t+1)-2^i)).toNat) = 1)    (hcover : ∀ d : ℕ, 1 ≤ d → d < 2^(t+1) → ∀ v : ℤ,      ∃ a : ℕ, a < 2^(t+1)-d ∧ x (v-(a : ℤ)) a = true ∧        x (v-(a : ℤ)) (a+d) = true)    (hcount : ∀ v : ℤ, (Finset.range (2^(t+1))).sum (fun a =>      (x (v-(a : ℤ)) a).toNat) = (t+1)+1)    (p0 : ℤ)    (hreg : ∀ r : ℤ, p0 - 3*2^t ≤ r → r ≤ p0 →      ((p0 - r) % 2 = 0 → x r 1 = true ∧ ∀ i < 2^t, x r (2*i) = x r (2*i+1)) ∧      ((p0 - r) % 2 = 1 → ∀ a, 0 < a → a < 2^(t+1) - 1 → x r a = false))    (hend1 : ∀ a, 0 < a → a < 2^(t+1) - 1 → x (p0+1) a = false) :    ∀ i, 1 ≤ i → i ≤ t → x (p0+2) (2^(t+1) - 2^i) = x (p0+2) (2^(t+1) - 2^i + 1) := by  intro i hi1 hit  obtain ⟨T, hT⟩ : ∃ T : ℕ, T = 2^t := ⟨_, rfl⟩  obtain ⟨I, hI⟩ : ∃ I : ℕ, I = 2^i := ⟨_, rfl⟩  have hD : (2:ℕ)^(t+1) = 2*T := by rw [hT, pow_succ]; ring  have hIT : I ≤ T := by rw [hI, hT]; exact Nat.pow_le_pow_right (by norm_num) hit  obtain ⟨I', hI'⟩ : ∃ I' : ℕ, I = 2 * I' := ⟨2^(i-1), by rw [hI, ← pow_succ']; congr 1; omega⟩  have hI2 : 2 ≤ I := by    rw [hI]    calc 2 = 2^1 := by norm_num      _ ≤ 2^i := Nat.pow_le_pow_right (by norm_num) hi1  have hTz : ((2:ℤ))^t = (T:ℤ) := by rw [hT]; push_cast; rfl  have hx : ∀ (q q' : ℤ) (a a' : ℕ), q = q' → a = a' → x q a = x q' a' := by    intro q q' a a' h1 h2; rw [h1, h2]  have hends : ∀ v : ℤ, x v 0 = true ∧ x v (2^(t+1) - 1) = true := by    intro v    have h := hexact 0 (by omega) v    simp only [pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero,      Nat.zero_add] at h    revert h    generalize x v 0 = u    generalize x v (2^(t+1) - 1) = w    cases u <;> cases w <;> simp  have hb1 := (cycle_power_dyadic_regular_continuation_right_bit_one t ht x htight hexact hcount    p0 hreg).2  rw [← hI]  have h2 := hexact i (by omega) (p0+2)  have h3 := hexact i (by omega) (p0+3)  rw [← hI] at h2 h3  cases hA : x (p0+2) (2^(t+1) - I) <;> cases hB : x (p0+2) (2^(t+1) - I + 1)  · rfl  · -- the class at p0+2 owns the rank-i pair at p0+3; any owner at p0+2 gives a second one    exfalso    have hne : (Finset.range I).sum (fun a =>        (x (p0+2-(a : ℤ)) a && x (p0+2-(a : ℤ)) (a+2^(t+1)-I)).toNat) ≠ 0 := by omega    obtain ⟨a, ha, hfa⟩ := Finset.exists_ne_zero_of_sum_ne_zero hne    rw [Finset.mem_range] at ha    have hfa' : x (p0+2-(a:ℤ)) a = true ∧ x (p0+2-(a:ℤ)) (a+2^(t+1)-I) = true := by      revert hfa      cases x (p0+2-(a:ℤ)) a <;> cases x (p0+2-(a:ℤ)) (a+2^(t+1)-I) <;> simp    rcases Nat.lt_or_ge a 2 with hlt | hge    · rcases (show a = 0 ∨ a = 1 by omega) with rfl | rfl      · rw [hx _ (p0+2) (0+2^(t+1)-I) (2^(t+1)-I) (by simp) (by omega), hA] at hfa'        exact absurd hfa'.2 (by decide)      · rw [hx _ (p0+1) 1 1 (by push_cast; ring) rfl, hend1 1 (by omega) (by omega)] at hfa'        exact absurd hfa'.1 (by decide)    · have hr := hreg (p0+2-(a:ℤ)) (by rw [hTz]; omega) (by omega)      rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar      · have hp := (hr.1 (by omega)).2        have e1 := hp (a/2) (by omega)        have e2 := hp ((a+2^(t+1)-I)/2) (by omega)        rw [hx _ _ (2*(a/2)) a rfl (by omega)] at e1        rw [hx _ _ (2*((a+2^(t+1)-I)/2)) (a+2^(t+1)-I) rfl (by omega)] at e2        have := cpd_next_paired_high_two_le (Finset.range I) (fun a =>          (x (p0+3-(a : ℤ)) a && x (p0+3-(a : ℤ)) (a+2^(t+1)-I)).toNat) 1 (a+1)          (Finset.mem_range.mpr (by omega)) (Finset.mem_range.mpr (by omega)) (by omega)          (by            show (x (p0+3-((1:ℕ):ℤ)) 1 && x (p0+3-((1:ℕ):ℤ)) (1+2^(t+1)-I)).toNat = 1            rw [hx _ (p0+2) 1 1 (by push_cast; ring) rfl,              hx _ (p0+2) (1+2^(t+1)-I) (2^(t+1)-I+1) (by push_cast; ring) (by omega), hb1, hB]; rfl)          (by            show (x (p0+3-((a+1:ℕ):ℤ)) (a+1) && x (p0+3-((a+1:ℕ):ℤ)) (a+1+2^(t+1)-I)).toNat = 1            rw [hx _ (p0+2-(a:ℤ)) (a+1) (2*(a/2)+1) (by push_cast; ring) (by omega),              hx _ (p0+2-(a:ℤ)) (a+1+2^(t+1)-I) (2*((a+2^(t+1)-I)/2)+1) (by push_cast; ring) (by omega),              ← e1, ← e2, hfa'.1, hfa'.2]; rfl)        omega      · rw [hr.2 (by omega) a (by omega) (by omega)] at hfa'        exact absurd hfa'.1 (by decide)  · -- the class at p0+2 owns the rank-i pair at p0+2; the cover of D - I + 1 there gives another    exfalso    obtain ⟨a, ha, h1, h2'⟩ := hcover (2^(t+1) - I + 1) (by omega) (by omega) (p0+2)    have hown : (x (p0+2-((0:ℕ):ℤ)) 0 && x (p0+2-((0:ℕ):ℤ)) (0+2^(t+1)-I)).toNat = 1 := by      rw [hx _ (p0+2) 0 0 (by simp) rfl, hx _ (p0+2) (0+2^(t+1)-I) (2^(t+1)-I) (by simp) (by omega),        (hends _).1, hA]; rfl    rcases Nat.lt_or_ge a 2 with hlt | hge    · rcases (show a = 0 ∨ a = 1 by omega) with rfl | rfl      · rw [hx _ (p0+2) (0 + (2^(t+1)-I+1)) (2^(t+1)-I+1) (by simp) (by omega), hB] at h2'        exact absurd h2' (by decide)      · rw [hx _ (p0+1) 1 1 (by push_cast; ring) rfl, hend1 1 (by omega) (by omega)] at h1        exact absurd h1 (by decide)    · have hr := hreg (p0+2-(a:ℤ)) (by rw [hTz]; omega) (by omega)      rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar      · have e2 := (hr.1 (by omega)).2 ((a+2^(t+1)-I)/2) (by omega)        rw [hx _ _ (2*((a+2^(t+1)-I)/2)) (a+2^(t+1)-I) rfl (by omega),          hx _ _ (2*((a+2^(t+1)-I)/2)+1) (a + (2^(t+1)-I+1)) rfl (by omega), h2'] at e2        have := cpd_next_paired_high_two_le (Finset.range I) (fun a =>          (x (p0+2-(a : ℤ)) a && x (p0+2-(a : ℤ)) (a+2^(t+1)-I)).toNat) 0 a          (Finset.mem_range.mpr (by omega)) (Finset.mem_range.mpr (by omega)) (by omega) hown          (by show (x (p0+2-(a:ℤ)) a && x (p0+2-(a:ℤ)) (a+2^(t+1)-I)).toNat = 1              rw [h1, e2]; rfl)        omega      · rw [hr.2 (by omega) a (by omega) (by omega)] at h1        exact absurd h1 (by decide)  · rfl
See it in the graphDiscuss this resultChallenge it