Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Cross-entropy against a block-modified spectral state

Proved
OAI.EntropyPhotonNumber.block_crossEntropy

by Shuze Chen · Oct 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

entropymatrix-analysisoai-mathquantum-information

Let F=ℓ2(Nn,C)F=\ell^2(\mathbb{N}^n,\mathbb{C})F=ℓ2(Nn,C) be the nnn-mode Fock space. Let III be a finite set and JJJ any set, let (bk)k∈I⊔J(b_k)_{k\in I\sqcup J}(bk​)k∈I⊔J​ be a Hilbert basis of FFF, and let p:I⊔J→(0,∞)p:I\sqcup J\to(0,\infty)p:I⊔J→(0,∞) with ∑kpk=1\sum_kp_k=1∑k​pk​=1. For a matrix A∈CI×IA\in\mathbb{C}^{I\times I}A∈CI×I let

B(A)=∑i,i′∈IAii′ ∣bi⟩⟨bi′∣\mathsf B(A)=\sum_{i,i'\in I}A_{ii'}\,|b_i\rangle\langle b_{i'}|B(A)=i,i′∈I∑​Aii′​∣bi​⟩⟨bi′​∣

be its embedding as an operator acting on the span of the finite block {bi:i∈I}\{b_i:i\in I\}{bi​:i∈I}. Let M∈CI×IM\in\mathbb{C}^{I\times I}M∈CI×I be Hermitian with orthonormal eigenvectors ci∈CIc_i\in\mathbb{C}^Ici​∈CI and eigenvalues λi\lambda_iλi​ (as chosen by the spectral theorem). The block-modified basis is ai=∑i′(ci)i′ bi′a_i=\sum_{i'}(c_i)_{i'}\,b_{i'}ai​=∑i′​(ci​)i′​bi′​ for i∈Ii\in Ii∈I and aj=bja_j=b_jaj​=bj​ for j∈Jj\in Jj∈J; the partition function is Z=∑j∈Jpj+∑i∈Ieλi>0\mathcal Z=\sum_{j\in J}p_j+\sum_{i\in I}e^{\lambda_i}>0Z=∑j∈J​pj​+∑i∈I​eλi​>0, and the modified weights are wi=eλi/Zw_i=e^{\lambda_i}/\mathcal Zwi​=eλi​/Z (i∈I)(i\in I)(i∈I), wj=pj/Zw_j=p_j/\mathcal Zwj​=pj​/Z (j∈J)(j\in J)(j∈J), which are positive and sum to 111. The block state is the state ρM=∑k∈I⊔Jwk ∣ak⟩⟨ak∣\rho_M=\sum_{k\in I\sqcup J}w_k\,|a_k\rangle\langle a_k|ρM​=∑k∈I⊔J​wk​∣ak​⟩⟨ak​∣.

For a state σ\sigmaσ write Eσ(T)=Tr⁡(σT)\mathbb E_\sigma(T)=\operatorname{Tr}(\sigma T)Eσ​(T)=Tr(σT) (computed as ∑k⟨σ∣k⟩,Tσ∣k⟩⟩\sum_k\langle\sqrt\sigma|k\rangle,T\sqrt\sigma|k\rangle\rangle∑k​⟨σ​∣k⟩,Tσ​∣k⟩⟩ over the number basis) and define the cross-entropy of σ\sigmaσ relative to the spectral data (b,p)(b,p)(b,p) as

H(σ ∥ b,p)=∑k∈I⊔J(−log⁡pk) ⟨bk,σbk⟩.H(\sigma\,\|\,b,p)=\sum_{k\in I\sqcup J}\bigl(-\log p_k\bigr)\,\langle b_k,\sigma b_k\rangle .H(σ∥b,p)=k∈I⊔J∑​(−logpk​)⟨bk​,σbk​⟩.

Theorem. Let σ\sigmaσ be a state such that the series ∑k(−log⁡pk)⟨bk,σbk⟩\sum_k(-\log p_k)\langle b_k,\sigma b_k\rangle∑k​(−logpk​)⟨bk​,σbk​⟩ converges (absolutely). Then the series ∑k(−log⁡wk) ⟨ak,σak⟩\sum_k(-\log w_k)\,\langle a_k,\sigma a_k\rangle∑k​(−logwk​)⟨ak​,σak​⟩ converges, and

∑k∈I⊔J(−log⁡wk) ⟨ak,σak⟩=H(σ ∥ b,p)+Re⁡Eσ(B(diag⁡(log⁡pi)i∈I))−Re⁡Eσ(B(M))+log⁡Z.\sum_{k\in I\sqcup J}\bigl(-\log w_k\bigr)\,\langle a_k,\sigma a_k\rangle=H(\sigma\,\|\,b,p)+\operatorname{Re}\mathbb E_\sigma\bigl(\mathsf B(\operatorname{diag}(\log p_i)_{i\in I})\bigr)-\operatorname{Re}\mathbb E_\sigma\bigl(\mathsf B(M)\bigr)+\log\mathcal Z .k∈I⊔J∑​(−logwk​)⟨ak​,σak​⟩=H(σ∥b,p)+ReEσ​(B(diag(logpi​)i∈I​))−ReEσ​(B(M))+logZ.

The left side is the cross-entropy −Tr⁡σlog⁡ρM-\operatorname{Tr}\sigma\log\rho_M−TrσlogρM​ of σ\sigmaσ against the block state ρM\rho_MρM​ (eigenbasis aaa, eigenvalues www). The formula expresses it through the unperturbed cross-entropy and two finite-block expectations, which makes the dependence on MMM explicit (affine in MMM plus log⁡Z\log\mathcal ZlogZ) for variational arguments.

Formalization Note The values ⟨bk,σbk⟩\langle b_k,\sigma b_k\rangle⟨bk​,σbk​⟩ are written as real parts of complex inner products, the identity is a HasSum statement, and H(σ∥b,p)H(\sigma\|b,p)H(σ∥b,p) is the tsum crossEntropy b p σ.

Preamble
import Mathlib
import Definitions.Def_EntropyPhotonNumber
import Definitions.Def_OAI_MathematicalPhysics_Fock_Beam
import Definitions.Def_OAI_Analysis_QuantumTrace_Basic
import Definitions.Def_OAI_MathematicalPhysics_Fock_Operators
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Gibbs
import Definitions.Def_OAI_Analysis_TensorLp
import Definitions.Def_OAI_InformationTheory_PhotonNumber_BeamTrace
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Functions
import Definitions.Def_OAI_Analysis_DiagonalForms
import Definitions.Def_OAI_InformationTheory_PhotonNumber_ThermalMetric
import Definitions.Def_OAI_InformationTheory_PhotonNumber_BeamForms
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Generator
import Definitions.Def_OAI_InformationTheory_PhotonNumber_SpectralLog
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Continuity
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Entropy
import Definitions.Def_OAI_InformationTheory_PhotonNumber_GibbsVariational
import Definitions.Def_OAI_Analysis_Herglotz
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Interpolation
import Definitions.Def_OAI_InformationTheory_PhotonNumber_SpectralForms
import Definitions.Def_OAI_InformationTheory_PhotonNumber_Contraction
import Definitions.Def_OAI_InformationTheory_PhotonNumber_FiniteVariation

open OAI OAI.EntropyPhotonNumber
open scoped ComplexConjugate
open scoped BigOperators ComplexConjugate
open scoped BigOperators ComplexConjugate ENNReal Topology
open MeasureTheory
open scoped BigOperators
open MvPolynomial
open scoped BigOperators ComplexConjugate Classical
open Submodule
open scoped ENNReal
open Module
open scoped ComplexConjugate BigOperators Matrix
open scoped ComplexConjugate
open scoped BigOperators ComplexConjugate
open scoped BigOperators ComplexConjugate ENNReal Topology
open MeasureTheory
open scoped BigOperators
open MvPolynomial
open scoped BigOperators ComplexConjugate Classical
open Submodule
open scoped ENNReal
open Module
open scoped ComplexConjugate BigOperators Matrix
open NormedSpace
open scoped Matrix.Norms.Operator
open QuantumTrace
variable {n : ℕ} {I J : Type*} [Fintype I] [DecidableEq I]
Formal statement
theorem OAI.EntropyPhotonNumber.block_crossEntropy (σ : State n) (b : HilbertBasis (I ⊕ J) ℂ (Fock n))
    (p : I ⊕ J → ℝ) (hp : ∀ j, 0 < p j) (hs : HasSum p 1)
    (hc : Summable (fun j => (-Real.log (p j))*(inner ℂ (b j) (σ.op (b j))).re))
    (M : Matrix I I ℂ) (hM : M.IsHermitian) :
    HasSum (fun j => (-Real.log (FiniteBlock.weights p M hM j))*
      (inner ℂ (FiniteBlock.basis b hM.eigenvectorBasis j)
        (σ.op (FiniteBlock.basis b hM.eigenvectorBasis j))).re)
      (crossEntropy b p σ+
        (expectation σ (FiniteBlock.block b (Matrix.diagonal (fun i => (Real.log (p (Sum.inl i)) : ℂ))))).re-
        (expectation σ (FiniteBlock.block b M)).re+Real.log (FiniteBlock.partition p M hM)) := by sorry
Source
https://github.com/openai/math/blob/1581d4cbdd69a0faf34b2089614fe2a814316a6a/lean/OAI/InformationTheory/PhotonNumber/FiniteVariation.lean#L694-L743

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me