Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 12 — all-ones normalization of a binary code

Proved
MetricSelfDualCompletion.Completion.lemma_12

by mikedeng1 · Nov 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theorycomplexity-theorydual-good-codesp2o-batch-stoc27ap2o-gran-per-chapterp2o-plan-paperp2o-v1

This is Lemma 12 of the paper.

For every binary linear code D≤F2nD\le\mathbb F_2^nD≤F2n​ with n≥1n\ge1n≥1 one can efficiently construct a code E≤F22nE\le\mathbb F_2^{2n}E≤F22n​ such that

dim⁡E=n,12n∈E,min⁡{d(E),d(E⊥)} ≥ min⁡{d(D),d(D⊥)}.\dim E=n,\qquad \mathbf 1_{2n}\in E,\qquad \min\{d(E),d(E^\perp)\}\ \ge\ \min\{d(D),d(D^\perp)\}.dimE=n,12n​∈E,min{d(E),d(E⊥)} ≥ min{d(D),d(D⊥)}.

Here 12n\mathbf 1_{2n}12n​ is the all-ones vector and d(⋅)d(\cdot)d(⋅) the minimum distance, d(0)=+∞d(0)=+\inftyd(0)=+∞. "Efficiently construct" means: one fixed deterministic polynomial-time algorithm maps every basis of DDD to a basis of EEE.

The lemma puts the all-ones word into a code while keeping the smaller of its primal and dual distances; it is the first step of the passage from dual-good codes to self-dual codes (Proposition 14).

Formalization Note The algorithm is a PvsNP.PolyTimeComputable function; its input is a row basis of DDD encoded with its dimensions in unary, its output a row basis of EEE. D=0D=0D=0 and D=F2nD=\mathbb F_2^nD=F2n​ are included.

Differences from the source:

  • encoding: "one can efficiently construct" → a fixed PvsNP.PolyTimeComputable function, chosen before nnn and DDD, mapping an encoded row basis of DDD (dimensions in unary) to an encoded row basis of EEE; reason: codes are specified by bases (§2.1) and the machine model measures input length; no instance changes.
  • reading: "construct a code EEE" from DDD → one EEE per DDD, reached from every row basis of DDD; reason: EEE is constructed from the code DDD; the stronger reading (the output may not depend on which basis of DDD is given).
Preamble
import Mathlib
import Definitions.Def_QAlgorithms_Defs_TensorCode
import Definitions.Def_PvsNP
import Definitions.Def_MetricSelfDualCompletion_Completion_Codes
import Definitions.Def_MetricSelfDualCompletion_Completion_Encoding
Formal statement
namespace MetricSelfDualCompletion.Completion

open QAlgorithms

/-- Lemma 12 (All-ones normalization), printed p. 10 / PDF p. 12. For every code `D ⩽ F₂ⁿ`,
`n ⩾ 1`, there is a code `E ⩽ F₂^{2n}` with `dim E = n`, `1_{2n} ∈ E` and
`min{d(E), d(E^⊥)} ⩾ min{d(D), d(D^⊥)}`, and one fixed deterministic polynomial-time machine maps
every row basis of `D` to a row basis of `E`. -/
theorem lemma_12 :
    ∃ f : List Bool → List Bool, PvsNP.PolyTimeComputable f ∧
    ∀ (n : ℕ), 1 ≤ n → ∀ D : Submodule (ZMod 2) (Fin n → ZMod 2),
      ∃ E : Submodule (ZMod 2) (Fin (2 * n) → ZMod 2),
        Module.finrank (ZMod 2) E = n ∧ allOnes (2 * n) ∈ E ∧
        min (minDistCode D) (minDistCode (codeDual D)) ≤
          min (minDistCode E) (minDistCode (codeDual E)) ∧
        ∀ (k : ℕ) (B : Fin k → Fin n → ZMod 2), IsRowBasis B D →
          ∃ (r : ℕ) (B' : Fin r → Fin (2 * n) → ZMod 2),
            IsRowBasis B' E ∧ f (encMatrix B) = encMatrix B' := by sorry

end MetricSelfDualCompletion.Completion
Source
Rafail Ostrovsky, STOC 2027 submission #5 (October 2026), Lemma 12, printed p. 10 (PDF p. 12). https://github.com/sigact-stoc/stoc2027/releases/download/papers-1/5.pdf
Human review
  • Endorsed by Shuze Chen · Nov 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Nov 8, 2026

    Confirmed by the mission captain (proposal self-audit).

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