AFTD Auto-Formalizing Theoretical Domains

cycle_power_dyadic_middle_bits_from_defective_halves

theoremverified

If both phase variants of the defective half model are defect-free, the middle bits in the alternating model vanish.

Statement

theorem cycle_power_dyadic_middle_bits_from_defective_halves (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 : ∀ j < t+1, ∀ v : ℤ, (Finset.range (2^j)).sum (fun a =>
      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+2^(t+1)-2^j)).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)
    (halt : ∀ p : ℤ, x (p+1) 1 = !x p 1)
    (hpart : ∀ p : ℤ, x p 1 = false → ∀ j, 0 < j → j < 2^(t+1) - 1 → j ≠ 2^t - 1 → j ≠ 2^t → x p j = false)
    (hnodefect : ∀ (y : ℤ → ℕ → Bool) (e : ℤ → Bool) (shift : ℤ),
      (shift = 0 ∨ shift = (2 : ℤ)^(t-1)) → cycle_power_dyadic_defective_half_model t y e shift → ∀ v, e v = false) :
    ∀ p : ℤ, x p 1 = false → x p (2^t - 1) = false ∧ x p (2^t) = false
Source
Conditional assembly of the middle-bit statement from the defective half-model ladder for RT-1.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
Used by 2

The proof, explained

To show that the middle bits x(p, 2^t - 1) and x(p, 2^t) vanish when x(p, 1) = false, we decompose the alternating model into two defective half models of scale t, having phase shifts 0 and 2^(t-1). The hypothesis hnodefect states that both half models are defect-free, so their defect functions vanish everywhere. Choosing the defect index v = 2^(t-1) - 1 simplifies the evaluated row index algebraically to p, immediately forcing both middle bits at row p to be false.

  1. Assuming x(p, 1) = false, the system decomposes into two defective half models of scale t: one with phase shift 0 and defect function v ↦ x(p + 2v + 2 - 2^t, 2^t - 1), and one with phase shift 2^(t-1) and defect function v ↦ x(p + 2v + 2 - 2^t, 2^t).

    We introduce an arbitrary row index p and the hypothesis that x(p, 1) = false. Applying the decomposition theorem for alternating configurations (cycle_power_dyadic_alternating_defective_halves) under the assumed weight, exactness, covering, and alternating conditions splits x into two defective half models of scale t, whose defect functions record the middle bit values at shifted coordinates.

    lines 16–18

    uses cycle_power_dyadic_alternating_defective_halves

      intro p hp
      obtain ⟨h0, h1⟩ := cycle_power_dyadic_alternating_defective_halves t ht x htight hexact hcover hcount
        halt hpart p hp
  2. 2^t = 2 * 2^(t-1), and evaluating the defect row argument at v = 2^(t-1) - 1 simplifies p + 2v + 2 - 2^t to p.

    Since t ≥ 2, we write 2^t as 2 * 2^(t-1) using pow_succ' and linear arithmetic (omega). We also record 1 ≤ 2^(t-1) via Nat.one_le_two_pow. Substituting 2^t = 2 * 2^(t-1) into the index expression p + 2(2^(t-1) - 1) + 2 - 2^t, integer ring arithmetic reduces it directly to p.

    lines 19–23

    uses pow_succ', Nat.one_le_two_pow

      have ht1 : 2 ^ t = 2 * 2 ^ (t-1) := by
        rw [← pow_succ']; congr 1; omega
      have ht2 : 1 ≤ 2 ^ (t-1) := Nat.one_le_two_pow
      have hr : p + 2 * (((2 ^ (t-1) : ℕ) : ℤ) - 1) + 2 - ((2^t : ℕ) : ℤ) = p := by
        rw [ht1]; push_cast; ring
  3. x(p, 2^t - 1) = false and x(p, 2^t) = false.

    By hypothesis hnodefect, any defective half model with shift 0 (using Or.inl) or shift 2^(t-1) (using Or.inr) has an identically false defect function. Evaluating these two defect functions at v = 2^(t-1) - 1 and rewriting the row argument using the index identity p + 2(2^(t-1) - 1) + 2 - 2^t = p immediately yields x(p, 2^t - 1) = false and x(p, 2^t) = false.

    lines 24–27

    uses Or.inl, Or.inr

      have e0 := hnodefect _ _ _ (Or.inl rfl) h0 (((2 ^ (t-1) : ℕ) : ℤ) - 1)
      have e1 := hnodefect _ _ _ (Or.inr rfl) h1 (((2 ^ (t-1) : ℕ) : ℤ) - 1)
      rw [hr] at e0 e1
      exact ⟨e0, e1⟩
cycle_power_dyadic_alternating_defective_halves
An alternating configuration satisfying the exactness, covering, parity, and weight conditions decomposes into two defective half models of scale t with shifts 0 and 2^(t-1).
pow_succ'
For any element a of a monoid and natural number n, a^(n+1) = a * a^n.
Nat.one_le_two_pow
For every natural number n, 1 ≤ 2^n.
Or.inl
From a proof of A, deduce the disjunction A ∨ B.
Or.inr
From a proof of B, deduce the disjunction A ∨ B.

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_middle_bits_from_defective_halves (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 : ∀ j < t+1, ∀ v : ℤ, (Finset.range (2^j)).sum (fun a =>      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+2^(t+1)-2^j)).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)    (halt : ∀ p : ℤ, x (p+1) 1 = !x p 1)    (hpart : ∀ p : ℤ, x p 1 = false → ∀ j, 0 < j → j < 2^(t+1) - 1 → j ≠ 2^t - 1 → j ≠ 2^t → x p j = false)    (hnodefect : ∀ (y : ℤ → ℕ → Bool) (e : ℤ → Bool) (shift : ℤ),      (shift = 0 ∨ shift = (2 : ℤ)^(t-1)) → cycle_power_dyadic_defective_half_model t y e shift → ∀ v, e v = false) :    ∀ p : ℤ, x p 1 = false → x p (2^t - 1) = false ∧ x p (2^t) = false := by  intro p hp  obtain ⟨h0, h1⟩ := cycle_power_dyadic_alternating_defective_halves t ht x htight hexact hcover hcount    halt hpart p hp  have ht1 : 2 ^ t = 2 * 2 ^ (t-1) := by    rw [← pow_succ']; congr 1; omega  have ht2 : 1 ≤ 2 ^ (t-1) := Nat.one_le_two_pow  have hr : p + 2 * (((2 ^ (t-1) : ℕ) : ℤ) - 1) + 2 - ((2^t : ℕ) : ℤ) = p := by    rw [ht1]; push_cast; ring  have e0 := hnodefect _ _ _ (Or.inl rfl) h0 (((2 ^ (t-1) : ℕ) : ℤ) - 1)  have e1 := hnodefect _ _ _ (Or.inr rfl) h1 (((2 ^ (t-1) : ℕ) : ℤ) - 1)  rw [hr] at e0 e1  exact ⟨e0, e1⟩
See it in the graphDiscuss this resultChallenge it