Definitions for Asymptotic Error Rates in Quantum Hypothesis Testing
DefinitionQAlgorithms_Papers_Independent_Intakenext100_P45The objects the formalized statements of Asymptotic Error Rates in Quantum Hypothesis Testing (arXiv:0708.4282) are stated in. Each was checked against the paper by a blind read-back and a moderator.
chernoffOverlap: PDF p.9 (11): oriented trace overlap.chernoffInfimum: PDF p.16 (26): infimum, with no assertion of attainment.chernoffDistance: PDF p.9 (11): extended Chernoff distance, with -log(0)=+infinity.rateTerm: PDF p.8: positive-copy rate term; k represents n=k+1, avoiding 0 times infinity.HasRate: PDF p.8: an actual extended limit, rather than a chosen default value of a limit.typeIError: PDF pp.6,8: alpha accepts the alternative.typeIIError: PDF pp.6,8: beta is acceptance of the null under the alternative.bayesError: PDF pp.6,10 (18): arbitrary positive weights need not sum to one.helstromError: PDF pp.8--9 (10): the Helstrom expression with the single outer factor 1/2.traceDist: PDF p.17: unsquared trace distance.SpectralPair: PDF p.9 (12): chosen unitary eigenbases, retained even in degenerate eigenspaces.basisWeight: PDF p.9 (12): eigenbasis overlap weight.spectralP: PDF p.9 (12): p distribution, before normalization is asserted.spectralQ: PDF p.9 (12): q distribution.kl: PDF p.10 (16): classical relative entropy in nats, including support failure.classicalOverlap: PDF pp.19,21: scalar trace overlap, with 0^0=1 and inverse powers zero on the kernel.classicalCoefficient: PDF p.19: classical Chernoff coefficient.classicalDistance: PDF p.19: classical Chernoff distance in nats.exponentOf: PDF p.21 (42): the genuine extended supremum; the divisor is positive on Ico 0 1.classicalExponent: PDF p.21 (42): classical Hoeffding exponent.quantumExponent: PDF p.25 (44): quantum Hoeffding exponent.Common: PDF p.22: common support; coordinates with zero basis overlap are excluded too.overlapMass: PDF p.22: mass p(B).overlapConditionalLaw: PDF p.22: conditional law, used only when mass p q is positive.otherConditional: PDF p.22: the other conditional law on the SAME common-support type.conditionalExponent: PDF p.23: conditional exponent.SamePositiveSupport: PDF p.21: equivalence of finite laws, without positivity of ambient zero coordinates.iidLaw: PDF p.21: IID product of a finite law.RandomizedTest: PDF pp.20--21: randomized test, accepting H1 with the indicated probability.classicalAlpha: PDF p.21: classical type-I error.classicalBeta: PDF p.21: classical type-II error.classicalError: PDF p.10 (17): weighted classical error.ClassicalTestSequence: PDF p.21: every block length is positive.alphaSeq: PDF p.21: alpha sequence for the original IID laws.betaSeq: PDF p.21: beta sequence for the original IID laws.ClassicalHBCL: PDF p.21, Theorem 3: the two clauses of the HBCL tradeoff, with strict converse.ObservableWords: PDF p.22: actual observable word space, with doubly impossible words removed.NullAdmissible: PDF p.22: nonrandomized tests are explicitly Bool-valued.observableOfCommon: PDF p.23: restriction to B^n. Its word is observable since each p coordinate is positive.restrictTest: PDF p.23: restriction of a nonrandomized test.observableAlpha: PDF p.23: actual original alpha of a nonrandomized observable-space test.observableBeta: PDF p.23: actual original beta.restrictedAlpha: PDF p.23: conditional alpha on B^n.restrictedBeta: PDF p.23: conditional beta on B^n.quantumArc: PDF pp.19--20: normalized product arc, generally not self-adjoint.quantumArcLog: PDF p.20: logarithm of the arc by similarity to its positive definite sandwich. Used with invertible rho,sigma. No self-adjoint cfc is applied to the arc itself.arcRelative: PDF p.20 (39): finite trace relative entropy of the arc.DiagonalizesNonnegative: PDF p.26: positive-spectrum diagonalization data; inverses are explicit, not a default inverse.nonnegativeSpectrumLog: PDF p.26: spectral log for diagonalizable nonnegative-spectrum products. The zero eigenvalue has log value zero. The fallback is unused on the products in the theorem; no diagonalization premise is imposed on the theorem's data.generalizedRelative: PDF p.26: finite trace extension, with Y positive but possibly unnormalized/singular.supportConditionalEntropy: PDF pp.25--26: conditional entropy-type expression, retaining multiplication order.hellingerArc: PDF p.19: classical Hellinger arc, including harmless zero ambient coordinates.logDerivative: PDF p.19: logarithmic derivative, used where common support guarantees analyticity.Profile: PDF pp.24--25: full finite-tail shape, retaining strict convexity only for distinct conditionals.constrainedTypeII: PDF p.30 (53): optimum over ALL effects, including joint effects on tensor copies.QuantumTests: PDF pp.8,27: arbitrary sequence of joint effects, independent of which hypothesis holds.quantumAlpha: PDF pp.8,27: the alpha error sequence for actual tensor copies.quantumBeta: PDF pp.8,27: the beta error sequence.densityIdempotence: PDF p.17: pure density, with normalization supplied by IsDensityMatrix at every use.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_ExtendedQuantumEntropy
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P07
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P56
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P60
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P28
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P13
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P15
/-! Audenaert--Nussbaum--Szkoła--Verstraete, arXiv:0708.4282v1.
Natural logarithms. Copy index k means the positive number k+1.
The zero spectral power is the identity, as in Section 4.4; infima need not
be attained. Accepted-library imports use the independent-paper override.
Compilation and independent moderation are pending the batch handoff. -/
noncomputable section
namespace QAlgorithms.Papers.Independent.Intakenext100.P45
open QAlgorithms Filter
open scoped Matrix ComplexConjugate ComplexOrder ENNReal BigOperators Topology
open QAlgorithms.Papers.Independent.Information100.P07
(support positivePart positiveProjection IsProjection)
open QAlgorithms.Papers.Independent.Information100.P56 (IsLaw)
open QAlgorithms.Papers.Independent.Information100.P60 (Mat copies)
open QAlgorithms.Papers.Independent.Dependency50.P28 (logNonnegativeExtended relativeEntropy)
open QAlgorithms.Papers.Independent.Claimed50.P15 (positiveMatrixRpow)
attribute [local instance] Classical.propDecidable Classical.decEq
variable {I J : Type} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J]
/-- PDF p.9 (11): oriented trace overlap. -/
def chernoffOverlap (rho sigma : Mat I) (s : ℝ) : ℝ :=
(positiveMatrixRpow rho (1-s) * positiveMatrixRpow sigma s).trace.re
/-- PDF p.16 (26): infimum, with no assertion of attainment. -/
def chernoffInfimum (rho sigma : Mat I) : ℝ := sInf (chernoffOverlap rho sigma '' Set.Icc 0 1)
/-- PDF p.9 (11): extended Chernoff distance, with -log(0)=+infinity. -/
def chernoffDistance (rho sigma : Mat I) : EReal := -logNonnegativeExtended (chernoffInfimum rho sigma)
/-- PDF p.8: positive-copy rate term; k represents n=k+1, avoiding 0 times infinity. -/
def rateTerm (a : ℝ) (k : ℕ) : EReal :=
((1 / ((k+1 : ℕ) : ℝ) : ℝ) : EReal) * (-logNonnegativeExtended a)
/-- PDF p.8: an actual extended limit, rather than a chosen default value of a limit. -/
def HasRate (a : ℕ → ℝ) (r : EReal) : Prop :=
Tendsto (fun k => rateTerm (a k) k) atTop (nhds r)
/-- PDF pp.6,8: alpha accepts the alternative. -/
def typeIError (rho : Mat I) (P : Mat I) : ℝ := (P * rho).trace.re
/-- PDF pp.6,8: beta is acceptance of the null under the alternative. -/
def typeIIError (sigma : Mat I) (P : Mat I) : ℝ := ((1-P) * sigma).trace.re
/-- PDF pp.6,10 (18): arbitrary positive weights need not sum to one. -/
def bayesError (rho sigma P : Mat I) (a b : ℝ) : ℝ :=
a * typeIError rho P + b * typeIIError sigma P
/-- PDF pp.8--9 (10): the Helstrom expression with the single outer factor 1/2. -/
def helstromError (rho sigma : Mat I) (a b : ℝ) : ℝ :=
(1-traceNorm ((b : ℂ) • sigma - (a : ℂ) • rho))/2
/-- PDF p.17: unsquared trace distance. -/
def traceDist (rho sigma : Mat I) : ℝ := traceNorm (rho-sigma)/2
/-- PDF p.9 (12): chosen unitary eigenbases, retained even in degenerate eigenspaces. -/
structure SpectralPair (rho sigma : Mat I) where
leftBasis : Matrix.unitaryGroup I ℂ
rightBasis : Matrix.unitaryGroup I ℂ
leftValues : I → ℝ
rightValues : I → ℝ
left_nonneg : ∀ i, 0 ≤ leftValues i
right_nonneg : ∀ i, 0 ≤ rightValues i
left_spectral : rho = (leftBasis : Mat I) *
Matrix.diagonal (fun i => (leftValues i : ℂ)) * (leftBasis : Mat I)ᴴ
right_spectral : sigma = (rightBasis : Mat I) *
Matrix.diagonal (fun i => (rightValues i : ℂ)) * (rightBasis : Mat I)ᴴ
/-- PDF p.9 (12): eigenbasis overlap weight. -/
def basisWeight (U V : Mat I) (i j : I) : ℝ := Complex.normSq ((Uᴴ * V) i j)
/-- PDF p.9 (12): p distribution, before normalization is asserted. -/
def spectralP {rho sigma : Mat I} (D : SpectralPair rho sigma) : I × I → ℝ :=
fun ij => D.leftValues ij.1 * basisWeight D.leftBasis D.rightBasis ij.1 ij.2
/-- PDF p.9 (12): q distribution. -/
def spectralQ {rho sigma : Mat I} (D : SpectralPair rho sigma) : I × I → ℝ :=
fun ij => D.rightValues ij.2 * basisWeight D.leftBasis D.rightBasis ij.1 ij.2
/-- PDF p.10 (16): classical relative entropy in nats, including support failure. -/
def kl (p q : I → ℝ) : EReal :=
QAlgorithms.Papers.Independent.Dependency50.P28.classicalD (.finite 1 (by norm_num)) p q
/-- PDF pp.19,21: scalar trace overlap, with 0^0=1 and inverse powers zero on the kernel. -/
def classicalOverlap (p q : I → ℝ) (s : ℝ) : ℝ := ∑ i, (p i) ^ (1-s) * (q i) ^ s
/-- PDF p.19: classical Chernoff coefficient. -/
def classicalCoefficient (p q : I → ℝ) : ℝ :=
sInf (classicalOverlap p q '' Set.Icc 0 1)
/-- PDF p.19: classical Chernoff distance in nats. -/
def classicalDistance (p q : I → ℝ) : EReal :=
-logNonnegativeExtended (classicalCoefficient p q)
/-- PDF p.21 (42): the genuine extended supremum; the divisor is positive on Ico 0 1. -/
def exponentOf (Q : ℝ → ℝ) (r : ℝ) : EReal :=
sSup {v | ∃ s ∈ Set.Ico (0 : ℝ) 1,
v = (((1-s)⁻¹ : ℝ) : EReal) *
(((-r*s : ℝ) : EReal) - logNonnegativeExtended (Q s))}
/-- PDF p.21 (42): classical Hoeffding exponent. -/
def classicalExponent (p q : I → ℝ) (r : ℝ) : EReal :=
exponentOf (classicalOverlap p q) r
/-- PDF p.25 (44): quantum Hoeffding exponent. -/
def quantumExponent (rho sigma : Mat I) (r : ℝ) : EReal :=
exponentOf (chernoffOverlap rho sigma) r
/-- PDF p.22: common support; coordinates with zero basis overlap are excluded too. -/
abbrev Common (p q : I → ℝ) := {i : I // 0 < p i ∧ 0 < q i}
/-- PDF p.22: mass p(B). -/
def overlapMass (p q : I → ℝ) : ℝ := ∑ i : Common p q, p i.1
/-- PDF p.22: conditional law, used only when mass p q is positive. -/
def overlapConditionalLaw (p q : I → ℝ) : Common p q → ℝ := fun i => p i.1 / overlapMass p q
/-- PDF p.22: the other conditional law on the SAME common-support type. -/
def otherConditional (p q : I → ℝ) : Common p q → ℝ := fun i => q i.1 / overlapMass q p
/-- PDF p.23: conditional exponent. -/
def conditionalExponent (p q : I → ℝ) (r : ℝ) : EReal :=
classicalExponent (overlapConditionalLaw p q) (otherConditional p q) r
/-- PDF p.21: equivalence of finite laws, without positivity of ambient zero coordinates. -/
def SamePositiveSupport (p q : I → ℝ) : Prop := ∀ i, (0 < p i ↔ 0 < q i)
/-- PDF p.21: IID product of a finite law. -/
def iidLaw (p : I → ℝ) (n : ℕ) (x : Fin n → I) : ℝ := ∏ j, p (x j)
/-- PDF pp.20--21: randomized test, accepting H1 with the indicated probability. -/
abbrev RandomizedTest (I : Type) := I → Set.Icc (0 : ℝ) 1
/-- PDF p.21: classical type-I error. -/
def classicalAlpha (p : I → ℝ) (f : RandomizedTest I) : ℝ := ∑ i, p i * (f i).1
/-- PDF p.21: classical type-II error. -/
def classicalBeta (q : I → ℝ) (f : RandomizedTest I) : ℝ := ∑ i, q i * (1-(f i).1)
/-- PDF p.10 (17): weighted classical error. -/
def classicalError (p q : I → ℝ) (a b : ℝ) (f : RandomizedTest I) : ℝ :=
a * classicalAlpha p f + b * classicalBeta q f
/-- PDF p.21: every block length is positive. -/
abbrev ClassicalTestSequence (I : Type) := (k : ℕ) → RandomizedTest (Fin (k+1) → I)
/-- PDF p.21: alpha sequence for the original IID laws. -/
def alphaSeq (p : I → ℝ) (f : ClassicalTestSequence I) (k : ℕ) : ℝ :=
classicalAlpha (iidLaw p (k+1)) (f k)
/-- PDF p.21: beta sequence for the original IID laws. -/
def betaSeq (q : I → ℝ) (f : ClassicalTestSequence I) (k : ℕ) : ℝ :=
classicalBeta (iidLaw q (k+1)) (f k)
/-- PDF p.21, Theorem 3: the two clauses of the HBCL tradeoff, with strict converse. -/
def ClassicalHBCL (p q : I → ℝ) : Prop :=
(∀ r : ℝ, 0 < r → ∃ f : ClassicalTestSequence I, ∃ b : EReal,
HasRate (alphaSeq p f) (classicalExponent p q r) ∧
HasRate (betaSeq q f) b ∧ (r : EReal) ≤ b) ∧
(∀ (f : ClassicalTestSequence I) (a b : EReal) (r : ℝ), 0 < r →
HasRate (alphaSeq p f) a → HasRate (betaSeq q f) b →
(r : EReal) < b → a ≤ classicalExponent p q r)
/-- PDF p.22: actual observable word space, with doubly impossible words removed. -/
abbrev ObservableWords (p q : I → ℝ) (n : ℕ) :=
{x : Fin n → I // 0 < iidLaw p n x ∨ 0 < iidLaw q n x}
/-- PDF p.22: nonrandomized tests are explicitly Bool-valued. -/
def NullAdmissible (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) : Prop :=
∀ x, (iidLaw q n x.1 = 0 → f x = false) ∧
(iidLaw p n x.1 = 0 → f x = true)
/-- PDF p.23: restriction to B^n. Its word is observable since each p coordinate is positive. -/
def observableOfCommon (p q : I → ℝ) {n : ℕ} (x : Fin n → Common p q) : ObservableWords p q n :=
⟨fun j => (x j).1, Or.inl (Finset.prod_pos (fun j _ => (x j).2.1))⟩
/-- PDF p.23: restriction of a nonrandomized test. -/
def restrictTest (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) :
(Fin n → Common p q) → Bool := fun x => f (observableOfCommon p q x)
/-- PDF p.23: actual original alpha of a nonrandomized observable-space test. -/
def observableAlpha (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) : ℝ :=
∑ x, if f x then iidLaw p n x.1 else 0
/-- PDF p.23: actual original beta. -/
def observableBeta (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) : ℝ :=
∑ x, if f x then 0 else iidLaw q n x.1
/-- PDF p.23: conditional alpha on B^n. -/
def restrictedAlpha (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) : ℝ :=
∑ x : Fin n → Common p q,
if restrictTest p q f x then iidLaw (overlapConditionalLaw p q) n x else 0
/-- PDF p.23: conditional beta on B^n. -/
def restrictedBeta (p q : I → ℝ) {n : ℕ} (f : ObservableWords p q n → Bool) : ℝ :=
∑ x : Fin n → Common p q,
if restrictTest p q f x then 0 else iidLaw (otherConditional p q) n x
/-- PDF pp.19--20: normalized product arc, generally not self-adjoint. -/
def quantumArc (rho sigma : Mat I) (s : ℝ) : Mat I :=
((chernoffOverlap rho sigma s)⁻¹ : ℂ) • (positiveMatrixRpow rho (1-s) * positiveMatrixRpow sigma s)
/-- PDF p.20: logarithm of the arc by similarity to its positive definite sandwich.
Used with invertible rho,sigma. No self-adjoint cfc is applied to the arc itself. -/
def quantumArcLog (rho sigma : Mat I) (s : ℝ) : Mat I :=
let R := positiveMatrixRpow rho ((1-s)/2)
let Ri := positiveMatrixRpow rho (-((1-s)/2))
R * cfc Real.log (((chernoffOverlap rho sigma s)⁻¹ : ℂ) •
(R * positiveMatrixRpow sigma s * R)) * Ri
/-- PDF p.20 (39): finite trace relative entropy of the arc. -/
def arcRelative (rho sigma Y : Mat I) (s : ℝ) : ℝ :=
(quantumArc rho sigma s * (quantumArcLog rho sigma s - cfc Real.log Y)).trace.re
/-- PDF p.26: positive-spectrum diagonalization data; inverses are explicit, not a default inverse. -/
def DiagonalizesNonnegative (X : Mat I) (d : (I → ℝ) × Mat I × Mat I) : Prop :=
(∀ i, 0 ≤ d.1 i) ∧ d.2.1 * d.2.2 = 1 ∧ d.2.2 * d.2.1 = 1 ∧
X = d.2.1 * Matrix.diagonal (fun i => (d.1 i : ℂ)) * d.2.2
/-- PDF p.26: spectral log for diagonalizable nonnegative-spectrum products.
The zero eigenvalue has log value zero. The fallback is unused on the products in the theorem;
no diagonalization premise is imposed on the theorem's data. -/
def nonnegativeSpectrumLog (X : Mat I) : Mat I :=
if h : ∃ d, DiagonalizesNonnegative X d then
let d := h.choose
d.2.1 * Matrix.diagonal (fun i => (Real.log (d.1 i) : ℂ)) * d.2.2
else 0
/-- PDF p.26: finite trace extension, with Y positive but possibly unnormalized/singular. -/
def generalizedRelative (X Y : Mat I) : ℝ :=
(X * (nonnegativeSpectrumLog X - cfc Real.log Y)).trace.re
/-- PDF pp.25--26: conditional entropy-type expression, retaining multiplication order. -/
def supportConditionalEntropy (rho sigma : Mat I) : ℝ :=
let psi := (rho * support sigma).trace.re
let R := ((psi⁻¹ : ℝ) : ℂ) • rho
(R * (cfc Real.log R - cfc Real.log sigma) * support sigma).trace.re
/-- PDF p.19: classical Hellinger arc, including harmless zero ambient coordinates. -/
def hellingerArc (p q : I → ℝ) (s : ℝ) : I → ℝ :=
fun i => (p i) ^ (1-s) * (q i) ^ s / classicalOverlap p q s
/-- PDF p.19: logarithmic derivative, used where common support guarantees analyticity. -/
def logDerivative (p q : I → ℝ) (s : ℝ) : ℝ :=
deriv (fun t : ℝ => Real.log (classicalOverlap p q t)) s
/-- PDF pp.24--25: full finite-tail shape, retaining strict convexity only for distinct conditionals. -/
def Profile (p q : I → ℝ) (e : ℝ → EReal) : Prop :=
let a := -Real.log (overlapMass q p)
let b := -Real.log (overlapMass p q)
let h := kl (overlapConditionalLaw p q) (otherConditional p q)
let hrev := kl (otherConditional p q) (overlapConditionalLaw p q)
(∀ r : ℝ, 0 ≤ r → r < a → e r = ⊤) ∧
e a = (b : EReal) + hrev ∧
(b : EReal) + hrev = kl (fun i => if 0 < p i ∧ 0 < q i then q i / overlapMass q p else 0) p ∧
(a : EReal) + h = kl (fun i => if hi : 0 < p i ∧ 0 < q i then p i / overlapMass p q else 0) q ∧
(∀ r : ℝ, a ≤ r → e r ≠ ⊤ ∧ e r ≠ ⊥) ∧
AntitoneOn e (Set.Ici a) ∧
ConvexOn ℝ (Set.Ici a) (fun r => (e r).toReal) ∧
(∀ r : ℝ, a + h.toReal ≤ r → e r = (b : EReal)) ∧
(overlapConditionalLaw p q ≠ otherConditional p q →
StrictConvexOn ℝ (Set.Icc a (a+h.toReal)) (fun r => (e r).toReal) ∧
StrictAntiOn e (Set.Icc a (a+h.toReal))) ∧
(overlapConditionalLaw p q = otherConditional p q →
∀ r : ℝ, a ≤ r → e r = (b : EReal))
/-- PDF p.30 (53): optimum over ALL effects, including joint effects on tensor copies. -/
def constrainedTypeII (rho sigma : Mat I) (eps : ℝ) (k : ℕ) : ℝ :=
sInf {v | ∃ P : Mat (Fin (k+1) → I), IsEffect P ∧
typeIError (copies (k+1) rho) P ≤ eps ∧ v = typeIIError (copies (k+1) sigma) P}
/-- PDF pp.8,27: arbitrary sequence of joint effects, independent of which hypothesis holds. -/
abbrev QuantumTests (I : Type) := (k : ℕ) → Mat (Fin (k+1) → I)
/-- PDF pp.8,27: the alpha error sequence for actual tensor copies. -/
def quantumAlpha (rho : Mat I) (P : QuantumTests I) (k : ℕ) : ℝ :=
typeIError (copies (k+1) rho) (P k)
/-- PDF pp.8,27: the beta error sequence. -/
def quantumBeta (sigma : Mat I) (P : QuantumTests I) (k : ℕ) : ℝ :=
typeIIError (copies (k+1) sigma) (P k)
/-- PDF p.17: pure density, with normalization supplied by IsDensityMatrix at every use. -/
def densityIdempotence (rho : Mat I) : Prop := rho * rho = rho
/-! Small-case sanity tests for the locally constructed interfaces. -/
example : -logNonnegativeExtended 0 = ⊤ := by
simp [logNonnegativeExtended]
example (k : ℕ) : rateTerm 1 k = 0 := by
simp [rateTerm, logNonnegativeExtended]
example (p : I → ℝ) : iidLaw p 0 (fun i => Fin.elim0 i) = 1 := by
simp [iidLaw]
example (rho : Mat I) : typeIError rho 0 = 0 := by simp [typeIError]
example (sigma : Mat I) : typeIIError sigma 1 = 0 := by simp [typeIIError]
example (A : Mat I) : quantumExponent A A 0 = exponentOf (chernoffOverlap A A) 0 := rfl
example (X Y : Mat I) : generalizedRelative X Y =
(X * (nonnegativeSpectrumLog X - cfc Real.log Y)).trace.re := rfl
example : positiveMatrixRpow (0 : Mat (Fin 1)) 1 = 0 := by
simp [positiveMatrixRpow]
open scoped Matrix.Norms.L2Operator in
example (A : Mat I) (hA : A.IsHermitian) : positiveMatrixRpow A 0 = 1 := by
simp only [positiveMatrixRpow, Real.rpow_zero]
exact cfc_const_one ℝ A hA.isSelfAdjoint
example (X : Mat I) : generalizedRelative X X =
(X * (nonnegativeSpectrumLog X - cfc Real.log X)).trace.re := rfl
section HilbertAppendix
open QAlgorithms.Papers.Independent.Dependency50.P13
(IsTraceClass operatorTrace traceNormValue)
variable {H : Type} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H]
end HilbertAppendix
end QAlgorithms.Papers.Independent.Intakenext100.P45
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakenext100.P45.ClassicalHBCL
For a finite type and arbitrary functions , define when and otherwise, using the natural logarithm, and put
with extended real arithmetic and the total real-power operation. For every sequence of functions , put
The defined proposition is the conjunction of these two assertions: for every real , there exist such a sequence and an extended real number for which , , and ; and for every such sequence , every extended real , and every real , if , , and , then . All limits are as in the extended real numbers, so infinite limits are allowed. No nonnegativity or normalization assumption is imposed on ; a nonpositive or gives the corresponding rate term . The quantification includes empty , for which both sums are zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.ClassicalTestSequence
For any type , this abbreviates the type of sequences in which
Thus assigns a real number between zero and one, inclusive, to every word of length . The sequence starts with tests on words of length one at ; it contains no test on words of length zero. No consistency between different , finiteness of , or measurability is required.
QAlgorithms.Papers.Independent.Intakenext100.P45.Common
For a finite index type with decidable equality and arbitrary functions , this abbreviation denotes the subtype
Thus its elements are indices satisfying both strict positivity conditions. No nonnegativity or normalization assumptions are made on the functions elsewhere, and this subtype may be empty.
QAlgorithms.Papers.Independent.Intakenext100.P45.DiagonalizesNonnegative
For a finite index type with decidable equality, a complex matrix indexed by , and a triple consisting of a real-valued function and two complex matrices on , this property is exactly
Thus both orders of the inverse relation are required, while no unitarity of or equality is required. If is empty, the nonnegativity condition is vacuous and all the matrix equalities hold for the unique empty matrices.
QAlgorithms.Papers.Independent.Intakenext100.P45.HasRate
For any real sequence and any extended real number , possibly or , this is the assertion that
in the extended-real topology, where is the natural logarithm. No positivity, boundedness, or probability interpretation is required of the sequence.
QAlgorithms.Papers.Independent.Intakenext100.P45.NullAdmissible
For an index type , arbitrary functions , a natural number , and a Boolean-valued function on the words for which or , this property means that every such word satisfies both implications
The functions need not be probability laws. A negative product does not trigger either zero-product condition, and a word with both products zero is outside the domain. For , both products equal , so every satisfies the property.
QAlgorithms.Papers.Independent.Intakenext100.P45.ObservableWords
For an index type , arbitrary functions , and a natural number , this defines the set of words
No nonnegativity or normalization of or is assumed: membership requires strict positivity of at least one entire product. For , both empty products equal , so the unique empty word belongs to this set.
QAlgorithms.Papers.Independent.Intakenext100.P45.Profile
For a finite type with decidable equality, arbitrary real functions on , and , let , , , , , and define functions on by and . For any finite index set and real functions on it, write if implies for every , and otherwise. Set and , and define on to equal , respectively, on , and zero elsewhere. The predicate is the conjunction of all the following requirements: whenever ; ; ; ; is neither infinity whenever ; is nonincreasing on ; is convex there; for every ; if , then is strictly convex and is strictly decreasing on ; and if , then for every . Real values in these equations are embedded into the extended reals, whose operation sends both infinities to zero. There are no probability-law assumptions on ; empty sums are zero, , and division by zero is zero. In particular, if is empty, this predicate requires exactly for , with no restriction for .
QAlgorithms.Papers.Independent.Intakenext100.P45.QuantumTests
For any type , this abbreviates the type of sequences in which is a complex square matrix indexed by functions . No finiteness or decidable-equality assumption on is needed for this abbreviation, and no Hermiticity, positivity, projection, or effect condition is imposed on the matrices. The first matrix, , is indexed by one-coordinate functions.
QAlgorithms.Papers.Independent.Intakenext100.P45.RandomizedTest
For any type , this abbreviates the type of functions , where is the closed real interval. Thus each value comes with the conditions . No finiteness or measurability requirement is imposed; if is empty, there is exactly one such function.
QAlgorithms.Papers.Independent.Intakenext100.P45.SamePositiveSupport
For any type and arbitrary functions , this is the proposition
No finiteness, nonnegativity, or normalization assumption is imposed. At an index where neither value is positive, the condition permits either value to be zero or negative. If is empty, the proposition holds vacuously.
QAlgorithms.Papers.Independent.Intakenext100.P45.SpectralPair
For any finite index type with decidable equality and fixed complex matrices , this structure consists of two unitary matrices , two real-valued functions , proofs that and for every , and the identities
The values need not be ordered, distinct, strictly positive, or sum to one. The structure specifies such data when available; it does not assert their existence for every pair of matrices. Empty is allowed, with the nonnegativity requirements then vacuous.
QAlgorithms.Papers.Independent.Intakenext100.P45.alphaSeq
For a finite type , arbitrary function , sequence of tests , and natural number , this defines
No nonnegativity or normalization assumption is imposed on . At , this is a sum over words of length one. If is empty, there are no words of length , and the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.arcRelative
For a finite index type with decidable equality, arbitrary complex matrices indexed by , and any real , write for the real functional calculus of the total real power , and for that of the total real logarithm, with . Put
This defines the real number
There are no density-matrix, positivity, invertibility, or support assumptions. The real functional calculus returns zero on non-Hermitian matrices, and zero has reciprocal zero; in particular, gives value zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.basisWeight
For any finite index type with decidable equality, arbitrary complex matrices , and indices , this defines the squared complex modulus
Neither matrix is required to be unitary. If is empty, there are no indices to supply.
QAlgorithms.Papers.Independent.Intakenext100.P45.bayesError
For any finite index type with decidable equality, arbitrary complex matrices , and arbitrary real numbers , this defines
There are no positivity or normalization assumptions on the matrices or weights; in particular, neither nor is required. For empty , the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.betaSeq
For a finite type , arbitrary function , sequence of tests , and natural number , this defines
No nonnegativity or normalization assumption is imposed on . At , this is a sum over words of length one. If is empty, there are no words of length , and the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.chernoffDistance
For any finite index type with decidable equality and arbitrary complex matrices , let
where is the real continuous functional calculus for the total real-power function , returning zero for non-Hermitian . This defines an extended real number equal to when , and to when , where is the natural logarithm. No positivity or normalization assumptions are made on ; for empty , the value is .
QAlgorithms.Papers.Independent.Intakenext100.P45.chernoffInfimum
For any finite index type with decidable equality and arbitrary complex matrices , this defines the real infimum
where is the real continuous functional calculus of for the total real-power function , with zero returned for non-Hermitian matrices. Both endpoints are included, and the scalar convention is . No positivity or normalization assumptions are imposed on the matrices. If is empty, this infimum is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.chernoffOverlap
For any finite index type with decidable equality, arbitrary complex matrices indexed by , and real number , this defines
where is the real continuous functional calculus applied to with the function , using the total real-power operation. No positivity, Hermiticity, trace normalization, or restriction on is assumed; the functional calculus is used as a total operation, returning zero for non-Hermitian matrices. In particular, the scalar power convention includes . If is empty, the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalAlpha
For a finite type , arbitrary function , and function , this defines the real number
The values of lie in the closed interval , but is not required to be nonnegative or normalized, so this sum is not assumed to be a probability. If is empty, it equals zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalBeta
For a finite type , arbitrary function , and function , this defines the real number
The values of lie in the closed interval , but is not required to be nonnegative or normalized, so this sum is not assumed to be a probability. If is empty, it equals zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalCoefficient
For a finite index type with decidable equality and arbitrary functions , this definition gives the real infimum
The endpoints are included, and powers use the total real-power operation, with zeroth powers equal to one even for a zero base. No positivity or normalization assumptions are imposed, and the definition does not assert that the infimum is attained. For empty , the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalDistance
For a finite index type with decidable equality and arbitrary functions , set
using total real powers. This definition gives the extended real value when , and when , because the logarithm being negated is defined to be on nonpositive inputs. There are no positivity or normalization hypotheses on ; a positive therefore gives a negative value. Empty gives .
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalError
For a finite type , arbitrary functions , arbitrary real numbers , and a function , this defines
There are no nonnegativity or normalization assumptions on ; in particular, need not sum to one. If is empty, the defined value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalExponent
For a finite index type with decidable equality, arbitrary functions , and any real , this definition gives
where powers are total real powers, for , and otherwise. The displayed arithmetic outside the finite sum is extended real arithmetic. No positivity or normalization assumptions on , or sign restriction on , are imposed. A nonpositive overlap at any allowed gives ; in particular, empty gives .
QAlgorithms.Papers.Independent.Intakenext100.P45.classicalOverlap
For a finite index type with decidable equality, arbitrary functions , and any real , this definition gives
The powers use the total real-power operation. No positivity, normalization, or restriction on is assumed, so zero and negative bases are included; in particular, a zeroth power, including , is one. If is empty, the value is zero for every .
QAlgorithms.Papers.Independent.Intakenext100.P45.conditionalExponent
For a finite type , arbitrary functions , and any real , let , and define and for . The defined value lies in the extended real numbers and is
Here is the natural logarithm and the arithmetic involving is extended real arithmetic. No distribution assumptions are imposed on , and need not be positive. If is empty, the overlap sum is zero and the defined value is .
QAlgorithms.Papers.Independent.Intakenext100.P45.constrainedTypeII
For a finite type with decidable equality, arbitrary complex matrices indexed by , any real , and any natural number , put and define matrices on by and likewise for . This defines the real infimum
There are no density-matrix assumptions on or restrictions on , and means one copy. This is the total real infimum, which returns zero if the set is empty or unbounded below.
QAlgorithms.Papers.Independent.Intakenext100.P45.densityIdempotence
For a finite type with decidable equality and any complex matrix indexed by , this predicate means exactly . It imposes no Hermiticity, positivity, or trace-one condition. Zero matrices and matrices indexed by an empty are included.
QAlgorithms.Papers.Independent.Intakenext100.P45.exponentOf
For any function and any real , define for and for . This definition gives the extended real supremum
where the subtraction and multiplication are performed in the extended reals after embedding finite real quantities. The parameter is included and is excluded, so the multiplier is always finite and strictly positive. No regularity or positivity is assumed for , and no sign condition is imposed on . If for any allowed , the value is .
QAlgorithms.Papers.Independent.Intakenext100.P45.generalizedRelative
For a finite type with decidable equality and arbitrary complex matrices indexed by , this defines the real number . Here applies the total real logarithm through continuous functional calculus, and is obtained by choosing a representation with every and , and setting ; if no such representation exists, . In particular, . No density-matrix, positivity, normalization, or support-inclusion hypotheses are required, and the value is real rather than extended real.
QAlgorithms.Papers.Independent.Intakenext100.P45.hellingerArc
For a finite type with decidable equality, arbitrary real-valued functions on , and any real , this defines the real-valued function
The powers are total real powers. There are no nonnegativity, normalization, support, or restrictions on . Division by zero returns zero, so a zero denominator makes the entire returned function zero; the definition also permits an empty .
QAlgorithms.Papers.Independent.Intakenext100.P45.helstromError
For any finite index type with decidable equality, arbitrary complex matrices , and arbitrary real numbers , put . This defines
where is the conjugate transpose and the matrix square root is obtained through the real continuous functional calculus for . No positivity or trace normalization of , or sign or sum condition on , is required; the value can be negative. If is empty, the value is .
QAlgorithms.Papers.Independent.Intakenext100.P45.iidLaw
For any type , arbitrary function , natural number , and word , this defines
No nonnegativity or normalization of is required. When , the product is empty and equals , including when is empty; if is empty and , no such word exists.
QAlgorithms.Papers.Independent.Intakenext100.P45.kl
For a finite index type with decidable equality and arbitrary functions , this definition gives the extended real value
Here is the natural logarithm. There are no nonnegativity or normalization assumptions on ; indices with contribute zero. If no is positive, including when is empty, the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.logDerivative
For a finite type with decidable equality, arbitrary real-valued functions on , and any real , this defines the value at of the total derivative of
The powers and real logarithm are total operations, with , and the derivative returns zero where the function is not differentiable. No probability-law, positivity, differentiability, or restriction on is assumed, and may be empty.
QAlgorithms.Papers.Independent.Intakenext100.P45.nonnegativeSpectrumLog
For a finite type with decidable equality and any complex matrix indexed by , this defines a matrix as follows. If there exist real numbers and complex matrices such that and , choose one such triple and return ; otherwise return the zero matrix. The choice is not required to be unitary. The logarithm is the total real logarithm, so . No Hermiticity, positivity, invertibility, or nonempty-index assumption is imposed on .
QAlgorithms.Papers.Independent.Intakenext100.P45.observableAlpha
For a finite index type , arbitrary functions , a natural number , and a Boolean-valued function on
this defines the real number
Neither normalization nor nonnegativity of , nor null-admissibility of , is assumed; consequently this is a real weighted sum without a stipulated probability interpretation. An empty sum is zero. For , the value is if is true on the empty word and otherwise.
QAlgorithms.Papers.Independent.Intakenext100.P45.observableBeta
For a finite index type , arbitrary functions , a natural number , and a Boolean-valued function on
this defines the real number
Neither normalization nor nonnegativity of , nor null-admissibility of , is assumed. An empty sum is zero. For , the value is if is true on the empty word and otherwise.
QAlgorithms.Papers.Independent.Intakenext100.P45.observableOfCommon
For an index type , arbitrary functions , a natural number , and a word whose letters lie in
this defines the corresponding word in by forgetting each letter’s membership in . Its membership among the observable words—those having a strictly positive -product or -product—is certified by . For , this sends the unique empty word to the unique empty observable word, even when is empty.
QAlgorithms.Papers.Independent.Intakenext100.P45.otherConditional
For a finite type and arbitrary functions , let . This defines the function on given by
There are no assumptions that or is nonnegative everywhere or sums to one. If is nonempty, the denominator is strictly positive; if is empty, the result is the unique function with empty domain.
QAlgorithms.Papers.Independent.Intakenext100.P45.overlapConditionalLaw
For a finite index type with decidable equality and arbitrary functions , this definition assigns to each in the real number
No normalization or nonnegativity assumptions are imposed outside . If is nonempty, the denominator is strictly positive and these values sum to one. If is empty, the denominator is zero, but the resulting function has empty domain and hence no values to evaluate.
QAlgorithms.Papers.Independent.Intakenext100.P45.overlapMass
For a finite index type with decidable equality and arbitrary functions , this definition gives
It sums , rather than , over indices where both functions are strictly positive. No normalization is assumed, so the value need not be at most one. If there are no such indices, including when is empty, the sum is zero; otherwise it is strictly positive.
QAlgorithms.Papers.Independent.Intakenext100.P45.quantumAlpha
For a finite type with decidable equality, an arbitrary complex matrix indexed by , a sequence whose th member is a complex matrix indexed by , and any natural number , this defines
Neither nor the sequence is subject to positivity or normalization conditions; in particular, need not be an effect. The case uses one copy.
QAlgorithms.Papers.Independent.Intakenext100.P45.quantumArc
For a finite index type with decidable equality, arbitrary complex matrices indexed by , and any real number , let denote the real continuous functional calculus applied to and , using the total real-power function. Put
This defines the matrix
with the real scalar embedded in . No positivity, Hermiticity, trace normalization, or restriction on is assumed. The functional calculus returns zero for a non-Hermitian matrix, and when , so that case produces the zero matrix.
QAlgorithms.Papers.Independent.Intakenext100.P45.quantumArcLog
For a finite index type with decidable equality, arbitrary complex matrices indexed by , and any real , write for the real continuous functional calculus of , using total real powers, and for that of the total real logarithm, for which . Define
The defined matrix is
No positivity, invertibility, normalization, or range restriction on is assumed; is defined by its displayed power formula. These real functional calculi return zero on non-Hermitian matrices. The reciprocal of zero is zero, so makes the defined matrix zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.quantumBeta
For a finite type with decidable equality, an arbitrary complex matrix indexed by , a sequence whose th member is a complex matrix indexed by , and any natural number , this defines
Neither nor the sequence is subject to positivity or normalization conditions; in particular, need not be an effect. The case uses one copy.
QAlgorithms.Papers.Independent.Intakenext100.P45.quantumExponent
For a finite index type with decidable equality, arbitrary complex matrices indexed by , and any real , write for the matrix obtained by applying the total continuous functional calculus to with the real function . This definition gives
where for and otherwise, and the outer arithmetic is extended real arithmetic. No Hermitian, positivity, or trace-one conditions on the matrices are assumed. Any nonpositive overlap at an allowed makes the value ; empty gives .
QAlgorithms.Papers.Independent.Intakenext100.P45.rateTerm
For every real number and natural number , including , this defines the extended real number
Here is the natural logarithm, and is always positive. There is no assumption that is a probability; in particular, gives a negative value.
QAlgorithms.Papers.Independent.Intakenext100.P45.restrictTest
For an index type , arbitrary functions , a natural number , and a Boolean-valued function on the words having a strictly positive -product or -product, this defines a Boolean-valued function on words over : it evaluates on the same word after forgetting the letters’ membership in . No null-admissibility condition on is required. If is empty and , the new function has empty domain; for , it evaluates at the empty word.
QAlgorithms.Papers.Independent.Intakenext100.P45.restrictedAlpha
For a finite index type , arbitrary functions , a natural number , and a Boolean-valued function on the words with strictly positive -product or -product, put and . This defines
where is the same word regarded as a word in , and hence as an observable word. No null-admissibility or probability-law hypotheses are imposed. Division by zero is defined to be zero. If is empty and , the sum is zero; for , the empty product is , and the value is determined by whether is true on the empty word.
QAlgorithms.Papers.Independent.Intakenext100.P45.restrictedBeta
For a finite index type , arbitrary functions , a natural number , and a Boolean-valued function on the words with strictly positive -product or -product, put and . This defines
where forgets each letter’s membership in . No null-admissibility or probability-law hypotheses are imposed. Division by zero is defined to be zero. If is empty and , the sum is zero; for , it equals when is false on the empty word and otherwise.
QAlgorithms.Papers.Independent.Intakenext100.P45.spectralP
For a finite index type with decidable equality and complex matrices indexed by , let consist of unitary matrices and nonnegative real families , satisfying and . This definition assigns to each the real number
Neither matrix is required to have trace one, so this function is not required to sum to one. If is empty, its domain is empty.
QAlgorithms.Papers.Independent.Intakenext100.P45.spectralQ
For a finite index type with decidable equality and complex matrices indexed by , let consist of unitary matrices and nonnegative real families , satisfying and . This definition assigns to each the real number
Neither matrix is required to have trace one, so this function is not required to sum to one. If is empty, its domain is empty.
QAlgorithms.Papers.Independent.Intakenext100.P45.supportConditionalEntropy
For a finite type with decidable equality and arbitrary complex matrices indexed by , let be the orthogonal projection onto the range of , let , and set , with the real scalar regarded as complex. This defines , where the logarithms use continuous functional calculus for the total real logarithm, including . No positivity, normalization, support inclusion, or nonzero- assumption is imposed; if , its inverse is defined to be zero, so and the returned value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.traceDist
For any finite index type with decidable equality and arbitrary complex matrices , this defines
where the square root is obtained through the real continuous functional calculus for . No Hermiticity, positivity, or trace normalization is assumed for either matrix. If is empty, the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.typeIError
For any finite index type with decidable equality and arbitrary complex matrices , this defines the real number
No density-matrix assumption on , or effect or projection assumption on , is imposed, so the value is not required to lie in . For empty , it is zero.
QAlgorithms.Papers.Independent.Intakenext100.P45.typeIIError
For any finite index type with decidable equality and arbitrary complex matrices , this defines
where is the identity matrix on . No density-matrix, effect, or projection assumptions are imposed, and the value need not lie in . For empty , it is zero.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.