Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5: permutation families of nested pairs

Open
QAlgorithms.Papers.Independent.Intake100.P31.lemma5

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

For a binary code C≤F2nC\le\mathbb F_2^nC≤F2n​, let Ak(C)A_k(C)Ak​(C) count its weight-kkk codewords and put εk(C)=Ak(C)2n−dim⁡C/(nk)\varepsilon_k(C)=A_k(C)2^{n-\dim C}/\binom nkεk​(C)=Ak​(C)2n−dimC/(kn​) and ε(C)=max⁡1≤k≤nεk(C)\varepsilon(C)=\max_{1\le k\le n}\varepsilon_k(C)ε(C)=max1≤k≤n​εk​(C). The permutation orbit is indexed by every permutation in SnS_nSn​, including repetitions of identical codes. For K≤L≤F2nK\le L\le\mathbb F_2^nK≤L≤F2n​, set ε(L/K)=max⁡1≤k≤n[εk(L)−(∣K∣/∣L∣)εk(K)]\varepsilon(L/K)=\max_{1\le k\le n}[\varepsilon_k(L)-(|K|/|L|)\varepsilon_k(K)]ε(L/K)=max1≤k≤n​[εk​(L)−(∣K∣/∣L∣)εk​(K)]. A dimension-ttt universal pair family (Kr,Lr)(K_r,L_r)(Kr​,Lr​) satisfies Kr≤LrK_r\le L_rKr​≤Lr​ and Pr⁡r[x∈Lr∖Kr]≤ε2t−n\Pr_r[x\in L_r\setminus K_r]\le\varepsilon2^{t-n}Prr​[x∈Lr​∖Kr​]≤ε2t−n for every nonzero xxx. For n≥1n\ge1n≥1 and K≤LK\le LK≤L, applying the same uniformly sampled permutation to both codes gives

Pr⁡σ∈Sn[x∈σL∖σK]≤ε(L/K)2dim⁡L−n(x≠0).\Pr_{\sigma\in S_n}[x\in\sigma L\setminus\sigma K]\le\varepsilon(L/K)2^{\dim L-n}\qquad(x\ne0).σ∈Sn​Pr​[x∈σL∖σK]≤ε(L/K)2dimL−n(x=0).

The maximum in the parameter encloses the entire difference.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P31
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intake100.P31

open scoped BigOperators Matrix ComplexConjugate

open QAlgorithms

local instance {n : ℕ} (C : BinaryLinearCode n) : Fintype C := Fintype.ofFinite C

/-- PDF p.9, Lemma 5: the SAME permutation acts on both codes. -/
theorem lemma5 {n : ℕ} (hn : 0 < n) (small large : BinaryLinearCode n) (h : small ≤ large) :
    PairUniversalAt (permCode small) (permCode large) (Module.finrank (ZMod 2) large)
      (pairSpectrumParameter small large) := by sorry

end QAlgorithms.Papers.Independent.Intake100.P31

end
Source
Dual universality of hash functions and its applications to quantum cryptography, arXiv:1101.0064v4, PDF p. 9, Lemma 5: permutation families of nested pairs
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every positive integer nnn and binary linear subspaces Csmall⊆Clarge⊆F2nC_{\mathrm{small}}\subseteq C_{\mathrm{large}}\subseteq\mathbb F_2^nCsmall​⊆Clarge​⊆F2n​, write dsmalld_{\mathrm{small}}dsmall​ and dlarged_{\mathrm{large}}dlarge​ for their dimensions, let Ak(C)A_k(C)Ak​(C) count the vectors of weight kkk in a code CCC, define Cs={x:x∘s−1∈C}C_s=\{x:x\circ s^{-1}\in C\}Cs​={x:x∘s−1∈C} for each coordinate permutation sss, and set

ε=max⁡1≤k≤n(Ak(Clarge)(nk) 2n−dlarge−Ak(Csmall)(nk) 2n−dsmall∣Csmall∣∣Clarge∣).\varepsilon= \max_{1\le k\le n} \left( \frac{A_k(C_{\mathrm{large}})}{\binom nk}\,2^{n-d_{\mathrm{large}}} - \frac{A_k(C_{\mathrm{small}})}{\binom nk}\,2^{n-d_{\mathrm{small}}} \frac{|C_{\mathrm{small}}|}{|C_{\mathrm{large}}|} \right).ε=1≤k≤nmax​((kn​)Ak​(Clarge​)​2n−dlarge​−(kn​)Ak​(Csmall​)​2n−dsmall​∣Clarge​∣∣Csmall​∣​).

Then (Csmall)s⊆(Clarge)s(C_{\mathrm{small}})_s\subseteq(C_{\mathrm{large}})_s(Csmall​)s​⊆(Clarge​)s​ for every sss, and every nonzero x∈F2nx\in\mathbb F_2^nx∈F2n​ satisfies

∣{s∈Sn:x∈(Clarge)s, x∉(Csmall)s}∣n!≤ε 2dlarge−n.\frac{|\{s\in S_n:x\in(C_{\mathrm{large}})_s,\ x\notin(C_{\mathrm{small}})_s\}|}{n!} \le \varepsilon\,2^{d_{\mathrm{large}}-n}.n!∣{s∈Sn​:x∈(Clarge​)s​, x∈/(Csmall​)s​}∣​≤ε2dlarge​−n.

Equality of the two original subspaces is allowed; in that case both the displayed fraction and ε\varepsilonε are zero.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 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