op2130_load_bit_gadgets
The fixed even-bit, odd-bit, and left-reference preparation sequences give the specified Boolean encoding independently of all dummy coins.
Statement
theorem op2130_load_bit_gadgets : (∀ c d1 d2 d3 d4 d5 : Bool, let step := fun m c => op2130_gate_update 0 m 2 c let m := step (step (step (step 5 d1) d2) d3) d4 m = 1 ∧ step m c = (if c then 2 else 0) ∧ op2130_gate_update (-3) 0 (if c then 2 else 0) d5 = -1) ∧ (∀ c d1 d2 d3 d4 : Bool, let step := fun m c => op2130_gate_update 1 m (-1) c let m := step (step (step (-3) d1) d2) d3 m = 0 ∧ step m c = (if c then 1 else -1) ∧ op2130_gate_update 5 1 (if c then 1 else -1) d4 = 2) ∧ (∀ d1 d2 : Bool, op2130_gate_update 0 (op2130_gate_update 0 (-3) (-1) d1) (-1) d2 = -1)
- Source
- OP-2130, independent-bit loading gadget
- Verified
- 24 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 3
- op2130_decision_gatesTwo local height updates implement AND, OR, and the two required signal conversions on the indicated finite encodings, independently of…
- LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder. - TotalPreorderA total preorder: a preorder where
≤is total (complete). This is weaker thanLinearOrder— it does NOT require antisymmetry or…
- Used by 2
- 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_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 three local preparation sequences—for even bits, odd bits, and the left reference—correctly initialize and encode a Boolean input independently of any dummy coin choices. Because the space of dummy coin assignments is finite ($2^6$, $2^5$, and $2^2$ cases), each helper lemma is proved by exhaustive case analysis and automated evaluation of the local gate update rule. The main result then combines the three lemmas into a conjunction.
The even-bit loading sequence brings the middle value from 5 down to 1, encodes the data bit $c$ as 2 (if true) or 0 (if false), and transitions to $-1$ in the following gate update, independently of dummy coins $d_1, \dots, d_5$. automation
An exhaustive case split on all $2^6 = 64$ truth-value combinations for $(c, d_1, d_2, d_3, d_4, d_5)$ reduces the goal in every branch to concrete integer arithmetic. The automated tactic `norm_num` unfolds the definition of `op2130_gate_update` and verifies the three conjuncts in every case.
uses
op2130_gate_updatecases c <;> cases d1 <;> cases d2 <;> cases d3 <;> cases d4 <;> cases d5 <;> norm_num [op2130_gate_update]
The odd-bit loading sequence brings the middle value from $-3$ up to 0, encodes the data bit $c$ as 1 (if true) or $-1$ (if false), and transitions to 2 in the following gate update, independently of dummy coins $d_1, \dots, d_4$. automation
An exhaustive case split on all $2^5 = 32$ truth-value combinations for $(c, d_1, d_2, d_3, d_4)$ leaves only numerical evaluations. The `norm_num` tactic unfolds `op2130_gate_update` and computes each update step, verifying that all three conjuncts hold in each case.
uses
op2130_gate_updatecases c <;> cases d1 <;> cases d2 <;> cases d3 <;> cases d4 <;> norm_num [op2130_gate_update]
The left-reference preparation sequence produces final state $-1$ after two gate updates, independently of dummy coins $d_1$ and $d_2$. automation
Case splitting across the $2^2 = 4$ possible assignments to $(d_1, d_2)$ generates four ground arithmetic equalities, each of which is evaluated and confirmed to equal $-1$ by `norm_num` unfolding `op2130_gate_update`.
uses
op2130_gate_updatecases d1 <;> cases d2 <;> norm_num [op2130_gate_update]
The conjunction of the even-bit, odd-bit, and left-reference preparation specifications holds.
The main theorem packages the three independently verified lemmas (`op2130_load_even_bit`, `op2130_load_odd_bit`, and `op2130_load_left_reference`) into a single three-way conjunction.
uses
op2130_load_even_bit,op2130_load_odd_bit,op2130_load_left_referenceexact ⟨op2130_load_even_bit, op2130_load_odd_bit, op2130_load_left_reference⟩
op2130_gate_update- The local gate update function: it updates an integer cell value $m$ given left neighbor $l$, right neighbor $r$, and a coin; it increments $m$ if $2m < l + r$, decrements $m$ if $2m > l + r$, and on a tie ($2m = l + r$) uses the coin to increment if true and decrement if false.
op2130_load_even_bit- For any Boolean data bit $c$ and dummy coins $d_1, \dots, d_5$, four iterations of the $(0, 2)$-neighbor update from 5 reach state 1, a fifth iteration with coin $c$ encodes $c$ as 2 (if true) or 0 (if false), and a subsequent update with neighbors $(-3, \text{encoded value})$ from 0 yields $-1$.
op2130_load_odd_bit- For any Boolean data bit $c$ and dummy coins $d_1, \dots, d_4$, three iterations of the $(1, -1)$-neighbor update from $-3$ reach state 0, a fourth iteration with coin $c$ encodes $c$ as 1 (if true) or $-1$ (if false), and a subsequent update with neighbors $(5, \text{encoded value})$ from 1 yields 2.
op2130_load_left_reference- For any dummy coins $d_1, d_2$, two consecutive updates with neighbors $(0, -1)$ starting from middle state $-3$ yield $-1$.
- The proofs of the three helper lemmas proceed by exhaustive finite case analysis over all Boolean combinations of inputs and dummy coins (64, 32, and 4 cases respectively), with each case verified purely by the computational evaluator `norm_num`.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op2130_load_even_bit (c d1 d2 d3 d4 d5 : Bool) : let step := fun m c => op2130_gate_update 0 m 2 c let m := step (step (step (step 5 d1) d2) d3) d4 m = 1 ∧ step m c = (if c then 2 else 0) ∧ op2130_gate_update (-3) 0 (if c then 2 else 0) d5 = -1 := by cases c <;> cases d1 <;> cases d2 <;> cases d3 <;> cases d4 <;> cases d5 <;> norm_num [op2130_gate_update]theorem op2130_load_odd_bit (c d1 d2 d3 d4 : Bool) : let step := fun m c => op2130_gate_update 1 m (-1) c let m := step (step (step (-3) d1) d2) d3 m = 0 ∧ step m c = (if c then 1 else -1) ∧ op2130_gate_update 5 1 (if c then 1 else -1) d4 = 2 := by cases c <;> cases d1 <;> cases d2 <;> cases d3 <;> cases d4 <;> norm_num [op2130_gate_update]theorem op2130_load_left_reference (d1 d2 : Bool) : op2130_gate_update 0 (op2130_gate_update 0 (-3) (-1) d1) (-1) d2 = -1 := by cases d1 <;> cases d2 <;> norm_num [op2130_gate_update]theorem op2130_load_bit_gadgets : (∀ c d1 d2 d3 d4 d5 : Bool, let step := fun m c => op2130_gate_update 0 m 2 c let m := step (step (step (step 5 d1) d2) d3) d4 m = 1 ∧ step m c = (if c then 2 else 0) ∧ op2130_gate_update (-3) 0 (if c then 2 else 0) d5 = -1) ∧ (∀ c d1 d2 d3 d4 : Bool, let step := fun m c => op2130_gate_update 1 m (-1) c let m := step (step (step (-3) d1) d2) d3 m = 0 ∧ step m c = (if c then 1 else -1) ∧ op2130_gate_update 5 1 (if c then 1 else -1) d4 = 2) ∧ (∀ d1 d2 : Bool, op2130_gate_update 0 (op2130_gate_update 0 (-3) (-1) d1) (-1) d2 = -1) := by exact ⟨op2130_load_even_bit, op2130_load_odd_bit, op2130_load_left_reference⟩