Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

LabGates of flatMap from per-prefix label states

Proved
IntMul.Kappa.R8.Bit.Oppbank.LabGates_flatMap_prefix

by Ethan Cheung Wang · Oct 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

intmulkappalabgates

Let blk:N→List(Instr)\mathtt{blk}:\mathbb{N}\to\mathrm{List}(\mathrm{Instr})blk:N→List(Instr) and fix an initial frame labeling LLL. Write Pi=(List.range i).flatMap blkP_i=(\mathrm{List.range}\,i).\mathrm{flatMap}\,\mathtt{blk}Pi​=(List.rangei).flatMapblk for the prefix program.

If for every i<ki<ki<k the block blk(i)\mathtt{blk}(i)blk(i) is label-gate consistent from the labeling produced by running PiP_iPi​ on LLL, then the full concatenation is label-gate consistent from LLL:

LabGates N ((List.range k).flatMap blk) L.\mathrm{LabGates}\,N\,((\mathrm{List.range}\,k).\mathrm{flatMap}\,\mathtt{blk})\,L.LabGatesN((List.rangek).flatMapblk)L.

This is the correct composition principle for assembling stage-one/stage-two LabGates of net0O.prog.

Preamble
import Definitions.Def_IntMul_Kappa_R6_Defs4
import Mathlib
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxRecDepth 8192
Formal statement
namespace IntMul.Kappa.R8.Bit.Oppbank
open IntMul.Kappa.R6.Bit (LabGates labStepH FMat)
theorem LabGates_flatMap_prefix {Wr : Type*} [Fintype Wr] [DecidableEq Wr] {R : Type*} [CommRing R]
    {m N k : ℕ} (blk : ℕ → List (IntMul.Kappa.R6.Bit.Instr Wr R m))
    (L : Wr → FMat m N)
    (h : ∀ (i : ℕ), i < k →
      LabGates N (blk i) (((List.range i).flatMap blk).foldl (labStepH N) L)) :
    LabGates N ((List.range k).flatMap blk) L := by sorry
end IntMul.Kappa.R8.Bit.Oppbank

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me