Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 13 — prefix-sum self-dual construction

Proved
MetricSelfDualCompletion.Completion.lemma_13

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

coding-theoryp2o-batch-stoc27ap2o-gran-per-chapterp2o-plan-paperp2o-v1self-dual-codes

This is Lemma 13 of the paper.

Let n≥1n\ge1n≥1 and let E≤F2nE\le\mathbb F_2^nE≤F2n​ be a binary linear code containing the all-ones vector 1n\mathbf 1_n1n​. Let Φ:E×E⊥→F22n\Phi:E\times E^\perp\to\mathbb F_2^{2n}Φ:E×E⊥→F22n​ be the prefix-sum map, Φi(c,w)=(ci+si−1(w), ci+si(w))\Phi_i(c,w)=(c_i+s_{i-1}(w),\,c_i+s_i(w))Φi​(c,w)=(ci​+si−1​(w),ci​+si​(w)) with st(w)=∑j≤twjs_t(w)=\sum_{j\le t}w_jst​(w)=∑j≤t​wj​, and P=Φ(E×E⊥)P=\Phi(E\times E^\perp)P=Φ(E×E⊥). Then

  1. Φ:E×E⊥→P\Phi:E\times E^\perp\to PΦ:E×E⊥→P is an invertible linear map;
  2. for all c,c′∈Ec,c'\in Ec,c′∈E and w,w′∈E⊥w,w'\in E^\perpw,w′∈E⊥,
Φ(c,w)⊤Φ(c′,w′)=c⊤w′+w⊤c′;\Phi(c,w)^\top\Phi(c',w')=c^\top w'+w^\top c';Φ(c,w)⊤Φ(c′,w′)=c⊤w′+w⊤c′;
  1. PPP is self-dual, P=P⊥P=P^\perpP=P⊥;
  2. d(P) ≥ min⁡{d(E⊥), 2d(E)}d(P)\ \ge\ \min\{d(E^\perp),\,2d(E)\}d(P) ≥ min{d(E⊥),2d(E)} (with d(0)=+∞d(0)=+\inftyd(0)=+∞ and 2⋅∞=∞2\cdot\infty=\infty2⋅∞=∞).

This converts a code with the all-ones word and good primal and dual distances into a self-dual code of twice the length.

Formalization Note Item 1 is a linear equivalence from the subspace E×E⊥E\times E^\perpE×E⊥ onto PPP that agrees with Φ\PhiΦ; Φ\PhiΦ is the restriction of a linear map on F2n×F2n\mathbb F_2^n\times\mathbb F_2^nF2n​×F2n​ (see the Codes definition for the 0-based coordinate layout). Distances are in N∪{∞}\mathbb N\cup\{\infty\}N∪{∞}.

Differences from the source:

  • encoding: "Φ : E × E⊥ → P is an invertible linear map" → a linear equivalence E×E⊥≃PE\times E^\perp\simeq PE×E⊥≃P whose values are those of Φ\PhiΦ; reason: Lean form of "invertible linear map onto PPP"; same content.
  • encoding: 1-based coordinates, pair iii at positions 2i−1,2i2i-1,2i2i−1,2i → 0-based, pair iii at positions 2i,2i+12i,2i+12i,2i+1; reason: Fin n indexing; same map.
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 13 (Prefix-sum self-dual construction), printed p. 11 / PDF p. 13. For `n ⩾ 1` and a
code `E ⩽ F₂ⁿ` containing `1ₙ`, the prefix-sum map `Φ` restricted to `E × E^⊥` is a linear
isomorphism onto `P = Φ(E, E^⊥)`; `Φ(c, w)^⊤ Φ(c', w') = c^⊤ w' + w^⊤ c'` for all
`c, c' ∈ E`, `w, w' ∈ E^⊥`; `P` is self-dual and `d(P) ⩾ min{d(E^⊥), 2 d(E)}`. -/
theorem lemma_13 (n : ℕ) (hn : 1 ≤ n) (E : Submodule (ZMod 2) (Fin n → ZMod 2))
    (hE : allOnes n ∈ E) :
    (∃ e : (E.prod (codeDual E)) ≃ₗ[ZMod 2] (prefixSumCode E),
      ∀ x : E.prod (codeDual E),
        ((e x : Fin (2 * n) → ZMod 2)) =
          prefixSumMap n (x : (Fin n → ZMod 2) × (Fin n → ZMod 2))) ∧
    (∀ c ∈ E, ∀ c' ∈ E, ∀ w ∈ codeDual E, ∀ w' ∈ codeDual E,
      prefixSumMap n (c, w) ⬝ᵥ prefixSumMap n (c', w') = c ⬝ᵥ w' + w ⬝ᵥ c') ∧
    IsSelfDual (prefixSumCode E) ∧
    min (minDistCode (codeDual E)) (2 * minDistCode E) ≤ minDistCode (prefixSumCode E) := by sorry

end MetricSelfDualCompletion.Completion
Source
Rafail Ostrovsky, STOC 2027 submission #5 (October 2026), §5.2, Lemma 13, printed p. 11 (PDF p. 13). 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