Generated chunks are label-consistent (QHNetRec )
ProvedIntMul.Kappa.R8.Bit.Oppbank.genF_labGates_recOn the total-decoder network QHNetRec, chunks produced by the label generator are label-consistent.
Fix a field size , a wire embedding that is injective on a domain , a family of frame matrices indexed by codes, and an edge family . Let be a list of local instructions that is well-formed on (every touched wire lies in , and every XOR pair is among those wires), and let be an initial code assignment. Write for the generated chunk list and for the corresponding global program (one frame-change edge per move, then one XOR gate per local pair).
Assume that every generated move from an old code to a new code carries frames along:
If a labelling agrees with the initial frames on the embedded domain — whenever — then:
- the generated program is label-consistent starting from , in the sense of ;
- after the program, the label at is the frame of the final code ;
- labels of wires outside the image are left unchanged.
The argument is by induction on . For a single instruction the moves are applied first; injectivity of on ensures that a move of one wire does not disturb another, and the edge-matrix hypothesis updates the moved wire's label from to . After the moves, every touched wire sits at the instruction's target code, so the subsequent XOR gates see equal labels on their support and act as the identity on the labelling. The inductive step concatenates this block with the program of the tail, using the decomposition of under list append.
Formalization Note. This is the QHNetRec retarget of the published R6 theorem IntMul.Kappa.R6.Bit.genF_labGates (9a6c078b-c567-48f9-8d40-e650f78ed5c4). The platform theorem applies to the R6 genF / chunkProg constants and cannot be used on the inlined QHNetRec copies, so the proof is ported rather than imported. The statement is specialized to the QHNetRec carrier and to coefficient ring , field size , matching NB.chunkProg and NB.xorG. It imports only QHNetRec (and Defs4 / Mathlib), not the old QHNet, and does not close 9a6c078b.
import Definitions.Def_IntMul_Kappa_R6_Defs4 import Definitions.Def_IntMul_Kappa_R8_Data_BitOppbankQHNetRec import Mathlib set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxRecDepth 100000 set_option maxHeartbeats 8000000
namespace IntMul.Kappa.R8.Bit.Oppbank
open IntMul.Kappa.R6.Bit (LabGates labStepH FMat edgeMat Edge)
open IntMul.Kappa.R8.Bit.Oppbank.NB
theorem genF_labGates_rec {N : ℕ} (ι : ℕ → Wr) (D : ℕ → Prop) (lab : ℕ → FMat 529 N)
(E : ℕ → ℕ → Edge 529) (hι : ∀ w w', D w → D w' → ι w = ι w' → w = w') :
∀ (W : List LInstr) (f : ℕ → ℕ) (L : Wr → FMat 529 N),
(∀ i ∈ W, (∀ w ∈ i.2.1, D w) ∧ ∀ p ∈ i.2.2, p.1 ∈ i.2.1 ∧ p.2 ∈ i.2.1) →
(∀ ch ∈ (genF f W).2, ∀ mv ∈ ch.2.1, edgeMat N (E mv.2 ch.1) * lab mv.2 = lab ch.1) →
(∀ w, D w → L (ι w) = lab (f w)) →
LabGates N (chunkProg ι E (genF f W).2) L ∧
(∀ w, D w → (chunkProg ι E (genF f W).2).foldl (labStepH N) L (ι w) =
lab ((genF f W).1 w)) ∧
∀ x, (∀ w, D w → ι w ≠ x) → (chunkProg ι E (genF f W).2).foldl (labStepH N) L x = L x := by sorry
end IntMul.Kappa.R8.Bit.Oppbank