Binary matrix row spaces and logical-operator distance #
Ported to Lean Pool from QCL-SUAT/Lean-QEC at
a0855f8a6374c1dda2097bbf07f33ba53760fdcd. Declarations are placed in
QECCertificates, with three uniquely named extensions of Matrix; imports and
module syntax are updated. The span-generator equivalence has its quantifiers corrected.
Lean-QEC, Copyright 2026 The Lean-QEC Authors (Mattias Ehatamm, Yi Lee, Xiaodi Wu, Runzhou Tao). This product includes software developed as part of the paper "End-to-End Formalization of Quantum Error Correction" (arXiv:2605.16523). Licensed under the Apache License, Version 2.0.
The submodule spanned by the rows of a matrix.
Equations
- M.certificateRowSpace = Submodule.span γ (Set.range M)
Instances For
Minimum Hamming weight in the first kernel outside the second row space, or n + 1 if empty.
Equations
- QECCertificates.minWeightKernelOutsideRowSpace M₁ M₂ = match (Finset.image hammingNorm (↑(Matrix.toLin' M₁).ker \ ↑M₂.certificateRowSpace).toFinset).min with | none => n + 1 | some a => a
Instances For
Every row of the first matrix is orthogonal to every row of the second.
Equations
- M₁.certificateMutuallyOrthogonalRows M₂ = ∀ (a : α) (b : β), M₁ a ⬝ᵥ M₂ b = 0
Instances For
The first matrix row space equals the kernel of the second matrix.
Equations
- M₁.certificateIsKernelFor M₂ = (M₁.certificateRowSpace = (Matrix.toLin' M₂).ker)