AFTD Auto-Formalizing Theoretical Domains

op2130_height_double_local

theoremverified

Two consecutive updates at one path height affect only that site, and their center value is the corresponding two-step scalar gate.

Statement

theorem op2130_height_double_local (h : ℕ → ℤ) (j : ℕ) (hj : 1 ≤ j) (c1 c2 : Bool) :
    (op2130_height_double h j c1 c2 j =
      op2130_gate_update (h (j-1))
        (op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1) (h (j+1)) c2) ∧
    (∀ i, i ≠ j → op2130_height_double h j c1 c2 i = h i)
Source
OP-2130, spatial localization of the two-update gate
Verified
24 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • op2130_decision_gatesTwo local height updates implement AND, OR, and the two required signal conversions on the indicated finite encodings, independently of…
  • op2130_height_stepOne greedy update of a path cumulative-height profile at an interior site, using the supplied coin for a tie.
Used by 6
  • op2130_circuit_advance_and_orFour local height updates convert an AND signal to its odd encoding and combine it with the next bit in an OR gate.
  • op2130_eval_ready_inductionAn arbitrary number of four-request circuit advances preserves the encoded gate value, all untouched bit and gate coordinates, and the AND…
  • op2130_circuit_advance_or_andFour local height updates convert an OR signal to its even encoding and combine it with the next bit in an AND gate.
  • op2130_load_spatial_correctThe even and odd bit-loading gadgets set exactly the desired local Boolean signal and gate value while leaving every other height…
  • op2130_prepared_circuit_correctFor any number of alternating gates and any bit and dummy tapes, the prepared profile and reverse loading followed by left-to-right…
  • op2130_load_to_eval_readyAfter the reverse loading invariant holds, four fixed local updates establish the initial invariant for the verified left-to-right gate…

The proof, explained

The theorem establishes that two consecutive height updates at site j act locally: the value at site j is updated by two successive applications of the scalar gate update, while every other site i ≠ j is unchanged. The proof establishes the center formula by tracking the values of the neighbors and center across the two steps, proves that off-center sites are invariant, and combines both results into the target conjunction.

  1. The left neighbor at j - 1 is unaffected by the first height update at site j.

    Since j ≥ 1, linear arithmetic gives j - 1 ≠ j. By definition, op2130_height_step modifies only the value at j, leaving position j - 1 equal to h (j - 1).

    lines 10–11

      have hleft : op2130_height_step h j c1 (j-1) = h (j-1) := by
        simp [op2130_height_step, show j-1 ≠ j by omega]
  2. The right neighbor at j + 1 is unaffected by the first height update at site j.

    Because j + 1 ≠ j, the height update at site j leaves position j + 1 equal to h (j + 1).

    lines 12–13

      have hright : op2130_height_step h j c1 (j+1) = h (j+1) := by
        simp [op2130_height_step]
  3. The value at site j after the first update is the result of the scalar gate update op2130_gate_update.

    Evaluating op2130_height_step at site j replaces the value with the scalar gate update computed from the neighbors h (j - 1) and h (j + 1) and the coin c1.

    lines 14–16

      have hcenter : op2130_height_step h j c1 j =
          op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1 := by
        simp [op2130_height_step, op2130_gate_update]
  4. The value at site j after two updates is given by the two-step scalar gate update.

    Unfolding the definition of op2130_height_double into two consecutive height updates, the second update evaluates the gate at site j using the intermediate values at j - 1, j, and j + 1. Rewriting with the intermediate values replaces the neighbors by their original values h (j - 1) and h (j + 1), and the center by the first gate update.

    lines 17–22

      unfold op2130_height_double
      have hout : op2130_height_step (op2130_height_step h j c1) j c2 j =
          op2130_gate_update (op2130_height_step h j c1 (j-1))
            (op2130_height_step h j c1 j) (op2130_height_step h j c1 (j+1)) c2 := by
        simp [op2130_height_step, op2130_gate_update]
      rw [hout,hleft,hcenter,hright]
  5. Two consecutive height updates at site j leave any site i ≠ j unchanged.

    Since each height update only modifies position j, and i ≠ j, simplification shows both updates leave the value at i as h i.

    lines 24–26

    theorem op2130_height_double_other (h : ℕ → ℤ) (j i : ℕ) (c1 c2 : Bool)
        (hne : i ≠ j) : op2130_height_double h j c1 c2 i = h i := by
      simp [op2130_height_double, op2130_height_step, hne]
  6. Two consecutive height updates at site j update site j by the two-step scalar gate and preserve all other sites i ≠ j.

    The main theorem op2130_height_double_local is a conjunction. Its first component is op2130_height_double_center, and its second component applies op2130_height_double_other to an arbitrary site i ≠ j.

    lines 28–34

    uses op2130_height_double_center, op2130_height_double_other

    theorem op2130_height_double_local (h : ℕ → ℤ) (j : ℕ) (hj : 1 ≤ j) (c1 c2 : Bool) :
        (op2130_height_double h j c1 c2 j =
          op2130_gate_update (h (j-1))
            (op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1) (h (j+1)) c2) ∧
        (∀ i, i ≠ j → op2130_height_double h j c1 c2 i = h i) := by
      exact ⟨op2130_height_double_center h j hj c1 c2,
        fun i hi => op2130_height_double_other h j i c1 c2 hi⟩
op2130_height_double_center
Two consecutive height updates at site j evaluate at site j to the two-step gate update using the original neighbors j-1 and j+1.
op2130_height_double_other
Two consecutive height updates at site j leave any site i ≠ j unchanged.

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

set_option maxHeartbeats 1000000def op2130_height_double (h : ℕ → ℤ) (j : ℕ) (c1 c2 : Bool) : ℕ → ℤ :=  op2130_height_step (op2130_height_step h j c1) j c2theorem op2130_height_double_center (h : ℕ → ℤ) (j : ℕ) (hj : 1 ≤ j) (c1 c2 : Bool) :    op2130_height_double h j c1 c2 j =      op2130_gate_update (h (j-1))        (op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1) (h (j+1)) c2 := by  have hleft : op2130_height_step h j c1 (j-1) = h (j-1) := by    simp [op2130_height_step, show j-1 ≠ j by omega]  have hright : op2130_height_step h j c1 (j+1) = h (j+1) := by    simp [op2130_height_step]  have hcenter : op2130_height_step h j c1 j =      op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1 := by    simp [op2130_height_step, op2130_gate_update]  unfold op2130_height_double  have hout : op2130_height_step (op2130_height_step h j c1) j c2 j =      op2130_gate_update (op2130_height_step h j c1 (j-1))        (op2130_height_step h j c1 j) (op2130_height_step h j c1 (j+1)) c2 := by    simp [op2130_height_step, op2130_gate_update]  rw [hout,hleft,hcenter,hright]theorem op2130_height_double_other (h : ℕ → ℤ) (j i : ℕ) (c1 c2 : Bool)    (hne : i ≠ j) : op2130_height_double h j c1 c2 i = h i := by  simp [op2130_height_double, op2130_height_step, hne]theorem op2130_height_double_local (h : ℕ → ℤ) (j : ℕ) (hj : 1 ≤ j) (c1 c2 : Bool) :    (op2130_height_double h j c1 c2 j =      op2130_gate_update (h (j-1))        (op2130_gate_update (h (j-1)) (h j) (h (j+1)) c1) (h (j+1)) c2) ∧    (∀ i, i ≠ j → op2130_height_double h j c1 c2 i = h i) := by  exact ⟨op2130_height_double_center h j hj c1 c2,    fun i hi => op2130_height_double_other h j i c1 c2 hi⟩
See it in the graphDiscuss this resultChallenge it