Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The invariant of oblivious Gauss–Jordan elimination is preserved by one column step

Proved
OPI.GE.inv_succ

by sragavan · Nov 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let KKK be a field. An augmented matrix A0∈Kr×(c+1)A_0\in K^{r\times(c+1)}A0​∈Kr×(c+1) encodes the linear system ∑k<cAikzk=Ai,c\sum_{k<c}A_{ik}z_k=A_{i,c}∑k<c​Aik​zk​=Ai,c​ for i<ri<ri<r. Oblivious Gauss–Jordan elimination processes the columns 0,1,…,c−10,1,\dots,c-10,1,…,c−1 in order, keeping the current matrix and a "used" flag for each row. At column jjj it selects the first unused row with a nonzero entry in column jjj, if there is one, as the pivot. It then normalizes that row, subtracts multiples of it from all other rows so that column jjj becomes a unit vector, and marks the row as used. If no row qualifies, nothing changes. Let run(A0,j)\mathrm{run}(A_0,j)run(A0​,j) be the state after jjj columns, and say that row ppp is the pivot of column kkk if it was selected at step kkk.

The invariant Inv(A0,j)\mathrm{Inv}(A_0,j)Inv(A0​,j) asserts three things:

  1. the current system has the same solutions as A0A_0A0​;
  2. for each processed column k<jk<jk<j: if row ppp is its pivot, then ppp is marked used and column kkk of the current matrix is the unit vector epe_pep​; if column kkk has no pivot, every unused row has entry 000 in column kkk;
  3. every used row is the pivot of some processed column.

Statement. For j<cj<cj<c,

Inv(A0,j) ⟹ Inv(A0,j+1).\mathrm{Inv}(A_0,j)\ \Longrightarrow\ \mathrm{Inv}(A_0,j+1).Inv(A0​,j) ⟹ Inv(A0​,j+1).

By induction the invariant holds after all ccc columns, which is the main input to the correctness theorem solution_solves. The elimination has a data-independent sequence of operations, which is what allows it to be compiled into a reversible circuit for the decoder.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part01
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Defs_GradientMethods
import Definitions.Def_QAlgorithms_Defs_OPIOraclePrograms
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_QAlgorithms_Defs_Fourier
import Definitions.Def_TwoFoldOPI_elemBits
import Definitions.Def_TwoFoldOPI_schurSquare
import Definitions.Def_TwoFoldOPI_schurFailureSum
import Definitions.Def_CodingTheory
import Definitions.Def_OAIThreeMachineSched01
import Definitions.Def_CookLevin_Cost
import Definitions.Def_TwoFoldOPI_codeOf
import Definitions.Def_TwoFoldOPI_solves
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_TwoFoldOPI_CLSerializableF
open OPI OPI.GE
variable {K : Type*} [Field K] [DecidableEq K] {r c : ℕ}
Formal statement
theorem OPI.GE.inv_succ (A0 : Aug K r c) (j : ℕ) (hj : j < c) (h : Inv A0 j) : Inv A0 (j + 1) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/GE.lean#L190-L274

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