AFTD Auto-Formalizing Theoretical Domains

cycle_power_reflect_shifted_pair_defect

theoremverified

Reflection transports a defective pair-ownership equation and reverses the phase.

Statement

theorem cycle_power_reflect_shifted_pair_defect
    (D L : ℕ) (hL : 0 < L) (hLD : L ≤ D)
    (x : ℤ → ℕ → Bool) (e : ℤ → Bool) (shift : ℤ)
    (h : ∀ v : ℤ, (Finset.range L).sum (fun a =>
      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+D-L)).toNat) +
        (e (v+shift)).toNat = 1) :
    ∀ v : ℤ, (Finset.range L).sum (fun a =>
      (cycle_power_rooted_reflect D x (v-(a : ℤ)) a &&
       cycle_power_rooted_reflect D x (v-(a : ℤ)) (a+D-L)).toNat) +
        (e (-v-((D-L : ℕ) : ℤ)+shift)).toNat = 1
Source
Reflection identities for the two-phase defective half-model route of RT-1.
Verified
10 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • cycle_power_rooted_reflectReflects the offsets of a rooted Boolean profile in its arc of length D and changes its integer root so that physical lattice points are…
Used by 1

The proof, explained

The proof establishes that reflection preserves the defect equation for shifted pair ownership by evaluating the given hypothesis at the reflected base vertex -v - (D - L). Reversing the summation index over {0, ..., L - 1} aligns the defect term with the hypothesis immediately. Unfolding rooted reflection and simplifying the indices shows that the reflected summand at L - 1 - a corresponds to the original summand at a with its two boolean factors swapped. The proof concludes using the commutativity of boolean conjunction.

  1. Fix an arbitrary vertex v ∈ ℤ; reversing the summation index over {0, ..., L - 1} replaces each index a with L - 1 - a.

    We introduce the arbitrary vertex v. Using Finset.sum_range_reflect, the sum over a ∈ range L is rewritten in reverse order, replacing each index a with L - 1 - a.

    lines 13–14

    uses Finset.sum_range_reflect

      intro v
      rw [← Finset.sum_range_reflect]
  2. Evaluating the hypothesis at the reflected position -v - (D - L) reduces the goal to showing that the reflected sum and the hypothesized sum agree term-by-term.

    We instantiate the hypothesis h at the reflected vertex -v - (D - L), giving an equation hs whose defect term (e(-v - (D - L) + shift)).toNat matches the defect term of the goal. Matching the two equations using convert hs using 1 and cancelling the identical defect terms with congrArg leaves the equality of the two sums over range L. Applying Finset.sum_congr reduces this to showing that their summands are equal for every a ∈ range L.

    lines 15–18

    uses congrArg, Finset.sum_congr

      have hs := h (-v-((D-L : ℕ) : ℤ))
      convert hs using 1
      apply congrArg (fun z : ℕ => z + (e (-v-((D-L : ℕ) : ℤ)+shift)).toNat)
      apply Finset.sum_congr rfl
  3. For any index a ∈ range L, we have a < L, and expanding cycle_power_rooted_reflect expresses the reflected summands in terms of x.

    Let a ∈ range L. Range membership via Finset.mem_range.mp gives a < L. Expanding the definition cycle_power_rooted_reflect D x p k = x (-p - (D - 1)) (D - 1 - k) expresses both factors of the conjunction in terms of x at vertex -(v - (L - 1 - a)) - (D - 1) with indices D - 1 - (L - 1 - a) and D - 1 - ((L - 1 - a) + D - L).

    lines 19–21

    uses Finset.mem_range.mp

      intro a ha
      have haL : a < L := Finset.mem_range.mp ha
      dsimp [cycle_power_rooted_reflect]
  4. Under the bounds 0 < L ≤ D and a < L, the reflected indices and vertex simplify to a + D - L, a, and -v - (D - L) - a.

    Using linear integer arithmetic (omega), we establish three identities: the first index D - 1 - (L - 1 - a) equals a + D - L (hidx₁), the second index D - 1 - ((L - 1 - a) + D - L) equals a (hidx₂), and the vertex -(v - (L - 1 - a)) - (D - 1) equals -v - (D - L) - a (hp).

    lines 22–25

      have hidx₁ : D-1-(L-1-a)=a+D-L := by omega
      have hidx₂ : D-1-((L-1-a)+D-L)=a := by omega
      have hp : -(v-((L-1-a : ℕ) : ℤ))-((D-1 : ℕ) : ℤ) =
          -v-((D-L : ℕ) : ℤ)-(a : ℤ) := by omega
  5. Rewriting with the index identities and commutativity of boolean conjunction closes the goal.

    Rewriting with hidx₁, hidx₂, and hp transforms the reflected product into x (-v - (D - L) - a) (a + D - L) && x (-v - (D - L) - a) a. Applying Bool.and_comm swaps the two boolean terms, matching the summand in the hypothesis and completing the proof.

    line 26

    uses Bool.and_comm

      rw [hidx₁,hidx₂,hp,Bool.and_comm]
Finset.sum_range_reflect
Reversing the summation index over {0, ..., n - 1} via j ↦ n - 1 - j preserves the sum: ∑ j ∈ range n, f (n - 1 - j) = ∑ j ∈ range n, f j.
congrArg
If two inputs are equal, applying a function to both yields equal outputs: a₁ = a₂ → f a₁ = f a₂.
Finset.sum_congr
Two sums over equal finite sets are equal if their summands agree on every element.
Finset.mem_range.mp
An element a in Finset.range n is strictly less than n: a ∈ range n → a < n.
Bool.and_comm
Boolean conjunction is commutative: (x && y) = (y && x).

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

open Finsettheorem cycle_power_reflect_shifted_pair_defect    (D L : ℕ) (hL : 0 < L) (hLD : L ≤ D)    (x : ℤ → ℕ → Bool) (e : ℤ → Bool) (shift : ℤ)    (h : ∀ v : ℤ, (Finset.range L).sum (fun a =>      (x (v-(a : ℤ)) a && x (v-(a : ℤ)) (a+D-L)).toNat) +        (e (v+shift)).toNat = 1) :    ∀ v : ℤ, (Finset.range L).sum (fun a =>      (cycle_power_rooted_reflect D x (v-(a : ℤ)) a &&       cycle_power_rooted_reflect D x (v-(a : ℤ)) (a+D-L)).toNat) +        (e (-v-((D-L : ℕ) : ℤ)+shift)).toNat = 1 := by  intro v  rw [← Finset.sum_range_reflect]  have hs := h (-v-((D-L : ℕ) : ℤ))  convert hs using 1  apply congrArg (fun z : ℕ => z + (e (-v-((D-L : ℕ) : ℤ)+shift)).toNat)  apply Finset.sum_congr rfl  intro a ha  have haL : a < L := Finset.mem_range.mp ha  dsimp [cycle_power_rooted_reflect]  have hidx₁ : D-1-(L-1-a)=a+D-L := by omega  have hidx₂ : D-1-((L-1-a)+D-L)=a := by omega  have hp : -(v-((L-1-a : ℕ) : ℤ))-((D-1 : ℕ) : ℤ) =      -v-((D-L : ℕ) : ℤ)-(a : ℤ) := by omega  rw [hidx₁,hidx₂,hp,Bool.and_comm]
See it in the graphDiscuss this resultChallenge it