Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5: explicit finite-sample upper and lower testing bounds

Open
QAlgorithms.Papers.Independent.Advance50.P01.theorem5_finiteSampleBounds

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

prove2quantum

Let ρ\rhoρ and σ\sigmaσ be positive semidefinite complex matrices of trace one on a common nonzero finite-dimensional Hilbert space, with supp⁡ρ⊆supp⁡σ\operatorname{supp}\rho\subseteq\operatorname{supp}\sigmasuppρ⊆suppσ. All logarithms are natural. Write D=Tr⁡[ρ(log⁡ρ−log⁡σ)]D=\operatorname{Tr}[\rho(\log\rho-\log\sigma)]D=Tr[ρ(logρ−logσ)] and V=Tr⁡[ρ(log⁡ρ−log⁡σ)2]−D2V=\operatorname{Tr}[\rho(\log\rho-\log\sigma)^2]-D^2V=Tr[ρ(logρ−logσ)2]−D2, with zero kernel contributions. Tests are all binary POVMs (A,I−A)(A,I-A)(A,I−A) on the nnn-fold tensor product; their conditional errors are αn(A)=Tr⁡[ρ⊗n(I−A)]\alpha_n(A)=\operatorname{Tr}[\rho^{\otimes n}(I-A)]αn​(A)=Tr[ρ⊗n(I−A)] and βn(A)=Tr⁡[σ⊗nA]\beta_n(A)=\operatorname{Tr}[\sigma^{\otimes n}A]βn​(A)=Tr[σ⊗nA]. Let Φ\PhiΦ denote the standard normal cumulative distribution function.

Assume V>0V>0V>0 and fix 0<ε<10<\varepsilon<10<ε<1. Let CCC be a valid universal Berry–Esseen constant, independent of the states, bases, sample size and tolerance, with 0.40973≤C≤0.47840.40973\le C\le0.47840.40973≤C≤0.4784. For any complete spectral presentations let P(x,y)=λx∣⟨by∣ax⟩∣2P(x,y)=\lambda_x|\langle b_y|a_x\rangle|^2P(x,y)=λx​∣⟨by​∣ax​⟩∣2 and T3=EP∣log⁡(λX/μY)−D∣3T^3=\mathbb E_P|\log(\lambda_X/\mu_Y)-D|^3T3=EP​∣log(λX​/μY​)−D∣3. Zero-weight terms are zero. Define βn∗(ε)=min⁡αn(A)≤εβn(A)\beta_n^*(\varepsilon)=\min_{\alpha_n(A)\le\varepsilon}\beta_n(A)βn∗​(ε)=minαn​(A)≤ε​βn​(A), Hn=−log⁡βn∗(ε)H_n=-\log\beta_n^*(\varepsilon)Hn​=−logβn∗​(ε) and δn=CT3/[n(V)3]\delta_n=CT^3/[\sqrt n(\sqrt V)^3]δn​=CT3/[n​(V​)3]. For every integer n≥1n\ge1n≥1, the following bounds hold whenever their respective shifted-tolerance conditions hold:

ε−δn≥0 ⟹ Hn≥Ln:=nD+nV Φ−1(ε−δn),ε+δn+2/n≤1 ⟹ Hn≤Un:=nD+nV Φ−1(ε+δn+2/n)+log⁡(29n2).\begin{aligned}\varepsilon-\delta_n\ge0&\ \Longrightarrow\ H_n\ge L_n:=nD+\sqrt n\sqrt V\,\Phi^{-1}(\varepsilon-\delta_n),\\\varepsilon+\delta_n+2/\sqrt n\le1&\ \Longrightarrow\ H_n\le U_n:=nD+\sqrt n\sqrt V\,\Phi^{-1}(\varepsilon+\delta_n+2/\sqrt n)+\log(2^9n^2).\end{aligned}ε−δn​≥0ε+δn​+2/n​≤1​ ⟹ Hn​≥Ln​:=nD+n​V​Φ−1(ε−δn​), ⟹ Hn​≤Un​:=nD+n​V​Φ−1(ε+δn​+2/n​)+log(29n2).​

Use Φ−1(0)=−∞\Phi^{-1}(0)=-\inftyΦ−1(0)=−∞ and Φ−1(1)=+∞\Phi^{-1}(1)=+\inftyΦ−1(1)=+∞. For sufficiently large nnn, both arguments are interior and, with cn=nD+nV Φ−1(ε)c_n=nD+\sqrt n\sqrt V\,\Phi^{-1}(\varepsilon)cn​=nD+n​V​Φ−1(ε),

Ln=cn+O(1),Un=cn+2log⁡n+O(1).L_n=c_n+O(1),\qquad U_n=c_n+2\log n+O(1).Ln​=cn​+O(1),Un​=cn​+2logn+O(1).

These are separate finite bounds and expansions of the bounding expressions. In particular the theorem does not identify the optimized remainder with either bounding remainder.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P01
Formal statement
noncomputable section

open Filter

open scoped Topology

namespace QAlgorithms.Papers.Independent.Advance50.P01

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

open QAlgorithms.Papers.Independent.Information100.P63 (normalCDF normalQuantile tensorPower)

open QAlgorithms.Papers.Independent.Information100.P58 (testingBeta testingD)

open QAlgorithms.Papers.Independent.Dependency50.P36 (relativeEntropyFinite)

attribute [local instance] Classical.propDecidable

-- Match the universe-zero matrix indices of the pinned accepted interfaces.

variable {I : Type} [Fintype I] [DecidableEq I]

-- SupportIncluded is opened directly from the accepted Information100.P71 module.

/-- Theorem 5, source PDF pp. 14–16, (44)–(45). Each finite inequality has its own
weak shifted-epsilon condition and n>=1. Extended quantiles retain the endpoints.
The final clauses expand the bounding expressions, not the optimized divergence itself.
Zero-weight sigma-kernel terms implement compression (p. 5). -/
theorem theorem5_finiteSampleBounds (C : ℝ) (hC : IsBerryEsseenConstant C)
    (hCrange : (0.40973 : ℝ) ≤ C ∧ C ≤ (0.4784 : ℝ))
    [Nonempty I] (rho sigma : Matrix I I ℂ)
    (hrho : IsDensityMatrix rho) (hsigma : IsDensityMatrix sigma)
    (hsupport : SupportIncluded rho sigma) (hV : 0 < relativeVarianceNats rho sigma)
    (r : SpectralDecomposition rho) (s : SpectralDecomposition sigma)
    (epsilon : ℝ) (hepsilon : 0 < epsilon ∧ epsilon < 1) :
    (∀ n : ℕ, 1 ≤ n →
      0 ≤ epsilon - beCorrection C (relativeVarianceNats rho sigma) (spectralThirdMoment r s) n →
      finiteLower rho sigma epsilon C (spectralThirdMoment r s) n ≤
        iidTestingDivergenceNats rho sigma n epsilon) ∧
    (∀ n : ℕ, 1 ≤ n →
      epsilon + beCorrection C (relativeVarianceNats rho sigma) (spectralThirdMoment r s) n +
          2 / Real.sqrt n ≤ 1 →
      iidTestingDivergenceNats rho sigma n epsilon ≤
        finiteUpper rho sigma epsilon C (spectralThirdMoment r s) n) ∧
    (∃ lowerRemainder upperRemainder : ℕ → ℝ,
      (lowerRemainder =O[atTop] (fun _ : ℕ => (1 : ℝ))) ∧
      (upperRemainder =O[atTop] (fun _ : ℕ => (1 : ℝ))) ∧
      ∃ N : ℕ, 1 ≤ N ∧ ∀ n ≥ N,
        0 < epsilon - beCorrection C (relativeVarianceNats rho sigma) (spectralThirdMoment r s) n ∧
        epsilon + beCorrection C (relativeVarianceNats rho sigma) (spectralThirdMoment r s) n +
            2 / Real.sqrt n < 1 ∧
        finiteLower rho sigma epsilon C (spectralThirdMoment r s) n =
          ((secondOrderCenter rho sigma epsilon n + lowerRemainder n : ℝ) : EReal) ∧
        finiteUpper rho sigma epsilon C (spectralThirdMoment r s) n =
          ((secondOrderCenter rho sigma epsilon n + 2 * Real.log n +
            upperRemainder n : ℝ) : EReal)) := by sorry

end QAlgorithms.Papers.Independent.Advance50.P01

end
Source
Second-order asymptotics for quantum hypothesis testing, arXiv:1208.1400v3, PDF p. 15, Theorem 5, equations (44)–(45)
Read-back

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

Let C∈[0.40973,0.4784]C\in[0.40973,0.4784]C∈[0.40973,0.4784] satisfy the following property: C>0C>0C>0, and for every natural number ddd, every probability vector pi≥0p_i\ge0pi​≥0 on {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and every real family ziz_izi​ with mean μ=∑ipizi\mu=\sum_i p_i z_iμ=∑i​pi​zi​, positive variance v=∑ipi(zi−μ)2v=\sum_i p_i(z_i-\mu)^2v=∑i​pi​(zi​−μ)2, and third absolute central moment t3=∑ipi∣zi−μ∣3t_3=\sum_i p_i|z_i-\mu|^3t3​=∑i​pi​∣zi​−μ∣3, the probability that (∑j=1nzXj−nμ)/(nv)≤t(\sum_{j=1}^n z_{X_j}-n\mu)/(\sqrt n\sqrt v)\le t(∑j=1n​zXj​​−nμ)/(n​v​)≤t, for independent samples with law ppp, differs from Φ(t)\Phi(t)Φ(t) by at most Ct3/(n(v)3)Ct_3/(\sqrt n(\sqrt v)^3)Ct3​/(n​(v​)3), for every n≥1n\ge1n≥1 and real ttt; here Φ(t)=∫−∞te−x2/2/2π dx\Phi(t)=\int_{-\infty}^{t}e^{-x^2/2}/\sqrt{2\pi}\,dxΦ(t)=∫−∞t​e−x2/2/2π​dx. Let III be a nonempty finite type with decidable equality, and let ρ,σ\rho,\sigmaρ,σ be positive semidefinite matrices of trace one with ker⁡σ⊆ker⁡ρ\ker\sigma\subseteq\ker\rhokerσ⊆kerρ. Define

D=Re⁡tr⁡ ⁣(cfc⁡(x↦xlog⁡x)ρ−ρ cfc⁡(log⁡)σ),L=cfc⁡(x↦log⁡x/log⁡2)ρ−cfc⁡(x↦log⁡x/log⁡2)σ−Dlog⁡21,V=(log⁡2)2Re⁡tr⁡(ρL2)>0.D=\operatorname{Re}\operatorname{tr}\!\left(\operatorname{cfc}(x\mapsto x\log x)\rho-\rho\,\operatorname{cfc}(\log)\sigma\right),\quad L=\operatorname{cfc}(x\mapsto\log x/\log2)\rho-\operatorname{cfc}(x\mapsto\log x/\log2)\sigma-\frac D{\log2}\mathbf1,\quad V=(\log2)^2\operatorname{Re}\operatorname{tr}(\rho L^2)>0.D=Retr(cfc(x↦xlogx)ρ−ρcfc(log)σ),L=cfc(x↦logx/log2)ρ−cfc(x↦logx/log2)σ−log2D​1,V=(log2)2Retr(ρL2)>0.

Choose any spectral decompositions ρ=∑xrxuxux∗\rho=\sum_x r_xu_xu_x^*ρ=∑x​rx​ux​ux∗​, σ=∑ysyvyvy∗\sigma=\sum_y s_yv_yv_y^*σ=∑y​sy​vy​vy∗​, with orthonormal bases and nonnegative weights summing to one. Put pxy=rx∣⟨vy,ux⟩∣2p_{xy}=r_x|\langle v_y,u_x\rangle|^2pxy​=rx​∣⟨vy​,ux​⟩∣2, let zxy=log⁡(rx/sy)z_{xy}=\log(r_x/s_y)zxy​=log(rx​/sy​) when both weights are nonzero and zxy=0z_{xy}=0zxy​=0 otherwise, and set T3=∑x,ypxy∣zxy−D∣3T_3=\sum_{x,y}p_{xy}|z_{xy}-D|^3T3​=∑x,y​pxy​∣zxy​−D∣3; strict positivity of every sys_ysy​ is not assumed. For 0<ϵ<10<\epsilon<10<ϵ<1, define

βn=inf⁡0⪯A⪯1Re⁡tr⁡(Aρ⊗n)≥1−ϵRe⁡tr⁡(Aσ⊗n),Hn={+∞,βn=0,−log⁡βn,βn≠0,\beta_n=\inf_{\substack{0\preceq A\preceq\mathbf1\\ \operatorname{Re}\operatorname{tr}(A\rho^{\otimes n})\ge1-\epsilon}} \operatorname{Re}\operatorname{tr}(A\sigma^{\otimes n}),\qquad H_n=\begin{cases}+\infty,&\beta_n=0,\\-\log\beta_n,&\beta_n\ne0,\end{cases}βn​=0⪯A⪯1Retr(Aρ⊗n)≥1−ϵ​inf​Retr(Aσ⊗n),Hn​={+∞,−logβn​,​βn​=0,βn​=0,​

and bn=CT3/(n(V)3)b_n=CT_3/(\sqrt n(\sqrt V)^3)bn​=CT3​/(n​(V​)3). Let Q(p)=−∞Q(p)=-\inftyQ(p)=−∞ for p≤0p\le0p≤0, Q(p)=+∞Q(p)=+\inftyQ(p)=+∞ for p≥1p\ge1p≥1, and Q(p)=inf⁡{z:p≤Φ(z)}Q(p)=\inf\{z:p\le\Phi(z)\}Q(p)=inf{z:p≤Φ(z)} otherwise, and put Ln=nD+nV Q(ϵ−bn)L_n=nD+\sqrt n\sqrt V\,Q(\epsilon-b_n)Ln​=nD+n​V​Q(ϵ−bn​) and Un=nD+nV Q(ϵ+bn+2/n)+log⁡(29n2)U_n=nD+\sqrt n\sqrt V\,Q(\epsilon+b_n+2/\sqrt n)+\log(2^9n^2)Un​=nD+n​V​Q(ϵ+bn​+2/n​)+log(29n2). The theorem asserts Ln≤HnL_n\le H_nLn​≤Hn​ for every n≥1n\ge1n≥1 satisfying 0≤ϵ−bn0\le\epsilon-b_n0≤ϵ−bn​, and Hn≤UnH_n\le U_nHn​≤Un​ for every n≥1n\ge1n≥1 satisfying ϵ+bn+2/n≤1\epsilon+b_n+2/\sqrt n\le1ϵ+bn​+2/n​≤1, including equality at these quantile endpoints. It also asserts that there are real sequences ℓn,un\ell_n,u_nℓn​,un​, each bounded in absolute value eventually, and an N≥1N\ge1N≥1, such that for every n≥Nn\ge Nn≥N both quantile arguments lie strictly between zero and one and

Ln=nD+nV Q(ϵ)+ℓn,Un=nD+nV Q(ϵ)+2log⁡n+un.L_n=nD+\sqrt n\sqrt V\,Q(\epsilon)+\ell_n,\qquad U_n=nD+\sqrt n\sqrt V\,Q(\epsilon)+2\log n+u_n.Ln​=nD+n​V​Q(ϵ)+ℓn​,Un​=nD+n​V​Q(ϵ)+2logn+un​.
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