Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

II B / III C: unique two-word code without constant columns

Open
QAlgorithms.Papers.Independent.Intakethird100.P30.twoWordClassification

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let n≥1n\ge1n≥1 and let C={u,v}C=\{u,v\}C={u,v} consist of two distinct binary words. Put d=∣u⊕v∣d=|u\oplus v|d=∣u⊕v∣, their Hamming distance, so d≥1d\ge1d≥1. Write Rj={0j,1j}R_j=\{0^j,1^j\}Rj​={0j,1j} for the repetition code, and QC∗Q_C^*QC∗​ for the Bob-only symmetric-extendability threshold of its constructed filtered family. Deleting constant coordinates produces a code equivalent to RdR_dRd​, and

QC∗=QRd∗≤QRn∗.Q_C^*=Q_{R_d}^*\le Q_{R_n}^*.QC∗​=QRd​∗​≤QRn​∗​.

If CCC already has no constant columns, it is equivalent to RnR_nRn​ and its threshold equals QRn∗Q_{R_n}^*QRn​∗​. Thus repetition codes are optimal among two-word codes at the same block length, including the valid one-bit case. This statement does not assert optimality among codes of other sizes.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P30
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P30

open scoped BigOperators Matrix ComplexConjugate ComplexOrder

attribute [local instance] Classical.propDecidable Classical.decEq

variable {I J K L A B : Type}

variable [Fintype I] [Fintype J] [Fintype K] [Fintype L]

variable [Fintype A] [Fintype B]

/-- PDF pp.4,6: classification and optimality among two-word codes, including
n=1 and reduction to positive Hamming distance after constant-column deletion. -/
theorem twoWordClassification {n : ℕ} (hn : 1 ≤ n)
    (C : Bool → Qubits n) (hC : Function.Injective C) :
    (NoConstantColumns C → CodeEquivalent C (repetition (Fin n)) ∧
      bobThreshold C = bobThreshold (repetition (Fin n))) ∧
    1 ≤ hammingDist (C false) (C true) ∧
    CodeEquivalent (deleteConstants C)
      (repetition (Fin (hammingDist (C false) (C true)))) ∧
    bobThreshold C = bobThreshold (repetition (Fin (hammingDist (C false) (C true)))) ∧
    bobThreshold C ≤ bobThreshold (repetition (Fin n)) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P30

end
Source
Numerical evidence for bound secrecy from two-way post-processing in quantum key distribution, arXiv:1612.07734v2, PDF p. 6, II B / III C: unique two-word code without constant columns
Read-back

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

Let n≥1n\ge1n≥1 and let C:{0,1}→{0,1}nC:\{0,1\}\to\{0,1\}^{n}C:{0,1}→{0,1}n be injective. Write ddd for the Hamming distance between C(0)C(0)C(0) and C(1)C(1)C(1), let V={i:∃k,l, C(k)i≠C(l)i}V=\{i:\exists k,l,\ C(k)_i\ne C(l)_i\}V={i:∃k,l, C(k)i​=C(l)i​}, and let CVC_VCV​ be the restriction of CCC to VVV. For any coordinate type JJJ, let RJ(b)i=bR_J(b)_i=bRJ​(b)i​=b be the repetition code. Two codes E:L→{0,1}JE:L\to\{0,1\}^{J}E:L→{0,1}J and F:L′→{0,1}J′F:L'\to\{0,1\}^{J'}F:L′→{0,1}J′ are called equivalent here precisely when there are bijections p:J→J′p:J\to J'p:J→J′ and e:L→L′e:L\to L'e:L→L′ and a Boolean mask t:J→{0,1}t:J\to\{0,1\}t:J→{0,1} such that E(k)i=F(e(k))p(i)⊕tiE(k)_i=F(e(k))_{p(i)}\oplus t_iE(k)i​=F(e(k))p(i)​⊕ti​ for all k,ik,ik,i. Define

BE,Q((a,k),(a′,l))=∏i∈J(1−2Q21ai=E(k)i1ai′=E(l)i+Q21ai=ai′1E(k)i=E(l)i),B_{E,Q}((a,k),(a',l)) =\prod_{i\in J} \left( \frac{1-2Q}{2}\mathbf1_{a_i=E(k)_i}\mathbf1_{a'_i=E(l)_i} +\frac Q2\mathbf1_{a_i=a'_i}\mathbf1_{E(k)_i=E(l)_i} \right),BE,Q​((a,k),(a′,l))=i∈J∏​(21−2Q​1ai​=E(k)i​​1ai′​=E(l)i​​+2Q​1ai​=ai′​​1E(k)i​=E(l)i​​),

and let b(E)b(E)b(E) be the supremum of {0}\{0\}{0} together with the q∈[0,1/2]q\in[0,1/2]q∈[0,1/2] for which BE,qB_{E,q}BE,q​ has no positive semidefinite extension to an additional copy of its label subsystem with both label-copy partial traces equal to BE,qB_{E,q}BE,q​, without requiring trace one. The theorem asserts that if every coordinate of CCC varies between some two labels, then CCC is equivalent to R{0,…,n−1}R_{\{0,\ldots,n-1\}}R{0,…,n−1}​ and their bbb-values agree. It further asserts, without that additional condition, that

d≥1,CV is equivalent to R{0,…,d−1},b(C)=b(R{0,…,d−1}),b(C)≤b(R{0,…,n−1}).d\ge1,\qquad C_V\text{ is equivalent to }R_{\{0,\ldots,d-1\}},\qquad b(C)=b(R_{\{0,\ldots,d-1\}}),\qquad b(C)\le b(R_{\{0,\ldots,n-1\}}).d≥1,CV​ is equivalent to R{0,…,d−1}​,b(C)=b(R{0,…,d−1}​),b(C)≤b(R{0,…,n−1}​).
Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me