AFTD Auto-Formalizing Theoretical Domains

cycle_power_dyadic_regular_continuation_right_rank_partner

theoremverified

Part of the rightward continuation, for every exponent t+1 ≥ 2, from exactness alone. In an exactly dyadically covered integer Boolean class model at exponent t+1 (D = 2^(t+1)), 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. Then for every rank 1 ≤ i ≤ t the class rooted at p0+1 does not contain offset D - 2^i.

Statement

theorem cycle_power_dyadic_regular_continuation_right_rank_partner (t : ℕ) (ht : 1 ≤ t)
    (x : ℤ → ℕ → Bool)
    (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)
    (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)) :
    ∀ i, 1 ≤ i → i ≤ t → x (p0+1) (2^(t+1) - 2^i) = false
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: the offsets D - 2^i of the class at p0+1.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 3

The proof, explained

The proof compares the rank-i exactness sums at vertices p0 and p0+1, each of which sums 2^i = J + 1 Boolean terms to 1. At p0, the final term (offset J) vanishes because root p0 - J has odd type and J is an interior offset, so the sum of the first J terms equals 1. At p0+1, the initial term simplifies to the target value x(p0+1, 2^(t+1) - 2^i) because every vertex contains offset 0. The remaining J terms for p0+1 equal the first J terms for p0 term-by-term due to the even- and odd-type regularity of the intermediate roots, forcing x(p0+1, 2^(t+1) - 2^i) = false.

  1. Fix rank i with 1 ≤ i ≤ t, and establish basic arithmetic properties of T = 2^t and I = 2^i, including I ≤ T, 2 ∣ I, and 2 ≤ I.

    We introduce rank i with 1 ≤ i ≤ t. Setting T = 2^t and I = 2^i, we have 2^(t+1) = 2T and I ≤ T by monotonicity of powers of 2. Since i ≥ 1, I = 2^i is even and at least 2^1 = 2.

    lines 10–20

    uses pow_succ, Nat.pow_le_pow_right, dvd_pow_self

      intro i hi1 hit
      obtain ⟨T, hT⟩ : ∃ T : ℕ, T = 2^t := ⟨_, rfl⟩
      have hD : (2:ℕ)^(t+1) = 2*T := by rw [hT, pow_succ]; ring
      have hTz : ((2:ℤ))^t = (T:ℤ) := by rw [hT]; push_cast; rfl
      obtain ⟨I, hI⟩ : ∃ I : ℕ, I = 2^i := ⟨_, rfl⟩
      have hIT : I ≤ T := by rw [hI, hT]; exact Nat.pow_le_pow_right (by norm_num) hit
      have hI2 : 2 ∣ I := by
        rw [hI]; exact dvd_pow_self 2 (by omega)
      have hIpos : 2 ≤ I := by
        rw [hI]; calc 2 = 2^1 := by norm_num
          _ ≤ 2^i := Nat.pow_le_pow_right (by norm_num) hi1
  2. The Boolean class function x respects equality of its arguments: q = q' and a = a' imply x(q, a) = x(q', a').

    Direct substitution into the function x.

    lines 21–22

      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. For every root v ∈ ℤ, offset 0 is present: x(v, 0) = true.

    Specializing the exactness hypothesis to rank i = 0 gives a sum of 2^0 = 1 term: (x(v, 0) && x(v, 2^(t+1) - 1)).toNat = 1. A Boolean conjunction evaluates to 1 if and only if both conjuncts are true, so x(v, 0) = true.

    lines 23–31

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

      have hends : ∀ v : ℤ, x v 0 = 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. Decompose the rank-i exactness sums at p0 and p0+1 into an intermediate sum of J = I - 1 terms and an isolated boundary term.

    Since I ≥ 2, we write I = J + 1 with J = I - 1. The exactness hypothesis at rank i states that the sum of I terms is 1 at both p0 and p0+1. For p0, we peel off the last term (at index J). For p0+1, we peel off the first term (at index 0) and shift the indices of the remaining J terms.

    lines 32–36

    uses Finset.sum_range_succ, Finset.sum_range_succ'

      obtain ⟨J, hJ⟩ : ∃ J : ℕ, I = J + 1 := ⟨I - 1, by omega⟩
      have h0 := hexact i (by omega) p0
      have h1 := hexact i (by omega) (p0+1)
      rw [← hI, hJ, Finset.sum_range_succ] at h0
      rw [← hI, hJ, Finset.sum_range_succ'] at h1
  5. The boundary term at index J in the sum for p0 vanishes.

    The term at index J involves root r = p0 - J. The distance p0 - r = J = I - 1 = 2^i - 1 is odd because I is even. By the odd regularity assumption on roots r, all interior offsets are false. Since 0 < J < 2^(t+1) - 1, we have x(p0 - J, J) = false, so this term evaluates to 0.

    lines 37–41

      -- the last term at p0 vanishes: root p0 - J has odd type and J is interior
      have hlast : (x (p0 - (J:ℤ)) J && x (p0 - (J:ℤ)) (J + 2^(t+1) - (J+1))).toNat = 0 := by
        have hr := hreg (p0 - (J:ℤ)) (by rw [hTz]; omega) (by omega)
        rw [hr.2 (by omega) J (by omega) (by omega)]
        rfl
  6. The boundary term at index 0 in the sum for p0+1 simplifies to (x(p0+1, 2^(t+1) - 2^i)).toNat.

    At index a = 0, the root is p0 + 1 - 0 = p0 + 1. The first factor is x(p0+1, 0), which is true because offset 0 is always present. The second factor has offset 0 + 2^(t+1) - (J+1) = 2^(t+1) - 2^i. Thus the conjunction reduces to x(p0+1, 2^(t+1) - 2^i).

    lines 42–46

      have hfirst : (x (p0 + 1 - ((0:ℕ):ℤ)) 0 && x (p0 + 1 - ((0:ℕ):ℤ)) (0 + 2^(t+1) - (J+1))).toNat =
          (x (p0+1) (2^(t+1) - 2^i)).toNat := by
        rw [hx _ (p0+1) 0 0 (by simp) rfl, hends,
          hx (p0 + 1 - ((0:ℕ):ℤ)) (p0+1) (0 + 2^(t+1) - (J+1)) (2^(t+1) - 2^i) (by simp) (by omega)]
        rfl
  7. The intermediate sums over indices a < J for p0+1 and p0 are equal term by term.

    For each a < J, the term for p0+1 at offset a+1 involves root p0 + 1 - (a+1) = p0 - a, which is the same root appearing at offset a in the sum for p0. We case-split on the parity of a: if a is even, p0 - (p0 - a) = a is even, so by even regularity consecutive offsets have identical values; because 2^(t+1) - I is also even, both offsets a and a + 2^(t+1) - I match their successors a+1 and a + 1 + 2^(t+1) - I. If a is odd, p0 - (p0 - a) = a is odd, so by odd regularity the interior offsets a and a+1 are both false, making both sides evaluate to 0.

    lines 47–67

    uses Finset.sum_congr, Finset.mem_range.mp, Nat.mod_two_eq_zero_or_one

      have hmid : (Finset.range J).sum (fun a =>
            (x (p0 + 1 - ((a+1 : ℕ) : ℤ)) (a+1) &&
              x (p0 + 1 - ((a+1 : ℕ) : ℤ)) (a + 1 + 2^(t+1) - (J+1))).toNat) =
          (Finset.range J).sum (fun a =>
            (x (p0 - (a : ℤ)) a && x (p0 - (a : ℤ)) (a + 2^(t+1) - (J+1))).toNat) := by
        refine Finset.sum_congr rfl fun a ha => ?_
        have haJ := Finset.mem_range.mp ha
        have hr := hreg (p0 - (a:ℤ)) (by rw [hTz]; omega) (by omega)
        rw [hx (p0 + 1 - ((a+1 : ℕ) : ℤ)) (p0 - (a:ℤ)) (a+1) (a+1) (by push_cast; ring) rfl,
          hx (p0 + 1 - ((a+1 : ℕ) : ℤ)) (p0 - (a:ℤ)) (a + 1 + 2^(t+1) - (J+1))
            (a + 2^(t+1) - (J+1) + 1) (by push_cast; ring) (by omega)]
        rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar
        · have hev := (hr.1 (by omega)).2
          have e1 := hev (a/2) (by rw [← hT]; omega)
          have e2 := hev ((a + 2^(t+1) - (J+1))/2) (by rw [← hT]; omega)
          rw [hx _ _ (a+1) (2*(a/2)+1) rfl (by omega), ← e1,
            hx _ _ (a + 2^(t+1) - (J+1) + 1) (2*((a + 2^(t+1) - (J+1))/2)+1) rfl (by omega), ← e2,
            hx _ _ (2*(a/2)) a rfl (by omega),
            hx _ _ (2*((a + 2^(t+1) - (J+1))/2)) (a + 2^(t+1) - (J+1)) rfl (by omega)]
        · rw [hr.2 (by omega) (a+1) (by omega) (by omega), hr.2 (by omega) a (by omega) (by omega)]
          simp
  8. Offset 2^(t+1) - 2^i is not present at root p0+1: x(p0+1, 2^(t+1) - 2^i) = false.

    Since the boundary term at p0 vanishes, the intermediate sum of J terms equals 1. Substituting this intermediate sum into the exactness equation for p0+1 gives (x(p0+1, 2^(t+1) - 2^i)).toNat + 1 = 1, which implies (x(p0+1, 2^(t+1) - 2^i)).toNat = 0, and hence x(p0+1, 2^(t+1) - 2^i) = false.

    lines 68–73

      rw [hlast] at h0
      rw [hfirst, hmid] at h1
      have hfin : (x (p0+1) (2^(t+1) - 2^i)).toNat = 0 := by omega
      revert hfin
      generalize x (p0+1) (2^(t+1) - 2^i) = w
      cases w <;> simp
pow_succ
a^(n + 1) = a^n * a in any monoid
Nat.pow_le_pow_right
if n > 0 and i ≤ j, then n^i ≤ n^j for natural numbers
dvd_pow_self
an element a divides a^n for any positive exponent n
pow_zero
a^0 = 1 in any monoid
Finset.range_one
the range Finset.range 1 is the singleton set {0}
Finset.sum_singleton
the sum of a function over a singleton set {a} equals f(a)
Nat.cast_zero
the coercion of the natural number 0 to another semiring is 0
sub_zero
subtracting 0 leaves an element unchanged
Nat.zero_add
0 + n = n for any natural number n
Finset.sum_range_succ
the sum over {0, ..., n} equals the sum over {0, ..., n-1} plus the term at n
Finset.sum_range_succ'
the sum over {0, ..., n} equals the shifted sum of f(k+1) over {0, ..., n-1} plus the initial term f(0)
Finset.sum_congr
sums over equal finite sets are equal if the summands agree at every element
Finset.mem_range.mp
if a ∈ Finset.range n, then a < n
Nat.mod_two_eq_zero_or_one
every natural number modulo 2 is either 0 or 1

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 cycle_power_dyadic_regular_continuation_right_rank_partner (t : ℕ) (ht : 1 ≤ t)    (x : ℤ → ℕ → Bool)    (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)    (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)) :    ∀ i, 1 ≤ i → i ≤ t → x (p0+1) (2^(t+1) - 2^i) = false := by  intro i hi1 hit  obtain ⟨T, hT⟩ : ∃ T : ℕ, T = 2^t := ⟨_, rfl⟩  have hD : (2:ℕ)^(t+1) = 2*T := by rw [hT, pow_succ]; ring  have hTz : ((2:ℤ))^t = (T:ℤ) := by rw [hT]; push_cast; rfl  obtain ⟨I, hI⟩ : ∃ I : ℕ, I = 2^i := ⟨_, rfl⟩  have hIT : I ≤ T := by rw [hI, hT]; exact Nat.pow_le_pow_right (by norm_num) hit  have hI2 : 2 ∣ I := by    rw [hI]; exact dvd_pow_self 2 (by omega)  have hIpos : 2 ≤ I := by    rw [hI]; calc 2 = 2^1 := by norm_num      _ ≤ 2^i := Nat.pow_le_pow_right (by norm_num) hi1  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 := 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  obtain ⟨J, hJ⟩ : ∃ J : ℕ, I = J + 1 := ⟨I - 1, by omega⟩  have h0 := hexact i (by omega) p0  have h1 := hexact i (by omega) (p0+1)  rw [← hI, hJ, Finset.sum_range_succ] at h0  rw [← hI, hJ, Finset.sum_range_succ'] at h1  -- the last term at p0 vanishes: root p0 - J has odd type and J is interior  have hlast : (x (p0 - (J:ℤ)) J && x (p0 - (J:ℤ)) (J + 2^(t+1) - (J+1))).toNat = 0 := by    have hr := hreg (p0 - (J:ℤ)) (by rw [hTz]; omega) (by omega)    rw [hr.2 (by omega) J (by omega) (by omega)]    rfl  have hfirst : (x (p0 + 1 - ((0:ℕ):ℤ)) 0 && x (p0 + 1 - ((0:ℕ):ℤ)) (0 + 2^(t+1) - (J+1))).toNat =      (x (p0+1) (2^(t+1) - 2^i)).toNat := by    rw [hx _ (p0+1) 0 0 (by simp) rfl, hends,      hx (p0 + 1 - ((0:ℕ):ℤ)) (p0+1) (0 + 2^(t+1) - (J+1)) (2^(t+1) - 2^i) (by simp) (by omega)]    rfl  have hmid : (Finset.range J).sum (fun a =>        (x (p0 + 1 - ((a+1 : ℕ) : ℤ)) (a+1) &&          x (p0 + 1 - ((a+1 : ℕ) : ℤ)) (a + 1 + 2^(t+1) - (J+1))).toNat) =      (Finset.range J).sum (fun a =>        (x (p0 - (a : ℤ)) a && x (p0 - (a : ℤ)) (a + 2^(t+1) - (J+1))).toNat) := by    refine Finset.sum_congr rfl fun a ha => ?_    have haJ := Finset.mem_range.mp ha    have hr := hreg (p0 - (a:ℤ)) (by rw [hTz]; omega) (by omega)    rw [hx (p0 + 1 - ((a+1 : ℕ) : ℤ)) (p0 - (a:ℤ)) (a+1) (a+1) (by push_cast; ring) rfl,      hx (p0 + 1 - ((a+1 : ℕ) : ℤ)) (p0 - (a:ℤ)) (a + 1 + 2^(t+1) - (J+1))        (a + 2^(t+1) - (J+1) + 1) (by push_cast; ring) (by omega)]    rcases Nat.mod_two_eq_zero_or_one a with hpar | hpar    · have hev := (hr.1 (by omega)).2      have e1 := hev (a/2) (by rw [← hT]; omega)      have e2 := hev ((a + 2^(t+1) - (J+1))/2) (by rw [← hT]; omega)      rw [hx _ _ (a+1) (2*(a/2)+1) rfl (by omega), ← e1,        hx _ _ (a + 2^(t+1) - (J+1) + 1) (2*((a + 2^(t+1) - (J+1))/2)+1) rfl (by omega), ← e2,        hx _ _ (2*(a/2)) a rfl (by omega),        hx _ _ (2*((a + 2^(t+1) - (J+1))/2)) (a + 2^(t+1) - (J+1)) rfl (by omega)]    · rw [hr.2 (by omega) (a+1) (by omega) (by omega), hr.2 (by omega) a (by omega) (by omega)]      simp  rw [hlast] at h0  rw [hfirst, hmid] at h1  have hfin : (x (p0+1) (2^(t+1) - 2^i)).toNat = 0 := by omega  revert hfin  generalize x (p0+1) (2^(t+1) - 2^i) = w  cases w <;> simp
See it in the graphDiscuss this resultChallenge it