Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Oblivious Gauss–Jordan elimination returns a solution of every solvable linear system

Proved
OPI.GE.solution_solves

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let KKK be a field and A0∈Kr×(c+1)A_0\in K^{r\times(c+1)}A0​∈Kr×(c+1) an augmented matrix, encoding the 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. Run oblivious Gauss–Jordan elimination: for each column k=0,…,c−1k=0,\dots,c-1k=0,…,c−1 in turn, select the first not-yet-used row with a nonzero entry in column kkk (if any) as the pivot. Normalize it and eliminate column kkk from all other rows, without swapping rows. The particular solution sol(A0)∈Kc\mathrm{sol}(A_0)\in K^csol(A0​)∈Kc is read off at the end: sol(A0)k\mathrm{sol}(A_0)_ksol(A0​)k​ is the final right-hand-side entry of the pivot row of column kkk, and 000 if column kkk had no pivot (a free variable).

Statement. If the system has some solution, then the particular solution solves it:

(∃z∈Kc: A0z=b) ⟹ ∑k<c(A0)ik sol(A0)k=(A0)i,cfor all i<r.\big(\exists z\in K^c:\ A_0z=b\big)\ \Longrightarrow\ \sum_{k<c}(A_0)_{ik}\,\mathrm{sol}(A_0)_k=(A_0)_{i,c}\quad\text{for all } i<r.(∃z∈Kc: A0​z=b) ⟹ k<c∑​(A0​)ik​sol(A0​)k​=(A0​)i,c​for all i<r.

This is the correctness of the linear-algebra step of the classical decoder. The relinearized system w−s∘v+t=0w-s\circ v+t=0w−s∘v+t=0 is solved in this oblivious way (Relin.decode_eq), and the same elimination is compiled into a straight-line program and then into a reversible circuit.

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.solution_solves (A0 : Aug K r c) (hsol : ∃ z, Solves A0 z) : Solves A0 (solution A0) := 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#L294-L344

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