AFTD Auto-Formalizing Theoretical Domains

cycle_power_dyadic_regular_continuation_right_next_paired_of_middle

theoremverified

Conditional form of the pairing step. 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. If moreover (hypothesis on this model) every pair (2i, 2i+1) of the class rooted at p0+2 with 2 ≤ i < 2^t, 2i not a power of two and not of the form D - 2^k, is paired, then every pair (2i, 2i+1), i < 2^t, of that class is paired (the conclusion of cycle_power_dyadic_regular_continuation_right_next_paired).

Statement

theorem cycle_power_dyadic_regular_continuation_right_next_paired_of_middle (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))
    (hmid : ∀ i < 2^t, 2 ≤ i → (∀ k, 2*i ≠ 2^k) → (∀ k, 2*i + 2^k ≠ 2^(t+1)) →
      x (p0+2) (2*i) = x (p0+2) (2*i+1)) :
    ∀ i < 2^t, x (p0+2) (2*i) = x (p0+2) (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. Reduces the stated cycle_power_dyadic_regular_continuation_right_next_paired to cycle_power_dyadic_regular_continuation_right_next_paired_middle.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 7

The proof, explained

The theorem completes the pairing step for the class rooted at p0+2, showing that x(p0+2, 2i) = x(p0+2, 2i+1) for all i < 2^t, provided this pairing is already assumed for middle offsets. First, it proves that the preceding class p0+1 has an empty interior by showing that all its low and high dyadic corner offsets vanish. Using this empty interior, prior lemmas establish pairing for powers of two and high dyadic complements in class p0+2. Finally, a partition of indices i < 2^t into i = 0, powers of two, dyadic complements, and middle offsets resolves every case.

  1. Offset 1 is inactive in class p0+1 and active in class p0+2: x(p0+1, 1) = false and x(p0+2, 1) = true.

    This follows from cycle_power_dyadic_regular_continuation_right_bit_one using the regular alternating structure of the classes up to p0.

    line 19

    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. The interior of class p0+1 is entirely empty: x(p0+1, a) = false for all 0 < a < 2^(t+1) - 1.

    By cycle_power_dyadic_tight_class_interior_false_of_root_children, an interior is empty if all low dyadic corners 2^j - 1 and high dyadic corners 2^(t+1) - 2^j vanish. For j = 1, 2^1 - 1 = 1 is false by Step 1; for 2 ≤ j ≤ t, the low corners vanish by cycle_power_dyadic_regular_continuation_right_low_corners. The high corners vanish by cycle_power_dyadic_regular_continuation_right_rank_partner.

    lines 20–32

    uses cycle_power_dyadic_tight_class_interior_false_of_root_children, Nat.lt_or_ge, cycle_power_dyadic_regular_continuation_right_low_corners, cycle_power_dyadic_regular_continuation_right_rank_partner

      have hend1 : ∀ a, 0 < a → a < 2^(t+1) - 1 → x (p0+1) a = false := by
        refine cycle_power_dyadic_tight_class_interior_false_of_root_children (t+1) (by omega) (x (p0+1))
          (htight (p0+1)) ?_ ?_
        · intro j hj1 hjm
          rcases Nat.lt_or_ge j 2 with hj | hj
          · have : j = 1 := by omega
            subst this
            simpa using hb1.1
          · exact cycle_power_dyadic_regular_continuation_right_low_corners t ht x htight hexact hcover
              hcount p0 hreg j hj (by omega)
        · intro j hj1 hjm
          exact cycle_power_dyadic_regular_continuation_right_rank_partner t (by omega) x hexact p0 hreg j
            hj1 (by omega)
  3. In class p0+2, every power of two 2^k with 1 ≤ k < t is paired with 2^k + 1.

    This is provided by cycle_power_dyadic_regular_continuation_right_next_paired_pow, using the fact from Step 2 that class p0+1 has an empty interior.

    lines 33–34

    uses cycle_power_dyadic_regular_continuation_right_next_paired_pow

      have hpow := cycle_power_dyadic_regular_continuation_right_next_paired_pow t ht x htight hexact
        hcover hcount p0 hreg hend1
  4. In class p0+2, every high dyadic offset 2^(t+1) - 2^i with 1 ≤ i ≤ t is paired with 2^(t+1) - 2^i + 1.

    This is provided by cycle_power_dyadic_regular_continuation_right_next_paired_high, using the emptiness of the interior of class p0+1.

    lines 35–36

    uses cycle_power_dyadic_regular_continuation_right_next_paired_high

      have hhigh := cycle_power_dyadic_regular_continuation_right_next_paired_high t ht x htight hexact
        hcover hcount p0 hreg hend1
  5. 2^(t+1) = 2 * 2^t.

    Rewriting 2^(t+1) as 2^t * 2 via pow_succ and applying commutativity of multiplication gives the identity.

    line 37

    uses pow_succ

      have hD : (2:ℕ)^(t+1) = 2 * 2^t := by rw [pow_succ]; ring
  6. The base offset 0 in class p0+2 is active: x(p0+2, 0) = true.

    Exact coverage at dyadic scale 0 at vertex p0+2 requires that the sum over range 1 is 1. Simplifying this singleton sum shows that x(p0+2, 0) && x(p0+2, 2^(t+1)-1) is true, so x(p0+2, 0) must be true.

    lines 38–44

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

      have h0 : x (p0+2) 0 = true := by
        have h := hexact 0 (by omega) (p0+2)
        simp only [pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero,
          Nat.zero_add] at h
        revert h
        generalize x (p0+2) 0 = u
        cases u <;> simp
  7. For index i = 0, the pair (0, 1) is paired: x(p0+2, 0) = x(p0+2, 1).

    Fix i < 2^t. When i < 1, we have i = 0. By Step 6, x(p0+2, 0) = true, and by Step 1, x(p0+2, 1) = true, so both sides equal true.

    lines 45–49

    uses Nat.lt_or_ge

      intro i hi
      rcases Nat.lt_or_ge i 1 with hi0 | hi1
      · have : i = 0 := by omega
        subst this
        rw [h0, hb1.2]
  8. If 2i = 2^k is a power of two, the pair (2i, 2i+1) is paired: x(p0+2, 2i) = x(p0+2, 2i+1).

    Since i ≥ 1 and i < 2^t, the exponent satisfies 1 ≤ k ≤ t. If k < t, the pairing holds by Step 3. If k = t, then 2i = 2^t = 2^(t+1) - 2^t, so the pairing holds by the high dyadic pairing of Step 4 with index t.

    lines 50–67

    uses Nat.lt_or_ge, pow_zero, Nat.pow_le_pow_right, le_rfl

      by_cases hp : ∃ k, 2*i = 2^k
      · obtain ⟨k, hk⟩ := hp
        have hk1 : 1 ≤ k := by
          rcases Nat.lt_or_ge k 1 with h | h
          · have : k = 0 := by omega
            subst this; rw [pow_zero] at hk; omega
          · exact h
        have hkt : k ≤ t := by
          by_contra hc
          have : 2^(t+1) ≤ 2^k := Nat.pow_le_pow_right (by norm_num) (by omega)
          omega
        rcases Nat.lt_or_ge k t with hlt | hge
        · rw [hk]; exact hpow k hk1 hlt
        · have hkt' : k = t := by omega
          subst hkt'
          have := hhigh k hk1 le_rfl
          rw [show 2^(k+1) - 2^k = 2^k by omega] at this
          rw [hk]; exact this
  9. If 2i = 2^(t+1) - 2^k is a high dyadic offset, the pair (2i, 2i+1) is paired: x(p0+2, 2i) = x(p0+2, 2i+1).

    Since 1 ≤ i < 2^t, the exponent satisfies 1 ≤ k ≤ t. The pairing holds directly by Step 4 applied to k.

    lines 68–81

    uses Nat.lt_or_ge, pow_zero, Nat.pow_le_pow_right

      by_cases hq : ∃ k, 2*i + 2^k = 2^(t+1)
      · obtain ⟨k, hk⟩ := hq
        have hk1 : 1 ≤ k := by
          rcases Nat.lt_or_ge k 1 with h | h
          · have : k = 0 := by omega
            subst this; rw [pow_zero] at hk; omega
          · exact h
        have hkt : k ≤ t := by
          by_contra hc
          have : 2^(t+1) ≤ 2^k := Nat.pow_le_pow_right (by norm_num) (by omega)
          omega
        have := hhigh k hk1 hkt
        rw [show 2^(t+1) - 2^k = 2*i by omega] at this
        exact this
  10. For all remaining indices i < 2^t, the pair (2i, 2i+1) is paired: x(p0+2, 2i) = x(p0+2, 2i+1).

    When 2i is neither a power of two nor of the form 2^(t+1) - 2^k, index i cannot be 0 (Step 7) or 1 (which would make 2i = 2^1). Thus 2 ≤ i, satisfying all hypotheses of the middle pairs condition hmid.

    lines 82–87

    uses Nat.lt_or_ge, absurd

      · push Not at hp hq
        have hi2 : 2 ≤ i := by
          rcases Nat.lt_or_ge i 2 with h | h
          · exact absurd (show 2*i = 2^1 by omega) (hp 1)
          · exact h
        exact hmid i hi hi2 hp hq
cycle_power_dyadic_regular_continuation_right_bit_one
Under regularity on the left, offset 1 is false in class p0+1 and true in class p0+2.
cycle_power_dyadic_tight_class_interior_false_of_root_children
For a tight class, if all low dyadic offsets 2^j - 1 and high dyadic offsets 2^m - 2^j vanish (1 ≤ j < m), then all interior offsets 0 < a < 2^m - 1 vanish.
Nat.lt_or_ge
For natural numbers n and m, either n < m or n ≥ m.
cycle_power_dyadic_regular_continuation_right_low_corners
Under regularity on the left, the low dyadic offsets 2^j - 1 vanish in class p0+1 for 2 ≤ j ≤ t.
cycle_power_dyadic_regular_continuation_right_rank_partner
Under regularity on the left, the high dyadic offsets 2^(t+1) - 2^i vanish in class p0+1 for 1 ≤ i ≤ t.
cycle_power_dyadic_regular_continuation_right_next_paired_pow
If class p0+1 has an empty interior, then in class p0+2, offsets that are powers of two 2^k (1 ≤ k < t) are paired with 2^k + 1.
cycle_power_dyadic_regular_continuation_right_next_paired_high
If class p0+1 has an empty interior, then in class p0+2, high dyadic offsets 2^(t+1) - 2^i (1 ≤ i ≤ t) are paired with 2^(t+1) - 2^i + 1.
pow_succ
a^(n+1) = a^n * a for any base a and exponent n.
pow_zero
a^0 = 1 for any base a.
Finset.range_one
The finset range 1 consists solely of {0}.
Finset.sum_singleton
The sum of a function over a singleton set {a} equals the function evaluated at a.
Nat.cast_zero
Coercing 0 from ℕ to a semiring gives 0.
sub_zero
Subtracting 0 leaves an element unchanged (a - 0 = a).
Nat.zero_add
Adding 0 to n from the left gives n (0 + n = n).
Nat.pow_le_pow_right
If n > 0 and i ≤ j, then n^i ≤ n^j.
le_rfl
Every element is less than or equal to itself (a ≤ a).
absurd
From a proof of P and a proof of ¬P, any proposition follows (ex falso quodlibet).

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_next_paired_of_middle (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))    (hmid : ∀ i < 2^t, 2 ≤ i → (∀ k, 2*i ≠ 2^k) → (∀ k, 2*i + 2^k ≠ 2^(t+1)) →      x (p0+2) (2*i) = x (p0+2) (2*i+1)) :    ∀ i < 2^t, x (p0+2) (2*i) = x (p0+2) (2*i+1) := by  have hb1 := cycle_power_dyadic_regular_continuation_right_bit_one t ht x htight hexact hcount p0 hreg  have hend1 : ∀ a, 0 < a → a < 2^(t+1) - 1 → x (p0+1) a = false := by    refine cycle_power_dyadic_tight_class_interior_false_of_root_children (t+1) (by omega) (x (p0+1))      (htight (p0+1)) ?_ ?_    · intro j hj1 hjm      rcases Nat.lt_or_ge j 2 with hj | hj      · have : j = 1 := by omega        subst this        simpa using hb1.1      · exact cycle_power_dyadic_regular_continuation_right_low_corners t ht x htight hexact hcover          hcount p0 hreg j hj (by omega)    · intro j hj1 hjm      exact cycle_power_dyadic_regular_continuation_right_rank_partner t (by omega) x hexact p0 hreg j        hj1 (by omega)  have hpow := cycle_power_dyadic_regular_continuation_right_next_paired_pow t ht x htight hexact    hcover hcount p0 hreg hend1  have hhigh := cycle_power_dyadic_regular_continuation_right_next_paired_high t ht x htight hexact    hcover hcount p0 hreg hend1  have hD : (2:ℕ)^(t+1) = 2 * 2^t := by rw [pow_succ]; ring  have h0 : x (p0+2) 0 = true := by    have h := hexact 0 (by omega) (p0+2)    simp only [pow_zero, Finset.range_one, Finset.sum_singleton, Nat.cast_zero, sub_zero,      Nat.zero_add] at h    revert h    generalize x (p0+2) 0 = u    cases u <;> simp  intro i hi  rcases Nat.lt_or_ge i 1 with hi0 | hi1  · have : i = 0 := by omega    subst this    rw [h0, hb1.2]  by_cases hp : ∃ k, 2*i = 2^k  · obtain ⟨k, hk⟩ := hp    have hk1 : 1 ≤ k := by      rcases Nat.lt_or_ge k 1 with h | h      · have : k = 0 := by omega        subst this; rw [pow_zero] at hk; omega      · exact h    have hkt : k ≤ t := by      by_contra hc      have : 2^(t+1) ≤ 2^k := Nat.pow_le_pow_right (by norm_num) (by omega)      omega    rcases Nat.lt_or_ge k t with hlt | hge    · rw [hk]; exact hpow k hk1 hlt    · have hkt' : k = t := by omega      subst hkt'      have := hhigh k hk1 le_rfl      rw [show 2^(k+1) - 2^k = 2^k by omega] at this      rw [hk]; exact this  by_cases hq : ∃ k, 2*i + 2^k = 2^(t+1)  · obtain ⟨k, hk⟩ := hq    have hk1 : 1 ≤ k := by      rcases Nat.lt_or_ge k 1 with h | h      · have : k = 0 := by omega        subst this; rw [pow_zero] at hk; omega      · exact h    have hkt : k ≤ t := by      by_contra hc      have : 2^(t+1) ≤ 2^k := Nat.pow_le_pow_right (by norm_num) (by omega)      omega    have := hhigh k hk1 hkt    rw [show 2^(t+1) - 2^k = 2*i by omega] at this    exact this  · push Not at hp hq    have hi2 : 2 ≤ i := by      rcases Nat.lt_or_ge i 2 with h | h      · exact absurd (show 2*i = 2^1 by omega) (hp 1)      · exact h    exact hmid i hi hi2 hp hq
See it in the graphDiscuss this resultChallenge it