/- 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.ClassicalSimple public import OperatorEntropy.MixtureEntropy public import OperatorEntropy.Subadditivity public import OperatorEntropy.GrowingTower.QuantumBernoulli public import Mathlib.MeasureTheory.Function.Floor public import Mathlib.Probability.ConditionalProbability /-! # Alicki–Fannes entropy is at most Kolmogorov–Sinai entropy Let `T` be a measure-preserving map of a probability space `(X, μ)` and `f` a finite operational partition of unity of `L^∞(μ)`. Write `u(x) = (fᵢ(x))ᵢ`, a unit vector for almost every `x`. This module proves `H[f, T] ≤ h_KS(T)` (`ClassicalOperationalPartition.alfEntropyRate_coe_le_ksEntropy`) and hence the Alicki–Fannes theorem for classical systems, `ksEntropy_eq_alfDynamicalEntropyClassical : h_KS(T) = alfDynamicalEntropyClassical μ hT`. * `ClassicalOperationalPartition.normalize`: changing `f` on a null set so that `∑ i, ‖fᵢ x‖ ^ 2 = 1` at every point does not change the entropy rate. * `ClassicalOperationalPartition.exists_measurePartition_near`: for `ε > 0` there is a finite measurable partition `Q` (level sets of the integer parts of `N Re fᵢ`, `N Im fᵢ`) and vectors `e q` of norm at most `1` with `‖⟨e q, u(x)⟩‖ ^ 2 ≥ 1 - ε` on the cell `Q q`. * `ClassicalOperationalPartition.corrMatrix_val_eq_sum_cond`: the correlation matrix is the mixture `∑ₐ μ(Cₐ) σₐ` over the cells `Cₐ` of a finite partition, `σₐ` the correlation matrix for the conditional measure `μ[|Cₐ]`. Applied to `⋁_{t < n} T^{-t} Q`, the mixture bound `OperatorEntropy.vonNeumannEntropy_le_mixture_of_le` gives `S(ρ[f⁽ⁿ⁾]) ≤ H(⋁_{t < n} T^{-t} Q) + max_a S(σₐ)`. * `ClassicalOperationalPartition.vonNeumannEntropy_corrMatrix_orbit_le`: on a cell with itinerary `a`, every `u(T^t x)` is close to `e (a t)`, so `S(σₐ) ≤ n (ε + 2 |ι| √ε)`. The proof is by induction on `n`: subadditivity (`OperatorEntropy.vonNeumannEntropy_subadditive`) splits off the first site, whose reduced state is nearly pure (`OperatorEntropy.vonNeumannEntropy_le_of_re_quadForm`), and the remaining `n` sites are the orbit correlation matrix for the image measure `T_* μ[|Cₐ]`. * Dividing by `n` and letting `n → ∞`: `H[f, T] ≤ h(T, Q) + ε + 2 |ι| √ε ≤ h_KS(T) + ε + 2 |ι| √ε`, and `ε → 0` gives `H[f, T] ≤ h_KS(T)`. ## Main results * `alfDynamicalEntropyClassical_le_ksEntropy`: `h_AF(T) ≤ h_KS(T)`. * `ksEntropy_eq_alfDynamicalEntropyClassical` (also stated as `ksEntropy_eq_alfDynamicalEntropy`): `h_KS(T) = h_AF(T)`. * `alfDynamicalEntropySimple_eq_alfDynamicalEntropyClassical`: the supremum over simple partitions of unity equals the supremum over all of them. ## 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 ProbabilityTheory open scoped ComplexOrder Topology noncomputable section namespace ErgodicTheory.Entropy variable {X : Type*} [MeasurableSpace X] {μ : Measure X} /-- The integral over the whole space is the sum of the integrals over the cells of a finite measurable partition. -/ theorem MeasurePartition.integral_eq_sum_setIntegral {κ : Type*} [Fintype κ] (R : MeasurePartition μ κ) {g : X → ℂ} (hg : Integrable g μ) : ∫ x, g x ∂μ = ∑ a, ∫ x in R.cells a, g x ∂μ := by have h := integral_iUnion_ae (μ := μ) (f := g) (fun a => (R.measurable a).nullMeasurableSet) R.aedisjoint (by rw [R.cover]; exact hg.integrableOn) rwa [R.cover, Measure.restrict_univ, tsum_fintype] at h /-- A measurable map with finite range into a space with measurable singletons is constant on the cells of a finite measurable partition indexed by `Fin m` (its level sets). -/ theorem MeasurePartition.exists_fin_of_finite_range {Y : Type*} [MeasurableSpace Y] [MeasurableSingletonClass Y] (μ : Measure X) {φ : X → Y} (hφ : Measurable φ) (hfin : (Set.range φ).Finite) : ∃ (m : ℕ) (Q : MeasurePartition μ (Fin m)), ∀ q, ∀ x ∈ Q.cells q, ∀ y ∈ Q.cells q, φ x = φ y := by let value : Fin hfin.toFinset.card → Y := fun j => (hfin.toFinset.equivFin.symm j : Y) refine ⟨hfin.toFinset.card, { cells := fun j => φ ⁻¹' {value j} measurable := fun j => hφ (measurableSet_singleton _) aedisjoint := fun j j' hjj' => by refine Disjoint.aedisjoint (Disjoint.preimage _ (Set.disjoint_singleton.mpr fun h => hjj' ?_)) exact hfin.toFinset.equivFin.symm.injective (Subtype.ext h) cover := by refine Set.eq_univ_of_forall fun x => Set.mem_iUnion.mpr ?_ refine ⟨hfin.toFinset.equivFin ⟨φ x, hfin.mem_toFinset.mpr ⟨x, rfl⟩⟩, ?_⟩ simp [value] }, fun q x hx y hy => ?_⟩ exact (Set.mem_singleton_iff.mp hx).trans (Set.mem_singleton_iff.mp hy).symm end ErgodicTheory.Entropy namespace ErgodicTheory.Quantum namespace ClassicalOperationalPartition variable {X : Type*} [MeasurableSpace X] {μ : Measure X} {ι : Type*} [Fintype ι] /-! ### Partitions of unity normalised at every point -/ /-- A partition of unity with `∑ i, ‖f i x‖ ^ 2 = 1` at every point is a partition of unity for every measure `ν`. -/ def withMeasure (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) (ν : Measure X) : ClassicalOperationalPartition ν ι where toFun := P.toFun measurable := P.measurable norm_le_one := P.norm_le_one sum_norm_sq := Eventually.of_forall hP /-- The functions of `P.withMeasure hP ν` are those of `P`. -/ @[simp] theorem withMeasure_toFun (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) (ν : Measure X) : (P.withMeasure hP ν).toFun = P.toFun := rfl /-- The orbit products of a partition of unity normalised at every point are normalised at every point. -/ theorem sum_norm_sq_orbit (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) (T : X → X) (n : ℕ) (x : X) : ∑ w : Fin n → ι, ‖∏ t : Fin n, P.toFun (w t) (T^[t] x)‖ ^ 2 = 1 := by have hprod : ∏ t : Fin n, ∑ i, ‖P.toFun i (T^[t] x)‖ ^ 2 = 1 := Finset.prod_eq_one fun t _ => hP _ rw [Fintype.prod_sum] at hprod rw [← hprod] refine Finset.sum_congr rfl fun w _ => ?_ rw [norm_prod, Finset.prod_pow] /-- The orbit products `x ↦ ∏_{t < n} f_{w t} (T^t x)` of a partition of unity normalised at every point, as a partition of unity for an arbitrary measure `ν`. For `ν = μ` and `T` measure-preserving these are the functions of `P.refine hT n`. -/ def orbit (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) (ν : Measure X) (n : ℕ) : ClassicalOperationalPartition ν (Fin n → ι) where toFun w x := ∏ t : Fin n, P.toFun (w t) (T^[t] x) measurable w := Finset.measurable_prod _ fun t _ => (P.measurable (w t)).comp (hT.iterate t) norm_le_one w x := by rw [norm_prod] exact Finset.prod_le_one₀ (fun _ _ => norm_nonneg _) fun t _ => P.norm_le_one _ _ sum_norm_sq := Eventually.of_forall (P.sum_norm_sq_orbit hP T n) /-- The functions of the orbit partition are the orbit products. -/ @[simp] theorem orbit_toFun (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) (ν : Measure X) (n : ℕ) (w : Fin n → ι) (x : X) : (P.orbit hP hT ν n).toFun w x = ∏ t : Fin n, P.toFun (w t) (T^[t] x) := rfl /-- Splitting off the first factor of an orbit product. -/ theorem orbit_toFun_cons (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) (ν ν' : Measure X) (n : ℕ) (i : ι) (w : Fin n → ι) (x : X) : (P.orbit hP hT ν (n + 1)).toFun (Fin.cons i w) x = P.toFun i x * (P.orbit hP hT ν' n).toFun w (T x) := by simp only [orbit_toFun, Fin.prod_univ_succ, Fin.cons_zero, Fin.cons_succ, Fin.val_zero, Function.iterate_zero, id_eq, Fin.val_succ, Function.iterate_succ_apply] /-! ### Entropy of nearly pure correlation matrices -/ /-- The function `x ↦ ‖∑ i, v i * f i x‖ ^ 2` is integrable. -/ theorem integrable_norm_sum_mul_sq {ν : Measure X} [IsFiniteMeasure ν] (P : ClassicalOperationalPartition ν ι) (v : ι → ℂ) : Integrable (fun x => ‖∑ i, v i * P.toFun i x‖ ^ 2) ν := by refine Integrable.of_bound (C := (∑ i, ‖v i‖) ^ 2) ?_ (Eventually.of_forall fun x => ?_) · exact ((Finset.measurable_sum _ fun i _ => measurable_const.mul (P.measurable i)).norm.pow_const 2).aestronglyMeasurable · rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] gcongr refine (norm_sum_le _ _).trans (Finset.sum_le_sum fun i _ => ?_) rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (P.norm_le_one i x) /-- **One-site bound.** If `‖∑ i, v i * f i x‖ ^ 2 ≥ 1 - ε` for `ν`-almost every `x`, where `∑ i, ‖v i‖ ^ 2 ≤ 1`, then the correlation matrix of `f` has entropy at most `ε + 2 |ι| √ε`. -/ theorem vonNeumannEntropy_corrMatrix_le_of_ae [DecidableEq ι] {ν : Measure X} [IsProbabilityMeasure ν] (P : ClassicalOperationalPartition ν ι) (v : ι → ℂ) {ε : ℝ} (hv : ∑ i, ‖v i‖ ^ 2 ≤ 1) (h : ∀ᵐ x ∂ν, 1 - ε ≤ ‖∑ i, v i * P.toFun i x‖ ^ 2) : vonNeumannEntropy P.corrMatrix ≤ ε + 2 * Fintype.card ι * Real.sqrt ε := by refine vonNeumannEntropy_le_of_re_quadForm P.corrMatrix v hv ?_ have hq := P.star_dotProduct_corr_eq v change star v ⬝ᵥ (P.corrMatrix.val *ᵥ v) = _ at hq rw [hq, integral_complex_ofReal, Complex.ofReal_re] calc 1 - ε = ∫ _x, (1 - ε) ∂ν := by simp _ ≤ _ := integral_mono_ae (integrable_const _) (P.integrable_norm_sum_mul_sq v) h /-- Splitting a word of length `n + 1` into its first letter and the rest. -/ def finSuccEquivProd (ι : Type*) (n : ℕ) : (Fin (n + 1) → ι) ≃ ι × (Fin n → ι) where toFun w := (w 0, Fin.tail w) invFun p := Fin.cons p.1 p.2 left_inv w := Fin.cons_self_tail w right_inv p := by simp /-- The reduced density matrix on the first site of the correlation matrix of the orbit products is the correlation matrix of `P`. -/ theorem corrMatrix_orbit_reindex_partialTraceRight [DecidableEq ι] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) (ν : Measure X) [IsProbabilityMeasure ν] (n : ℕ) : ((P.orbit hP hT ν (n + 1)).corrMatrix.reindex (finSuccEquivProd ι n)).partialTraceRight = (P.withMeasure hP ν).corrMatrix := by refine DensityMatrix.ext (funext fun i => funext fun i' => ?_) change ∑ w, ((P.orbit hP hT ν (n + 1)).corrMatrix.reindex (finSuccEquivProd ι n)).val (i, w) (i', w) = _ simp_rw [DensityMatrix.reindex_val_apply] change ∑ w, (P.orbit hP hT ν (n + 1)).corrMatrix.val (Fin.cons i w) (Fin.cons i' w) = _ simp only [corrMatrix_val_apply, withMeasure_toFun] rw [← integral_finsetSum _ fun w _ => (P.orbit hP hT ν (n + 1)).integrable_star_mul _ _] refine integral_congr_ae (Eventually.of_forall fun x => ?_) simp only [P.orbit_toFun_cons hP hT ν ν, star_mul'] have h1 := P.sum_norm_sq_orbit hP T n (T x) have h2 : ∑ w : Fin n → ι, star ((P.orbit hP hT ν n).toFun w (T x)) * (P.orbit hP hT ν n).toFun w (T x) = 1 := by rw [← Complex.ofReal_one, ← h1, Complex.ofReal_sum] refine Finset.sum_congr rfl fun w _ => ?_ rw [Complex.star_def, Complex.conj_mul', Complex.ofReal_pow] rfl calc ∑ w : Fin n → ι, star (P.toFun i x) * star ((P.orbit hP hT ν n).toFun w (T x)) * (P.toFun i' x * (P.orbit hP hT ν n).toFun w (T x)) = star (P.toFun i x) * P.toFun i' x * ∑ w : Fin n → ι, star ((P.orbit hP hT ν n).toFun w (T x)) * (P.orbit hP hT ν n).toFun w (T x) := by rw [Finset.mul_sum] exact Finset.sum_congr rfl fun w _ => by ring _ = _ := by rw [h2, mul_one] /-- The reduced density matrix on the last `n` sites of the correlation matrix of the orbit products of length `n + 1` for `ν` is the correlation matrix of the orbit products of length `n` for the image measure `T_* ν`. -/ theorem corrMatrix_orbit_reindex_partialTraceLeft [DecidableEq ι] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) (ν : Measure X) [IsProbabilityMeasure ν] (n : ℕ) : ((P.orbit hP hT ν (n + 1)).corrMatrix.reindex (finSuccEquivProd ι n)).partialTraceLeft = (P.orbit hP hT (ν.map T) n).corrMatrix := by refine DensityMatrix.ext (funext fun w => funext fun w' => ?_) change ∑ i, ((P.orbit hP hT ν (n + 1)).corrMatrix.reindex (finSuccEquivProd ι n)).val (i, w) (i, w') = _ simp_rw [DensityMatrix.reindex_val_apply] change ∑ i, (P.orbit hP hT ν (n + 1)).corrMatrix.val (Fin.cons i w) (Fin.cons i w') = _ simp only [corrMatrix_val_apply] rw [← integral_finsetSum _ fun i _ => (P.orbit hP hT ν (n + 1)).integrable_star_mul _ _, integral_map hT.aemeasurable ((P.orbit hP hT (ν.map T) n).integrable_star_mul w w').aestronglyMeasurable] refine integral_congr_ae (Eventually.of_forall fun x => ?_) simp only [P.orbit_toFun_cons hP hT ν (ν.map T), star_mul'] have h2 : ∑ i, star (P.toFun i x) * P.toFun i x = 1 := by rw [← Complex.ofReal_one, ← hP x, Complex.ofReal_sum] refine Finset.sum_congr rfl fun i _ => ?_ rw [Complex.star_def, Complex.conj_mul', Complex.ofReal_pow] calc ∑ i, star (P.toFun i x) * star ((P.orbit hP hT (ν.map T) n).toFun w (T x)) * (P.toFun i x * (P.orbit hP hT (ν.map T) n).toFun w' (T x)) = star ((P.orbit hP hT (ν.map T) n).toFun w (T x)) * (P.orbit hP hT (ν.map T) n).toFun w' (T x) * ∑ i, star (P.toFun i x) * P.toFun i x := by rw [Finset.mul_sum] exact Finset.sum_congr rfl fun i _ => by ring _ = _ := by rw [h2, mul_one] /-- **Entropy of an orbit correlation matrix along a fixed itinerary.** Let `f` be a partition of unity normalised at every point, `ν` a probability measure and `v t` vectors with `∑ i, ‖v t i‖ ^ 2 ≤ 1` such that `‖∑ i, v t i * f i (T^t x)‖ ^ 2 ≥ 1 - ε` for `ν`-almost every `x` and every `t < n`. Then the correlation matrix of the orbit products of length `n` for `ν` has entropy at most `n (ε + 2 |ι| √ε)`. The proof is by induction on `n`: subadditivity splits off the first site, which is bounded by `vonNeumannEntropy_corrMatrix_le_of_ae`, and the remaining sites form the orbit correlation matrix of length `n` for `T_* ν`. -/ theorem vonNeumannEntropy_corrMatrix_orbit_le [DecidableEq ι] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : Measurable T) {ε : ℝ} (n : ℕ) (ν : Measure X) [IsProbabilityMeasure ν] (v : Fin n → ι → ℂ) (hv : ∀ t, ∑ i, ‖v t i‖ ^ 2 ≤ 1) (hclose : ∀ t : Fin n, ∀ᵐ x ∂ν, 1 - ε ≤ ‖∑ i, v t i * P.toFun i (T^[t] x)‖ ^ 2) : vonNeumannEntropy (P.orbit hP hT ν n).corrMatrix ≤ n * (ε + 2 * Fintype.card ι * Real.sqrt ε) := by induction n generalizing ν with | zero => refine (vonNeumannEntropy_le_log_card _).trans_eq ?_ simp | succ n ih => have h1 : vonNeumannEntropy (P.withMeasure hP ν).corrMatrix ≤ ε + 2 * Fintype.card ι * Real.sqrt ε := vonNeumannEntropy_corrMatrix_le_of_ae _ (v 0) (hv 0) (by simpa using hclose 0) have h2 := ih (ν.map T) (fun t => v t.succ) (fun t => hv _) fun t => by have hms : MeasurableSet {y | 1 - ε ≤ ‖∑ i, v t.succ i * P.toFun i (T^[t] y)‖ ^ 2} := measurableSet_le measurable_const ((Finset.measurable_sum _ fun i _ => measurable_const.mul ((P.measurable i).comp (hT.iterate t))).norm.pow_const 2) rw [ae_map_iff hT.aemeasurable hms] filter_upwards [hclose t.succ] with x hx rwa [Fin.val_succ, Function.iterate_succ_apply] at hx calc vonNeumannEntropy (P.orbit hP hT ν (n + 1)).corrMatrix = vonNeumannEntropy ((P.orbit hP hT ν (n + 1)).corrMatrix.reindex (finSuccEquivProd ι n)) := (vonNeumannEntropy_reindex _ _).symm _ ≤ _ := vonNeumannEntropy_subadditive _ _ ≤ (ε + 2 * Fintype.card ι * Real.sqrt ε) + n * (ε + 2 * Fintype.card ι * Real.sqrt ε) := by rw [P.corrMatrix_orbit_reindex_partialTraceRight hP hT ν n, P.corrMatrix_orbit_reindex_partialTraceLeft hP hT ν n] exact add_le_add h1 h2 _ = _ := by push_cast; ring /-- **Correlation matrix as a mixture over a finite partition.** For a finite measurable partition `R` of a probability space, the correlation matrix of a partition of unity normalised at every point is the mixture `∑ₐ μ(Rₐ) σₐ`, where `σₐ` is the correlation matrix for the conditional measure `μ[|Rₐ]` when `μ(Rₐ) ≠ 0` (and `σₐ = ρ` otherwise). -/ theorem corrMatrix_val_eq_sum_cond [DecidableEq ι] [IsProbabilityMeasure μ] {κ : Type*} [Fintype κ] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) (R : MeasurePartition μ κ) : P.corrMatrix.val = ∑ a, ((μ.real (R.cells a) : ℝ) : ℂ) • (if h : μ (R.cells a) = 0 then P.corrMatrix else haveI := cond_isProbabilityMeasure (μ := μ) h (P.withMeasure hP (μ[|R.cells a])).corrMatrix).val := by ext i j rw [corrMatrix_val_apply, R.integral_eq_sum_setIntegral (P.integrable_star_mul i j), Matrix.sum_apply] refine Finset.sum_congr rfl fun a _ => ?_ rw [Matrix.smul_apply, smul_eq_mul] by_cases h : μ (R.cells a) = 0 · rw [Measure.restrict_eq_zero.mpr h, integral_zero_measure, measureReal_def, show (μ (R.cells a)).toReal = 0 by simp [h], Complex.ofReal_zero, zero_mul] · simp only [h, ↓reduceDIte] change _ = _ * ∫ x, star (P.toFun i x) * P.toFun j x ∂(μ[|R.cells a]) rw [ProbabilityTheory.cond, integral_smul_measure, Complex.real_smul, ← mul_assoc, ← Complex.ofReal_mul, measureReal_def, ENNReal.toReal_inv, mul_inv_cancel₀ (ENNReal.toReal_ne_zero.mpr ⟨h, measure_ne_top _ _⟩), Complex.ofReal_one, one_mul] /-- **Entropy bound along a partition into nearly constant pieces.** Let `f` be a partition of unity normalised at every point and `Q` a finite measurable partition with vectors `e q`, `∑ i, ‖e q i‖ ^ 2 ≤ 1`, such that `‖∑ i, e q i * f i x‖ ^ 2 ≥ 1 - ε` on the cell `Q q`. Then `S(ρ[f⁽ⁿ⁾]) ≤ H(⋁_{t < n} T^{-t} Q) + n (ε + 2 |ι| √ε)`. -/ theorem vonNeumannEntropy_corrMatrix_orbit_le_ksEntropySeq [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : MeasurePreserving T μ μ) {J : Type*} [Fintype J] (Q : MeasurePartition μ J) (e : J → ι → ℂ) (he : ∀ q, ∑ i, ‖e q i‖ ^ 2 ≤ 1) {ε : ℝ} (hQ : ∀ q, ∀ x ∈ Q.cells q, 1 - ε ≤ ‖∑ i, e q i * P.toFun i x‖ ^ 2) (n : ℕ) : vonNeumannEntropy (P.orbit hP hT.measurable μ n).corrMatrix ≤ ksEntropySeq hT Q n + n * (ε + 2 * Fintype.card ι * Real.sqrt ε) := by set F := P.orbit hP hT.measurable μ n with hF have hFn : ∀ x, ∑ w, ‖F.toFun w x‖ ^ 2 = 1 := P.sum_norm_sq_orbit hP T n have hmix := F.corrMatrix_val_eq_sum_cond hFn (ksJoin hT Q n) refine (vonNeumannEntropy_le_mixture_of_le _ _ _ (fun a => measureReal_nonneg) hmix (C := n * (ε + 2 * Fintype.card ι * Real.sqrt ε)) fun a ha => ?_).trans_eq ?_ · have h : μ ((ksJoin hT Q n).cells a) ≠ 0 := fun h => ha (by rw [measureReal_def, h]; rfl) simp only [h, ↓reduceDIte] have := cond_isProbabilityMeasure (μ := μ) h refine P.vonNeumannEntropy_corrMatrix_orbit_le hP hT.measurable n _ (fun t => e (a t)) (fun t => he _) fun t => ?_ filter_upwards [ae_cond_mem ((ksJoin hT Q n).measurable a)] with x hx rw [ksJoin_cells, ksJoinCells_apply, Set.mem_iInter] at hx exact hQ _ _ (hx t) · rw [ksEntropySeq, entropy_def] rfl /-- Two complex numbers with the same integer parts of `N` times their real and imaginary parts are at distance at most `2 / N`. -/ theorem norm_sub_le_of_floor_eq {N : ℝ} (hN : 0 < N) {z z' : ℂ} (hre : ⌊N * z.re⌋ = ⌊N * z'.re⌋) (him : ⌊N * z.im⌋ = ⌊N * z'.im⌋) : ‖z - z'‖ ≤ 2 / N := by have h1 := Int.abs_sub_lt_one_of_floor_eq_floor hre have h2 := Int.abs_sub_lt_one_of_floor_eq_floor him rw [← mul_sub, abs_mul, abs_of_pos hN] at h1 h2 refine (Complex.norm_le_abs_re_add_abs_im _).trans ?_ rw [Complex.sub_re, Complex.sub_im, le_div_iff₀ hN] nlinarith /-- `⌊N x⌋ ∈ [-N, N]` for `|x| ≤ 1` and a natural number `N`. -/ theorem floor_mem_Icc_of_abs_le_one (N : ℕ) {x : ℝ} (hx : |x| ≤ 1) : ⌊(N : ℝ) * x⌋ ∈ Set.Icc (-(N : ℤ)) N := by have hN : (0 : ℝ) ≤ N := N.cast_nonneg obtain ⟨h1, h2⟩ := abs_le.mp hx constructor · rw [Int.le_floor]; push_cast; nlinarith · rw [Int.floor_le_iff]; push_cast; nlinarith /-- **Partition into pieces on which a partition of unity is nearly constant.** For a partition of unity `f` normalised at every point and `ε > 0` there are a finite measurable partition `Q` and vectors `e q` with `∑ i, ‖e q i‖ ^ 2 ≤ 1` such that `‖∑ i, e q i * f i x‖ ^ 2 ≥ 1 - ε` for every `x` in the cell `Q q`. The cells are the level sets of the integer parts of `N Re fᵢ` and `N Im fᵢ` for `N ≥ 4 |ι| / ε`, and `e q = conj (f (y))` for a point `y` of the cell. -/ theorem exists_measurePartition_near (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {ε : ℝ} (hε : 0 < ε) : ∃ (m : ℕ) (Q : MeasurePartition μ (Fin m)) (e : Fin m → ι → ℂ), (∀ q, ∑ i, ‖e q i‖ ^ 2 ≤ 1) ∧ ∀ q, ∀ x ∈ Q.cells q, 1 - ε ≤ ‖∑ i, e q i * P.toFun i x‖ ^ 2 := by classical set N : ℕ := ⌈4 * Fintype.card ι / ε⌉₊ + 1 with hN have hNpos : (0 : ℝ) < N := by rw [hN]; positivity have hNε : 4 * Fintype.card ι / N ≤ ε := by rw [div_le_iff₀ hNpos, hN] have h := Nat.le_ceil (4 * Fintype.card ι / ε) rw [div_le_iff₀ hε] at h push_cast nlinarith let φ : X → ι → ℤ × ℤ := fun x i => (⌊(N : ℝ) * (P.toFun i x).re⌋, ⌊(N : ℝ) * (P.toFun i x).im⌋) have hφ : Measurable φ := measurable_pi_iff.mpr fun i => ((measurable_const.mul (Complex.measurable_re.comp (P.measurable i))).floor).prodMk ((measurable_const.mul (Complex.measurable_im.comp (P.measurable i))).floor) have hfin : (Set.range φ).Finite := by refine (Set.Finite.pi (t := fun _ : ι => Set.Icc (-(N : ℤ)) N ×ˢ Set.Icc (-(N : ℤ)) N) fun _ => (Set.finite_Icc _ _).prod (Set.finite_Icc _ _)).subset ?_ rintro _ ⟨x, rfl⟩ refine Set.mem_univ_pi.mpr fun i => ⟨?_, ?_⟩ · exact floor_mem_Icc_of_abs_le_one N ((Complex.abs_re_le_norm _).trans (P.norm_le_one i x)) · exact floor_mem_Icc_of_abs_le_one N ((Complex.abs_im_le_norm _).trans (P.norm_le_one i x)) obtain ⟨m, Q, hQ⟩ := MeasurePartition.exists_fin_of_finite_range μ hφ hfin refine ⟨m, Q, fun q => if h : (Q.cells q).Nonempty then fun i => star (P.toFun i h.some) else 0, fun q => ?_, fun q x hx => ?_⟩ · dsimp only split_ifs with h · simp only [norm_star]; exact (hP _).le · simp · have h : (Q.cells q).Nonempty := ⟨x, hx⟩ simp only [h, ↓reduceDIte] set y := h.some have hxy := hQ q x hx y h.some_mem have hclose : ∀ i, ‖P.toFun i x - P.toFun i y‖ ≤ 2 / N := fun i => norm_sub_le_of_floor_eq hNpos (congrArg Prod.fst (congrFun hxy i)) (congrArg Prod.snd (congrFun hxy i)) have hy1 : ∑ i, star (P.toFun i y) * P.toFun i y = 1 := by rw [← Complex.ofReal_one, ← hP y, Complex.ofReal_sum] refine Finset.sum_congr rfl fun i _ => ?_ rw [Complex.star_def, Complex.conj_mul', Complex.ofReal_pow] have hsplit : ∑ i, star (P.toFun i y) * P.toFun i x = 1 + ∑ i, star (P.toFun i y) * (P.toFun i x - P.toFun i y) := by rw [← hy1, ← Finset.sum_add_distrib] exact Finset.sum_congr rfl fun i _ => by ring have hr : ‖∑ i, star (P.toFun i y) * (P.toFun i x - P.toFun i y)‖ ≤ Fintype.card ι * (2 / N) := by refine (norm_sum_le _ _).trans ?_ calc ∑ i, ‖star (P.toFun i y) * (P.toFun i x - P.toFun i y)‖ ≤ ∑ _i : ι, 2 / (N : ℝ) := Finset.sum_le_sum fun i _ => by rw [norm_mul, norm_star] exact (mul_le_of_le_one_left (norm_nonneg _) (P.norm_le_one i y)).trans (hclose i) _ = _ := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] have hlow : 1 - Fintype.card ι * (2 / N) ≤ ‖∑ i, star (P.toFun i y) * P.toFun i x‖ := by rw [hsplit] have := norm_sub_norm_le (1 : ℂ) (-∑ i, star (P.toFun i y) * (P.toFun i x - P.toFun i y)) rw [norm_neg, sub_neg_eq_add, norm_one] at this linarith have hd : 2 * (Fintype.card ι * (2 / N)) ≤ ε := by calc 2 * (Fintype.card ι * (2 / (N : ℝ))) = 4 * Fintype.card ι / N := by ring _ ≤ ε := hNε have hnn := norm_nonneg (∑ i, star (P.toFun i y) * P.toFun i x) nlinarith /-! ### Normalisation on a null set -/ /-- The partition of unity `P` modified on the null set where `∑ i, ‖f i x‖ ^ 2 ≠ 1`: there the functions are replaced by the indicator of `i₀`, so that the identity holds at every point. -/ def normalize [DecidableEq ι] (P : ClassicalOperationalPartition μ ι) (i₀ : ι) : ClassicalOperationalPartition μ ι where toFun i x := if ∑ j, ‖P.toFun j x‖ ^ 2 = 1 then P.toFun i x else if i = i₀ then 1 else 0 measurable i := Measurable.ite (measurableSet_eq_fun (Finset.measurable_sum _ fun j _ => (P.measurable j).norm.pow_const 2) measurable_const) (P.measurable i) measurable_const norm_le_one i x := by split_ifs · exact P.norm_le_one i x · simp · simp sum_norm_sq := Eventually.of_forall fun x => by split_ifs with h · exact h · rw [Finset.sum_eq_single i₀ (fun j _ hj => by simp [hj]) (by simp)] simp /-- The modified partition of unity satisfies `∑ i, ‖f i x‖ ^ 2 = 1` at every point. -/ theorem sum_norm_sq_normalize [DecidableEq ι] (P : ClassicalOperationalPartition μ ι) (i₀ : ι) (x : X) : ∑ i, ‖(P.normalize i₀).toFun i x‖ ^ 2 = 1 := by change ∑ i, ‖if ∑ j, ‖P.toFun j x‖ ^ 2 = 1 then P.toFun i x else if i = i₀ then 1 else 0‖ ^ 2 = 1 split_ifs with h · exact h · rw [Finset.sum_eq_single i₀ (fun j _ hj => by simp [hj]) (by simp)] simp /-- Modifying a partition of unity on a null set does not change the correlation matrices of its refinements. -/ theorem corrMatrix_refine_normalize [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) (i₀ : ι) {T : X → X} (hT : MeasurePreserving T μ μ) (n : ℕ) : ((P.normalize i₀).refine hT n).corrMatrix = (P.refine hT n).corrMatrix := by have hgood : ∀ᵐ x ∂μ, ∀ t : Fin n, ∑ j, ‖P.toFun j (T^[t] x)‖ ^ 2 = 1 := ae_all_iff.mpr fun t => (hT.iterate t).quasiMeasurePreserving.ae P.sum_norm_sq have heq : ∀ᵐ x ∂μ, ∀ w, ((P.normalize i₀).refine hT n).toFun w x = (P.refine hT n).toFun w x := by filter_upwards [hgood] with x hx w simp only [refine_toFun] exact Finset.prod_congr rfl fun t _ => by simp only [normalize, hx t, ↓reduceIte] refine DensityMatrix.ext (funext fun w => funext fun w' => ?_) simp only [corrMatrix_val_apply] refine integral_congr_ae ?_ filter_upwards [heq] with x hx rw [hx, hx] /-- Modifying a partition of unity on a null set does not change its entropy rate. -/ theorem alfEntropyRate_normalize [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) (i₀ : ι) {T : X → X} (hT : MeasurePreserving T μ μ) : (P.normalize i₀).alfEntropyRate hT = P.alfEntropyRate hT := by unfold alfEntropyRate simp_rw [P.corrMatrix_refine_normalize i₀ hT] /-! ### The upper bound -/ /-- For a partition of unity normalised at every point and `ε > 0`, there is a finite measurable partition `Q` with `H[f, T] ≤ h(T, Q) + ε + 2 |ι| √ε`. -/ theorem exists_alfEntropyRate_le_ksEntropyPartition_add [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : MeasurePreserving T μ μ) {ε : ℝ} (hε : 0 < ε) : ∃ (m : ℕ) (Q : MeasurePartition μ (Fin m)), P.alfEntropyRate hT ≤ ksEntropyPartition hT Q + (ε + 2 * Fintype.card ι * Real.sqrt ε) := by obtain ⟨m, Q, e, he, hQ⟩ := P.exists_measurePartition_near hP hε refine ⟨m, Q, ?_⟩ have hη : 0 ≤ ε + 2 * Fintype.card ι * Real.sqrt ε := by positivity have hlim := (tendsto_ksEntropySeq hT Q).add_const (ε + 2 * Fintype.card ι * Real.sqrt ε) rw [← hlim.limsup_eq] refine limsup_le_limsup (Eventually.of_forall fun n => ?_) ?_ hlim.isBoundedUnder_le · have h := P.vonNeumannEntropy_corrMatrix_orbit_le_ksEntropySeq hP hT Q e he hQ n change vonNeumannEntropy (P.orbit hP hT.measurable μ n).corrMatrix / n ≤ _ rcases n.eq_zero_or_pos with rfl | hn · simpa using hη · have hn' : (0 : ℝ) < n := by exact_mod_cast hn rw [div_le_iff₀ hn', add_mul, div_mul_cancel₀ _ hn'.ne'] linarith · 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 partition of unity normalised at every point is at most the Kolmogorov–Sinai entropy. -/ theorem alfEntropyRate_coe_le_ksEntropy_of_forall [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) (hP : ∀ x, ∑ i, ‖P.toFun i x‖ ^ 2 = 1) {T : X → X} (hT : MeasurePreserving T μ μ) : ((P.alfEntropyRate hT : ℝ) : EReal) ≤ ksEntropy hT := by rcases eq_or_ne (ksEntropy hT) ⊤ with htop | htop · rw [htop]; exact le_top have hbot : ksEntropy hT ≠ ⊥ := fun h => by have := ksEntropy_nonneg hT rw [h] at this exact absurd this (by simp) rw [← EReal.coe_toReal htop hbot, EReal.coe_le_coe_iff] have key : ∀ ε > 0, P.alfEntropyRate hT ≤ (ksEntropy hT).toReal + (ε + 2 * Fintype.card ι * Real.sqrt ε) := fun ε hε => by obtain ⟨m, Q, h⟩ := P.exists_alfEntropyRate_le_ksEntropyPartition_add hP hT hε have hQ := le_ksEntropy hT Q rw [← EReal.coe_toReal htop hbot, EReal.coe_le_coe_iff] at hQ linarith have hcont : Continuous fun ε : ℝ => (ksEntropy hT).toReal + (ε + 2 * Fintype.card ι * Real.sqrt ε) := by fun_prop have hlim : Tendsto (fun ε : ℝ => (ksEntropy hT).toReal + (ε + 2 * Fintype.card ι * Real.sqrt ε)) (𝓝[>] 0) (𝓝 (ksEntropy hT).toReal) := by have h0 := hcont.tendsto 0 simp only [Real.sqrt_zero, mul_zero, add_zero] at h0 exact h0.mono_left nhdsWithin_le_nhds exact ge_of_tendsto hlim (eventually_nhdsWithin_of_forall key) /-- **Alicki–Fannes entropy rate of a partition of unity is at most Kolmogorov–Sinai entropy.** For every finite operational partition of unity `f` of `L^∞(μ)`, `H[f, T] ≤ h_KS(T)`. -/ theorem alfEntropyRate_coe_le_ksEntropy [DecidableEq ι] [IsProbabilityMeasure μ] (P : ClassicalOperationalPartition μ ι) {T : X → X} (hT : MeasurePreserving T μ μ) : ((P.alfEntropyRate hT : ℝ) : EReal) ≤ ksEntropy hT := by obtain ⟨x, hx⟩ := P.sum_norm_sq.exists obtain ⟨i₀, -, -⟩ := Finset.exists_ne_zero_of_sum_ne_zero (hx ▸ one_ne_zero) rw [← P.alfEntropyRate_normalize i₀ hT] exact (P.normalize i₀).alfEntropyRate_coe_le_ksEntropy_of_forall (P.sum_norm_sq_normalize i₀) hT end ClassicalOperationalPartition open ClassicalOperationalPartition variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] {T : X → X} /-- **Alicki–Fannes entropy is at most Kolmogorov–Sinai entropy.** For a measure-preserving map `T` of a probability space, the Alicki–Fannes entropy over all finite operational partitions of unity of `L^∞(μ)` is at most `h_KS(T)`. -/ theorem alfDynamicalEntropyClassical_le_ksEntropy (hT : MeasurePreserving T μ μ) : alfDynamicalEntropyClassical μ hT ≤ ksEntropy hT := iSup_le fun _ => iSup_le fun P => P.alfEntropyRate_coe_le_ksEntropy hT /-- **The Alicki–Fannes theorem for classical systems.** For a measure-preserving map `T` of a probability space `(X, μ)`, the Kolmogorov–Sinai entropy equals the Alicki–Fannes dynamical entropy of the abelian system `(L^∞(μ), f ↦ f ∘ T, ∫ · dμ)` over all finite operational partitions of unity. -/ theorem ksEntropy_eq_alfDynamicalEntropyClassical (hT : MeasurePreserving T μ μ) : ksEntropy hT = alfDynamicalEntropyClassical μ hT := le_antisymm (ksEntropy_le_alfDynamicalEntropyClassical hT) (alfDynamicalEntropyClassical_le_ksEntropy hT) /-- **Kolmogorov–Sinai entropy as an Alicki–Fannes entropy.** For a measure-preserving map `T` of a probability space `(X, μ)`, `h_KS(T)` equals the Alicki–Fannes dynamical entropy `alfDynamicalEntropyClassical μ hT` over all finite operational partitions of unity of `L^∞(μ)` (the same statement as `ksEntropy_eq_alfDynamicalEntropyClassical`). -/ theorem ksEntropy_eq_alfDynamicalEntropy (hT : MeasurePreserving T μ μ) : ksEntropy hT = alfDynamicalEntropyClassical μ hT := ksEntropy_eq_alfDynamicalEntropyClassical hT /-- Restricting the Alicki–Fannes supremum to simple partitions of unity does not change it. -/ theorem alfDynamicalEntropySimple_eq_alfDynamicalEntropyClassical (hT : MeasurePreserving T μ μ) : alfDynamicalEntropySimple μ hT = alfDynamicalEntropyClassical μ hT := by rw [← ksEntropy_eq_alfDynamicalEntropySimple, ksEntropy_eq_alfDynamicalEntropyClassical] end ErgodicTheory.Quantum