Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for A Hierarchy of Information Quantities for Finite Block Length Analysis of Quantum Tasks

Definition
QAlgorithms_Papers_Independent_Advance50_P02

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

prove2quantum

The objects the formalized statements of A Hierarchy of Information Quantities for Finite Block Length Analysis of Quantum Tasks (arXiv:1208.1478) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • PositiveTraceSubnormalized: PDF pp.6--7: the source's strictly positive-trace subnormalized states.
  • negLog: PDF p.8, Definition 4: -log_2, explicitly extended at zero.
  • extendedTestingDivergence: PDF p.8, Definition 4. Reuses the accepted extended testing entropy, adapting its argument order. The beta optimization is nonempty/bounded on the theorem domains.
  • smoothedMaxRelativeEntropy: PDF pp.7--8, Definition 2: nearby strictly positive-trace subnormalized states, with positive scale t=2^lambda. Includes Lemma 2's subnormalized centers.
  • lowProjector: PDF p.14, Definition 8: weak spectral projector, including zero eigenvalues.
  • spectrumMass: PDF p.14: actual quantum threshold mass, without logarithms at zero.
  • spectrumEntropy: PDF p.14, Definition 8: empty/unbounded sets give negative/positive infinity.
  • classicalThresholdMass: PDF p.2, (2): classical threshold mass, permitting Q=0 at positive P.
  • classicalSpectrumDivergence: PDF p.2, (2): extended-real classical information spectrum.
  • relativeMean: PDF pp.7,19: finite relative entropy in bits, used only on the support domain. Kernel log values are irrelevant after weighting by rho.
  • centeredRelativeVariance: PDF p.19, correcting Definition 1 p.7: accepted centered pair variance in bits.
  • PositiveSpectralPresentation: PDF p.14: arbitrary finite index, nonnegative eigenvalues, and full unitary reconstruction of this PSD matrix. Unlike Information100.P53.SpectralData, no ordering or Fin-index presentation is imposed.
  • eigenbasisOverlapSquared: PDF p.14: overlap squared of the two eigenvectors.
  • nsSpectralPresentation: PDF p.14: adapt column eigenvectors to the accepted NS row-vector presentation.
  • nsProbability: PDF p.14: Nussbaum--Szkola P, including zero-probability entries.
  • nsReferenceWeight: PDF p.14: Nussbaum--Szkola Q; need not have total mass one.
  • classicalMean: PDF p.19: classical mean, used only on the finite-likelihood domain.
  • classicalVariance: PDF p.19: centered classical information variance.
  • classicalThirdCentralMoment: PDF p.19: third absolute central moment (the cube of the printed T).
  • weightPower: PDF pp.2,18: products of classical weights, including the empty product.
  • empiricalMeanMass: Eq.(31), PDF p.18: CDF of the empirical mean of n independent log likelihoods. Used with n>0 and support inclusion; zero-P atoms carry zero mass.
  • distinctEigenvalueSet: PDF p.14: distinct spectral values, counting the kernel once.
  • distinctCount: PDF pp.13--14: number of distinct eigenvalues, not dimension or rank.
  • eigenspaceProjector: PDF p.14: projection onto one whole eigenspace.
  • spectralSpread: PDF p.17: spread for an invertible PSD operator; only used there.
  • positiveSpectralFactor: PDF pp.17--18: corrected positive bin count. Printed 2*ceil(lambda)=0 for flat spectra. The proof requires l>0; use l=max(1,ceil(lambda)). For singular sigma use the separately proved nu branch, without evaluating log(0).
  • identityTensor: PDF p.7: identity on A tensored with the reference on B.
  • positiveTraceSmoothedMinEntropy: PDF p.8, Definition 3: normalized reference optimization on B.
  • conditionalTesting: PDF p.8, Definition 5: optimized conditional testing entropy.
  • cqBlockMatrix: PDF pp.7--8: unnormalized positive classical blocks, allowing zero labels.
  • processBlocks: PDF pp.7--8: arbitrary many-to-one processing, constructed from input.
  • NormalizedBlocks: PDF p.7: normalized CQ states expressed as positive blocks.
  • cqMarginal: PDF p.7: the actual B marginal.
  • conditionOnClassical: PDF p.9, Proposition 7: reorder XAB to A(XB).
  • joinClassical: PDF p.9, Proposition 7: reorder XAB to (XA)B.
  • labelCount: PDF p.9: positive-probability support size.
  • PublicRandomSeed: PDF pp.10--12: independent public seed of arbitrary finite size.
  • Extractor: PDF p.10: arbitrary seeded hashes to a finite output alphabet.
  • extractionOutput: PDF p.10: output retaining the public seed.
  • extractionIdeal: PDF p.10: same seed cqMarginal, uniform output, one common reference.
  • extractionSecurity: PDF p.10, Definition 6: extractionSecurity optimized over one normalized sigma_B.
  • extractionLength: PDF p.10, Definition 6: maximal INTEGER length; arbitrary output cardinality. The set is nonempty/bounded on normalized CQ sources with e<1.
  • Compressor: PDF pp.11--12: seeded encoder and seed/message-dependent decoder POVM.
  • compressionError: PDF p.12, Definition 7: actual source/seed average error.
  • compressionLength: PDF p.12, Definition 7: minimal INTEGER length.
  • blocksPower: PDF p.20: independent CQ copies in the product classical basis.
  • conditionalMean: PDF pp.7,20: conditional entropy, actual marginal.
  • cqConditionalVariance: PDF pp.19--20: centered conditional pair variance.
  • gaussianCenter: PDF p.19: Gaussian approximation, including V=0.
  • LogarithmicRemainder: PDF p.19: two-sided O(log n), constants before blocklength.
  • ConstantRemainder: PDF p.19, (33): two-sided O(1).
  • liftIsometry: PDF p.8: the actual isometry U tensor identity_B.
  • nsTensorP: PDF p.14: NS P for product eigenbases, independently computed from the product eigenvalues and the eigenbasisOverlapSquared of product eigenvectors.
  • nsTensorQ: PDF p.14: NS Q for the same product eigenbases.
  • supportedSpread: PDF p.21: spread after restricting a marginal to its positive support.
  • finiteBins: PDF p.21: positive-bin correction, including a flat nonzero marginal.
  • intervalSup: PDF p.21: lower/upper optimization over a half-open real interval, in EReal.
  • intervalInf: PDF p.21: infimum counterpart, retaining infinite limiting values.
  • monotoneInverse: Lemma 18, PDF p.22: generalized inverse with extended endpoints.
  • inverseRate: PDF p.22: optimization over ALL real threshold sequences.
  • thresholdRate: PDF p.22: threshold spectrum with its exact limsup/non-strict or liminf/strict constraint.
  • pauliP: Appendix A, PDF pp.24--25: explicit NS probabilities, total P=1.
  • pauliQ: Appendix A, PDF pp.24--25: reference weights, total Q=2(p^2+(1-p)^2) on the nontrivial NS support. Remaining zero-P entries are irrelevant to Ds.
  • binomialBelow: Appendix A, PDF p.25: F(k-1;n,p), with F(-1)=0 at k=0.
  • binomialCutoff: Appendix A, PDF p.25: maximum k in 0,...,n with F(k-1)<=epsilon. For 0<=epsilon<1 the set contains 0 and larger k>n never qualify.
  • PairSequence: PDF pp.21--23: arbitrary finite pairs; slot k is source blocklength k+1. Dimensions can vary and no iid, support or variance property is built in.
  • StateSequence: PDF p.22: both sequences consist of normalized quantum states.
  • ErrorConstraint: PDF pp.22--23: the two different asymptotic error constraints.
  • quantumSpectrumRate: PDF p.22: source thresholds are 2^((k+1)R), in bits.
  • optimizedEntropySequenceRate: PDF pp.22--23: one-shot rates, optimizing all [0,1]-valued error sequences.
  • VaryingRegisterTests: PDF p.23: one genuine effect at each blocklength, without a free rate variable.
  • testError: PDF p.23: actual type-I error of an effect.
  • testRate: PDF p.23: actual type-II exponent, including zero type-II error.
  • operationalTestingRate: PDF p.23: operational B and the strict-error sup form of B-dagger.
  • testingConverseRate: PDF p.23: universal converse threshold defining B-dagger.
  • SpectralControl: PDF p.23: the source's sufficient polynomial spectral condition. The positive-eigenvalue alternative is on the supported restriction and explicitly retains support inclusion. Constants and thresholds precede k.
  • nsSequence: PDF p.23: classical NS distributions as diagonal matrices; testing arbitrary effects on diagonal states equals randomized classical testing.
  • smoothMaxEndpoint: PDF p.23: explicit endpoint continuation for smoothing parameter one, by its monotone left limit, rather than a finite real default.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_MatrixDistances
import Definitions.Def_QAlgorithms_Defs_MatrixMapPositivity
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P63
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P71
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P06
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P30
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P67
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P26
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P28
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P36
import Definitions.Def_QAlgorithms_Papers_Independent_Bridge50_P50

/-! Tomamichel--Hayashi, arXiv:1208.1478v3. Binary logarithms throughout.
Extended-real optimizations preserve empty sets and infinite values. Matching accepted
primitives are imported; source-specific interfaces have distinct names. Local definitions
have complete bodies. Source corrections/deferrals are recorded with this unit.
Compilation and independent moderation are pending the batch handoff. -/

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]

/-- PDF pp.6--7: the source's strictly positive-trace subnormalized states. -/
def PositiveTraceSubnormalized (a : Mat I) : Prop :=
  QAlgorithms.Papers.Independent.Information100.P67.IsSubnormalized a ∧ 0 < a.trace.re

/-- PDF p.8, Definition 4: -log_2, explicitly extended at zero. -/
def negLog (x : ℝ) : EReal := if x = 0 then ⊤ else (-logTwo x : ℝ)

/-- PDF p.8, Definition 4. Reuses the accepted extended testing entropy, adapting its argument order.
The beta optimization is nonempty/bounded on the theorem domains. -/
def extendedTestingDivergence (e : ℝ) (rho sigma : Mat I) : EReal :=
  QAlgorithms.Papers.Independent.Dependency50.P36.testingEntropy rho sigma e

/-- PDF pp.7--8, Definition 2: nearby strictly positive-trace subnormalized
states, with positive scale t=2^lambda. Includes Lemma 2's subnormalized centers. -/
def smoothedMaxRelativeEntropy (e : ℝ) (rho sigma : Mat I) : EReal :=
  sInf {d : EReal | ∃ tau : Mat I, PositiveTraceSubnormalized tau ∧ purifiedDistance rho tau ≤ e ∧
    ∃ t : ℝ, 0 < t ∧ Below tau ((t : ℂ) • sigma) ∧ d = (logTwo t : ℝ)}

/-- PDF p.14, Definition 8: weak spectral projector, including zero eigenvalues. -/
def lowProjector (rho sigma : Mat I) (R : ℝ) : Mat I :=
  cfc (fun x : ℝ => if x ≤ 0 then (1 : ℝ) else 0)
    (rho - ((Real.rpow 2 R : ℝ) : ℂ) • sigma)

/-- PDF p.14: actual quantum threshold mass, without logarithms at zero. -/
def spectrumMass (rho sigma : Mat I) (R : ℝ) : ℝ :=
  effectProb rho (lowProjector rho sigma R)

/-- PDF p.14, Definition 8: empty/unbounded sets give negative/positive infinity. -/
def spectrumEntropy (e : ℝ) (rho sigma : Mat I) : EReal :=
  sSup {r : EReal | ∃ R : ℝ, spectrumMass rho sigma R ≤ e ∧ r = (R : EReal)}

/-- PDF p.2, (2): classical threshold mass, permitting Q=0 at positive P. -/
def classicalThresholdMass {K : Type} [Fintype K] (P Q : K → ℝ) (R : ℝ) : ℝ :=
  ∑ z, if P z ≤ Real.rpow 2 R * Q z then P z else 0

/-- PDF p.2, (2): extended-real classical information spectrum. -/
def classicalSpectrumDivergence {K : Type} [Fintype K] (e : ℝ) (P Q : K → ℝ) : EReal :=
  sSup {r : EReal | ∃ R : ℝ, classicalThresholdMass P Q R ≤ e ∧ r = (R : EReal)}

/-- PDF pp.7,19: finite relative entropy in bits, used only on the support domain.
Kernel log values are irrelevant after weighting by rho. -/
def relativeMean (rho sigma : Mat I) : ℝ :=
  effectProb rho (cfc logTwo rho - cfc logTwo sigma)

/-- PDF p.19, correcting Definition 1 p.7: accepted centered pair variance in bits. -/
def centeredRelativeVariance (rho sigma : Mat I) : ℝ :=
  QAlgorithms.Papers.Independent.Dependency50.P36.pairInformationVariance rho sigma

/-- PDF p.14: arbitrary finite index, nonnegative eigenvalues, and full unitary
reconstruction of this PSD matrix. Unlike Information100.P53.SpectralData, no
ordering or Fin-index presentation is imposed. -/
structure PositiveSpectralPresentation (rho : Mat I) where
  value : I → ℝ
  nonnegative : ∀ i, 0 ≤ value i
  vectors : Mat I
  unitary : vectorsᴴ * vectors = 1
  decomposition : rho = vectors * Matrix.diagonal (fun i => (value i : ℂ)) * vectorsᴴ

/-- PDF p.14: overlap squared of the two eigenvectors. -/
def eigenbasisOverlapSquared {rho sigma : Mat I} (r : PositiveSpectralPresentation rho) (s : PositiveSpectralPresentation sigma)
    (x y : I) : ℝ :=
  Complex.normSq (∑ i, conj (r.vectors i x) * s.vectors i y)

/-- PDF p.14: adapt column eigenvectors to the accepted NS row-vector presentation. -/
def nsSpectralPresentation {rho : Mat I} (r : PositiveSpectralPresentation rho) :
    QAlgorithms.Papers.Independent.Bridge50.P50.NSSpectralData I :=
  ⟨r.value, fun x i => r.vectors i x⟩

/-- PDF p.14: Nussbaum--Szkola P, including zero-probability entries. -/
def nsProbability {rho sigma : Mat I} (r : PositiveSpectralPresentation rho) (s : PositiveSpectralPresentation sigma) : I × I → ℝ :=
  QAlgorithms.Papers.Independent.Bridge50.P50.nsP (nsSpectralPresentation r) (nsSpectralPresentation s)

/-- PDF p.14: Nussbaum--Szkola Q; need not have total mass one. -/
def nsReferenceWeight {rho sigma : Mat I} (r : PositiveSpectralPresentation rho) (s : PositiveSpectralPresentation sigma) : I × I → ℝ :=
  QAlgorithms.Papers.Independent.Bridge50.P50.nsQ (nsSpectralPresentation r) (nsSpectralPresentation s)

/-- PDF p.19: classical mean, used only on the finite-likelihood domain. -/
def classicalMean {K : Type} [Fintype K] (P Q : K → ℝ) : ℝ :=
  ∑ z, P z * (logTwo (P z) - logTwo (Q z))

/-- PDF p.19: centered classical information variance. -/
def classicalVariance {K : Type} [Fintype K] (P Q : K → ℝ) : ℝ :=
  ∑ z, P z * (logTwo (P z) - logTwo (Q z) - classicalMean P Q) ^ 2

/-- PDF p.19: third absolute central moment (the cube of the printed T). -/
def classicalThirdCentralMoment {K : Type} [Fintype K] (P Q : K → ℝ) : ℝ :=
  ∑ z, P z * |logTwo (P z) - logTwo (Q z) - classicalMean P Q| ^ 3

/-- PDF pp.2,18: products of classical weights, including the empty product. -/
def weightPower {K : Type} (n : ℕ) (P : K → ℝ) : (Fin n → K) → ℝ :=
  fun z => ∏ i, P (z i)

/-- Eq.(31), PDF p.18: CDF of the empirical mean of n independent log
likelihoods. Used with n>0 and support inclusion; zero-P atoms carry zero mass. -/
def empiricalMeanMass {K : Type} [Fintype K] (n : ℕ) (P Q : K → ℝ) (R : ℝ) : ℝ :=
  ∑ z : Fin n → K, if (∑ i : Fin n, (logTwo (P (z i)) - logTwo (Q (z i)))) / n ≤ R
    then weightPower n P z else 0

/-- PDF p.14: distinct spectral values, counting the kernel once. -/
def distinctEigenvalueSet (sigma : Mat I) : Finset ℝ :=
  if h : sigma.IsHermitian then Finset.univ.image h.eigenvalues else ∅

/-- PDF pp.13--14: number of distinct eigenvalues, not dimension or rank. -/
def distinctCount (sigma : Mat I) : ℕ := (distinctEigenvalueSet sigma).card

/-- PDF p.14: projection onto one whole eigenspace. -/
def eigenspaceProjector (sigma : Mat I) (v : ℝ) : Mat I :=
  cfc (fun x : ℝ => if x = v then (1 : ℝ) else 0) sigma

/-- PDF p.17: spread for an invertible PSD operator; only used there. -/
def spectralSpread (sigma : Mat I) : ℝ :=
  logTwo (sSup (distinctEigenvalueSet sigma : Set ℝ)) - logTwo (sInf (distinctEigenvalueSet sigma : Set ℝ))

/-- PDF pp.17--18: corrected positive bin count. Printed 2*ceil(lambda)=0 for
flat spectra. The proof requires l>0; use l=max(1,ceil(lambda)). For singular
sigma use the separately proved nu branch, without evaluating log(0). -/
def positiveSpectralFactor (sigma : Mat I) : ℕ :=
  if sigma.PosDef then min (2 * max 1 (Nat.ceil (spectralSpread sigma))) (distinctCount sigma)
  else distinctCount sigma

/-- PDF p.7: identity on A tensored with the reference on B. -/
def identityTensor (A : Type) [DecidableEq A] (sigma : Mat B) : Mat (A × B) :=
  fun i j => if i.1 = j.1 then sigma i.2 j.2 else 0

/-- PDF p.8, Definition 3: normalized reference optimization on B. -/
def positiveTraceSmoothedMinEntropy (e : ℝ) (rho : Mat (A × B)) : EReal :=
  sSup {h : EReal | ∃ sigma : Mat B, QAlgorithms.IsDensityMatrix sigma ∧
    h = -smoothedMaxRelativeEntropy e rho (identityTensor A sigma)}

/-- PDF p.8, Definition 5: optimized conditional testing entropy. -/
def conditionalTesting (e : ℝ) (rho : Mat (A × B)) : EReal :=
  sSup {h : EReal | ∃ sigma : Mat B, QAlgorithms.IsDensityMatrix sigma ∧
    h = -extendedTestingDivergence e rho (identityTensor A sigma)}

/-- PDF pp.7--8: unnormalized positive classical blocks, allowing zero labels. -/
def cqBlockMatrix (blocks : X → Mat B) : Mat (X × B) :=
  fun i j => if i.1 = j.1 then blocks i.1 i.2 j.2 else 0

/-- PDF pp.7--8: arbitrary many-to-one processing, constructed from input. -/
def processBlocks (f : X → Z) (blocks : X → Mat B) : Z → Mat B :=
  fun z => ∑ x, if f x = z then blocks x else 0

/-- PDF p.7: normalized CQ states expressed as positive blocks. -/
def NormalizedBlocks (blocks : X → Mat B) : Prop :=
  (∀ x, (blocks x).PosSemidef) ∧ (∑ x, (blocks x).trace.re) = 1

/-- PDF p.7: the actual B marginal. -/
def cqMarginal (blocks : X → Mat B) : Mat B := ∑ x, blocks x

/-- PDF p.9, Proposition 7: reorder XAB to A(XB). -/
def conditionOnClassical (blocks : X → Mat (A × B)) : Mat (A × (X × B)) :=
  fun i j => if i.2.1 = j.2.1 then blocks i.2.1 (i.1,i.2.2) (j.1,j.2.2) else 0

/-- PDF p.9, Proposition 7: reorder XAB to (XA)B. -/
def joinClassical (blocks : X → Mat (A × B)) : Mat ((X × A) × B) :=
  fun i j => if i.1.1 = j.1.1 then blocks i.1.1 (i.1.2,i.2) (j.1.2,j.2) else 0

/-- PDF p.9: positive-probability support size. -/
def labelCount (blocks : X → Mat B) : ℕ :=
  (Finset.univ.filter fun x => 0 < (blocks x).trace.re).card

/-- PDF pp.10--12: independent public seed of arbitrary finite size. -/
structure PublicRandomSeed where
  size : ℕ
  probability : Fin size → ℝ
  nonnegative : ∀ s, 0 ≤ probability s
  total : ∑ s, probability s = 1

/-- PDF p.10: arbitrary seeded hashes to a finite output alphabet. -/
structure Extractor (X : Type) where
  seed : PublicRandomSeed
  outputs : ℕ
  outputs_positive : 0 < outputs
  hash : Fin seed.size → X → Fin outputs

/-- PDF p.10: output retaining the public seed. -/
def extractionOutput (P : Extractor X) (blocks : X → Mat B) :
    Mat (Fin P.seed.size × (Fin P.outputs × B)) :=
  fun i j => if i.1 = j.1 ∧ i.2.1 = j.2.1 then
    (P.seed.probability i.1 : ℂ) *
      (∑ x, if P.hash i.1 x = i.2.1 then blocks x i.2.2 j.2.2 else 0) else 0

/-- PDF p.10: same seed cqMarginal, uniform output, one common reference. -/
def extractionIdeal (P : Extractor X) (sigma : Mat B) :
    Mat (Fin P.seed.size × (Fin P.outputs × B)) :=
  fun i j => if i.1 = j.1 ∧ i.2.1 = j.2.1 then
    ((P.seed.probability i.1 / P.outputs : ℝ) : ℂ) * sigma i.2.2 j.2.2 else 0

/-- PDF p.10, Definition 6: extractionSecurity optimized over one normalized sigma_B. -/
def extractionSecurity (P : Extractor X) (blocks : X → Mat B) : ℝ :=
  sInf {d : ℝ | ∃ sigma : Mat B, QAlgorithms.IsDensityMatrix sigma ∧
    d = purifiedDistance (extractionOutput P blocks) (extractionIdeal P sigma)}

/-- PDF p.10, Definition 6: maximal INTEGER length; arbitrary output cardinality.
The set is nonempty/bounded on normalized CQ sources with e<1. -/
def extractionLength (e : ℝ) (blocks : X → Mat B) : ℕ :=
  sSup {l : ℕ | ∃ P : Extractor X, (l : ℝ) ≤ logTwo P.outputs ∧ extractionSecurity P blocks ≤ e}

/-- PDF pp.11--12: seeded encoder and seed/message-dependent decoder POVM. -/
structure Compressor (X B : Type) [Fintype X] [Fintype B] [DecidableEq B] where
  seed : PublicRandomSeed
  messages : ℕ
  messages_positive : 0 < messages
  encode : Fin seed.size → X → Fin messages
  decode : Fin seed.size → Fin messages → X → Mat B
  positive : ∀ s m x, (decode s m x).PosSemidef
  complete : ∀ s m, ∑ x, decode s m x = 1

/-- PDF p.12, Definition 7: actual source/seed average error. -/
def compressionError (P : Compressor X B) (blocks : X → Mat B) : ℝ :=
  1 - ∑ s, P.seed.probability s * ∑ x, effectProb (blocks x) (P.decode s (P.encode s x) x)

/-- PDF p.12, Definition 7: minimal INTEGER length. -/
def compressionLength (e : ℝ) (blocks : X → Mat B) : ℕ :=
  sInf {m : ℕ | ∃ P : Compressor X B, logTwo P.messages ≤ (m : ℝ) ∧
    compressionError P blocks ≤ e}

/-- PDF p.20: independent CQ copies in the product classical basis. -/
def blocksPower (n : ℕ) (blocks : X → Mat B) : (Fin n → X) → Mat (Fin n → B) :=
  fun x i j => ∏ k, blocks (x k) (i k) (j k)

/-- PDF pp.7,20: conditional entropy, actual marginal. -/
def conditionalMean (blocks : X → Mat B) : ℝ :=
  -relativeMean (cqBlockMatrix blocks) (identityTensor X (cqMarginal blocks))

/-- PDF pp.19--20: centered conditional pair variance. -/
def cqConditionalVariance (blocks : X → Mat B) : ℝ :=
  centeredRelativeVariance (cqBlockMatrix blocks) (identityTensor X (cqMarginal blocks))

/-- PDF p.19: Gaussian approximation, including V=0. -/
def gaussianCenter (n : ℕ) (D V e : ℝ) : ℝ :=
  n * D + Real.sqrt ((n : ℝ) * V) * normalQuantile e

/-- PDF p.19: two-sided O(log n), constants before blocklength. -/
def LogarithmicRemainder (f : ℕ → EReal) (center : ℕ → ℝ) : Prop :=
  ∃ C : ℝ, 0 < C ∧ ∃ n0 : ℕ, 2 ≤ n0 ∧ ∀ n ≥ n0,
    ((center n - C * logTwo n : ℝ) : EReal) ≤ f n ∧
    f n ≤ ((center n + C * logTwo n : ℝ) : EReal)

/-- PDF p.19, (33): two-sided O(1). -/
def ConstantRemainder (f : ℕ → EReal) (center : ℕ → ℝ) : Prop :=
  ∃ C : ℝ, 0 < C ∧ ∃ n0 : ℕ, 1 ≤ n0 ∧ ∀ n ≥ n0,
    ((center n - C : ℝ) : EReal) ≤ f n ∧ f n ≤ ((center n + C : ℝ) : EReal)

example : negLog 0 = ⊤ := by simp [negLog]

example : logTwo 1 = 0 := by simp [logTwo]

example (P : I → ℝ) (x : Fin 0 → I) : weightPower 0 P x = 1 := by simp [weightPower]

example (rho sigma : Mat I) : centeredRelativeVariance rho sigma =
    QAlgorithms.Papers.Independent.Dependency50.P36.pairInformationVariance rho sigma := by
  rfl

example (blocks : X → Mat B) (i j : B) (x : X) :
    cqBlockMatrix blocks (x,i) (x,j) = blocks x i j := by simp [cqBlockMatrix]

example (blocks : X → Mat B) (a b : Fin 0 → B) (x : Fin 0 → X) :
    blocksPower 0 blocks x a b = 1 := by simp [blocksPower]

/-- PDF p.8: the actual isometry U tensor identity_B. -/
def liftIsometry (U : Matrix I A ℂ) : Matrix (I × B) (A × B) ℂ :=
  fun i j => U i.1 j.1 * (if i.2 = j.2 then (1 : ℂ) else 0)

/-- PDF p.14: NS P for product eigenbases, independently computed from the
product eigenvalues and the eigenbasisOverlapSquared of product eigenvectors. -/
def nsTensorP {rho sigma : Mat I} (r : PositiveSpectralPresentation rho) (s : PositiveSpectralPresentation sigma)
    (n : ℕ) (z : Fin n → I × I) : ℝ :=
  (∏ k, r.value (z k).1) * Complex.normSq
    (∑ a : Fin n → I, conj (∏ k, r.vectors (a k) (z k).1) *
      (∏ k, s.vectors (a k) (z k).2))

/-- PDF p.14: NS Q for the same product eigenbases. -/
def nsTensorQ {rho sigma : Mat I} (r : PositiveSpectralPresentation rho) (s : PositiveSpectralPresentation sigma)
    (n : ℕ) (z : Fin n → I × I) : ℝ :=
  (∏ k, s.value (z k).2) * Complex.normSq
    (∑ a : Fin n → I, conj (∏ k, r.vectors (a k) (z k).1) *
      (∏ k, s.vectors (a k) (z k).2))

/-- PDF p.21: spread after restricting a marginal to its positive support. -/
def supportedSpread (sigma : Mat I) : ℝ :=
  logTwo (sSup (distinctEigenvalueSet sigma : Set ℝ)) - logTwo (QAlgorithms.minPositiveEigenvalue sigma)

/-- PDF p.21: positive-bin correction, including a flat nonzero marginal. -/
def finiteBins (n : ℕ) (sigma : Mat I) : ℕ :=
  max 1 (Nat.ceil ((n : ℝ) * supportedSpread sigma))

/-- PDF p.21: lower/upper optimization over a half-open real interval, in EReal. -/
def intervalSup (a b : ℝ) (f : ℝ → ℝ) : EReal :=
  sSup {v : EReal | ∃ x : ℝ, a ≤ x ∧ x < b ∧ v = (f x : EReal)}

/-- PDF p.21: infimum counterpart, retaining infinite limiting values. -/
def intervalInf (a b : ℝ) (f : ℝ → ℝ) : EReal :=
  sInf {v : EReal | ∃ x : ℝ, a ≤ x ∧ x < b ∧ v = (f x : EReal)}

/-- Lemma 18, PDF p.22: generalized inverse with extended endpoints. -/
def monotoneInverse (g : ℝ → ℝ) (e : ℝ) : EReal :=
  sSup {r : EReal | ∃ R : ℝ, g R ≤ e ∧ r = (R : EReal)}

/-- PDF p.22: optimization over ALL real threshold sequences. -/
def inverseRate (g : ℕ → ℝ → ℝ) (e : ℝ) (strict : Bool) : EReal :=
  sSup {v : EReal | ∃ a : ℕ → ℝ,
    (if strict then liminf (fun n => (a n : EReal)) atTop < (e : EReal)
     else limsup (fun n => (a n : EReal)) atTop ≤ (e : EReal)) ∧
    v = liminf (fun n => monotoneInverse (g n) (a n)) atTop}

/-- PDF p.22: threshold spectrum with its exact limsup/non-strict or liminf/strict constraint. -/
def thresholdRate (g : ℕ → ℝ → ℝ) (e : ℝ) (strict : Bool) : EReal :=
  sSup {r : EReal | ∃ R : ℝ,
    (if strict then liminf (fun n => (g n R : EReal)) atTop < (e : EReal)
     else limsup (fun n => (g n R : EReal)) atTop ≤ (e : EReal)) ∧ r = (R : EReal)}

/-- Appendix A, PDF pp.24--25: explicit NS probabilities, total P=1. -/
def pauliP (p : ℝ) : Fin 4 → ℝ := ![p/2, p/2, (1-p)/2, (1-p)/2]

/-- Appendix A, PDF pp.24--25: reference weights, total Q=2(p^2+(1-p)^2)
on the nontrivial NS support. Remaining zero-P entries are irrelevant to Ds. -/
def pauliQ (p : ℝ) : Fin 4 → ℝ := ![p^2, p^2, (1-p)^2, (1-p)^2]

/-- Appendix A, PDF p.25: F(k-1;n,p), with F(-1)=0 at k=0. -/
def binomialBelow (n : ℕ) (p : ℝ) (k : ℕ) : ℝ :=
  ∑ j ∈ Finset.range k, if j ≤ n then (Nat.choose n j : ℝ) * p^j * (1-p)^(n-j) else 0

/-- Appendix A, PDF p.25: maximum k in 0,...,n with F(k-1)<=epsilon.
For 0<=epsilon<1 the set contains 0 and larger k>n never qualify. -/
def binomialCutoff (n : ℕ) (p e : ℝ) : ℕ :=
  ((Finset.range (n+1)).filter fun k => binomialBelow n p k ≤ e).sup id

/-- PDF pp.21--23: arbitrary finite pairs; slot k is source blocklength k+1.
Dimensions can vary and no iid, support or variance property is built in. -/
structure PairSequence where
  Index : ℕ → Type
  finite : ∀ k, Fintype (Index k)
  decidable : ∀ k, DecidableEq (Index k)
  rho : ∀ k, Mat (Index k)
  sigma : ∀ k, Mat (Index k)

attribute [instance] PairSequence.finite PairSequence.decidable

/-- PDF p.22: both sequences consist of normalized quantum states. -/
def StateSequence (S : PairSequence) : Prop :=
  ∀ k, QAlgorithms.IsDensityMatrix (S.rho k) ∧ QAlgorithms.IsDensityMatrix (S.sigma k)

/-- PDF pp.22--23: the two different asymptotic error constraints. -/
def ErrorConstraint (a : ℕ → ℝ) (e : ℝ) (strict : Bool) : Prop :=
  if strict then liminf (fun n => (a n : EReal)) atTop < (e : EReal)
  else limsup (fun n => (a n : EReal)) atTop ≤ (e : EReal)

/-- PDF p.22: source thresholds are 2^((k+1)R), in bits. -/
def quantumSpectrumRate (S : PairSequence) (e : ℝ) (strict : Bool) : EReal :=
  thresholdRate (fun k R => spectrumMass (S.rho k) (S.sigma k) ((k+1 : ℕ)*R)) e strict

/-- PDF pp.22--23: one-shot rates, optimizing all [0,1]-valued error sequences. -/
def optimizedEntropySequenceRate (H : ℕ → ℝ → EReal) (e : ℝ) (strict : Bool) : EReal :=
  sSup {v : EReal | ∃ a : ℕ → ℝ, (∀ k, 0 ≤ a k ∧ a k ≤ 1) ∧
    ErrorConstraint a e strict ∧
    v = liminf (fun k => (((1 : ℝ)/(k+1 : ℕ) : ℝ) : EReal) * H k (a k)) atTop}

/-- PDF p.23: one genuine effect at each blocklength, without a free rate variable. -/
def VaryingRegisterTests (S : PairSequence) :=
  {Q : ∀ k, Mat (S.Index k) // ∀ k, QAlgorithms.IsEffect (Q k)}

/-- PDF p.23: actual type-I error of an effect. -/
def testError (S : PairSequence) (Q : VaryingRegisterTests S) (k : ℕ) : ℝ :=
  effectProb (S.rho k) (1 - Q.val k)

/-- PDF p.23: actual type-II exponent, including zero type-II error. -/
def testRate (S : PairSequence) (Q : VaryingRegisterTests S) : EReal :=
  liminf (fun k => (((1 : ℝ)/(k+1 : ℕ) : ℝ) : EReal) *
    negLog (effectProb (S.sigma k) (Q.val k))) atTop

/-- PDF p.23: operational B and the strict-error sup form of B-dagger. -/
def operationalTestingRate (S : PairSequence) (e : ℝ) (strict : Bool) : EReal :=
  sSup {v : EReal | ∃ Q : VaryingRegisterTests S,
    ErrorConstraint (testError S Q) e strict ∧ v = testRate S Q}

/-- PDF p.23: universal converse threshold defining B-dagger. -/
def testingConverseRate (S : PairSequence) (e : ℝ) : EReal :=
  sInf {r : EReal | ∃ R : ℝ, r = (R : EReal) ∧
    ∀ Q : VaryingRegisterTests S, (R : EReal) ≤ testRate S Q →
      (e : EReal) ≤ liminf (fun k => (testError S Q k : EReal)) atTop}

/-- PDF p.23: the source's sufficient polynomial spectral condition. The
positive-eigenvalue alternative is on the supported restriction and explicitly
retains support inclusion. Constants and thresholds precede k. -/
def SpectralControl (S : PairSequence) : Prop :=
  (∃ C : ℝ, 0 < C ∧ ∃ d k0 : ℕ, ∀ k ≥ k0,
    (distinctCount (S.sigma k) : ℝ) ≤ C * (k+1 : ℕ)^d) ∨
  (∃ C : ℝ, 0 < C ∧ ∃ d k0 : ℕ, ∀ k ≥ k0,
    SupportIncluded (S.rho k) (S.sigma k) ∧
    0 < QAlgorithms.minPositiveEigenvalue (S.sigma k) ∧
    -logTwo (QAlgorithms.minPositiveEigenvalue (S.sigma k)) ≤ C * (k+1 : ℕ)^d)

/-- PDF p.23: classical NS distributions as diagonal matrices; testing arbitrary
effects on diagonal states equals randomized classical testing. -/
def nsSequence (S : PairSequence) (r : ∀ k, PositiveSpectralPresentation (S.rho k))
    (s : ∀ k, PositiveSpectralPresentation (S.sigma k)) : PairSequence where
  Index k := S.Index k × S.Index k
  finite _ := inferInstance
  decidable _ := Classical.decEq _
  rho k := Matrix.diagonal (fun z => (nsProbability (r k) (s k) z : ℂ))
  sigma k := Matrix.diagonal (fun z => (nsReferenceWeight (r k) (s k) z : ℂ))

/-- PDF p.23: explicit endpoint continuation for smoothing parameter one,
by its monotone left limit, rather than a finite real default. -/
def smoothMaxEndpoint (a : ℝ) (rho sigma : Mat I) : EReal :=
  if a < 1 then smoothedMaxRelativeEntropy a rho sigma
  else sInf {v : EReal | ∃ b : ℝ, 0 ≤ b ∧ b < 1 ∧ v = smoothedMaxRelativeEntropy b rho sigma}

/-- Sanity: no seed-dependent choice of the reference in the ideal state. -/
example (P : Extractor X) (sigma : Mat B) (s : Fin P.seed.size)
    (z : Fin P.outputs) (i j : B) :
    extractionIdeal P sigma (s,(z,i)) (s,(z,j)) =
      ((P.seed.probability s / P.outputs : ℝ) : ℂ) * sigma i j := by
  simp [extractionIdeal]

example (n : ℕ) (p : ℝ) : binomialBelow n p 0 = 0 := by simp [binomialBelow]

example (g : ℕ → ℝ → ℝ) (e : ℝ) :
    ErrorConstraint (fun n => g n 0) e false =
      (limsup (fun n => (g n 0 : EReal)) atTop ≤ (e : EReal)) := rfl

/-- Sanity: the NS adapter preserves the specified column eigenvector. -/
example {rho : Mat I} (r : PositiveSpectralPresentation rho) (x i : I) :
    (nsSpectralPresentation r).vector x i = r.vectors i x := by
  rfl

end QAlgorithms.Papers.Independent.Advance50.P02
Source
A Hierarchy of Information Quantities for Finite Block Length Analysis of Quantum Tasks, arXiv:1208.1478v3, https://arxiv.org/abs/1208.1478v3
Read-back

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

QAlgorithms.Papers.Independent.Advance50.P02.Compressor

For finite types X,BX,BX,B, with decidable equality on BBB, a compressor consists of a finite seed distribution pu≥0p_u\ge0pu​≥0 with ∑upu=1\sum_u p_u=1∑u​pu​=1, a positive natural number KKK of messages, an encoding function c(u,x)∈{0,…,K−1}c(u,x)\in\{0,\ldots,K-1\}c(u,x)∈{0,…,K−1}, and complex matrices Du,m,xD_{u,m,x}Du,m,x​ indexed by B×BB\times BB×B. Every Du,m,xD_{u,m,x}Du,m,x​ must be positive semidefinite, and for every seed uuu and message mmm they must satisfy ∑x∈XDu,m,x=IB\sum_{x\in X}D_{u,m,x}=I_B∑x∈X​Du,m,x​=IB​. Seed probabilities may vanish, and the seed size is necessarily positive. Neither XXX nor BBB is explicitly required to be nonempty; when XXX is empty and BBB is nonempty, the completeness equation cannot hold.

QAlgorithms.Papers.Independent.Advance50.P02.ConstantRemainder

For any extended real sequence f:N→[−∞,+∞]f:\mathbb N\to[-\infty,+\infty]f:N→[−∞,+∞] and real sequence c:N→Rc:\mathbb N\to\mathbb Rc:N→R, this predicate means that there exist a real constant C>0C>0C>0 and a natural number n0≥1n_0\ge1n0​≥1 such that, for every natural number n≥n0n\ge n_0n≥n0​,

c(n)−C≤f(n)≤c(n)+C,c(n)-C\le f(n)\le c(n)+C,c(n)−C≤f(n)≤c(n)+C,

with the real bounds embedded into the extended reals. Thus fff is finite from n0n_0n0​ onward, while its earlier values are unrestricted.

QAlgorithms.Papers.Independent.Advance50.P02.ErrorConstraint

For every real sequence a:N→Ra:\mathbb N\to\mathbb Ra:N→R, real number eee, and Boolean parameter strict\mathrm{strict}strict, this predicate means

lim inf⁡n→∞an<eif strict=true,lim sup⁡n→∞an≤eif strict=false.\liminf_{n\to\infty}a_n<e \quad\text{if }\mathrm{strict}=\mathrm{true}, \qquad \limsup_{n\to\infty}a_n\le e \quad\text{if }\mathrm{strict}=\mathrm{false}.n→∞liminf​an​<eif strict=true,n→∞limsup​an​≤eif strict=false.

The limits inferior and superior are taken after embedding the sequence into the extended real numbers, so infinite values are allowed. There are no bounds or probability assumptions on ana_nan​ or eee.

QAlgorithms.Papers.Independent.Advance50.P02.Extractor

For any type XXX, an extractor consists of a finite seed distribution (pu)u=0s−1(p_u)_{u=0}^{s-1}(pu​)u=0s−1​, with nonnegative real probabilities summing to one, a positive natural number KKK of outputs, and a function h:{0,…,s−1}×X→{0,…,K−1}h:\{0,\ldots,s-1\}\times X\to\{0,\ldots,K-1\}h:{0,…,s−1}×X→{0,…,K−1}. The seed size is necessarily positive, but individual seed probabilities may vanish. No finiteness or nonemptiness assumption on XXX, and no further condition on hhh, is imposed.

QAlgorithms.Papers.Independent.Advance50.P02.LogarithmicRemainder

For any sequence f:N→[−∞,+∞]f:\mathbb N\to[-\infty,+\infty]f:N→[−∞,+∞] of extended real numbers and any real sequence c:N→Rc:\mathbb N\to\mathbb Rc:N→R, this predicate means that there exist a real constant C>0C>0C>0 and a natural number n0≥2n_0\ge2n0​≥2 such that, for every natural number n≥n0n\ge n_0n≥n0​,

c(n)−Clog⁡nlog⁡2≤f(n)≤c(n)+Clog⁡nlog⁡2,c(n)-C\frac{\log n}{\log2}\le f(n)\le c(n)+C\frac{\log n}{\log2},c(n)−Clog2logn​≤f(n)≤c(n)+Clog2logn​,

where the real bounds are regarded as extended real numbers. In particular, f(n)f(n)f(n) must be finite for all n≥n0n\ge n_0n≥n0​; no condition is imposed on earlier terms.

QAlgorithms.Papers.Independent.Advance50.P02.NormalizedBlocks

For finite index types X,BX,BX,B and any family of complex matrices HxH_xHx​ indexed by BBB, this predicate means precisely that every HxH_xHx​ is positive semidefinite and

∑x∈XℜTr⁡Hx=1.\sum_{x\in X}\Re\operatorname{Tr}H_x=1.x∈X∑​ℜTrHx​=1.

It does not require each block to have trace 111, and zero blocks are permitted. If XXX or BBB is empty, the sum is 000, so the predicate cannot hold.

QAlgorithms.Papers.Independent.Advance50.P02.PairSequence

This structure consists of a family of index types IkI_kIk​, one for every natural number kkk, together with a specified finite enumeration and decidable equality on each IkI_kIk​, and two families of complex square matrices ρk,σk\rho_k,\sigma_kρk​,σk​ indexed by IkI_kIk​. The index types may vary with kkk, may be empty, and include an index type at k=0k=0k=0. No positivity, trace, normalization, or relation between the matrices is required.

QAlgorithms.Papers.Independent.Advance50.P02.PositiveSpectralPresentation

For a finite index type III with decidable equality and a specified complex matrix ρ\rhoρ indexed by I×II\times II×I, a presentation consists of real numbers λi\lambda_iλi​ for every i∈Ii\in Ii∈I and a complex matrix UUU indexed by I×II\times II×I, together with the requirements

λi≥0(i∈I),U†U=1,ρ=U diag⁡(λi) U†.\lambda_i\ge0\quad(i\in I),\qquad U^\dagger U=\mathbf1,\qquad \rho=U\,\operatorname{diag}(\lambda_i)\,U^\dagger.λi​≥0(i∈I),U†U=1,ρ=Udiag(λi​)U†.

Here U†U^\daggerU† is the conjugate transpose. The numbers may be zero or repeated and are not required to be ordered or sum to one. Empty III is included, with vacuous scalar conditions and the corresponding empty-matrix equalities.

QAlgorithms.Papers.Independent.Advance50.P02.PositiveTraceSubnormalized

For a finite index type III with decidable equality and a complex matrix aaa indexed by I×II\times II×I, this predicate means that aaa is positive semidefinite and its real trace satisfies 0<Re⁡tr⁡(a)≤10<\operatorname{Re}\operatorname{tr}(a)\le 10<Retr(a)≤1. Trace one is not required. If III is empty, the strict positivity condition cannot hold.

QAlgorithms.Papers.Independent.Advance50.P02.PublicRandomSeed

A public random seed consists of a natural number sss and real numbers pup_upu​, indexed by u∈{0,…,s−1}u\in\{0,\ldots,s-1\}u∈{0,…,s−1}, satisfying pu≥0p_u\ge 0pu​≥0 for every uuu and ∑upu=1\sum_u p_u=1∑u​pu​=1. Zero probabilities are permitted. Although the size is specified as an arbitrary natural number, these conditions exclude s=0s=0s=0, since an empty sum is zero.

QAlgorithms.Papers.Independent.Advance50.P02.SpectralControl

For a sequence SSS consisting of finite index types IkI_kIk​ with decidable equality and arbitrary complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on them, the declaration defines the following disjunction: either there exist C>0C>0C>0 and natural numbers d,k0d,k_0d,k0​ such that, for every k≥k0k\ge k_0k≥k0​, the number of distinct eigenvalues of σk\sigma_kσk​ is at most C(k+1)dC(k+1)^dC(k+1)d; or there exist C>0C>0C>0 and natural numbers d,k0d,k_0d,k0​ such that, for every k≥k0k\ge k_0k≥k0​,

ker⁡σk⊆ker⁡ρk,λk+>0,−log⁡2λk+≤C(k+1)d.\ker\sigma_k\subseteq\ker\rho_k,\qquad \lambda_k^+>0,\qquad -\log_2\lambda_k^+\le C(k+1)^d.kerσk​⊆kerρk​,λk+​>0,−log2​λk+​≤C(k+1)d.

Here the distinct-eigenvalue set is defined to be the image of the real eigenvalue list when σk\sigma_kσk​ is Hermitian and the empty set otherwise. The quantity λk+\lambda_k^+λk+​ is the minimum of the strictly positive entries in the ascending eigenvalue list, or 000 if no such entry exists; for a non-Hermitian matrix that ascending list is defined to be identically 000. Thus the first alternative counts 000 eigenvalues for a non-Hermitian matrix, whereas the second alternative requires a strictly positive eigenvalue. The exponent ddd and cutoff k0k_0k0​ may be 000, the two alternatives may use different constants, and no density assumption is part of this predicate.

QAlgorithms.Papers.Independent.Advance50.P02.StateSequence

For a sequence consisting of finite index types IkI_kIk​ with decidable equality and complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on IkI_kIk​, this predicate means that, for every natural number kkk, including zero, both matrices are positive semidefinite and satisfy tr⁡ρk=tr⁡σk=1\operatorname{tr}\rho_k=\operatorname{tr}\sigma_k=1trρk​=trσk​=1. These hypotheses cannot hold at an index kkk for which IkI_kIk​ is empty, since the trace of an empty matrix is zero.

QAlgorithms.Papers.Independent.Advance50.P02.VaryingRegisterTests

For every sequence consisting of finite index types IkI_kIk​ with decidable equality and complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on those types, this defines the type of families of complex square matrices QkQ_kQk​ on IkI_kIk​ such that, for every natural number kkk, including zero, both QkQ_kQk​ and 1Ik−Qk\mathbf1_{I_k}-Q_k1Ik​​−Qk​ are positive semidefinite. No normalization or positivity is required of ρk,σk\rho_k,\sigma_kρk​,σk​, and no additional relation between the tests at different indices is imposed; empty index types are allowed.

QAlgorithms.Papers.Independent.Advance50.P02.binomialBelow

For every pair of natural numbers n,kn,kn,k, including zero, and every real number ppp, this defines

Bn,p(k)=∑0≤j<kj≤n(nj)pj(1−p)n−j.B_{n,p}(k)=\sum_{\substack{0\le j<k\\j\le n}}\binom nj p^j(1-p)^{n-j}.Bn,p​(k)=0≤j<kj≤n​∑​(jn​)pj(1−p)n−j.

Indices j>nj>nj>n contribute zero explicitly, and the subtraction n−jn-jn−j is natural-number subtraction, truncated at zero. The sum is zero when k=0k=0k=0, and powers with exponent zero equal 111, including 000^000. No assumption 0≤p≤10\le p\le10≤p≤1 is imposed, so the expression is not required to be a probability.

QAlgorithms.Papers.Independent.Advance50.P02.binomialCutoff

For every natural number nnn, including zero, and every pair of real numbers p,ep,ep,e, this defines the largest k∈{0,…,n}k\in\{0,\ldots,n\}k∈{0,…,n} satisfying

∑0≤j<kj≤n(nj)pj(1−p)n−j≤e,\sum_{\substack{0\le j<k\\j\le n}}\binom nj p^j(1-p)^{n-j}\le e,0≤j<kj≤n​∑​(jn​)pj(1−p)n−j≤e,

with value 000 if no such kkk exists. In particular, k=n+1k=n+1k=n+1 is never considered, and when n=0n=0n=0 the result is always 000. Neither ppp nor eee is restricted to a probability range.

QAlgorithms.Papers.Independent.Advance50.P02.blocksPower

For arbitrary types X,BX,BX,B, every natural number nnn, and every family of complex matrices AxA_xAx​ indexed by B×BB\times BB×B, this definition assigns to each tuple x=(x0,…,xn−1)∈Xnx=(x_0,\ldots,x_{n-1})\in X^nx=(x0​,…,xn−1​)∈Xn the matrix on BnB^nBn with entries

(Ax[n])i,j=∏k=0n−1(Axk)ik,jk.(A^{[n]}_x)_{i,j} =\prod_{k=0}^{n-1}(A_{x_k})_{i_k,j_k}.(Ax[n]​)i,j​=k=0∏n−1​(Axk​​)ik​,jk​​.

No finiteness, positivity, or normalization assumptions are imposed. For n=0n=0n=0, both tuple index types consist of the unique empty tuple, and the empty product gives the single matrix entry 111.

QAlgorithms.Papers.Independent.Advance50.P02.centeredRelativeVariance

For any finite index type III with decidable equality and arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, put

L=Clog⁡2(ρ)−Clog⁡2(σ),D0=Re⁡tr⁡ ⁣(Cx↦xln⁡x(ρ)−ρ Cln⁡(σ))ln⁡2.L=\mathcal C_{\log_2}(\rho)-\mathcal C_{\log_2}(\sigma), \qquad D_0=\frac{\operatorname{Re}\operatorname{tr}\!\left( \mathcal C_{x\mapsto x\ln x}(\rho)-\rho\,\mathcal C_{\ln}(\sigma) \right)}{\ln2}.L=Clog2​​(ρ)−Clog2​​(σ),D0​=ln2Retr(Cx↦xlnx​(ρ)−ρCln​(σ))​.

The defined real number is Re⁡tr⁡(ρL2)−D02\operatorname{Re}\operatorname{tr}(\rho L^2)-D_0^2Retr(ρL2)−D02​. Here log⁡2x=ln⁡x/ln⁡2\log_2x=\ln x/\ln2log2​x=lnx/ln2, the scalar logarithm is total with ln⁡0=0\ln0=0ln0=0, and the real self-adjoint functional calculus C\mathcal CC returns zero on non-Hermitian inputs. There are no density-matrix or support assumptions and no division by tr⁡ρ\operatorname{tr}\rhotrρ. For empty III, the value is zero.

QAlgorithms.Papers.Independent.Advance50.P02.classicalMean

For any finite type KKK and arbitrary real functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, define L(t)=ln⁡(t)/ln⁡2L(t)=\ln(t)/\ln2L(t)=ln(t)/ln2, using the total real logarithm, for which ln⁡0=0\ln0=0ln0=0 and ln⁡(−t)=ln⁡t\ln(-t)=\ln tln(−t)=lnt when t>0t>0t>0. This definition returns

∑z∈KP(z)(L(P(z))−L(Q(z))).\sum_{z\in K}P(z)\bigl(L(P(z))-L(Q(z))\bigr).z∈K∑​P(z)(L(P(z))−L(Q(z))).

There are no nonnegativity, normalization, or support assumptions on P,QP,QP,Q. In particular, zero and negative weights are permitted; if KKK is empty, the value is zero.

QAlgorithms.Papers.Independent.Advance50.P02.classicalSpectrumDivergence

For any finite type KKK, real eee, and arbitrary real-valued functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, this defines the extended real supremum

sup⁡{R∈R:∑z∈KP(z)≤2RQ(z)P(z)≤e}.\sup\left\{R\in\mathbb R: \sum_{\substack{z\in K\\P(z)\le2^R Q(z)}}P(z)\le e\right\}.sup⎩⎨⎧​R∈R:z∈KP(z)≤2RQ(z)​∑​P(z)≤e⎭⎬⎫​.

No nonnegativity or normalization conditions are imposed on P,QP,QP,Q, and eee is unrestricted. The supremum of an empty set is −∞-\infty−∞, while an unbounded set gives +∞+\infty+∞. If KKK is empty, the value is +∞+\infty+∞ for e≥0e\ge0e≥0 and −∞-\infty−∞ for e<0e<0e<0.

QAlgorithms.Papers.Independent.Advance50.P02.classicalThirdCentralMoment

For any finite type KKK and arbitrary real functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, put L(t)=ln⁡(t)/ln⁡2L(t)=\ln(t)/\ln2L(t)=ln(t)/ln2 and

m=∑z∈KP(z)(L(P(z))−L(Q(z))).m=\sum_{z\in K}P(z)\bigl(L(P(z))-L(Q(z))\bigr).m=z∈K∑​P(z)(L(P(z))−L(Q(z))).

This definition returns ∑z∈KP(z)∣L(P(z))−L(Q(z))−m∣3\sum_{z\in K}P(z)\left|L(P(z))-L(Q(z))-m\right|^3∑z∈K​P(z)∣L(P(z))−L(Q(z))−m∣3. The logarithm uses the total real convention ln⁡0=0\ln0=0ln0=0 and ln⁡(−t)=ln⁡t\ln(-t)=\ln tln(−t)=lnt for t>0t>0t>0. The weights need not be nonnegative or normalized, and no support condition is assumed; consequently the result need not be nonnegative. For empty KKK, it is zero.

QAlgorithms.Papers.Independent.Advance50.P02.classicalThresholdMass

For any finite type KKK, arbitrary real-valued functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, and real RRR, this defines

∑z∈KP(z)≤2RQ(z)P(z).\sum_{\substack{z\in K\\P(z)\le2^R Q(z)}}P(z).z∈KP(z)≤2RQ(z)​∑​P(z).

Equality at the threshold is included. Neither function is required to be nonnegative or normalized. If KKK is empty, the sum is zero.

QAlgorithms.Papers.Independent.Advance50.P02.classicalVariance

For any finite type KKK and arbitrary real functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, put L(t)=ln⁡(t)/ln⁡2L(t)=\ln(t)/\ln2L(t)=ln(t)/ln2 and

m=∑z∈KP(z)(L(P(z))−L(Q(z))).m=\sum_{z\in K}P(z)\bigl(L(P(z))-L(Q(z))\bigr).m=z∈K∑​P(z)(L(P(z))−L(Q(z))).

This definition returns ∑z∈KP(z)(L(P(z))−L(Q(z))−m)2\sum_{z\in K}P(z)\bigl(L(P(z))-L(Q(z))-m\bigr)^2∑z∈K​P(z)(L(P(z))−L(Q(z))−m)2. The real logarithm is total, with ln⁡0=0\ln0=0ln0=0 and ln⁡(−t)=ln⁡t\ln(-t)=\ln tln(−t)=lnt for t>0t>0t>0. No nonnegativity, normalization, or support conditions are imposed, so the returned value is not required to be nonnegative. For empty KKK, it is zero.

QAlgorithms.Papers.Independent.Advance50.P02.compressionError

For finite types X,BX,BX,B, with decidable equality on BBB, a compressor with finite seed probabilities pu≥0p_u\ge0pu​≥0, ∑upu=1\sum_u p_u=1∑u​pu​=1, positive message count KKK, encoding function c(u,x)c(u,x)c(u,x), and positive semidefinite decoding matrices Du,m,xD_{u,m,x}Du,m,x​ satisfying ∑xDu,m,x=IB\sum_xD_{u,m,x}=I_B∑x​Du,m,x​=IB​, and any complex matrices AxA_xAx​ on BBB, compression error is

1−∑upu∑x∈XRe⁡Tr⁡ ⁣(AxDu,c(u,x),x).1-\sum_u p_u\sum_{x\in X} \operatorname{Re}\operatorname{Tr}\!\left(A_xD_{u,c(u,x),x}\right).1−u∑​pu​x∈X∑​ReTr(Ax​Du,c(u,x),x​).

No positivity or normalization is imposed on AxA_xAx​, so the definition does not require this real number to lie between zero and one. An empty sum over XXX gives error one.

QAlgorithms.Papers.Independent.Advance50.P02.compressionLength

For finite types X,BX,BX,B, with decidable equality on BBB, any real eee, and arbitrary complex matrices AxA_xAx​ on BBB, compression length is the infimum in N\mathbb NN of the natural numbers mmm for which there exist a finite seed distribution pu≥0p_u\ge0pu​≥0, ∑upu=1\sum_u p_u=1∑u​pu​=1, a positive natural message count KKK, an encoding function c(u,x)∈{0,…,K−1}c(u,x)\in\{0,\ldots,K-1\}c(u,x)∈{0,…,K−1}, and positive semidefinite decoding matrices Du,j,xD_{u,j,x}Du,j,x​ on BBB satisfying ∑xDu,j,x=IB\sum_xD_{u,j,x}=I_B∑x​Du,j,x​=IB​ for every u,ju,ju,j, such that

log⁡Klog⁡2≤m,1−∑upu∑xRe⁡Tr⁡ ⁣(AxDu,c(u,x),x)≤e.\frac{\log K}{\log2}\le m, \qquad 1-\sum_u p_u\sum_x \operatorname{Re}\operatorname{Tr}\!\left(A_xD_{u,c(u,x),x}\right)\le e.log2logK​≤m,1−u∑​pu​x∑​ReTr(Ax​Du,c(u,x),x​)≤e.

Neither the matrices AxA_xAx​ nor the tolerance eee have additional constraints. If the defining set is nonempty, the result is its least natural number; if it is empty, the natural-number infimum is zero.

QAlgorithms.Papers.Independent.Advance50.P02.conditionOnClassical

For index types X,A,BX,A,BX,A,B and any family of complex matrices HxH_xHx​ indexed by A×BA\times BA×B, this definition returns a matrix indexed by A×(X×B)A\times(X\times B)A×(X×B) whose entries are

C(a,(x,b)),(a′,(y,b′))={(Hx)(a,b),(a′,b′),x=y,0,x≠y.C_{(a,(x,b)),(a',(y,b'))}= \begin{cases} (H_x)_{(a,b),(a',b')},&x=y,\\ 0,&x\ne y. \end{cases}C(a,(x,b)),(a′,(y,b′))​={(Hx​)(a,b),(a′,b′)​,0,​x=y,x=y.​

Equality of labels is decided classically. No positivity, normalization, or nonemptiness assumption is imposed.

QAlgorithms.Papers.Independent.Advance50.P02.conditionalMean

For finite types X,BX,BX,B, both with decidable equality, and any family of complex matrices AxA_xAx​ on BBB, define matrices R,SR,SR,S on X×BX\times BX×B by

R(x,b),(y,c)={(Ax)b,c,x=y,0,x≠y,S(x,b),(y,c)={∑z∈X(Az)b,c,x=y,0,x≠y.R_{(x,b),(y,c)}= \begin{cases}(A_x)_{b,c},&x=y,\\0,&x\ne y,\end{cases} \qquad S_{(x,b),(y,c)}= \begin{cases}\displaystyle\sum_{z\in X}(A_z)_{b,c},&x=y,\\0,&x\ne y.\end{cases}R(x,b),(y,c)​={(Ax​)b,c​,0,​x=y,x=y,​S(x,b),(y,c)​=⎩⎨⎧​z∈X∑​(Az​)b,c​,0,​x=y,x=y.​

The conditional mean is

−Re⁡Tr⁡ ⁣[R(log⁡2R−log⁡2S)],-\operatorname{Re}\operatorname{Tr}\!\left[ R\bigl(\log_2 R-\log_2 S\bigr)\right],−ReTr[R(log2​R−log2​S)],

where log⁡2T\log_2 Tlog2​T means applying t↦log⁡t/log⁡2t\mapsto\log t/\log2t↦logt/log2 through the total real continuous functional calculus. No positivity, normalization, or support-inclusion hypothesis is imposed. Empty XXX or BBB is allowed and gives zero through the empty trace; the scalar logarithm uses its total real convention, including log⁡0=0\log0=0log0=0.

QAlgorithms.Papers.Independent.Advance50.P02.conditionalTesting

For finite index types A,BA,BA,B with decidable equality, any real eee, and any complex matrix ρ\rhoρ indexed by A×BA\times BA×B, this definition returns

sup⁡σ≥0Tr⁡σ=1(−De(ρ,IA⊗σ))\sup_{\substack{\sigma\ge0\\\operatorname{Tr}\sigma=1}} \bigl(-D_e(\rho,I_A\otimes\sigma)\bigr)σ≥0Trσ=1​sup​(−De​(ρ,IA​⊗σ))

in the extended real numbers. Here σ\sigmaσ is indexed by BBB, and IA⊗σI_A\otimes\sigmaIA​⊗σ has entry σb,b′\sigma_{b,b'}σb,b′​ between (a,b)(a,b)(a,b) and (a′,b′)(a',b')(a′,b′) when a=a′a=a'a=a′, and entry 000 otherwise. To define De(R,S)D_e(R,S)De​(R,S), first take the real infimum

be(R,S)=inf⁡{ℜTr⁡(QS):Q≥0, I−Q≥0, 1−e≤ℜTr⁡(QR)}.b_e(R,S)= \inf\left\{\Re\operatorname{Tr}(QS): Q\ge0,\ I-Q\ge0,\ 1-e\le\Re\operatorname{Tr}(QR)\right\}.be​(R,S)=inf{ℜTr(QS):Q≥0, I−Q≥0, 1−e≤ℜTr(QR)}.

Then De(R,S)=−ln⁡(be(R,S))/ln⁡2D_e(R,S)=-\ln(b_e(R,S))/\ln2De​(R,S)=−ln(be​(R,S))/ln2 if be(R,S)>0b_e(R,S)>0be​(R,S)>0, and De(R,S)=+∞D_e(R,S)=+\inftyDe​(R,S)=+∞ otherwise. No positivity or normalization assumption on ρ\rhoρ, and no restriction on eee, is imposed. An empty real infimum here has value 000, so it gives De=+∞D_e=+\inftyDe​=+∞ and contribution −∞-\infty−∞; an empty outer supremum also has value −∞-\infty−∞, including when BBB is empty.

QAlgorithms.Papers.Independent.Advance50.P02.cqBlockMatrix

For index types X,BX,BX,B and any family of complex matrices HxH_xHx​ indexed by BBB, this definition returns the matrix indexed by X×BX\times BX×B with entries

C(x,b),(y,c)={(Hx)b,c,x=y,0,x≠y.C_{(x,b),(y,c)}= \begin{cases} (H_x)_{b,c},&x=y,\\ 0,&x\ne y. \end{cases}C(x,b),(y,c)​={(Hx​)b,c​,0,​x=y,x=y.​

Equality of labels is decided classically. The blocks need not be positive semidefinite or normalized, and either index type may be empty.

QAlgorithms.Papers.Independent.Advance50.P02.cqConditionalVariance

For finite types X,BX,BX,B, both with decidable equality, and arbitrary complex matrices AxA_xAx​ on BBB, let RRR be the block-diagonal matrix on X×BX\times BX×B with block AxA_xAx​ at label xxx, and let SSS be block diagonal with the same block ∑xAx\sum_xA_x∑x​Ax​ at every label. Set

L=log⁡2R−log⁡2S,D=Re⁡Tr⁡[Ct↦tlog⁡t(R)−R Clog⁡(S)]log⁡2,L=\log_2R-\log_2S,\qquad D=\frac{\operatorname{Re}\operatorname{Tr} \left[C_{t\mapsto t\log t}(R)-R\,C_{\log}(S)\right]}{\log2},L=log2​R−log2​S,D=log2ReTr[Ct↦tlogt​(R)−RClog​(S)]​,

where CfC_fCf​ denotes the total real continuous functional calculus and log⁡2T=Ct↦log⁡t/log⁡2(T)\log_2T=C_{t\mapsto\log t/\log2}(T)log2​T=Ct↦logt/log2​(T). The defined conditional variance is the real number

Re⁡Tr⁡(RL2)−D2.\operatorname{Re}\operatorname{Tr}(RL^2)-D^2.ReTr(RL2)−D2.

No positivity, normalization, support inclusion, or nonnegativity of the result is assumed. Empty XXX or BBB is included and gives zero; scalar logarithms use the total real convention log⁡0=0\log0=0log0=0.

QAlgorithms.Papers.Independent.Advance50.P02.cqMarginal

For a finite label type XXX, any index type BBB, and any family of complex matrices HxH_xHx​ indexed by BBB, this definition returns

∑x∈XHx.\sum_{x\in X}H_x.x∈X∑​Hx​.

No positivity or normalization is assumed. If XXX is empty, the result is the zero matrix.

QAlgorithms.Papers.Independent.Advance50.P02.distinctCount

For any finite index type III with decidable equality and any complex matrix σ\sigmaσ indexed by III, this definition returns the cardinality of the finite set of its real Hermitian eigenvalues, counting each distinct value once, when σ\sigmaσ is Hermitian. It returns zero when σ\sigmaσ is not Hermitian, and also when III is empty.

QAlgorithms.Papers.Independent.Advance50.P02.distinctEigenvalueSet

For any finite index type III with decidable equality and any complex matrix σ\sigmaσ indexed by III, this definition returns the finite set of real eigenvalues supplied by the Hermitian spectral decomposition if σ\sigmaσ is Hermitian, with repeated values included only once. If σ\sigmaσ is not Hermitian, it returns the empty set. Empty III is allowed and gives the empty set.

QAlgorithms.Papers.Independent.Advance50.P02.eigenbasisOverlapSquared

Let III be any finite index type with decidable equality, and let ρ,σ\rho,\sigmaρ,σ be complex matrices indexed by III. A positive spectral presentation rrr of ρ\rhoρ consists of nonnegative real numbers λi\lambda_iλi​ and a complex matrix UUU satisfying U†U=1U^\dagger U=1U†U=1 and ρ=Udiag⁡(λi)U†\rho=U\operatorname{diag}(\lambda_i)U^\daggerρ=Udiag(λi​)U†; similarly, let sss present σ=Vdiag⁡(μi)V†\sigma=V\operatorname{diag}(\mu_i)V^\daggerσ=Vdiag(μi​)V†, with μi≥0\mu_i\ge0μi​≥0 and V†V=1V^\dagger V=1V†V=1. For any x,y∈Ix,y\in Ix,y∈I, this definition returns

∣∑i∈IUix‾Viy∣2.\left|\sum_{i\in I}\overline{U_{ix}}V_{iy}\right|^2.​i∈I∑​Uix​​Viy​​2.

Neither matrix is required to have trace one. The type III may be empty, in which case there are no choices of x,yx,yx,y.

QAlgorithms.Papers.Independent.Advance50.P02.eigenspaceProjector

For any finite index type III with decidable equality, any complex matrix σ\sigmaσ indexed by III, and any real number vvv, this definition applies real continuous functional calculus to σ\sigmaσ with the function that equals one at vvv and zero everywhere else. For Hermitian σ\sigmaσ, the result is the orthogonal projector onto its vvv-eigenspace, and is zero if vvv is absent from the spectrum. For non-Hermitian σ\sigmaσ, this functional calculus returns zero. No positivity, trace normalization, or nonemptiness of III is assumed.

QAlgorithms.Papers.Independent.Advance50.P02.empiricalMeanMass

For any finite type KKK, natural number nnn, arbitrary real functions P,Q:K→RP,Q:K\to\mathbb RP,Q:K→R, and real threshold RRR, let L(t)=ln⁡(t)/ln⁡2L(t)=\ln(t)/\ln2L(t)=ln(t)/ln2, with the total real logarithm conventions ln⁡0=0\ln0=0ln0=0 and ln⁡(−t)=ln⁡t\ln(-t)=\ln tln(−t)=lnt for t>0t>0t>0. This definition returns

∑z:{0,…,n−1}→K{∏i=0n−1P(zi),∑i=0n−1(L(P(zi))−L(Q(zi)))n≤R,0,otherwise.\sum_{z:\{0,\ldots,n-1\}\to K} \begin{cases} \displaystyle\prod_{i=0}^{n-1}P(z_i), &\displaystyle\frac{\sum_{i=0}^{n-1}\bigl(L(P(z_i))-L(Q(z_i))\bigr)}{n}\le R,\\ 0,&\text{otherwise}. \end{cases}z:{0,…,n−1}→K∑​⎩⎨⎧​i=0∏n−1​P(zi​),0,​n∑i=0n−1​(L(P(zi​))−L(Q(zi​)))​≤R,otherwise.​

There are no distribution or support assumptions. At n=0n=0n=0, the empty sum divided by zero is zero and the empty product is one, so the result is one if 0≤R0\le R0≤R and zero otherwise. If KKK is empty and n>0n>0n>0, the result is zero.

QAlgorithms.Papers.Independent.Advance50.P02.extendedTestingDivergence

For any finite index type III with decidable equality, real eee, and arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, let

b=inf⁡{Re⁡tr⁡(Qσ):Q⪰0, 1−Q⪰0, 1−e≤Re⁡tr⁡(Qρ)},b=\inf\left\{\operatorname{Re}\operatorname{tr}(Q\sigma): Q\succeq0,\ \mathbf1-Q\succeq0,\ 1-e\le\operatorname{Re}\operatorname{tr}(Q\rho)\right\},b=inf{Retr(Qσ):Q⪰0, 1−Q⪰0, 1−e≤Retr(Qρ)},

where this infimum is taken in the real numbers. The defined value is −ln⁡(b)/ln⁡2-\ln(b)/\ln2−ln(b)/ln2, regarded as an extended real number, if b>0b>0b>0, and +∞+\infty+∞ otherwise. There are no density-matrix assumptions or restrictions on eee. In particular, an empty feasible set has real infimum 000, giving +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.extractionIdeal

For any types X,BX,BX,B, an extractor on XXX with seed distribution (pu)u=0s−1(p_u)_{u=0}^{s-1}(pu​)u=0s−1​, positive output count KKK, and hash function, and any complex matrix σ\sigmaσ indexed by B×BB\times BB×B, the ideal extraction matrix is indexed by triples (u,k,b)(u,k,b)(u,k,b) and has entries

I(u,k,b),(v,ℓ,c)={puK σb,c,u=v and k=ℓ,0,otherwise.I_{(u,k,b),(v,\ell,c)} = \begin{cases} \dfrac{p_u}{K}\,\sigma_{b,c},&u=v\ \text{and }k=\ell,\\ 0,&\text{otherwise}. \end{cases}I(u,k,b),(v,ℓ,c)​={Kpu​​σb,c​,0,​u=v and k=ℓ,otherwise.​

Here pu≥0p_u\ge0pu​≥0 and ∑upu=1\sum_u p_u=1∑u​pu​=1. The hash function does not enter this formula, and σ\sigmaσ need not be positive or normalized. The denominator KKK is nonzero by the extractor’s positive output count.

QAlgorithms.Papers.Independent.Advance50.P02.extractionLength

For finite types X,BX,BX,B, with decidable equality on BBB, any real tolerance eee, and arbitrary complex matrices AxA_xAx​ on BBB, extraction length is the supremum in N\mathbb NN of the natural numbers lll for which there exists a finite seed distribution pu≥0p_u\ge0pu​≥0, ∑upu=1\sum_u p_u=1∑u​pu​=1, a positive natural output count KKK, and a hash function h(u,x)∈{0,…,K−1}h(u,x)\in\{0,\ldots,K-1\}h(u,x)∈{0,…,K−1}, such that l≤log⁡K/log⁡2l\le\log K/\log2l≤logK/log2 and the real infimum over positive semidefinite trace-one matrices σ\sigmaσ on BBB of

1−(Re⁡Tr⁡O IσO+(1−Re⁡Tr⁡O)(1−Re⁡Tr⁡Iσ))2\sqrt{1-\left( \operatorname{Re}\operatorname{Tr}\sqrt{\sqrt O\,I_\sigma\sqrt O} +\sqrt{(1-\operatorname{Re}\operatorname{Tr}O) (1-\operatorname{Re}\operatorname{Tr}I_\sigma)} \right)^2}1−(ReTrO​Iσ​O​​+(1−ReTrO)(1−ReTrIσ​)​)2​

is at most eee. The matrices OOO and IσI_\sigmaIσ​, indexed by (u,k,b)(u,k,b)(u,k,b), vanish between unequal seed or output labels; within a fixed (u,k)(u,k)(u,k) block they equal pu∑x: h(u,x)=kAxp_u\sum_{x:\,h(u,x)=k}A_xpu​∑x:h(u,x)=k​Ax​ and (pu/K)σ(p_u/K)\sigma(pu​/K)σ, respectively. Matrix functions use total real continuous functional calculus, and scalar square roots use the total real square root. No normalization or positivity of AxA_xAx​, or nonnegativity of eee, is required. An empty real infimum is zero; the natural-number supremum is zero if its defining set is empty or unbounded.

QAlgorithms.Papers.Independent.Advance50.P02.extractionOutput

For a finite type XXX, any type BBB, an extractor with seed probabilities pup_upu​, seed size sss, positive output count KKK, and hash function h(u,x)h(u,x)h(u,x), and any family of complex matrices AxA_xAx​ indexed by B×BB\times BB×B, the extraction output is the complex matrix indexed by triples (u,k,b)∈{0,…,s−1}×{0,…,K−1}×B(u,k,b)\in\{0,\ldots,s-1\}\times\{0,\ldots,K-1\}\times B(u,k,b)∈{0,…,s−1}×{0,…,K−1}×B whose entries are

O(u,k,b),(v,ℓ,c)={pu∑x∈X: h(u,x)=k(Ax)b,c,u=v and k=ℓ,0,otherwise.O_{(u,k,b),(v,\ell,c)} = \begin{cases} p_u\displaystyle\sum_{x\in X:\,h(u,x)=k}(A_x)_{b,c}, &u=v\ \text{and }k=\ell,\\ 0,&\text{otherwise}. \end{cases}O(u,k,b),(v,ℓ,c)​=⎩⎨⎧​pu​x∈X:h(u,x)=k∑​(Ax​)b,c​,0,​u=v and k=ℓ,otherwise.​

The seed probabilities are nonnegative and sum to one. No positivity or normalization is required of the matrices AxA_xAx​; if XXX is empty, this output is the zero matrix.

QAlgorithms.Papers.Independent.Advance50.P02.extractionSecurity

For finite types X,BX,BX,B, with decidable equality on BBB, an extractor with seed probabilities pup_upu​, positive output count KKK, and hash function hhh, and arbitrary complex matrices AxA_xAx​ indexed by B×BB\times BB×B, extraction security is the real infimum, over all positive semidefinite matrices σ\sigmaσ on BBB with Tr⁡σ=1\operatorname{Tr}\sigma=1Trσ=1, of

1−(Re⁡Tr⁡O IσO+(1−Re⁡Tr⁡O)(1−Re⁡Tr⁡Iσ))2.\sqrt{1-\left( \operatorname{Re}\operatorname{Tr}\sqrt{\sqrt O\,I_\sigma\sqrt O} +\sqrt{(1-\operatorname{Re}\operatorname{Tr}O) (1-\operatorname{Re}\operatorname{Tr}I_\sigma)} \right)^2}.1−(ReTrO​Iσ​O​​+(1−ReTrO)(1−ReTrIσ​)​)2​.

Here O(u,k,b),(v,ℓ,c)O_{(u,k,b),(v,\ell,c)}O(u,k,b),(v,ℓ,c)​ is zero unless u=vu=vu=v and k=ℓk=\ellk=ℓ, in which case it equals pu∑x: h(u,x)=k(Ax)b,cp_u\sum_{x:\,h(u,x)=k}(A_x)_{b,c}pu​∑x:h(u,x)=k​(Ax​)b,c​; IσI_\sigmaIσ​ has the same zero entries and otherwise equals (pu/K)σb,c(p_u/K)\sigma_{b,c}(pu​/K)σb,c​. Matrix square roots denote the total real continuous functional calculus with the real square-root function; scalar real square roots are zero on negative arguments. No positivity or normalization of the AxA_xAx​ is assumed. The real infimum uses the total convention giving zero for an empty or unbounded-below set; in particular, when BBB is empty there is no trace-one σ\sigmaσ, so this definition gives zero.

QAlgorithms.Papers.Independent.Advance50.P02.finiteBins

For every natural number nnn, including 000, and every complex matrix σ\sigmaσ indexed by a finite type III with decidable equality, this defines the natural number

finiteBins⁡(n,σ)=max⁡ ⁣(1,⌈n[log⁡2(sup⁡Eσ)−log⁡2(mσ)]⌉N).\operatorname{finiteBins}(n,\sigma) =\max\!\left(1,\left\lceil n\left[ \log_2(\sup E_\sigma)-\log_2(m_\sigma)\right]\right\rceil_{\mathbb N}\right).finiteBins(n,σ)=max(1,⌈n[log2​(supEσ​)−log2​(mσ​)]⌉N​).

Here EσE_\sigmaEσ​ is the set of distinct real eigenvalues when σ\sigmaσ is Hermitian and is empty otherwise; mσm_\sigmamσ​ is its least strictly positive eigenvalue, or 000 if none exists. The real supremum of the empty set is 000, log⁡2x=log⁡x/log⁡2\log_2x=\log x/\log2log2​x=logx/log2 uses the total real logarithm with log⁡0=0\log0=0log0=0, and ⌈x⌉N\lceil x\rceil_{\mathbb N}⌈x⌉N​ is the least natural number at least xxx, hence is 000 for x≤0x\le0x≤0. The result is always at least 111, and equals 111 when n=0n=0n=0 or when σ\sigmaσ is non-Hermitian; no positivity assumption is imposed.

QAlgorithms.Papers.Independent.Advance50.P02.gaussianCenter

For every natural number nnn and all real numbers D,V,eD,V,eD,V,e, this defines the real number

nD+nV Φ−1(e),Φ−1(e)=inf⁡{z∈R:e≤∫−∞zexp⁡(−x2/2)2π dx}.nD+\sqrt{nV}\,\Phi^{-1}(e), \qquad \Phi^{-1}(e)=\inf\left\{z\in\mathbb R:e\le \int_{-\infty}^{z}\frac{\exp(-x^2/2)}{\sqrt{2\pi}}\,dx\right\}.nD+nV​Φ−1(e),Φ−1(e)=inf{z∈R:e≤∫−∞z​2π​exp(−x2/2)​dx}.

No positivity assumption on VVV or restriction on eee is imposed. The real square root is zero on negative arguments, and the real infimum is defined to be zero when its set is empty or unbounded below. The definition includes n=0n=0n=0, when its value is zero.

QAlgorithms.Papers.Independent.Advance50.P02.identityTensor

For any index type AAA with decidable equality, any index type BBB, and any complex matrix σ\sigmaσ indexed by BBB, this definition returns the matrix indexed by A×BA\times BA×B whose entries are

T(a,b),(a′,b′)={σb,b′,a=a′,0,a≠a′.T_{(a,b),(a',b')}= \begin{cases} \sigma_{b,b'},&a=a',\\ 0,&a\ne a'. \end{cases}T(a,b),(a′,b′)​={σb,b′​,0,​a=a′,a=a′.​

No finiteness, positivity, or normalization assumption is required; either index type may be empty.

QAlgorithms.Papers.Independent.Advance50.P02.intervalInf

For arbitrary real endpoints a,ba,ba,b and any function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, this defines

intervalInf⁡(a,b,f)=inf⁡{f(x):a≤x<b},\operatorname{intervalInf}(a,b,f) =\inf\{f(x):a\le x<b\},intervalInf(a,b,f)=inf{f(x):a≤x<b},

where the values of fff are embedded in the extended reals before taking the infimum. No continuity, boundedness, or ordering of the endpoints is assumed. If a≥ba\ge ba≥b, the set is empty and the result is +∞+\infty+∞; on a nonempty interval the result can be −∞-\infty−∞.

QAlgorithms.Papers.Independent.Advance50.P02.intervalSup

For arbitrary real endpoints a,ba,ba,b and any function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, this defines

intervalSup⁡(a,b,f)=sup⁡{f(x):a≤x<b},\operatorname{intervalSup}(a,b,f) =\sup\{f(x):a\le x<b\},intervalSup(a,b,f)=sup{f(x):a≤x<b},

where the values of fff are embedded in the extended reals before taking the supremum. No continuity, boundedness, or ordering of the endpoints is assumed. If a≥ba\ge ba≥b, the set is empty and the result is −∞-\infty−∞; on a nonempty interval the result can be +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.inverseRate

For an arbitrary family g:N×R→Rg:\mathbb N\times\mathbb R\to\mathbb Rg:N×R→R, real eee, and Boolean flag strict\mathrm{strict}strict, this defines

inverseRate⁡(g,e,strict)=sup⁡a lim inf⁡n→∞sup⁡{R∈R:g(n,R)≤an},\operatorname{inverseRate}(g,e,\mathrm{strict}) = \sup_a\ \liminf_{n\to\infty}\sup\{R\in\mathbb R:g(n,R)\le a_n\},inverseRate(g,e,strict)=asup​ n→∞liminf​sup{R∈R:g(n,R)≤an​},

where all suprema and limit inferiors are in the extended reals and the outer supremum ranges over all real sequences a:N→Ra:\mathbb N\to\mathbb Ra:N→R satisfying lim inf⁡n→∞an<e\liminf_{n\to\infty}a_n<eliminfn→∞​an​<e when strict\mathrm{strict}strict is true, or lim sup⁡n→∞an≤e\limsup_{n\to\infty}a_n\le elimsupn→∞​an​≤e when it is false. There is no monotonicity assumption on ggg, and the sequences aaa are not required to be bounded or to lie in [0,1][0,1][0,1]. An empty inner threshold set has supremum −∞-\infty−∞, an unbounded one has supremum +∞+\infty+∞, and an empty outer feasible set also gives −∞-\infty−∞.

QAlgorithms.Papers.Independent.Advance50.P02.joinClassical

For index types X,A,BX,A,BX,A,B and any family of complex matrices HxH_xHx​ indexed by A×BA\times BA×B, this definition returns a matrix indexed by (X×A)×B(X\times A)\times B(X×A)×B whose entries are

C((x,a),b),((y,a′),b′)={(Hx)(a,b),(a′,b′),x=y,0,x≠y.C_{((x,a),b),((y,a'),b')}= \begin{cases} (H_x)_{(a,b),(a',b')},&x=y,\\ 0,&x\ne y. \end{cases}C((x,a),b),((y,a′),b′)​={(Hx​)(a,b),(a′,b′)​,0,​x=y,x=y.​

Equality of labels is decided classically. No positivity, normalization, or nonemptiness assumption is imposed.

QAlgorithms.Papers.Independent.Advance50.P02.labelCount

For finite index types X,BX,BX,B and any family of complex matrices HxH_xHx​ indexed by BBB, this definition returns

∣{x∈X:0<ℜTr⁡Hx}∣.\left|\left\{x\in X:0<\Re\operatorname{Tr}H_x\right\}\right|.∣{x∈X:0<ℜTrHx​}∣.

It counts labels with strictly positive real trace. No positivity or normalization of the blocks is assumed, so a nonzero block with zero or negative real trace is not counted. The result is 000 if XXX or BBB is empty.

QAlgorithms.Papers.Independent.Advance50.P02.liftIsometry

For index types I,A,BI,A,BI,A,B and any complex matrix UUU with rows indexed by III and columns indexed by AAA, this defines the matrix with rows indexed by I×BI\times BI×B and columns indexed by A×BA\times BA×B whose entries are

U~(i,b),(a,b′)={Ui,a,b=b′,0,b≠b′.\widetilde U_{(i,b),(a,b')}= \begin{cases} U_{i,a},&b=b',\\ 0,&b\ne b'. \end{cases}U(i,b),(a,b′)​={Ui,a​,0,​b=b′,b=b′.​

This is U⊗IBU\otimes I_BU⊗IB​. The definition itself imposes no isometry assumption on UUU, and permits empty index types.

QAlgorithms.Papers.Independent.Advance50.P02.lowProjector

For any finite index type III with decidable equality, arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, and real RRR, this defines the real self-adjoint functional calculus of H=ρ−2RσH=\rho-2^R\sigmaH=ρ−2Rσ with scalar function x↦1x\mapsto1x↦1 for x≤0x\le0x≤0 and x↦0x\mapsto0x↦0 for x>0x>0x>0. When HHH is Hermitian, it is the orthogonal projector onto the sum of its eigenspaces with nonpositive eigenvalues, including the zero eigenspace. If HHH is not Hermitian, the functional calculus returns the zero matrix. No positivity or normalization assumptions are imposed on ρ\rhoρ or σ\sigmaσ.

QAlgorithms.Papers.Independent.Advance50.P02.monotoneInverse

For any function g:R→Rg:\mathbb R\to\mathbb Rg:R→R and any real eee, this defines

monotoneInverse⁡(g,e)=sup⁡{R∈R:g(R)≤e},\operatorname{monotoneInverse}(g,e)=\sup\{R\in\mathbb R:g(R)\le e\},monotoneInverse(g,e)=sup{R∈R:g(R)≤e},

with real RRR embedded in the extended reals before taking the supremum. No monotonicity assumption is part of this definition. An empty feasible set gives −∞-\infty−∞, and a feasible set unbounded above gives +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.negLog

For every real number xxx, this defines an extended real value equal to +∞+\infty+∞ when x=0x=0x=0, and equal to −ln⁡(x)/ln⁡2-\ln(x)/\ln 2−ln(x)/ln2 otherwise. Negative xxx are included: the scalar logarithm is the total real logarithm, for which ln⁡(x)=ln⁡∣x∣\ln(x)=\ln|x|ln(x)=ln∣x∣ when x<0x<0x<0.

QAlgorithms.Papers.Independent.Advance50.P02.nsProbability

Let III be any finite index type with decidable equality, and let r,sr,sr,s be positive spectral presentations of complex matrices ρ,σ\rho,\sigmaρ,σ: their real values λx,μy\lambda_x,\mu_yλx​,μy​ are nonnegative, their matrices U,VU,VU,V satisfy U†U=V†V=1U^\dagger U=V^\dagger V=1U†U=V†V=1, and ρ=Udiag⁡(λx)U†\rho=U\operatorname{diag}(\lambda_x)U^\daggerρ=Udiag(λx​)U†, σ=Vdiag⁡(μy)V†\sigma=V\operatorname{diag}(\mu_y)V^\daggerσ=Vdiag(μy​)V†. This definition returns the real function on I×II\times II×I given by

P(x,y)=λx∣∑i∈IUix‾Viy∣2.P(x,y)=\lambda_x\left|\sum_{i\in I}\overline{U_{ix}}V_{iy}\right|^2.P(x,y)=λx​​i∈I∑​Uix​​Viy​​2.

There is no trace-one assumption, so normalization of this function as a probability distribution is not required. Empty III is allowed.

QAlgorithms.Papers.Independent.Advance50.P02.nsReferenceWeight

Let III be any finite index type with decidable equality, and let r,sr,sr,s be positive spectral presentations of complex matrices ρ,σ\rho,\sigmaρ,σ: their real values λx,μy\lambda_x,\mu_yλx​,μy​ are nonnegative, their matrices U,VU,VU,V satisfy U†U=V†V=1U^\dagger U=V^\dagger V=1U†U=V†V=1, and ρ=Udiag⁡(λx)U†\rho=U\operatorname{diag}(\lambda_x)U^\daggerρ=Udiag(λx​)U†, σ=Vdiag⁡(μy)V†\sigma=V\operatorname{diag}(\mu_y)V^\daggerσ=Vdiag(μy​)V†. This definition returns the real function on I×II\times II×I given by

Q(x,y)=μy∣∑i∈IUix‾Viy∣2.Q(x,y)=\mu_y\left|\sum_{i\in I}\overline{U_{ix}}V_{iy}\right|^2.Q(x,y)=μy​​i∈I∑​Uix​​Viy​​2.

Neither matrix is required to have trace one, and the resulting weights need not sum to one. Empty III is allowed.

QAlgorithms.Papers.Independent.Advance50.P02.nsSequence

Let SSS specify finite index types IkI_kIk​ with decidable equality and complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ for every k≥0k\ge0k≥0. Suppose that, for each kkk, rkr_krk​ supplies nonnegative real numbers λk,x\lambda_{k,x}λk,x​ and a square complex matrix UkU_kUk​ satisfying Uk†Uk=1U_k^\dagger U_k=1Uk†​Uk​=1 and ρk=Ukdiag⁡(λk,x)Uk†\rho_k=U_k\operatorname{diag}(\lambda_{k,x})U_k^\daggerρk​=Uk​diag(λk,x​)Uk†​, and sks_ksk​ similarly supplies nonnegative μk,y\mu_{k,y}μk,y​ and VkV_kVk​ with Vk†Vk=1V_k^\dagger V_k=1Vk†​Vk​=1 and σk=Vkdiag⁡(μk,y)Vk†\sigma_k=V_k\operatorname{diag}(\mu_{k,y})V_k^\daggerσk​=Vk​diag(μk,y​)Vk†​. The declaration constructs a new sequence on the finite registers Ik×IkI_k\times I_kIk​×Ik​, using classical decidable equality, whose two matrices are diagonal with respective diagonal entries

Pk(x,y)=λk,x∣∑i∈IkUk(i,x)‾Vk(i,y)∣2,Qk(x,y)=μk,y∣∑i∈IkUk(i,x)‾Vk(i,y)∣2.P_k(x,y)=\lambda_{k,x}\left|\sum_{i\in I_k}\overline{U_k(i,x)}V_k(i,y)\right|^2,\qquad Q_k(x,y)=\mu_{k,y}\left|\sum_{i\in I_k}\overline{U_k(i,x)}V_k(i,y)\right|^2.Pk​(x,y)=λk,x​​i∈Ik​∑​Uk​(i,x)​Vk​(i,y)​2,Qk​(x,y)=μk,y​​i∈Ik​∑​Uk​(i,x)​Vk​(i,y)​2.

All off-diagonal entries are zero. Neither trace-one normalization nor nonempty registers are required, so these weights are not assumed to sum to 111.

QAlgorithms.Papers.Independent.Advance50.P02.nsSpectralPresentation

Let III be any finite index type with decidable equality, let ρ\rhoρ be a complex matrix indexed by III, and let rrr consist of nonnegative real values λx\lambda_xλx​ and a complex matrix UUU satisfying U†U=1U^\dagger U=1U†U=1 and ρ=Udiag⁡(λx)U†\rho=U\operatorname{diag}(\lambda_x)U^\daggerρ=Udiag(λx​)U†. This definition constructs spectral data whose value at x∈Ix\in Ix∈I is λx\lambda_xλx​ and whose vector indexed by xxx has coordinate UixU_{ix}Uix​ at i∈Ii\in Ii∈I. The resulting data record contains only these values and vectors. No trace normalization or nonemptiness of III is assumed.

QAlgorithms.Papers.Independent.Advance50.P02.nsTensorP

For a finite type III with decidable equality, complex matrices ρ,σ\rho,\sigmaρ,σ indexed by III, and spectral presentations r=(λ,U)r=(\lambda,U)r=(λ,U), s=(μ,V)s=(\mu,V)s=(μ,V) satisfying λx,μy≥0\lambda_x,\mu_y\ge0λx​,μy​≥0, U†U=V†V=1U^\dagger U=V^\dagger V=1U†U=V†V=1, ρ=Udiag⁡(λ)U†\rho=U\operatorname{diag}(\lambda)U^\daggerρ=Udiag(λ)U†, and σ=Vdiag⁡(μ)V†\sigma=V\operatorname{diag}(\mu)V^\daggerσ=Vdiag(μ)V†, this defines a real number for every natural nnn and every sequence z=(z0,…,zn−1)∈(I×I)nz=(z_0,\ldots,z_{n-1})\in(I\times I)^nz=(z0​,…,zn−1​)∈(I×I)n:

nsTensorP⁡(r,s,n,z)=(∏k=0n−1λzk(1))∣∑a∈In∏k=0n−1Uak,zk(1)‾∏k=0n−1Vak,zk(2)∣2.\operatorname{nsTensorP}(r,s,n,z)= \left(\prod_{k=0}^{n-1}\lambda_{z_k^{(1)}}\right) \left| \sum_{a\in I^n} \overline{\prod_{k=0}^{n-1}U_{a_k,z_k^{(1)}}} \prod_{k=0}^{n-1}V_{a_k,z_k^{(2)}} \right|^2.nsTensorP(r,s,n,z)=(k=0∏n−1​λzk(1)​​)​a∈In∑​k=0∏n−1​Uak​,zk(1)​​​k=0∏n−1​Vak​,zk(2)​​​2.

The squared modulus is the complex norm squared. No trace normalization of either matrix is required. For n=0n=0n=0, both products are empty products, I0I^0I0 has one element, and the defined value is 111, including when III is empty.

QAlgorithms.Papers.Independent.Advance50.P02.nsTensorQ

For a finite type III with decidable equality, complex matrices ρ,σ\rho,\sigmaρ,σ indexed by III, and spectral presentations r=(λ,U)r=(\lambda,U)r=(λ,U), s=(μ,V)s=(\mu,V)s=(μ,V) satisfying λx,μy≥0\lambda_x,\mu_y\ge0λx​,μy​≥0, U†U=V†V=1U^\dagger U=V^\dagger V=1U†U=V†V=1, ρ=Udiag⁡(λ)U†\rho=U\operatorname{diag}(\lambda)U^\daggerρ=Udiag(λ)U†, and σ=Vdiag⁡(μ)V†\sigma=V\operatorname{diag}(\mu)V^\daggerσ=Vdiag(μ)V†, this defines a real number for every natural nnn and every sequence z∈(I×I)nz\in(I\times I)^nz∈(I×I)n:

nsTensorQ⁡(r,s,n,z)=(∏k=0n−1μzk(2))∣∑a∈In∏k=0n−1Uak,zk(1)‾∏k=0n−1Vak,zk(2)∣2.\operatorname{nsTensorQ}(r,s,n,z)= \left(\prod_{k=0}^{n-1}\mu_{z_k^{(2)}}\right) \left| \sum_{a\in I^n} \overline{\prod_{k=0}^{n-1}U_{a_k,z_k^{(1)}}} \prod_{k=0}^{n-1}V_{a_k,z_k^{(2)}} \right|^2.nsTensorQ(r,s,n,z)=(k=0∏n−1​μzk(2)​​)​a∈In∑​k=0∏n−1​Uak​,zk(1)​​​k=0∏n−1​Vak​,zk(2)​​​2.

The squared modulus is the complex norm squared. Neither matrix is assumed to have trace 111. At n=0n=0n=0, the empty products and the single term indexed by I0I^0I0 give value 111, even for empty III.

QAlgorithms.Papers.Independent.Advance50.P02.operationalTestingRate

Let SSS consist of finite index types IkI_kIk​ with decidable equality and arbitrary complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on IkI_kIk​, for every k≥0k\ge0k≥0. For an arbitrary real eee and Boolean parameter strict\mathrm{strict}strict, consider every sequence QkQ_kQk​ for which both QkQ_kQk​ and 1−Qk1-Q_k1−Qk​ are positive semidefinite. Define

ak=Re⁡Tr⁡(ρk(1−Qk)),R(Q)=lim inf⁡k→∞ℓ ⁣(Re⁡Tr⁡(Qkσk))k+1,a_k=\operatorname{Re}\operatorname{Tr}\bigl(\rho_k(1-Q_k)\bigr),\qquad R(Q)=\liminf_{k\to\infty}\frac{\ell\!\left(\operatorname{Re}\operatorname{Tr}(Q_k\sigma_k)\right)}{k+1},ak​=ReTr(ρk​(1−Qk​)),R(Q)=k→∞liminf​k+1ℓ(ReTr(Qk​σk​))​,

where ℓ(0)=+∞\ell(0)=+\inftyℓ(0)=+∞ and ℓ(x)=−log⁡2x\ell(x)=-\log_2xℓ(x)=−log2​x for x≠0x\ne0x=0, using the total real logarithm. The declaration defines

operationalTestingRate⁡(S,e,strict)=sup⁡{R(Q):{lim inf⁡k→∞ak<e,strict=true,lim sup⁡k→∞ak≤e,strict=false.}.\operatorname{operationalTestingRate}(S,e,\mathrm{strict}) =\sup\left\{R(Q): \begin{cases} \liminf_{k\to\infty}a_k<e,&\mathrm{strict}=\mathrm{true},\\ \limsup_{k\to\infty}a_k\le e,&\mathrm{strict}=\mathrm{false}. \end{cases}\right\}.operationalTestingRate(S,e,strict)=sup{R(Q):{liminfk→∞​ak​<e,limsupk→∞​ak​≤e,​strict=true,strict=false.​}.

The limits and supremum are taken in the extended reals. There is no requirement that e∈[0,1]e\in[0,1]e∈[0,1] or that the matrices are density matrices; an empty set of admissible test sequences has supremum −∞-\infty−∞.

QAlgorithms.Papers.Independent.Advance50.P02.optimizedEntropySequenceRate

For every function H:N×R→R‾H:\mathbb N\times\mathbb R\to\overline{\mathbb R}H:N×R→R, real number eee, and Boolean strict\mathrm{strict}strict, this defines

sup⁡a:N→[0,1]specified error conditionlim inf⁡k→∞1k+1 H(k,ak),\sup_{\substack{a:\mathbb N\to[0,1]\\ \text{specified error condition}}} \liminf_{k\to\infty}\frac1{k+1}\,H(k,a_k),a:N→[0,1]specified error condition​sup​k→∞liminf​k+11​H(k,ak​),

where the error condition is lim inf⁡k→∞ak<e\liminf_{k\to\infty}a_k<eliminfk→∞​ak​<e when strict=true\mathrm{strict}=\mathrm{true}strict=true, and lim sup⁡k→∞ak≤e\limsup_{k\to\infty}a_k\le elimsupk→∞​ak​≤e when strict=false\mathrm{strict}=\mathrm{false}strict=false. All limits and the supremum are taken in the extended real numbers, and 1/(k+1)1/(k+1)1/(k+1) is embedded there before multiplication. The bounds 0≤ak≤10\le a_k\le10≤ak​≤1 hold for every kkk, including zero; there are no further assumptions on HHH or eee. If no admissible sequence exists, the value is −∞-\infty−∞; in particular, this occurs in the strict case when e≤0e\le0e≤0.

QAlgorithms.Papers.Independent.Advance50.P02.pauliP

For every real number ppp, this defines a real-valued function on {0,1,2,3}\{0,1,2,3\}{0,1,2,3} by

Pp(0)=Pp(1)=p2,Pp(2)=Pp(3)=1−p2.P_p(0)=P_p(1)=\frac p2,\qquad P_p(2)=P_p(3)=\frac{1-p}{2}.Pp​(0)=Pp​(1)=2p​,Pp​(2)=Pp​(3)=21−p​.

There is no restriction on ppp. The four values sum to 111, but they are all nonnegative only when 0≤p≤10\le p\le10≤p≤1.

QAlgorithms.Papers.Independent.Advance50.P02.pauliQ

For every real number ppp, this defines a real-valued function QpQ_pQp​ on {0,1,2,3}\{0,1,2,3\}{0,1,2,3} by Qp(0)=Qp(1)=p2Q_p(0)=Q_p(1)=p^2Qp​(0)=Qp​(1)=p2 and Qp(2)=Qp(3)=(1−p)2Q_p(2)=Q_p(3)=(1-p)^2Qp​(2)=Qp​(3)=(1−p)2. There is no restriction on ppp and no normalization requirement; the sum of its four values is 2p2+2(1−p)22p^2+2(1-p)^22p2+2(1−p)2.

QAlgorithms.Papers.Independent.Advance50.P02.positiveSpectralFactor

For a finite index type III with decidable equality and any complex matrix σ\sigmaσ indexed by III, form SσS_\sigmaSσ​, the set of distinct eigenvalues if σ\sigmaσ is Hermitian and the empty set otherwise, and write dσ=∣Sσ∣d_\sigma=|S_\sigma|dσ​=∣Sσ​∣. If σ\sigmaσ is positive definite, this definition returns

min⁡ ⁣{2max⁡ ⁣{1,⌈ln⁡(sup⁡Sσ)−ln⁡(inf⁡Sσ)ln⁡2⌉N}, dσ};\min\!\left\{2\max\!\left\{1,\left\lceil \frac{\ln(\sup S_\sigma)-\ln(\inf S_\sigma)}{\ln 2} \right\rceil_{\mathbb N}\right\},\,d_\sigma\right\};min{2max{1,⌈ln2ln(supSσ​)−ln(infSσ​)​⌉N​},dσ​};

otherwise it returns dσd_\sigmadσ​. Here ⌈x⌉N\lceil x\rceil_{\mathbb N}⌈x⌉N​ is the least natural number at least xxx, with value 000 for x≤0x\le0x≤0; empty real suprema and infima and ln⁡0\ln0ln0 have value 000. In particular, the result is 000 whenever SσS_\sigmaSσ​ is empty.

QAlgorithms.Papers.Independent.Advance50.P02.positiveTraceSmoothedMinEntropy

For finite index types A,BA,BA,B with decidable equality, any real eee, and any complex matrix ρ\rhoρ indexed by A×BA\times BA×B, this definition returns the supremum in the extended real numbers of −De(ρ,IA⊗σ)-D_e(\rho,I_A\otimes\sigma)−De​(ρ,IA​⊗σ) over all positive semidefinite matrices σ\sigmaσ indexed by BBB with Tr⁡σ=1\operatorname{Tr}\sigma=1Trσ=1, where (IA⊗σ)(a,b),(a′,b′)=σb,b′(I_A\otimes\sigma)_{(a,b),(a',b')}=\sigma_{b,b'}(IA​⊗σ)(a,b),(a′,b′)​=σb,b′​ if a=a′a=a'a=a′ and is 000 otherwise. For matrices R,SR,SR,S, the quantity De(R,S)D_e(R,S)De​(R,S) is the extended-real infimum of log⁡2t=ln⁡t/ln⁡2\log_2 t=\ln t/\ln2log2​t=lnt/ln2 over matrices τ\tauτ and real numbers ttt satisfying τ≥0\tau\ge0τ≥0, 0<ℜTr⁡τ≤10<\Re\operatorname{Tr}\tau\le10<ℜTrτ≤1, t>0t>0t>0, tS−τ≥0tS-\tau\ge0tS−τ≥0, and

1−(F0(R,τ)+(1−ℜTr⁡R)(1−ℜTr⁡τ))2≤e,F0(R,τ)=ℜTr⁡R τ R.\sqrt{1-\left(F_0(R,\tau)+ \sqrt{(1-\Re\operatorname{Tr}R)(1-\Re\operatorname{Tr}\tau)}\right)^2}\le e, \qquad F_0(R,\tau)=\Re\operatorname{Tr}\sqrt{\sqrt R\,\tau\,\sqrt R}.1−(F0​(R,τ)+(1−ℜTrR)(1−ℜTrτ)​)2​≤e,F0​(R,τ)=ℜTrR​τR​​.

Matrix square roots in this formula use the real continuous functional calculus, and real square roots return 000 on negative arguments. No density-matrix assumption on ρ\rhoρ or restriction on eee is imposed. An empty inner feasible set gives De=+∞D_e=+\inftyDe​=+∞; an empty outer set gives −∞-\infty−∞, as happens when BBB is empty. For e<0e<0e<0, every inner feasible set is empty and the result is −∞-\infty−∞.

QAlgorithms.Papers.Independent.Advance50.P02.processBlocks

For a finite label type XXX, index types Z,BZ,BZ,B, a function f:X→Zf:X\to Zf:X→Z, and any family of complex matrices HxH_xHx​ indexed by BBB, this definition returns the family indexed by ZZZ given by

Kz=∑x∈Xf(x)=zHx.K_z=\sum_{\substack{x\in X\\f(x)=z}}H_x.Kz​=x∈Xf(x)=z​∑​Hx​.

Equality in the condition is decided classically. No positivity or normalization is required. A label with no preimage receives the zero matrix; if XXX is empty, every output block is zero.

QAlgorithms.Papers.Independent.Advance50.P02.quantumSpectrumRate

For every sequence of finite index types IkI_kIk​ with decidable equality and complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on IkI_kIk​, every real eee, and every Boolean strict\mathrm{strict}strict, let

mk(u)=Re⁡tr⁡ ⁣(ρk f(ρk−2uσk)),f(x)={1x≤0,0x>0,m_k(u)=\operatorname{Re}\operatorname{tr}\!\left(\rho_k\,f(\rho_k-2^u\sigma_k)\right), \qquad f(x)=\begin{cases}1&x\le0,\\0&x>0,\end{cases}mk​(u)=Retr(ρk​f(ρk​−2uσk​)),f(x)={10​x≤0,x>0,​

where fff is applied by the matrix functional calculus; in particular, its value at zero is 111. This definition is the extended-real supremum of all real RRR such that

lim inf⁡k→∞mk((k+1)R)<eif strict=true,lim sup⁡k→∞mk((k+1)R)≤eif strict=false.\liminf_{k\to\infty}m_k((k+1)R)<e \quad\text{if }\mathrm{strict}=\mathrm{true}, \qquad \limsup_{k\to\infty}m_k((k+1)R)\le e \quad\text{if }\mathrm{strict}=\mathrm{false}.k→∞liminf​mk​((k+1)R)<eif strict=true,k→∞limsup​mk​((k+1)R)≤eif strict=false.

The limits are computed in the extended reals. No density-matrix assumptions are imposed here, and the supremum is −∞-\infty−∞ if there are no qualifying real RRR, or +∞+\infty+∞ if they are unbounded above.

QAlgorithms.Papers.Independent.Advance50.P02.relativeMean

For any finite index type III with decidable equality and arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, this defines

Re⁡tr⁡ ⁣(ρ(Clog⁡2(ρ)−Clog⁡2(σ))),log⁡2x=ln⁡xln⁡2.\operatorname{Re}\operatorname{tr}\!\left( \rho\bigl(\mathcal C_{\log_2}(\rho)-\mathcal C_{\log_2}(\sigma)\bigr) \right), \qquad \log_2 x=\frac{\ln x}{\ln2}.Retr(ρ(Clog2​​(ρ)−Clog2​​(σ))),log2​x=ln2lnx​.

Here C\mathcal CC is the real self-adjoint functional calculus, returning zero on non-Hermitian inputs. The scalar logarithm is total, with ln⁡0=0\ln0=0ln0=0 and ln⁡x=ln⁡∣x∣\ln x=\ln|x|lnx=ln∣x∣ for negative xxx. No positivity, normalization, or support inclusion is required. For empty III, the value is zero.

QAlgorithms.Papers.Independent.Advance50.P02.smoothMaxEndpoint

For a finite index type III with decidable equality, arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ on III, and any real aaa, define

Mb(ρ,σ)=inf⁡{log⁡2t:τ⪰0,0<Re⁡Tr⁡τ≤1,P(ρ,τ)≤b,t>0,tσ−τ⪰0},M_b(\rho,\sigma)=\inf\left\{\log_2t: \begin{array}{l} \tau\succeq0,\quad 0<\operatorname{Re}\operatorname{Tr}\tau\le1,\quad P(\rho,\tau)\le b,\\ t>0,\quad t\sigma-\tau\succeq0 \end{array}\right\},Mb​(ρ,σ)=inf{log2​t:τ⪰0,0<ReTrτ≤1,P(ρ,τ)≤b,t>0,tσ−τ⪰0​},

with the infimum taken in the extended reals over all matrices τ\tauτ and real ttt satisfying these conditions. Here

P(X,Y)=1−(F0(X,Y)+(1−Re⁡Tr⁡X)(1−Re⁡Tr⁡Y))2,F0(X,Y)=Re⁡Tr⁡X Y X,P(X,Y)=\sqrt{1-\left(F_0(X,Y)+ \sqrt{(1-\operatorname{Re}\operatorname{Tr}X)(1-\operatorname{Re}\operatorname{Tr}Y)}\right)^2}, \qquad F_0(X,Y)=\operatorname{Re}\operatorname{Tr}\sqrt{\sqrt X\,Y\,\sqrt X},P(X,Y)=1−(F0​(X,Y)+(1−ReTrX)(1−ReTrY)​)2​,F0​(X,Y)=ReTrX​YX​​,

and matrix square roots use continuous functional calculus with the real square-root function. The declaration defines

smoothMaxEndpoint⁡(a,ρ,σ)={Ma(ρ,σ),a<1,inf⁡0≤b<1Mb(ρ,σ),a≥1.\operatorname{smoothMaxEndpoint}(a,\rho,\sigma)= \begin{cases} M_a(\rho,\sigma),&a<1,\\ \displaystyle\inf_{0\le b<1}M_b(\rho,\sigma),&a\ge1. \end{cases}smoothMaxEndpoint(a,ρ,σ)={Ma​(ρ,σ),0≤b<1inf​Mb​(ρ,σ),​a<1,a≥1.​

Thus a=1a=1a=1 uses the second branch, as does every larger aaa, whereas negative aaa uses the first branch. No positivity or normalization is required of ρ,σ\rho,\sigmaρ,σ, and the real square roots and logarithms retain their total definitions; an empty feasible set in either extended-real infimum gives +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.smoothedMaxRelativeEntropy

For any finite index type III with decidable equality, real eee, and arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, this is the extended real infimum of ln⁡(t)/ln⁡2\ln(t)/\ln2ln(t)/ln2 over matrices τ\tauτ and real numbers ttt satisfying τ⪰0\tau\succeq0τ⪰0, 0<Re⁡tr⁡τ≤10<\operatorname{Re}\operatorname{tr}\tau\le10<Retrτ≤1, t>0t>0t>0, tσ−τ⪰0t\sigma-\tau\succeq0tσ−τ⪰0, and

1−(Re⁡tr⁡C⋅ ⁣(C⋅(ρ) τ C⋅(ρ))+(1−Re⁡tr⁡ρ)(1−Re⁡tr⁡τ))2≤e.\sqrt{1-\left( \operatorname{Re}\operatorname{tr} \mathcal C_{\sqrt{\cdot}}\!\left( \mathcal C_{\sqrt{\cdot}}(\rho)\,\tau\,\mathcal C_{\sqrt{\cdot}}(\rho) \right) +\sqrt{(1-\operatorname{Re}\operatorname{tr}\rho) (1-\operatorname{Re}\operatorname{tr}\tau)} \right)^2}\le e.1−(RetrC⋅​​(C⋅​​(ρ)τC⋅​​(ρ))+(1−Retrρ)(1−Retrτ)​)2​≤e.

Here Cf(X)\mathcal C_f(X)Cf​(X) denotes the real self-adjoint functional calculus applied to XXX, which returns zero for a non-Hermitian input, and real square roots of negative numbers are defined to be zero. Neither ρ\rhoρ nor σ\sigmaσ is required to be a density matrix. An empty feasible set gives +∞+\infty+∞; in particular, this occurs when III is empty.

QAlgorithms.Papers.Independent.Advance50.P02.spectralSpread

For a finite index type III with decidable equality and any complex matrix σ\sigmaσ indexed by III, let SσS_\sigmaSσ​ be the finite set of its distinct real eigenvalues when σ\sigmaσ is Hermitian, and let Sσ=∅S_\sigma=\varnothingSσ​=∅ otherwise. This definition returns

ln⁡(sup⁡Sσ)ln⁡2−ln⁡(inf⁡Sσ)ln⁡2.\frac{\ln(\sup S_\sigma)}{\ln 2}-\frac{\ln(\inf S_\sigma)}{\ln 2}.ln2ln(supSσ​)​−ln2ln(infSσ​)​.

The suprema and infima here are taken in R\mathbb RR, where the empty-set values used by these operations are both 000, and the real logarithm is total with ln⁡0=0\ln 0=0ln0=0. Thus the result is 000 when SσS_\sigmaSσ​ is empty, including for non-Hermitian matrices and empty III. No positivity assumption is imposed on σ\sigmaσ or its eigenvalues.

QAlgorithms.Papers.Independent.Advance50.P02.spectrumEntropy

For any finite index type III with decidable equality, real eee, and arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, this is

sup⁡{R∈R:Re⁡tr⁡ ⁣(ρ C1(−∞,0](ρ−2Rσ))≤e},\sup\left\{R\in\mathbb R: \operatorname{Re}\operatorname{tr}\!\left( \rho\,\mathcal C_{\mathbf1_{(-\infty,0]}}(\rho-2^R\sigma) \right)\le e\right\},sup{R∈R:Retr(ρC1(−∞,0]​​(ρ−2Rσ))≤e},

with the supremum taken in the extended real numbers. The functional calculus gives the projector onto the nonpositive eigenspaces when its input is Hermitian, including zero eigenvalues, and gives zero otherwise. No positivity, normalization, or restrictions on eee are assumed. An empty set gives −∞-\infty−∞, and a set unbounded above gives +∞+\infty+∞. For example, when ρ=0\rho=0ρ=0, the value is +∞+\infty+∞ if e≥0e\ge0e≥0 and −∞-\infty−∞ if e<0e<0e<0.

QAlgorithms.Papers.Independent.Advance50.P02.spectrumMass

For any finite index type III with decidable equality, arbitrary complex matrices ρ,σ\rho,\sigmaρ,σ indexed by I×II\times II×I, and real RRR, this defines

Re⁡tr⁡ ⁣(ρ C1(−∞,0](ρ−2Rσ)).\operatorname{Re}\operatorname{tr}\!\left( \rho\,\mathcal C_{\mathbf1_{(-\infty,0]}}(\rho-2^R\sigma) \right).Retr(ρC1(−∞,0]​​(ρ−2Rσ)).

Here C\mathcal CC is the real self-adjoint functional calculus: for a Hermitian input, the indicated matrix projects onto its nonpositive eigenspaces, including its kernel; for a non-Hermitian input, it is zero. No density-matrix assumptions are required, so the defined real number is not required by the definition to be a probability.

QAlgorithms.Papers.Independent.Advance50.P02.supportedSpread

For a complex matrix σ\sigmaσ indexed by a finite type III with decidable equality, this defines

supportedSpread⁡(σ)=log⁡2 ⁣(sup⁡Eσ)−log⁡2(mσ),\operatorname{supportedSpread}(\sigma) =\log_2\!\left(\sup E_\sigma\right)-\log_2(m_\sigma),supportedSpread(σ)=log2​(supEσ​)−log2​(mσ​),

where EσE_\sigmaEσ​ is the finite set of distinct real eigenvalues if σ\sigmaσ is Hermitian, and is empty otherwise; mσm_\sigmamσ​ is the least strictly positive eigenvalue if one exists, and is 000 otherwise. Both the supremum and the result are real-valued, with sup⁡∅=0\sup\varnothing=0sup∅=0. Here log⁡2x=log⁡x/log⁡2\log_2x=\log x/\log2log2​x=logx/log2, where log⁡0=0\log0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for nonzero real xxx. No Hermitian, positivity, normalization, or nonemptiness hypothesis is required; in particular, a non-Hermitian matrix, a zero matrix, or a matrix on an empty index type has supported spread 000.

QAlgorithms.Papers.Independent.Advance50.P02.testError

For every sequence of finite index types IkI_kIk​ with decidable equality and complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on IkI_kIk​, every family QkQ_kQk​ for which QkQ_kQk​ and 1Ik−Qk\mathbf1_{I_k}-Q_k1Ik​​−Qk​ are positive semidefinite at every natural index, and every natural number kkk, including zero, this defines the real number

Re⁡tr⁡ ⁣(ρk(1Ik−Qk)).\operatorname{Re}\operatorname{tr}\!\left(\rho_k(\mathbf1_{I_k}-Q_k)\right).Retr(ρk​(1Ik​​−Qk​)).

There is no density-matrix assumption on ρk\rho_kρk​, so the definition does not require this number to lie in [0,1][0,1][0,1]; for an empty IkI_kIk​, it equals zero.

QAlgorithms.Papers.Independent.Advance50.P02.testRate

Let SSS specify, for each integer k≥0k\ge0k≥0, a finite index type IkI_kIk​ with decidable equality and two complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ indexed by IkI_kIk​. Let Q=(Qk)k≥0Q=(Q_k)_{k\ge0}Q=(Qk​)k≥0​ be a sequence of effects, meaning QkQ_kQk​ and 1−Qk1-Q_k1−Qk​ are positive semidefinite for every kkk. Put pk=Re⁡Tr⁡(Qkσk)p_k=\operatorname{Re}\operatorname{Tr}(Q_k\sigma_k)pk​=ReTr(Qk​σk​) and define ℓ(x)=+∞\ell(x)=+\inftyℓ(x)=+∞ when x=0x=0x=0, and ℓ(x)=−log⁡2x\ell(x)=-\log_2xℓ(x)=−log2​x otherwise, where log⁡2x=log⁡x/log⁡2\log_2x=\log x/\log2log2​x=logx/log2 uses the total real logarithm. The declaration defines the extended-real number

testRate⁡(S,Q)=lim inf⁡k→∞ℓ(pk)k+1.\operatorname{testRate}(S,Q)=\liminf_{k\to\infty}\frac{\ell(p_k)}{k+1}.testRate(S,Q)=k→∞liminf​k+1ℓ(pk​)​.

No positivity or normalization is required of ρk,σk\rho_k,\sigma_kρk​,σk​, and the index types may be empty; in particular, pkp_kpk​ need not be a probability. A zero value of pkp_kpk​ contributes +∞+\infty+∞; choosing every Qk=0Q_k=0Qk​=0 gives rate +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.testingConverseRate

Let SSS give finite index types IkI_kIk​ with decidable equality and arbitrary complex matrices ρk,σk\rho_k,\sigma_kρk​,σk​ on IkI_kIk​, for all k≥0k\ge0k≥0, and let e∈Re\in\mathbb Re∈R. For each sequence of effects QkQ_kQk​, where Qk,1−QkQ_k,1-Q_kQk​,1−Qk​ are positive semidefinite, write

ak(Q)=Re⁡Tr⁡(ρk(1−Qk)),R(Q)=lim inf⁡k→∞ℓ ⁣(Re⁡Tr⁡(Qkσk))k+1,a_k(Q)=\operatorname{Re}\operatorname{Tr}\bigl(\rho_k(1-Q_k)\bigr),\qquad R(Q)=\liminf_{k\to\infty}\frac{\ell\!\left(\operatorname{Re}\operatorname{Tr}(Q_k\sigma_k)\right)}{k+1},ak​(Q)=ReTr(ρk​(1−Qk​)),R(Q)=k→∞liminf​k+1ℓ(ReTr(Qk​σk​))​,

with ℓ(0)=+∞\ell(0)=+\inftyℓ(0)=+∞ and ℓ(x)=−log⁡2x\ell(x)=-\log_2xℓ(x)=−log2​x otherwise, using the total real logarithm. The declaration defines

testingConverseRate⁡(S,e)=inf⁡{R∈R:for every such Q,R≤R(Q) ⟹ e≤lim inf⁡k→∞ak(Q)},\operatorname{testingConverseRate}(S,e) =\inf\left\{R\in\mathbb R: \text{for every such }Q,\quad R\le R(Q)\ \Longrightarrow\ e\le\liminf_{k\to\infty}a_k(Q)\right\},testingConverseRate(S,e)=inf{R∈R:for every such Q,R≤R(Q) ⟹ e≤k→∞liminf​ak​(Q)},

where the real thresholds RRR are embedded into the extended reals and the infimum is taken there. Only finite real thresholds occur inside the set, although its infimum may be infinite; an empty set gives +∞+\infty+∞. No density or nonemptiness assumption is imposed on the registers.

QAlgorithms.Papers.Independent.Advance50.P02.thresholdRate

For an arbitrary family g:N×R→Rg:\mathbb N\times\mathbb R\to\mathbb Rg:N×R→R, real eee, and Boolean flag strict\mathrm{strict}strict, this defines the extended-real value

thresholdRate⁡(g,e,strict)={sup⁡{R∈R:lim inf⁡n→∞g(n,R)<e},strict=true,sup⁡{R∈R:lim sup⁡n→∞g(n,R)≤e},strict=false.\operatorname{thresholdRate}(g,e,\mathrm{strict}) = \begin{cases} \displaystyle\sup\{R\in\mathbb R:\liminf_{n\to\infty}g(n,R)<e\}, &\mathrm{strict}=\mathrm{true},\\[4pt] \displaystyle\sup\{R\in\mathbb R:\limsup_{n\to\infty}g(n,R)\le e\}, &\mathrm{strict}=\mathrm{false}. \end{cases}thresholdRate(g,e,strict)=⎩⎨⎧​sup{R∈R:n→∞liminf​g(n,R)<e},sup{R∈R:n→∞limsup​g(n,R)≤e},​strict=true,strict=false.​

The limits use the real values embedded in the extended reals, and each candidate RRR is a fixed real number independent of nnn. No monotonicity or boundedness assumption is imposed on ggg. An empty feasible set gives −∞-\infty−∞, and an unbounded feasible set gives +∞+\infty+∞.

QAlgorithms.Papers.Independent.Advance50.P02.weightPower

For any type KKK, natural number nnn, and arbitrary real function P:K→RP:K\to\mathbb RP:K→R, this definition assigns to each sequence z:{0,…,n−1}→Kz:\{0,\ldots,n-1\}\to Kz:{0,…,n−1}→K the value

∏i=0n−1P(zi).\prod_{i=0}^{n-1}P(z_i).i=0∏n−1​P(zi​).

No finiteness, nonnegativity, or normalization assumption on KKK or PPP is required. When n=0n=0n=0, the unique empty sequence has value one, including when KKK is empty; when KKK is empty and n>0n>0n>0, there are no such sequences.

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).

  • Endorsed by mikedeng1 · Nov 10, 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