/- Copyright (c) 2026 Marcel Morgenstern. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Marcel Morgenstern -/ module public import ErgodicTheory.Quantum.ClassicalIndicator public import OperatorEntropy.GramEntropy /-! # Simple partitions of unity: Alicki–Fannes entropy equals Kolmogorov–Sinai entropy Let `T` be a measure-preserving map of a probability space `(X, μ)`. * `vonNeumannEntropy_corrMatrix_le_entropy`: if every function of a partition of unity `g` is constant on each cell of a finite measurable partition `R`, then `S(ρ[g]) ≤ H(R)`. Writing `pₐ = μ(Rₐ)` and `cᵢₐ` for the value of `g i` on `Rₐ`, the correlation matrix is the Gram matrix `Aᴴ A` of `Aₐᵢ = √pₐ cᵢₐ`, so `S(ρ[g]) = S(A Aᴴ)` (`vonNeumannEntropy_eq_of_gram`), and `A Aᴴ` has diagonal `(pₐ)ₐ`, so `S(A Aᴴ) ≤ H(p)` (`vonNeumannEntropy_le_sum_negMulLog_diag`). * `IsSimple.levelPartition`: a simple partition of unity `f` is constant on the level sets of `x ↦ (f i x)ᵢ`, a finite measurable partition `Q`, and its `n`-th refinement is constant on the cells of `⋁_{t < n} T^{-t} Q`. Hence `S(ρ[f⁽ⁿ⁾]) ≤ H(⋁_{t < n} T^{-t} Q)` and `H[f, T] ≤ h(T, Q) ≤ h_KS(T)` (`alfEntropyRate_le_ksEntropy`). * `ksEntropy_eq_alfDynamicalEntropySimple`: together with the indicator partitions of `ErgodicTheory.Quantum.ClassicalIndicator`, the Kolmogorov–Sinai entropy equals the Alicki–Fannes entropy `alfDynamicalEntropySimple` taken over simple partitions of unity. The inequality `alfDynamicalEntropyClassical μ hT ≤ ksEntropy hT` for arbitrary bounded partitions of unity, and with it the equality `ksEntropy_eq_alfDynamicalEntropy`, is proved in `ErgodicTheory.Quantum.ClassicalUpperBound`. ## References * R. Alicki and M. Fannes, *Defining quantum dynamical entropy*, Lett. Math. Phys. **32** (1994) 75–82. * R. Alicki and M. Fannes, *Quantum Dynamical Systems*, Oxford University Press (2001). -/ @[expose] public section open MeasureTheory Filter OperatorEntropy ErgodicTheory.Entropy Matrix open scoped ComplexOrder noncomputable section namespace ErgodicTheory.Quantum namespace ClassicalOperationalPartition variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] {ι : Type*} [Fintype ι] [DecidableEq ι] /-- **Entropy bound for partitions of unity constant on cells.** If every function of the partition of unity `g` is constant on each cell of the finite measurable partition `R`, then the von Neumann entropy of the correlation matrix of `g` is at most the Shannon entropy of `R`. -/ theorem vonNeumannEntropy_corrMatrix_le_entropy {κ : Type*} [Fintype κ] (g : ClassicalOperationalPartition μ ι) (R : MeasurePartition μ κ) (c : ι → κ → ℂ) (hc : ∀ i a, ∀ x ∈ R.cells a, g.toFun i x = c i a) : vonNeumannEntropy g.corrMatrix ≤ entropy μ R.cells := by classical obtain ⟨A, hA⟩ : ∃ A : Matrix κ ι ℂ, A = fun a i => ((Real.sqrt (μ.real (R.cells a)) : ℝ) : ℂ) * c i a := ⟨_, rfl⟩ have hsq : ∀ a, ((Real.sqrt (μ.real (R.cells a)) : ℝ) : ℂ) * ((Real.sqrt (μ.real (R.cells a)) : ℝ) : ℂ) = ((μ.real (R.cells a) : ℝ) : ℂ) := fun a => by rw [← Complex.ofReal_mul, Real.mul_self_sqrt measureReal_nonneg] have hρ : g.corrMatrix.val = Aᴴ * A := by ext i j rw [corrMatrix_val_apply, Matrix.mul_apply] have hae : (fun x => star (g.toFun i x) * g.toFun j x) =ᵐ[μ] fun x => ∑ a, (R.cells a).indicator (fun _ => star (c i a) * c j a) x := by filter_upwards [R.ae_existsUnique_mem_cells] with x ⟨a, ha, hu⟩ rw [Finset.sum_eq_single a (fun b _ hb => Set.indicator_of_notMem (fun h => hb (hu b h)) _) (by simp), Set.indicator_of_mem ha, hc i a x ha, hc j a x ha] rw [integral_congr_ae hae, integral_finsetSum _ fun a _ => (integrable_const _).indicator (R.measurable a)] refine Finset.sum_congr rfl fun a _ => ?_ rw [integral_indicator_const _ (R.measurable a), Matrix.conjTranspose_apply, hA, Complex.real_smul] simp only [star_mul', Complex.star_def, Complex.conj_ofReal] linear_combination (-(starRingEnd ℂ) (c i a) * c j a) * hsq a have hdiag : ∀ a, (A * Aᴴ) a a = ((μ.real (R.cells a) : ℝ) : ℂ) := by intro a rw [Matrix.mul_apply] simp only [Matrix.conjTranspose_apply] rw [hA] simp only [star_mul', Complex.star_def, Complex.conj_ofReal] have hterm : ∀ i, ((Real.sqrt (μ.real (R.cells a)) : ℝ) : ℂ) * c i a * (((Real.sqrt (μ.real (R.cells a)) : ℝ) : ℂ) * (starRingEnd ℂ) (c i a)) = ((μ.real (R.cells a) : ℝ) : ℂ) * ((‖c i a‖ ^ 2 : ℝ) : ℂ) := fun i => by rw [Complex.ofReal_pow, ← Complex.mul_conj', ← hsq a] ring simp_rw [hterm] rw [← Finset.mul_sum] by_cases hR : μ (R.cells a) = 0 · rw [measureReal_def, hR, ENNReal.toReal_zero, Complex.ofReal_zero, zero_mul] · obtain ⟨x, hx, hx1⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hR (ae_restrict_of_ae g.sum_norm_sq) have hsum : ∑ i, ((‖c i a‖ ^ 2 : ℝ) : ℂ) = 1 := by rw [← Complex.ofReal_sum, ← Complex.ofReal_one, ← hx1] congr 1 exact Finset.sum_congr rfl fun i _ => by rw [hc i a x hx] rw [hsum, mul_one] have htr : (A * Aᴴ).trace = 1 := by rw [Matrix.trace_mul_comm, ← hρ, g.corrMatrix.trace_one] let σ : DensityMatrix κ := ⟨A * Aᴴ, Matrix.posSemidef_self_mul_conjTranspose A, htr⟩ calc vonNeumannEntropy g.corrMatrix = vonNeumannEntropy σ := vonNeumannEntropy_eq_of_gram _ σ A hρ rfl _ ≤ ∑ a, Real.negMulLog (σ.val a a).re := vonNeumannEntropy_le_sum_negMulLog_diag σ _ = entropy μ R.cells := by rw [entropy_def] refine Finset.sum_congr rfl fun a _ => ?_ change Real.negMulLog ((A * Aᴴ) a a).re = _ rw [hdiag, Complex.ofReal_re, measureReal_def] omit [IsProbabilityMeasure μ] [DecidableEq ι] in /-- A simple partition of unity takes finitely many values as a vector `x ↦ (f i x)ᵢ`. -/ theorem IsSimple.finite_range {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) : (Set.range fun x i => P.toFun i x).Finite := (Set.Finite.pi fun i => hP i).subset (by rintro _ ⟨x, rfl⟩ exact Set.mem_univ_pi.mpr fun i => ⟨x, rfl⟩) omit [IsProbabilityMeasure μ] [DecidableEq ι] in /-- The values of a simple partition of unity, enumerated by `Fin`. -/ def IsSimple.value {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) (j : Fin hP.finite_range.toFinset.card) : ι → ℂ := (hP.finite_range.toFinset.equivFin.symm j : ι → ℂ) /-- The level partition of a simple partition of unity `f`: the finite measurable partition of `X` into the level sets of `x ↦ (f i x)ᵢ`. -/ def IsSimple.levelPartition {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) : MeasurePartition μ (Fin hP.finite_range.toFinset.card) where cells j := (fun x i => P.toFun i x) ⁻¹' {hP.value j} measurable j := (measurable_pi_iff.mpr P.measurable) (measurableSet_singleton _) aedisjoint j j' hjj' := by refine Disjoint.aedisjoint (Disjoint.preimage _ (Set.disjoint_singleton.mpr fun h => hjj' ?_)) exact hP.finite_range.toFinset.equivFin.symm.injective (Subtype.ext h) cover := by refine Set.eq_univ_of_forall fun x => Set.mem_iUnion.mpr ?_ refine ⟨hP.finite_range.toFinset.equivFin ⟨fun i => P.toFun i x, hP.finite_range.mem_toFinset.mpr ⟨x, rfl⟩⟩, ?_⟩ simp [IsSimple.value] omit [IsProbabilityMeasure μ] [DecidableEq ι] in /-- On a cell of the level partition, the functions of the partition of unity take the corresponding value. -/ theorem IsSimple.toFun_eq_value {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) {j : Fin hP.finite_range.toFinset.card} {x : X} (hx : x ∈ hP.levelPartition.cells j) (i : ι) : P.toFun i x = hP.value j i := congrFun (Set.mem_singleton_iff.mp hx) i variable {T : X → X} /-- For a simple partition of unity `f` with level partition `Q`, the entropy of the `n`-th correlation matrix is at most `H(⋁_{t < n} T^{-t} Q)`. -/ theorem vonNeumannEntropy_corrMatrix_refine_le_ksEntropySeq {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) (hT : MeasurePreserving T μ μ) (n : ℕ) : vonNeumannEntropy (P.refine hT n).corrMatrix ≤ ksEntropySeq hT hP.levelPartition n := by refine vonNeumannEntropy_corrMatrix_le_entropy _ (ksJoin hT hP.levelPartition n) (fun u w => ∏ t, hP.value (w t) (u t)) fun u w x hx => ?_ rw [ksJoin_cells, ksJoinCells_apply, Set.mem_iInter] at hx rw [refine_toFun] exact Finset.prod_congr rfl fun t _ => hP.toFun_eq_value (hx t) (u t) /-- For a simple partition of unity `f` with level partition `Q`, `H[f, T] ≤ h(T, Q)`. -/ theorem alfEntropyRate_le_ksEntropyPartition {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) (hT : MeasurePreserving T μ μ) : P.alfEntropyRate hT ≤ ksEntropyPartition hT hP.levelPartition := by have hlim := tendsto_ksEntropySeq hT hP.levelPartition rw [← hlim.limsup_eq] refine limsup_le_limsup (Eventually.of_forall fun n => div_le_div_of_nonneg_right (vonNeumannEntropy_corrMatrix_refine_le_ksEntropySeq hP hT n) n.cast_nonneg) ?_ hlim.isBoundedUnder_le exact isCoboundedUnder_le_of_le atTop fun n => (P.vonNeumannEntropy_corrMatrix_refine_div_mem_Icc hT n).1 /-- The Alicki–Fannes entropy rate of a simple partition of unity is at most the Kolmogorov–Sinai entropy. -/ theorem alfEntropyRate_le_ksEntropy {P : ClassicalOperationalPartition μ ι} (hP : P.IsSimple) (hT : MeasurePreserving T μ μ) : ((P.alfEntropyRate hT : ℝ) : EReal) ≤ ksEntropy hT := (EReal.coe_le_coe_iff.mpr (alfEntropyRate_le_ksEntropyPartition hP hT)).trans (le_ksEntropy hT _) end ClassicalOperationalPartition open ClassicalOperationalPartition variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] {T : X → X} /-- **Kolmogorov–Sinai entropy as an Alicki–Fannes entropy over simple partitions.** For a measure-preserving map `T` of a probability space `(X, μ)`, the Kolmogorov–Sinai entropy `h_KS(T)` equals the Alicki–Fannes dynamical entropy of the abelian system `(L^∞(μ), f ↦ f ∘ T, ∫ · dμ)` computed with the operational partitions of unity whose functions take finitely many values (`alfDynamicalEntropySimple`). The inequality `≥` holds because such a partition of unity is constant on the cells of a finite measurable partition `Q`, which bounds the entropy of its `n`-th correlation matrix by `H(⋁_{t < n} T^{-t} Q)`; the inequality `≤` uses the indicator partitions of unity. The equality over all bounded partitions of unity is `ksEntropy_eq_alfDynamicalEntropy`. -/ theorem ksEntropy_eq_alfDynamicalEntropySimple (hT : MeasurePreserving T μ μ) : ksEntropy hT = alfDynamicalEntropySimple μ hT := le_antisymm (ksEntropy_le_alfDynamicalEntropySimple hT) (iSup_le fun _ => iSup_le fun P => alfEntropyRate_le_ksEntropy P.2 hT) end ErgodicTheory.Quantum