Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Iid randomness extraction expansion

Open
QAlgorithms.Papers.Independent.Advance50.P02.extraction_iid_secondOrder

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

prove2quantum

All Hilbert spaces are finite dimensional and complex; all logarithms are binary. Positive-operator inequalities use the identity when comparing with a scalar. Fix a normalized finite CQ source ρXB\rho_{XB}ρXB​ and 0<ε<10<\varepsilon<10<ε<1. Let H=−D(ρXB∥IX⊗ρB)H=-D(\rho_{XB}\Vert I_X\otimes\rho_B)H=−D(ρXB​∥IX​⊗ρB​) and VVV be its centered conditional pair variance. For maximal integer extraction length with an independent public seed and the purified-distance security criterion,

ℓε(Xn∣Bn)=nH+nV Φ−1(ε2)+O(log⁡n).\ell^\varepsilon(X^n|B^n)=nH+\sqrt{nV}\,\Phi^{-1}(\varepsilon^2)+O(\log n).ℓε(Xn∣Bn)=nH+nV​Φ−1(ε2)+O(logn).

The remainder is two-sided with constants before nnn, and includes V=0V=0V=0 and singular marginals. The plus sign and squared error distinguish this expansion from compression.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P02
Formal statement
noncomputable section

open Filter

open scoped BigOperators Matrix ComplexOrder ComplexConjugate Matrix.Norms.L2Operator Topology

namespace QAlgorithms.Papers.Independent.Advance50.P02

attribute [local instance] Classical.propDecidable Classical.decEq

open QAlgorithms.Papers.Independent.Information100.P63
  (Mat tensorPower logTwo normalQuantile testingBeta)

open QAlgorithms.Papers.Independent.Information100.P71 (SupportIncluded supportPower)

open QAlgorithms (effectProb)

open QAlgorithms.Papers.Independent.Information100.P06 (Below)

open QAlgorithms.Papers.Independent.Information100.P30 (tensorMap)

open QAlgorithms.Papers.Independent.Information100.P67 (purifiedDistance)

open QAlgorithms.Papers.Independent.Dependency50.P26 (TracePreserving)

open QAlgorithms.Papers.Independent.Dependency50.P28 (pinch)

variable {I J A B X Z : Type} [Fintype I] [DecidableEq I]
  [Fintype J] [DecidableEq J] [Fintype A] [DecidableEq A]
  [Fintype B] [DecidableEq B] [Fintype X] [DecidableEq X]
  [Fintype Z] [DecidableEq Z]

/-- Corollary 16, PDF p.20: plus Phi^-1(epsilon^2), retaining the public seed. Source correction. Printed: Definition 1 p.7 prints V=Tr rho(log rho-log sigma)^2; p.19 prints Gaussian density exp(+x^2/2).
Changed: Use centered V=Tr rho(log rho-log sigma)^2-D^2 and the standard normal density exp(-x^2/2).
Why: Section VI identifies s^2 as Var(Z) and uses the standard normal Berry–Esseen theorem. For pure rho and sigma=I/d the likelihood is constant, hence V=0 even when D=log2(d) is nonzero. -/
theorem extraction_iid_secondOrder (blocks : X → Mat B) (hblocks : NormalizedBlocks blocks)
    (e : ℝ) (he : 0 < e ∧ e < 1) :
    LogarithmicRemainder (fun n => (extractionLength e (blocksPower n blocks) : EReal))
      (fun n => gaussianCenter n (conditionalMean blocks) (cqConditionalVariance blocks) (e^2)) := by sorry

end QAlgorithms.Papers.Independent.Advance50.P02

end
Source
A Hierarchy of Information Quantities for Finite Block Length Analysis of Quantum Tasks, arXiv:1208.1478v3, PDF p. 20, Corollary 16: iid randomness extraction expansion
Read-back

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

For finite types X,BX,BX,B with decidable equality, let matrices ρx≥0\rho_x\ge0ρx​≥0 indexed by BBB satisfy ∑xRe⁡tr⁡ρx=1\sum_x\operatorname{Re}\operatorname{tr}\rho_x=1∑x​Retrρx​=1, and let 0<e<10<e<10<e<1. Define Γ=⨁xρx\Gamma=\bigoplus_x\rho_xΓ=⨁x​ρx​, Σ=∑xρx\Sigma=\sum_x\rho_xΣ=∑x​ρx​, Ω=1X⊗Σ\Omega=1_X\otimes\SigmaΩ=1X​⊗Σ, and

L=log⁡2Γ−log⁡2Ω,H=−Re⁡tr⁡(ΓL),V=Re⁡tr⁡(ΓL2)−(Re⁡tr⁡(ΓL))2,L=\log_2\Gamma-\log_2\Omega,\qquad H=-\operatorname{Re}\operatorname{tr}(\Gamma L),\qquad V=\operatorname{Re}\operatorname{tr}(\Gamma L^2) -\bigl(\operatorname{Re}\operatorname{tr}(\Gamma L)\bigr)^2,L=log2​Γ−log2​Ω,H=−Retr(ΓL),V=Retr(ΓL2)−(Retr(ΓL))2,

using spectral functional calculus with log⁡20=0\log_2 0=0log2​0=0. At length nnn, put ρx(n)=⨂i=0n−1ρxi\rho_x^{(n)}=\bigotimes_{i=0}^{n-1}\rho_{x_i}ρx(n)​=⨂i=0n−1​ρxi​​ for x∈Xnx\in X^nx∈Xn. An extractor consists of a finite public seed with probabilities ps≥0p_s\ge0ps​≥0, ∑sps=1\sum_sp_s=1∑s​ps​=1, a positive natural output count MMM, and maps fs:Xn→{0,…,M−1}f_s:X^n\to\{0,\ldots,M-1\}fs​:Xn→{0,…,M−1}. Its output and its ideal output for a density matrix τ\tauτ on BnB^nBn are block diagonal in seed and output label, with respective blocks

As,y=ps∑x:fs(x)=yρx(n),Bs,y(τ)=psMτ.A_{s,y}=p_s\sum_{x:f_s(x)=y}\rho_x^{(n)}, \qquad B_{s,y}(\tau)=\frac{p_s}{M}\tau.As,y​=ps​x:fs​(x)=y∑​ρx(n)​,Bs,y​(τ)=Mps​​τ.

Its security value is the real infimum over all density matrices τ\tauτ of

dP(A,B(τ))=1−(Re⁡tr⁡A B(τ)A+(1−Re⁡tr⁡A)(1−Re⁡tr⁡B(τ)))2.d_P(A,B(\tau))= \sqrt{1-\left( \operatorname{Re}\operatorname{tr}\sqrt{\sqrt A\,B(\tau)\sqrt A} +\sqrt{(1-\operatorname{Re}\operatorname{tr}A) (1-\operatorname{Re}\operatorname{tr}B(\tau))} \right)^2}.dP​(A,B(τ))=1−(RetrA​B(τ)A​​+(1−RetrA)(1−RetrB(τ))​)2​.

Let ℓext(e,n)\ell_{\mathrm{ext}}(e,n)ℓext​(e,n) be the supremum in N\mathbb NN of all natural ℓ\ellℓ for which an extractor has security value at most eee and ℓ≤log⁡2M\ell\le\log_2Mℓ≤log2​M; this natural-number supremum is 000 for an empty or unbounded feasible set. With Φ−1(u)=inf⁡{z:u≤∫−∞ze−t2/2/2π dt}\Phi^{-1}(u)=\inf\{z:u\le\int_{-\infty}^z e^{-t^2/2}/\sqrt{2\pi}\,dt\}Φ−1(u)=inf{z:u≤∫−∞z​e−t2/2/2π​dt}, there exist C>0C>0C>0 and n0≥2n_0\ge2n0​≥2 such that every natural n≥n0n\ge n_0n≥n0​ satisfies

nH+nV Φ−1(e2)−Clog⁡2n≤ℓext(e,n)≤nH+nV Φ−1(e2)+Clog⁡2n.nH+\sqrt{nV}\,\Phi^{-1}(e^2)-C\log_2n \le\ell_{\mathrm{ext}}(e,n) \le nH+\sqrt{nV}\,\Phi^{-1}(e^2)+C\log_2n.nH+nV​Φ−1(e2)−Clog2​n≤ℓext​(e,n)≤nH+nV​Φ−1(e2)+Clog2​n.

The length is embedded in the extended reals in these inequalities. Zero blocks and zero variance are included; the normalization hypothesis excludes empty XXX or BBB.

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

    Confirmed by the moderator at approval.

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