Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

One-shot randomness extraction and all-protocol converse

Open
QAlgorithms.Papers.Independent.Advance50.P02.extraction_oneShot

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. Let ρXB\rho_{XB}ρXB​ be normalized and classical on XXX, and let 0<η≤ε<10<\eta\le\varepsilon<10<η≤ε<1. A protocol applies a seed-dependent hash X→ZX\to ZX→Z with an independent public seed SSS. Its security is min⁡σBP(τSZB,τS⊗πZ⊗σB)\min_{\sigma_B}P(\tau_{SZB},\tau_S\otimes\pi_Z\otimes\sigma_B)minσB​​P(τSZB​,τS​⊗πZ​⊗σB​), with one normalized reference σB\sigma_BσB​ shared across seeds. Let ℓε\ell^\varepsilonℓε be the maximal integer length achievable with log⁡∣Z∣≥ℓ\log|Z|\ge\elllog∣Z∣≥ℓ and security at most ε\varepsilonε. Then

Hmin⁡ε−η(X∣B)−log⁡(1/η4)−3≤ℓε(X∣B)≤Hmin⁡ε(X∣B).H_{\min}^{\varepsilon-\eta}(X|B)-\log(1/\eta^4)-3\le\ell^\varepsilon(X|B)\le H_{\min}^\varepsilon(X|B).Hminε−η​(X∣B)−log(1/η4)−3≤ℓε(X∣B)≤Hminε​(X∣B).

For every individual protocol, the supporting converse (9) also gives

log⁡∣Z∣>Hmin⁡ε(X∣B) ⟹ dsec>ε.\log|Z|>H_{\min}^\varepsilon(X|B)\ \Longrightarrow\ d_{\rm sec}>\varepsilon.log∣Z∣>Hminε​(X∣B) ⟹ dsec​>ε.

This characterizes extraction while retaining the public seed in the security criterion.

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]

/-- Theorem 8, PDF pp.10--11: public-seed security and integer lengths. -/
theorem extraction_oneShot (blocks : X → Mat B) (hblocks : NormalizedBlocks blocks)
    (e eta : ℝ) (heta : 0 < eta) (hetae : eta ≤ e) (he : e < 1) :
    positiveTraceSmoothedMinEntropy (e-eta) (cqBlockMatrix blocks) - (logTwo (1 / eta^4) : ℝ) - 3 ≤
      (extractionLength e blocks : EReal) ∧
    (extractionLength e blocks : EReal) ≤ positiveTraceSmoothedMinEntropy e (cqBlockMatrix blocks) ∧
    (∀ P : Extractor X, positiveTraceSmoothedMinEntropy e (cqBlockMatrix blocks) < (logTwo P.outputs : EReal) →
      e < extractionSecurity P blocks) := 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. 10, Theorem 8: one-shot randomness extraction
Read-back

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

For finite index types X,BX,BX,B, let ρx⪰0\rho_x\succeq0ρx​⪰0 be matrices on BBB with ∑xRe⁡tr⁡ρx=1\sum_x\operatorname{Re}\operatorname{tr}\rho_x=1∑x​Retrρx​=1, and let real e,ηe,\etae,η satisfy 0<η≤e<10<\eta\le e<10<η≤e<1. Put ω=∑x∣x⟩⟨x∣⊗ρx\omega=\sum_x|x\rangle\langle x|\otimes\rho_xω=∑x​∣x⟩⟨x∣⊗ρx​. Then

Hmin⁡e−η(X∣B)ω−log⁡2(1/η4)−3≤ℓe≤Hmin⁡e(X∣B)ω,H_{\min}^{e-\eta}(X\mid B)_\omega-\log_2(1/\eta^4)-3 \le \ell_e\le H_{\min}^{e}(X\mid B)_\omega,Hmine−η​(X∣B)ω​−log2​(1/η4)−3≤ℓe​≤Hmine​(X∣B)ω​,

and every extractor with rrr outputs satisfies

Hmin⁡e(X∣B)ω<log⁡2r⟹e<sec⁡(P).H_{\min}^{e}(X\mid B)_\omega<\log_2r \quad\Longrightarrow\quad e<\operatorname{sec}(P).Hmine​(X∣B)ω​<log2​r⟹e<sec(P).

Here Hmin⁡u(C∣B)RH_{\min}^{u}(C\mid B)_RHminu​(C∣B)R​ means

sup⁡σ⪰0tr⁡σ=1−inf⁡{log⁡2t:t>0, ∃τ⪰0, 0<Re⁡tr⁡τ≤1, P(R,τ)≤u, τ⪯t(IC⊗σ)}.\sup_{\substack{\sigma\succeq0\\\operatorname{tr}\sigma=1}} -\inf\{\log_2t:t>0,\ \exists\tau\succeq0,\ 0<\operatorname{Re}\operatorname{tr}\tau\le1,\ P(R,\tau)\le u,\ \tau\preceq t(I_C\otimes\sigma)\}.σ⪰0trσ=1​sup​−inf{log2​t:t>0, ∃τ⪰0, 0<Retrτ≤1, P(R,τ)≤u, τ⪯t(IC​⊗σ)}.

The distance is P(R,S)=1−(Fr(R,S)+(1−Re⁡tr⁡R)(1−Re⁡tr⁡S))2P(R,S)=\sqrt{1-(F_{\mathrm r}(R,S)+\sqrt{(1-\operatorname{Re}\operatorname{tr}R)(1-\operatorname{Re}\operatorname{tr}S)})^2}P(R,S)=1−(Fr​(R,S)+(1−RetrR)(1−RetrS)​)2​, where Fr(R,S)=Re⁡tr⁡R SRF_{\mathrm r}(R,S)=\operatorname{Re}\operatorname{tr}\sqrt{\sqrt R\,S\sqrt R}Fr​(R,S)=RetrR​SR​​, using spectral matrix square roots. An extractor consists of a finite seed set, probabilities ps≥0p_s\ge0ps​≥0 summing to 111, a positive integer rrr, and arbitrary functions hs:X→{0,…,r−1}h_s:X\to\{0,\ldots,r-1\}hs​:X→{0,…,r−1}. Its output and ideal matrices are block diagonal in (s,y)(s,y)(s,y), with respective blocks ps∑x:hs(x)=yρxp_s\sum_{x:h_s(x)=y}\rho_xps​∑x:hs​(x)=y​ρx​ and psσ/rp_s\sigma/rps​σ/r; its security sec⁡(P)\operatorname{sec}(P)sec(P) is the real infimum of their purified distance over all density matrices σ\sigmaσ on BBB. The natural number ℓe\ell_eℓe​ is the supremum of all integers l≥0l\ge0l≥0 for which some such extractor has l≤log⁡2rl\le\log_2rl≤log2​r and security at most eee; this natural-number supremum is zero if the set is empty or unbounded. All displayed entropy comparisons use extended reals, and log⁡2x=log⁡x/log⁡2\log_2x=\log x/\log2log2​x=logx/log2. No restriction beyond the stated data is imposed on the hash functions.

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