Definitions for Second-order asymptotics for quantum hypothesis testing in settings beyond i.i.d. - quantum lattice systems and more
DefinitionQAlgorithms_Papers_Independent_Bridge50_P02The objects the formalized statements of Second-order asymptotics for quantum hypothesis testing in settings beyond i.i.d. - quantum lattice systems and more (arXiv:1510.04682) are stated in. Each was checked against the paper by a blind read-back and a moderator.
finitePairRelativeEntropyNats: PDF p.6, (2.4): positive Umegaki entropy in nats, converting the accepted nonpositive relative-entropy convention. Used only with support inclusion.pairInformationVarianceNats: PDF p.6, (2.5): PAIR information variance, in nats squared. Distinct from the accepted single-density spectral informationVariance in bits squared.realPetzLogOverlap: PDF pp.6,9: real analytic representative of the Petz logarithm. Kernel powers vanish; all uses have common support or support inclusion near s=1.optimalTestingExponentNats: PDF pp.8--10: testing exponent in natural logarithms, on the stated valid inputs.symmetricError: PDF p.12, (3.9): infimum of the SUM of the errors, with no prior factor 1/2.spectralIntegral: PDF p.7, (2.11): integration against the FINITE spectral measure of -log Delta in Omega_B. Its mass is Tr B, with no implicit normalization.spectralTail: PDF p.13, (3.13): finite spectral mass of (-infinity,nu].modularLowProjector: PDF p.14: spectral projector of Delta_(rho|sigma) on the STRICT interval [0,L).eigenvalueSet: PDF p.13: distinct eigenvalues, for the explicit spectral-sum identity.eigenprojector: PDF p.5: spectral projection of a Hermitian matrix at lambda.TestingSequence: PDF pp.8--9: a pair of finite spaces at each positive sequence index. No density, support, or analytic conclusions are built into this data structure.StatePairs: PDF pp.5--9: nonzero spaces, trace-one PSD pairs, and finite relative entropy domain.FaithfulPairs: PDF pp.6--9: the standing faithful-state restriction.AnalyticCumulants: PDF pp.9,11: analytic extensions of real log-Laplace germs, a common disc, finite pointwise real limits, and one bound uniform in the index and the whole disc. No variance limit or central limit theorem is assumed here.ConditionOne: PDF pp.8--9, Condition 1, with nondecreasing positive divergent weights. Repeated weights are permitted. The support-inclusion version is used in Remark 1.relativeEntropyRate: PDF p.9, (3.1): constructed limit, rather than a free entropy-rate parameter. The rates-exist theorem establishes that this topological limit exists under Condition 1.varianceRate: PDF p.9, (3.2): constructed variance-rate limit; its value may be zero.relativeEntropyCorrection: PDF p.10, (3.5): signed entropy correction.secondOrderCoefficient: PDF p.9: second-order coefficient, including the zero-variance case.SecondOrderBounds: PDF pp.9--10: both quantified clauses, with an all-index upper bound and eventual lower bound. The remainders are actual real FUNCTIONS of the weight, not free sequence errors.iidSequence: PDF p.16: slot k is tensor power k+1; no source n=0 is introduced.iidWeight: PDF p.16: IID weights at positive source indices.RandomVariable: PDF p.11: a measurable real random variable on a probability space, varying with k.logLaplace: PDF p.11: real log-Laplace transform; exponential integrability is a theorem hypothesis.BrycWeakLimit: PDF p.11: weak convergence, tested against every bounded continuous real function. This also describes a Dirac Gaussian limit when the limiting variance is zero.Site: PDF p.17: sites of the integer lattice.manhattan: PDF p.17: Manhattan distance between sites.SpinInteraction: PDF p.17: local observables on a common q-dimensional one-site space.translateSupport: PDF p.17: translate a finite support.translatedSite: PDF p.17: site identification under translation, with no basis change.TranslationInvariant: PDF p.17: covariance of the actual local matrices under every translation.FiniteRange: PDF p.18: some positive R kills all terms with Manhattan diameter at least R. For finite nonempty sets the diameter is attained; empty terms already vanish.latticeIncludeLocal: PDF p.17: inclusion A -> A tensor I on Z^d, in the named site bases. The accepted Next46.P28.includeLocal is restricted to subsets of Z.localHamiltonian: PDF p.18, (4.4): interaction Hamiltonian, constructed by summing all contained terms.spinBox: PDF p.18: Lambda_n={-n,...,n}^d, with n=k+1.spinSequence: PDF p.18, (4.5): the two actual finite-volume Gibbs matrices.spinVolumeWeight: PDF p.18: lattice volume (2n+1)^d; unrelated to the accepted angular-momentum spinWeight.normalizedPartition: PDF p.19, (4.8): partition function normalized by the completely mixed state.clusterGerm: PDF p.19, (4.8)--(4.10): the canonical cluster-coefficient germ. Subset Mobius inversion of the finite-volume normalized partition logarithms. Complex.log is used only near zero, where every partition value is near 1. Analytic continuation to the full polydisc is a conclusion, never an assumption.ClusterSmallness: PDF p.19, (4.11): nonnegative extended sum, so divergence is infinity, never zero.torusMeasure: PDF p.22: normalized Lebesgue measure on the Fourier cube [0,2pi)^d.torusAverage: PDF p.22: normalized integral of a real symbol on the Fourier cube.symbolCompression: PDF pp.22--23: compression of the Fourier multiplier to {0,...,n-1}^d. The sign is exp(-i <j-k,x>), as in the source. Finite enumeration changes basis only.fermionSequence: PDF p.23, (4.16): finite Fock densities, using the accepted exterior-power construction. The occupation basis includes the vacuum and all particle-number sectors.fermionWeight: PDF p.23: volume n^d, with positive source index n=k+1.symbolEntropy: PDF p.23, (4.20): relative entropy density of the commuting Fourier symbols.symbolPressure: PDF p.23, (4.21): limiting real Petz log-overlap density.
import Mathlib
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P15
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P63
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P58
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P71
import Definitions.Def_QAlgorithms_Papers_Independent_Next46_P23
/-! Statements from Datta--Pautrat--Rouze, arXiv:1510.04682v4.
All logarithms are natural. A sequence slot k represents the positive source index k+1.
All new definitions are confined to this paper. Compilation is pending.
Theorem 4 is recorded as accepted-library reuse; source-defective clauses are in HARD.md. -/
noncomputable section
open Filter MeasureTheory
open scoped BigOperators ENNReal Matrix ComplexConjugate ComplexOrder Matrix.Norms.L2Operator Topology
namespace QAlgorithms.Papers.Independent.Bridge50.P02
attribute [local instance] Classical.propDecidable Classical.decEq
open QAlgorithms.Papers.Independent.Claimed50.P15
(evaluate positiveMatrixRpow modularMatrix modularQuadratic resolventOverlap petzOverlap
finiteRelativeEntropyNats)
open QAlgorithms.Papers.Independent.Information100.P71 (supportPower SupportIncluded)
open QAlgorithms.Papers.Independent.Information100.P63 (Mat tensorPower testingBeta)
open QAlgorithms.Papers.Independent.Information100.P58 (normalQuantile)
variable {I : Type} [Fintype I] [DecidableEq I]
/-- PDF p.6, (2.4): positive Umegaki entropy in nats, converting the accepted
nonpositive relative-entropy convention. Used only with support inclusion. -/
def finitePairRelativeEntropyNats (rho sigma : Mat I) : ℝ :=
-finiteRelativeEntropyNats rho sigma
/-- PDF p.6, (2.5): PAIR information variance, in nats squared. Distinct from the
accepted single-density spectral informationVariance in bits squared. -/
def pairInformationVarianceNats (rho sigma : Mat I) : ℝ :=
evaluate rho ((cfc Real.log rho - cfc Real.log sigma) ^ 2) -
finitePairRelativeEntropyNats rho sigma ^ 2
/-- PDF pp.6,9: real analytic representative of the Petz logarithm.
Kernel powers vanish; all uses have common support or support inclusion near s=1. -/
def realPetzLogOverlap (rho sigma : Mat I) (s : ℝ) : ℝ :=
Real.log ((supportPower rho s * supportPower sigma (1-s)).trace.re)
/-- PDF pp.8--10: testing exponent in natural logarithms, on the stated valid inputs. -/
def optimalTestingExponentNats (rho sigma : Mat I) (epsilon : ℝ) : ℝ :=
-Real.log (testingBeta epsilon rho sigma)
/-- PDF p.12, (3.9): infimum of the SUM of the errors, with no prior factor 1/2. -/
def symmetricError (A B : Mat I) : ℝ :=
sInf {e : ℝ | ∃ T : Mat I, QAlgorithms.IsEffect T ∧
e = evaluate A (1-T) + evaluate B T}
/-- PDF p.7, (2.11): integration against the FINITE spectral measure of -log Delta
in Omega_B. Its mass is Tr B, with no implicit normalization. -/
def spectralIntegral (A B : Mat I) (f : ℝ → ℝ) : ℝ :=
modularQuadratic B (cfc (fun t : ℝ => f (-Real.log t)) (modularMatrix A B))
/-- PDF p.13, (3.13): finite spectral mass of (-infinity,nu]. -/
def spectralTail (A B : Mat I) (nu : ℝ) : ℝ :=
spectralIntegral A B (fun x => if x ≤ nu then 1 else 0)
/-- PDF p.14: spectral projector of Delta_(rho|sigma) on the STRICT interval [0,L). -/
def modularLowProjector (rho sigma : Mat I) (L : ℝ) : Mat (I × I) :=
cfc (fun t : ℝ => if 0 ≤ t ∧ t < L then 1 else 0) (modularMatrix rho sigma)
/-- PDF p.13: distinct eigenvalues, for the explicit spectral-sum identity. -/
def eigenvalueSet (A : Mat I) (hA : A.IsHermitian) : Finset ℝ :=
Finset.univ.image hA.eigenvalues
/-- PDF p.5: spectral projection of a Hermitian matrix at lambda. -/
def eigenprojector (A : Mat I) (lambda : ℝ) : Mat I :=
cfc (fun x : ℝ => if x = lambda then 1 else 0) A
/-- PDF pp.8--9: a pair of finite spaces at each positive sequence index.
No density, support, or analytic conclusions are built into this data structure. -/
structure TestingSequence 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] TestingSequence.finite TestingSequence.decidable
/-- PDF pp.5--9: nonzero spaces, trace-one PSD pairs, and finite relative entropy domain. -/
def StatePairs (S : TestingSequence) : Prop :=
∀ k, Nonempty (S.Index k) ∧ QAlgorithms.IsDensityMatrix (S.rho k) ∧
QAlgorithms.IsDensityMatrix (S.sigma k) ∧ SupportIncluded (S.rho k) (S.sigma k)
/-- PDF pp.6--9: the standing faithful-state restriction. -/
def FaithfulPairs (S : TestingSequence) : Prop :=
∀ k, (S.rho k).PosDef ∧ (S.sigma k).PosDef
/-- PDF pp.9,11: analytic extensions of real log-Laplace germs, a common disc,
finite pointwise real limits, and one bound uniform in the index and the whole disc.
No variance limit or central limit theorem is assumed here. -/
def AnalyticCumulants (w : ℕ → ℝ) (h : ℕ → ℝ → ℝ) : Prop :=
∃ r : ℝ, 0 < r ∧ ∃ H : ℕ → ℂ → ℂ,
(∀ k, AnalyticOnNhd ℂ (H k) (Metric.ball 0 r)) ∧
(∀ k x, |x| < r → H k (x : ℂ) = (h k x : ℂ)) ∧
(∀ x : ℝ, |x| < r → ∃ l : ℂ,
Tendsto (fun k => H k (x : ℂ) / (w k : ℂ)) atTop (nhds l)) ∧
(∃ C : ℝ, ∀ k z, ‖z‖ < r → ‖H k z‖ ≤ C * w k)
/-- PDF pp.8--9, Condition 1, with nondecreasing positive divergent weights.
Repeated weights are permitted. The support-inclusion version is used in Remark 1. -/
def ConditionOne (S : TestingSequence) (w : ℕ → ℝ) : Prop :=
StatePairs S ∧ (∀ k, 0 < w k) ∧ Monotone w ∧ Tendsto w atTop atTop ∧
AnalyticCumulants w (fun k x => realPetzLogOverlap (S.rho k) (S.sigma k) (1-x))
/-- PDF p.9, (3.1): constructed limit, rather than a free entropy-rate parameter.
The rates-exist theorem establishes that this topological limit exists under Condition 1. -/
def relativeEntropyRate (S : TestingSequence) (w : ℕ → ℝ) : ℝ :=
limUnder atTop (fun k => finitePairRelativeEntropyNats (S.rho k) (S.sigma k) / w k)
/-- PDF p.9, (3.2): constructed variance-rate limit; its value may be zero. -/
def varianceRate (S : TestingSequence) (w : ℕ → ℝ) : ℝ :=
limUnder atTop (fun k => pairInformationVarianceNats (S.rho k) (S.sigma k) / w k)
/-- PDF p.10, (3.5): signed entropy correction. -/
def relativeEntropyCorrection (S : TestingSequence) (w : ℕ → ℝ) (k : ℕ) : ℝ :=
finitePairRelativeEntropyNats (S.rho k) (S.sigma k) - w k * relativeEntropyRate S w
/-- PDF p.9: second-order coefficient, including the zero-variance case. -/
def secondOrderCoefficient (S : TestingSequence) (w : ℕ → ℝ) (epsilon : ℝ) : ℝ :=
Real.sqrt (varianceRate S w) * normalQuantile epsilon
/-- PDF pp.9--10: both quantified clauses, with an all-index upper bound and eventual lower
bound. The remainders are actual real FUNCTIONS of the weight, not free sequence errors. -/
def SecondOrderBounds (S : TestingSequence) (w center : ℕ → ℝ) (epsilon : ℝ) : Prop :=
(∀ t : ℝ, secondOrderCoefficient S w epsilon < t →
∃ f : ℝ → ℝ, Asymptotics.IsLittleO atTop f Real.sqrt ∧
∀ k, optimalTestingExponentNats (S.rho k) (S.sigma k) epsilon ≤
center k + Real.sqrt (w k) * t + f (w k)) ∧
(∀ t : ℝ, t < secondOrderCoefficient S w epsilon →
∀ f : ℝ → ℝ, Asymptotics.IsLittleO atTop f Real.sqrt →
∀ᶠ k in atTop, center k + Real.sqrt (w k) * t + f (w k) ≤
optimalTestingExponentNats (S.rho k) (S.sigma k) epsilon)
/-- PDF p.16: slot k is tensor power k+1; no source n=0 is introduced. -/
def iidSequence (rho sigma : Mat I) : TestingSequence where
Index k := Fin (k+1) → I
finite _ := inferInstance
decidable _ := Classical.decEq _
rho k := tensorPower (k+1) rho
sigma k := tensorPower (k+1) sigma
/-- PDF p.16: IID weights at positive source indices. -/
def iidWeight (k : ℕ) : ℝ := (k+1 : ℕ)
/-- PDF p.11: a measurable real random variable on a probability space, varying with k. -/
structure RandomVariable where
Space : Type
measurableSpace : MeasurableSpace Space
measure : @Measure Space measurableSpace
probability : @IsProbabilityMeasure Space measurableSpace measure
value : Space → ℝ
measurable_value : @Measurable Space ℝ measurableSpace inferInstance value
attribute [instance] RandomVariable.measurableSpace RandomVariable.probability
/-- PDF p.11: real log-Laplace transform; exponential integrability is a theorem hypothesis. -/
def logLaplace (X : RandomVariable) (x : ℝ) : ℝ :=
Real.log (∫ a, Real.exp (-x * X.value a) ∂X.measure)
/-- PDF p.11: weak convergence, tested against every bounded continuous real function.
This also describes a Dirac Gaussian limit when the limiting variance is zero. -/
def BrycWeakLimit (X : ℕ → RandomVariable) (w : ℕ → ℝ) (v : ℝ) : Prop :=
∀ f : ℝ → ℝ, Continuous f → (∃ C : ℝ, ∀ x, |f x| ≤ C) →
Tendsto (fun k => ∫ a, f (((X k).value a + deriv (logLaplace (X k)) 0) / Real.sqrt (w k)) ∂(X k).measure) atTop
(nhds (∫ y, f y ∂ProbabilityTheory.gaussianReal 0 (Real.toNNReal v)))
example (rho sigma : Mat I) : finitePairRelativeEntropyNats rho sigma =
-finiteRelativeEntropyNats rho sigma := rfl
set_option maxHeartbeats 2000000 in
example (rho sigma : Mat I) : relativeEntropyCorrection (iidSequence rho sigma) iidWeight 0 =
finitePairRelativeEntropyNats (tensorPower 1 rho) (tensorPower 1 sigma) -
relativeEntropyRate (iidSequence rho sigma) iidWeight := by
unfold relativeEntropyCorrection
rw [show iidWeight 0 = (1 : ℝ) by norm_num [iidWeight], one_mul]
rw [show (iidSequence rho sigma).decidable 0 =
(inferInstance : DecidableEq (Fin 1 → I)) from Subsingleton.elim _ _] <;> rfl
example (rho sigma : Mat I) : tensorPower 0 rho = tensorPower 0 sigma := by
funext a b
simp [QAlgorithms.Papers.Independent.Information100.P63.tensorPower]
/-- PDF p.17: sites of the integer lattice. -/
abbrev Site (d : ℕ) := Fin d → ℤ
/-- PDF p.17: Manhattan distance between sites. -/
def manhattan {d : ℕ} (x y : Site d) : ℝ := ∑ j, |((x j - y j : ℤ) : ℝ)|
/-- PDF p.17: local observables on a common q-dimensional one-site space. -/
structure SpinInteraction (d q : ℕ) where
term : ∀ X : Finset (Site d), Mat (X → Fin q)
hermitian : ∀ X, (term X).IsHermitian
empty_zero : term ∅ = 0
/-- PDF p.17: translate a finite support. -/
def translateSupport {d : ℕ} (X : Finset (Site d)) (t : Site d) : Finset (Site d) :=
X.image (fun x => x+t)
/-- PDF p.17: site identification under translation, with no basis change. -/
def translatedSite {d : ℕ} (X : Finset (Site d)) (t : Site d) (x : X) :
translateSupport X t :=
⟨x.val+t, Finset.mem_image.mpr ⟨x.val, x.property, rfl⟩⟩
/-- PDF p.17: covariance of the actual local matrices under every translation. -/
def TranslationInvariant {d q : ℕ} (Phi : SpinInteraction d q) : Prop :=
∀ (X : Finset (Site d)) (t : Site d) (a b : translateSupport X t → Fin q),
Phi.term (translateSupport X t) a b =
Phi.term X (fun x => a (translatedSite X t x)) (fun x => b (translatedSite X t x))
/-- PDF p.18: some positive R kills all terms with Manhattan diameter at least R.
For finite nonempty sets the diameter is attained; empty terms already vanish. -/
def FiniteRange {d q : ℕ} (Phi : SpinInteraction d q) : Prop :=
∃ R : ℝ, 0 < R ∧ ∀ X : Finset (Site d),
(∃ x ∈ X, ∃ y ∈ X, R ≤ manhattan x y) → Phi.term X = 0
/-- PDF p.17: inclusion A -> A tensor I on Z^d, in the named site bases.
The accepted Next46.P28.includeLocal is restricted to subsets of Z. -/
def latticeIncludeLocal {d q : ℕ} (Y X : Finset (Site d)) (hYX : Y ⊆ X)
(A : Mat (Y → Fin q)) : Mat (X → Fin q) :=
fun a b => if ∀ x : X, x.val ∉ Y → a x = b x then
A (fun y => a ⟨y.val, hYX y.property⟩) (fun y => b ⟨y.val, hYX y.property⟩)
else 0
/-- PDF p.18, (4.4): interaction Hamiltonian, constructed by summing all contained terms. -/
def localHamiltonian {d q : ℕ} (Phi : SpinInteraction d q) (X : Finset (Site d)) :
Mat (X → Fin q) :=
∑ Y ∈ X.powerset, if hYX : Y ⊆ X then latticeIncludeLocal Y X hYX (Phi.term Y) else 0
/-- PDF p.18: Lambda_n={-n,...,n}^d, with n=k+1. -/
def spinBox (d k : ℕ) : Finset (Site d) :=
Finset.univ.image (fun a : Fin d → Fin (2*(k+1)+1) =>
fun j => ((a j).val : ℤ) - (k+1 : ℤ))
/-- PDF p.18, (4.5): the two actual finite-volume Gibbs matrices. -/
def spinSequence {d q : ℕ} (Phi Psi : SpinInteraction d q) (beta1 beta2 : ℝ) :
TestingSequence where
Index k := spinBox d k → Fin q
finite _ := inferInstance
decidable _ := Classical.decEq _
rho k := QAlgorithms.gibbsState ((-beta1 : ℂ) • localHamiltonian Phi (spinBox d k))
sigma k := QAlgorithms.gibbsState ((-beta2 : ℂ) • localHamiltonian Psi (spinBox d k))
/-- PDF p.18: lattice volume (2n+1)^d; unrelated to the accepted angular-momentum spinWeight. -/
def spinVolumeWeight (d k : ℕ) : ℝ := ((2*(k+1)+1 : ℕ) : ℝ)^d
/-- PDF p.19, (4.8): partition function normalized by the completely mixed state. -/
def normalizedPartition {d q : ℕ} (Phi Psi : SpinInteraction d q)
(beta1 beta2 : ℝ) (X : Finset (Site d)) (z : ℂ × ℂ) : ℂ :=
((q : ℂ)^X.card)⁻¹ *
(NormedSpace.exp ((z.1 * (beta1 : ℂ)) • localHamiltonian Phi X) *
NormedSpace.exp ((z.2 * (beta2 : ℂ)) • localHamiltonian Psi X)).trace
/-- PDF p.19, (4.8)--(4.10): the canonical cluster-coefficient germ.
Subset Mobius inversion of the finite-volume normalized partition logarithms.
Complex.log is used only near zero, where every partition value is near 1.
Analytic continuation to the full polydisc is a conclusion, never an assumption. -/
def clusterGerm {d q : ℕ} (Phi Psi : SpinInteraction d q) (beta1 beta2 : ℝ)
(X : Finset (Site d)) (z : ℂ × ℂ) : ℂ :=
∑ Y ∈ X.powerset, (-1 : ℂ)^(X.card-Y.card) *
Complex.log (normalizedPartition Phi Psi beta1 beta2 Y z)
/-- PDF p.19, (4.11): nonnegative extended sum, so divergence is infinity, never zero. -/
def ClusterSmallness {d q : ℕ} (Phi Psi : SpinInteraction d q)
(beta1 beta2 a delta : ℝ) : Prop :=
(∑' X : {X : Finset (Site d) // (0 : Site d) ∈ X},
ENNReal.ofReal (Real.exp (2*a*(X.val.card : ℝ)) *
(Real.exp (delta*(beta1*‖Phi.term X.val‖ + beta2*‖Psi.term X.val‖))-1))) ≤
ENNReal.ofReal a
/-- PDF p.22: normalized Lebesgue measure on the Fourier cube [0,2pi)^d. -/
def torusMeasure (d : ℕ) : Measure (Fin d → ℝ) :=
(ENNReal.ofReal ((2*Real.pi)^d))⁻¹ •
volume.restrict (Set.pi Set.univ (fun _ => Set.Ico (0 : ℝ) (2*Real.pi)))
/-- PDF p.22: normalized integral of a real symbol on the Fourier cube. -/
def torusAverage {d : ℕ} (f : (Fin d → ℝ) → ℝ) : ℝ := ∫ x, f x ∂torusMeasure d
/-- PDF pp.22--23: compression of the Fourier multiplier to {0,...,n-1}^d.
The sign is exp(-i <j-k,x>), as in the source. Finite enumeration changes basis only. -/
def symbolCompression {d : ℕ} (qhat : (Fin d → ℝ) → ℝ) (n : ℕ) :
Mat (Fin (Fintype.card (Fin d → Fin n))) :=
let e := Fintype.equivFin (Fin d → Fin n)
fun j k => ∫ x : Fin d → ℝ,
Complex.exp (-Complex.I * ((∑ l,
(((e.symm j l).val : ℝ)-((e.symm k l).val : ℝ))*x l) : ℂ)) * (qhat x : ℂ)
∂torusMeasure d
/-- PDF p.23, (4.16): finite Fock densities, using the accepted exterior-power construction.
The occupation basis includes the vacuum and all particle-number sectors. -/
def fermionSequence {d : ℕ} (qhat rhat : (Fin d → ℝ) → ℝ) : TestingSequence where
Index k := Finset (Fin (Fintype.card (Fin d → Fin (k+1))))
finite _ := inferInstance
decidable _ := Classical.decEq _
rho k := QAlgorithms.Papers.Independent.Next46.P23.quasiFree (symbolCompression qhat (k+1))
sigma k := QAlgorithms.Papers.Independent.Next46.P23.quasiFree (symbolCompression rhat (k+1))
/-- PDF p.23: volume n^d, with positive source index n=k+1. -/
def fermionWeight (d k : ℕ) : ℝ := ((k+1 : ℕ) : ℝ)^d
/-- PDF p.23, (4.20): relative entropy density of the commuting Fourier symbols. -/
def symbolEntropy {d : ℕ} (qhat rhat : (Fin d → ℝ) → ℝ) : ℝ :=
torusAverage (fun x => qhat x * Real.log (qhat x / rhat x) +
(1-qhat x)*Real.log ((1-qhat x)/(1-rhat x)))
/-- PDF p.23, (4.21): limiting real Petz log-overlap density. -/
def symbolPressure {d : ℕ} (qhat rhat : (Fin d → ℝ) → ℝ) (s : ℝ) : ℝ :=
torusAverage (fun x => Real.log ((qhat x)^s * (rhat x)^(1-s) +
(1-qhat x)^s * (1-rhat x)^(1-s)))
example (k : ℕ) : spinVolumeWeight 1 k = (2*(k+1)+1 : ℕ) := by simp [spinVolumeWeight]
example (k : ℕ) : fermionWeight 1 k = (k+1 : ℕ) := by simp [fermionWeight]
example (d k : ℕ) : fermionWeight d k = ((k+1 : ℕ) : ℝ)^d := rfl
example (H : Mat I) (beta : ℝ) : QAlgorithms.gibbsState ((-beta : ℂ) • H) =
(NormedSpace.exp ((-beta : ℂ) • H)).trace⁻¹ • NormedSpace.exp ((-beta : ℂ) • H) := rfl
example {d q : ℕ} (Phi Psi : SpinInteraction d q) (b1 b2 : ℝ) (X : Finset (Site d)) :
clusterGerm Phi Psi b1 b2 X =
fun z => ∑ Y ∈ X.powerset, (-1 : ℂ)^(X.card-Y.card) *
Complex.log (normalizedPartition Phi Psi b1 b2 Y z) := rfl
end QAlgorithms.Papers.Independent.Bridge50.P02
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Bridge50.P02.AnalyticCumulants
For arbitrary functions and , this property means that there exist a real radius and functions , one for every , such that each is complex analytic at every point of , and for every real with , identifying real numbers with complex numbers. For each such real , there exists a complex number such that as . There also exists a real constant such that
No positivity, monotonicity, or growth assumption on , and no sign restriction on , is included. Division is total, so the quotient is zero when ; the displayed bound must still hold at every index.
QAlgorithms.Papers.Independent.Bridge50.P02.BrycWeakLimit
For a sequence of real random variables, each equipped with its own probability space, probability measure , and measurable value function, a function , and , this property means that, for every continuous for which there exists satisfying for all , one has
No positivity or divergence assumption on , integrability assumption on the exponential, or differentiability assumption on is part of this definition. The integrals and derivatives use their totalized values, with a nonintegrable real integrand having integral , a derivative equal to where differentiability fails, , for , and division by equal to . In particular, when , the argument of on the left is ; when , the Gaussian on the right is the point mass at .
QAlgorithms.Papers.Independent.Bridge50.P02.ClusterSmallness
For arbitrary natural numbers , interactions assigning Hermitian complex matrices to configurations on each finite , with zero matrices at , and arbitrary real numbers , this proposition means
The sum is a nonnegative extended-real sum and may equal ; the norms are the matrix norms occurring in the definition. No sign restrictions on the four real parameters are part of this proposition, and each potentially negative summand is replaced by zero before summation. The origin is the all-zero site; when , the site space has one element.
QAlgorithms.Papers.Independent.Bridge50.P02.ConditionOne
For a testing sequence with finite index types having decidable equality and matrices , and a function , this property requires that every be nonempty, that be positive semidefinite with complex trace , and that . It also requires at every index, whenever , and . Define
where is obtained by real continuous functional calculus from the function that is zero at and equals the total real power at , including when . Finally, there must exist , functions analytic at every point of , and , such that for real , each sequence converges to some complex number, and for every and . All requirements include ; positive definiteness of the matrices is not required.
QAlgorithms.Papers.Independent.Bridge50.P02.FaithfulPairs
For a testing sequence , consisting of finite index types with decidable equality and complex square matrices indexed by , this property means that, for every natural number , including , both and are positive definite. It imposes no trace normalization, support condition, or nonemptiness requirement on ; positive definiteness on an empty index type has no nonzero vectors on which to test strict positivity.
QAlgorithms.Papers.Independent.Bridge50.P02.FiniteRange
For natural numbers , let assign Hermitian complex matrices to finite , indexed by configurations , with . This predicate means that there exists a real such that, for every finite , if there are satisfying , then . The threshold inequality includes equality. For an empty or singleton , the antecedent cannot hold; when , all these distances are , so the antecedent cannot hold for any .
QAlgorithms.Papers.Independent.Bridge50.P02.RandomVariable
This structure consists of a type , a specified measurable-space structure on , a measure on that measurable space, a proof that is a probability measure, a function , and a proof that is measurable for the specified measurable-space structure and the usual measurable structure on . No finiteness, boundedness, integrability, or moment assumptions are included.
QAlgorithms.Papers.Independent.Bridge50.P02.SecondOrderBounds
For any testing sequence of complex matrices on finite index types with decidable equality, arbitrary functions (with the supplied center), and any real , define
Also let , where for the standard normal distribution function , and is the total limit-value operator applied to , with and ; matrix logarithms use real continuous functional calculus. The property is the conjunction of the following two assertions: for every real , there exists with at such that
and for every real and every such function ,
Here means that for every , eventually as . No bound is required at . No state, support, weight, convergence, or error-range hypotheses are included; the infima, logarithms, division, and square roots are total, including and for .
QAlgorithms.Papers.Independent.Bridge50.P02.Site
For every natural number , a site is a function from to , equivalently an integer vector with coordinates. For , there is exactly one site, the empty function.
QAlgorithms.Papers.Independent.Bridge50.P02.SpinInteraction
For natural numbers , a spin interaction consists of a complex square matrix for every finite set , whose rows and columns are indexed by all configurations , together with requirements that every is Hermitian and . No positivity, translation invariance, or range condition is part of this structure. The parameters may be : when , a nonempty has no configurations, whereas the empty has one configuration.
QAlgorithms.Papers.Independent.Bridge50.P02.StatePairs
For any testing sequence , whose data consist of finite types with decidable equality and complex matrices for every natural number , this property requires, for every , that be nonempty, that both matrices be positive semidefinite with complex trace exactly one, and that . Explicitly, every vector annihilated by must also be annihilated by . These requirements include ; neither matrix is required to be invertible, so singular density matrices are included.
QAlgorithms.Papers.Independent.Bridge50.P02.TestingSequence
A testing sequence consists of a type for every natural number , including , a finite enumeration and decidable equality for each , and two complex square matrices indexed by . The index types may vary with and may be empty. The structure imposes no positivity, Hermiticity, trace normalization, invertibility, support inclusion, or relation between different indices.
QAlgorithms.Papers.Independent.Bridge50.P02.TranslationInvariant
For natural numbers , let assign to each finite a Hermitian complex matrix indexed by configurations , with . This predicate requires that for every finite , every , and every two configurations on , . Empty supports and are included; for and nonempty , the quantification over configurations is empty.
QAlgorithms.Papers.Independent.Bridge50.P02.clusterGerm
For natural numbers , interactions assigning Hermitian matrices to finite subsets of , with zero matrices on the empty set, real numbers , a finite site set , and , this defines
For either interaction, is the sum over of its matrix on configurations , extended to by requiring the row and column configurations to agree outside . The logarithm is the principal complex logarithm, used as a total function, including its value at zero. The subtraction is natural-number subtraction, and ensures it is the ordinary nonnegative difference. All zero-dimensional and empty-set cases are included; in particular, .
QAlgorithms.Papers.Independent.Bridge50.P02.eigenprojector
For a finite type with decidable equality, an arbitrary complex matrix , and any real , this defines the real functional calculus of for the function equal to one at and zero elsewhere. For Hermitian , this is the orthogonal projection onto its -eigenspace, and is zero if is absent from the spectrum. Hermiticity is not a hypothesis: for non-Hermitian , the functional calculus returns zero. There are no positivity or normalization assumptions, and the index type may be empty.
QAlgorithms.Papers.Independent.Bridge50.P02.eigenvalueSet
For a finite type with decidable equality, a complex matrix , and a hypothesis that is Hermitian, this defines the finite set , where is the real eigenvalue family supplied by the Hermitian spectral decomposition of . Repeated eigenvalues appear only once in this set. No positivity or normalization is assumed; if is empty, the set is empty.
QAlgorithms.Papers.Independent.Bridge50.P02.fermionSequence
For every natural number and arbitrary functions , this constructs a sequence of pairs of complex matrices as follows. At index , put ; the matrix index set is the set of all subsets of , equipped with its finite structure and a decision procedure for equality. For either symbol , choose the finite equivalence , and define
For a matrix , set , and form a matrix indexed by subsets by setting its entry to zero when , and otherwise to the determinant of the submatrix of with rows in and columns in , both in increasing order. The sequence is
No positivity, normalization, or support conditions are fields of this constructed sequence. The integrals are total Bochner integrals, the square-matrix inverse is zero on singular matrices, and scalar reciprocals at zero are zero. The construction includes , for which .
QAlgorithms.Papers.Independent.Bridge50.P02.fermionWeight
For every pair of natural numbers , this defines the real number
where is converted to a real number before exponentiation. In particular, for every , and for every .
QAlgorithms.Papers.Independent.Bridge50.P02.finitePairRelativeEntropyNats
For a finite type with decidable equality and arbitrary complex matrices indexed by , this defines the real number
where each matrix logarithm uses real continuous functional calculus with the scalar function . No positivity, trace normalization, invertibility, or support inclusion is assumed. The scalar logarithm is total, with and for negative ; real functional calculus on a non-Hermitian matrix returns zero. The index type may be empty, in which case the value is zero.
QAlgorithms.Papers.Independent.Bridge50.P02.iidSequence
For any finite type with decidable equality and any complex square matrices indexed by , this constructs a testing sequence whose index type at is the set of functions , equipped with its finite enumeration and a classically chosen decidable equality. Its matrices have entries
Thus index uses one tensor factor. No nonemptiness, positivity, trace normalization, or support condition on is required; if is empty, every index type in this sequence is empty.
QAlgorithms.Papers.Independent.Bridge50.P02.iidWeight
For every natural number , including , this defines the real weight , where the natural number is converted to a real number; in particular, .
QAlgorithms.Papers.Independent.Bridge50.P02.latticeIncludeLocal
For natural numbers , finite sets , a specified inclusion , and a complex matrix indexed by configurations on with values in , this defines a matrix on configurations on : its entry at configurations is if for every , and is otherwise. Thus gives the single scalar entry of times the identity on configurations on , and imposes no agreement condition outside . Zero values of and are allowed.
QAlgorithms.Papers.Independent.Bridge50.P02.localHamiltonian
For natural numbers , an assignment of Hermitian matrices to finite , indexed by configurations and satisfying , and a finite set , this defines a complex matrix indexed by configurations on , with entries . The sum includes both and ; the explicit inclusion check in each summand always succeeds because the sum ranges over subsets of . In particular, . No translation invariance or finite range is assumed, and may be .
QAlgorithms.Papers.Independent.Bridge50.P02.logLaplace
For a random-variable structure consisting of a measurable space , a probability measure , and a measurable function , and for every real , this defines the real number
The minus sign in the exponential is part of the definition. No integrability or exponential-moment hypothesis is required: the real integral is the total Bochner integral, assigned zero when the integrand is not integrable, and the total real logarithm satisfies .
QAlgorithms.Papers.Independent.Bridge50.P02.manhattan
For every natural number and sites , this defines the real number , with each integer coordinate difference regarded as a real number. For , the empty sum is .
QAlgorithms.Papers.Independent.Bridge50.P02.modularLowProjector
For a finite type with decidable equality, arbitrary complex matrices , and any real , form . This defines the real functional calculus of for the indicator of : a scalar spectral value receives value one exactly when , and zero otherwise. No positivity, Hermiticity, invertibility, normalization, or positivity of is assumed. When is Hermitian this selects its eigenspaces in , including its kernel if ; when is non-Hermitian the functional calculus returns zero. The inverse of singular is zero. For , the resulting matrix is zero, and empty is allowed.
QAlgorithms.Papers.Independent.Bridge50.P02.normalizedPartition
For arbitrary natural numbers , let the sites be , and let assign to every finite site set a Hermitian complex matrix indexed by configurations , with their matrices on the empty set equal to zero. For real numbers , a finite site set , and , this defines
Here , where the entry of at configurations on is if and agree outside , and is zero otherwise; is defined identically from . The exponentials are matrix exponentials, and means the complex reciprocal of . No positivity assumptions on the temperatures or on are imposed: the reciprocal of zero is defined to be zero. For , the value is .
QAlgorithms.Papers.Independent.Bridge50.P02.optimalTestingExponentNats
For a finite type with decidable equality, arbitrary complex matrices , and any real , let
This defines . Neither matrix is assumed to be a density matrix, and has no prescribed range. The infimum is taken in the real numbers; an empty feasible set has infimum zero. The real logarithm also has , so a zero infimum gives exponent zero, while a negative infimum is evaluated using . Empty is permitted and gives zero.
QAlgorithms.Papers.Independent.Bridge50.P02.pairInformationVarianceNats
For a finite type with decidable equality and arbitrary complex matrices , let be their logarithms under real continuous functional calculus. This defines
where the matrix square means matrix multiplication. No positivity, normalization, invertibility, support inclusion, or nonnegativity of the resulting number is required. Scalar logarithms use and for , and real functional calculus returns zero on non-Hermitian matrices. Empty is allowed and gives zero.
QAlgorithms.Papers.Independent.Bridge50.P02.realPetzLogOverlap
For a finite type with decidable equality, arbitrary complex matrices , and any real , define by real continuous functional calculus using the scalar function that is zero at and equals the total real power otherwise. The declaration defines
There are no positivity, normalization, invertibility, support, or restrictions on . In particular, assigns zero to zero eigenvalues, and when is non-Hermitian. The outer logarithm is real and total: it is zero at zero and equals at negative arguments. Empty therefore gives zero.
QAlgorithms.Papers.Independent.Bridge50.P02.relativeEntropyCorrection
For any testing sequence of complex matrices on finite index types with decidable equality, any real weight function , and every natural index , including zero, this defines
where matrix logarithms use real continuous functional calculus and is the value selected by the total limit-value operator for as . No normalization, support, positivity, convergence, or asymptotic size of this correction is assumed or asserted; the quotients defining use total division, including zero denominators.
QAlgorithms.Papers.Independent.Bridge50.P02.relativeEntropyRate
For any testing sequence , with complex matrices on finite index types having decidable equality, and any real function , this defines the real value obtained by applying the total limit-value operator at to
where each matrix logarithm uses real continuous functional calculus. No density-matrix, support, nonemptiness, positivity-of-weight, or convergence hypothesis is imposed. If the sequence converges, the value is its limit; the definition remains assigned a value without asserting convergence. A zero denominator gives quotient zero.
QAlgorithms.Papers.Independent.Bridge50.P02.secondOrderCoefficient
For any testing sequence , any , and any real , this defines
where is the value selected by the total limit-value operator for as , with
The matrices belong to the finite index types of , and logarithms use real continuous functional calculus. No state, weight, convergence, variance-sign, or restriction is assumed. The square root is the total real square root, which is zero on negative inputs, and the real infimum defining is total even when its set is empty or unbounded below.
QAlgorithms.Papers.Independent.Bridge50.P02.spectralIntegral
For a finite type with decidable equality, arbitrary complex matrices , and any function , form the matrix indexed by with , and the vector , where uses real continuous functional calculus. Let be the real functional calculus of for . The defined number is
No positivity, Hermiticity, invertibility, normalization, or regularity of is assumed. The inverse is the total matrix inverse, which is zero for singular ; scalar , so zero spectral values use . Real functional calculus returns zero on non-Hermitian matrices, and scalar square roots of negative numbers are zero. Empty gives zero.
QAlgorithms.Papers.Independent.Bridge50.P02.spectralTail
For a finite type with decidable equality, arbitrary complex matrices , and any real threshold , set and . Let be the real functional calculus of for the indicator function . This defines , with an inclusive inequality at the threshold. No positivity, Hermiticity, invertibility, or normalization is assumed. The inverse is zero for singular , real functional calculus is zero on non-Hermitian matrices, and , so zero spectral values satisfy the indicator exactly when . Empty gives zero.
QAlgorithms.Papers.Independent.Bridge50.P02.spinBox
For natural numbers , this defines the finite set of all sites satisfying in every coordinate . It is obtained by independently choosing each coordinate from and subtracting . Thus gives coordinates in , and gives the singleton containing the empty site.
QAlgorithms.Papers.Independent.Bridge50.P02.spinSequence
For natural numbers , two assignments of Hermitian complex interaction matrices to finite subsets of , each vanishing on the empty subset, and arbitrary real numbers , this defines a sequence of matrix pairs. At index , let ; the finite index type, equipped with decidable equality, is the set of configurations . On this index type set to have entry , and define in the same way. The pair is and , using complex scalar inversion, with inverse defined as . Neither translation invariance nor finite range is required. The parameters may be ; for , each nonempty box has no configurations, so both matrices are the unique matrices on an empty index type.
QAlgorithms.Papers.Independent.Bridge50.P02.spinVolumeWeight
For every pair of natural numbers , this defines the real number
where the integer base is converted to a real number before exponentiation. Both and are allowed; in particular, and .
QAlgorithms.Papers.Independent.Bridge50.P02.symbolCompression
For every natural number , every function , and every natural number , let , let , and choose the finite-set equivalence used in the definition. This defines a complex matrix with entries
The coordinate values are converted to real numbers before subtraction. No regularity, integrability, or range restriction on is assumed; each entry uses the total complex Bochner integral and is zero if its integrand is not integrable. If and , the matrix has size zero; if , including , it has size one and its entry is at the unique point.
QAlgorithms.Papers.Independent.Bridge50.P02.symbolEntropy
For every natural number and arbitrary functions , this defines
There are no measurability, integrability, or range assumptions on the symbols. Division by zero is defined to give zero, and the real logarithm is total, with and for . The integral is the total real Bochner integral, so its value is zero if the displayed integrand is not integrable. When , the definition evaluates the displayed expression at the unique point of .
QAlgorithms.Papers.Independent.Bridge50.P02.symbolPressure
For every natural number , arbitrary functions , and real number , this defines
Here means functions from to , and the integral is the real integral against Lebesgue measure restricted to the indicated cube and normalized by . No measurability, integrability, periodicity, or bounds on either function are required by this definition; powers and logarithms use their total real-valued definitions, including , and the integral is also total, with value zero for a nonintegrable integrand. The definition includes , when the domain consists of the single empty tuple and the normalized measure has mass one.
QAlgorithms.Papers.Independent.Bridge50.P02.symmetricError
For a finite type with decidable equality and arbitrary complex matrices , this defines the real infimum
Thus the tests range over all positive semidefinite matrices whose complements are positive semidefinite, including and ; they need not be projections. No positivity or trace normalization of , or nonemptiness of , is assumed. For empty , the value is zero.
QAlgorithms.Papers.Independent.Bridge50.P02.torusAverage
For every natural number and every function , this defines
No measurability or integrability hypothesis on is required by the definition; the integral is the total Bochner integral, which is zero when is not integrable. For , this is evaluation at the unique point of .
QAlgorithms.Papers.Independent.Bridge50.P02.torusMeasure
For every natural number , this defines a measure on by restricting Lebesgue measure to the half-open box and multiplying it by :
for measurable . The normalization and multiplication are taken in the nonnegative extended reals. The case is included: the underlying space has one point and the measure gives it mass .
QAlgorithms.Papers.Independent.Bridge50.P02.translateSupport
For every natural number , finite set , and translation vector , this defines , using coordinatewise integer addition and retaining the result as a finite set. In particular, translating the empty set gives the empty set; is allowed.
QAlgorithms.Papers.Independent.Bridge50.P02.translatedSite
For every natural number , finite set , translation vector , and element , this defines the element of the finite set , including its membership in that set. When is empty there is no such argument .
QAlgorithms.Papers.Independent.Bridge50.P02.varianceRate
For any testing sequence , with complex matrices on finite index types having decidable equality, and any , this defines the real value selected by the total limit-value operator at for the sequence
Matrix logarithms use real continuous functional calculus. There are no density-matrix, support, nonemptiness, weight, convergence, or nonnegativity assumptions. When the displayed sequence converges, the defined value equals its limit; convergence is not itself asserted. Division by zero gives zero.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.