/- 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.Krieger.FiniteGenerator public import ErgodicTheory.Entropy.GeneratorTheoremTwoSided /-! # The two-sided generator theorem mod 0 and the entropy of Krieger's generator Kolmogorov–Sinai entropy only sees the measure algebra, so the generator theorem holds for generators mod 0. This file proves the two-sided version: if `P` two-sidedly generates `(α, e, μ)` mod 0 (`IsGeneratingTwoSidedMod0 e P`: every measurable set agrees `μ`-a.e. with a set determined by the two-sided `P`-itinerary), then `h(e) = h(e, P)`. Combined with Krieger's finite generator theorem this computes the entropy through the `k`-cell generator it produces: `h(e) = h(e, P) ≤ log k`. ## Main results * `ErgodicTheory.Entropy.ksEntropy_eq_ksEntropyPartition_of_isGeneratingTwoSidedMod0`: the two-sided Kolmogorov–Sinai generator theorem mod 0. * `ErgodicTheory.Krieger.krieger_finite_generator_entropy`: Krieger's generator `P` with `k` cells satisfies `h(e) = h(e, P) ≤ log k`. ## References * Peter Walters, *An Introduction to Ergodic Theory*, GTM **79**, Springer (1982), §4.6. * W. Krieger, *On entropy and generators of measure-preserving transformations*, Trans. Amer. Math. Soc. **149** (1970), 453–464. -/ @[expose] public section open MeasureTheory Filter universe u namespace ErgodicTheory.Entropy open ErgodicTheory.Krieger variable {α : Type*} [mα : MeasurableSpace α] [StandardBorelSpace α] {μ : Measure α} [IsProbabilityMeasure μ] omit [StandardBorelSpace α] [IsProbabilityMeasure μ] in /-- The two-sided saturation of a partition is a sub-σ-algebra of the ambient one. -/ lemma twoSidedSat_le {ι : Type*} [Fintype ι] (e : α ≃ᵐ α) (he : MeasurePreserving (⇑e) μ μ) (P : MeasurePartition μ ι) : twoSidedSat e P ≤ mα := iSup_le fun j => (MeasurableSpace.comap_mono (generatedSigmaAlgebra_le P)).trans (measurePreserving_ziter e he j).measurable.comap_le /-- **The two-sided Kolmogorov–Sinai generator theorem, mod 0.** For a measure-preserving automorphism `e` of a standard Borel probability space and a finite partition `P` that two-sidedly generates mod 0, `h(e) = h(e, P)`. For every finite partition `Q`, `h(e, Q) ≤ h(e, P) + H(Q | twoSidedSat e P)` (`ksEntropyPartition_le_add_condEntropy_twoSided`), and the conditional entropy vanishes because every cell of `Q` is measurable for the `μ`-completion of `twoSidedSat e P` (`condEntropy_eq_zero_of_ae_measurable`). -/ theorem ksEntropy_eq_ksEntropyPartition_of_isGeneratingTwoSidedMod0 (e : α ≃ᵐ α) (he : MeasurePreserving (⇑e) μ μ) {n : ℕ} (P : MeasurePartition μ (Fin n)) (hgen : IsGeneratingTwoSidedMod0 e P) : ksEntropy he = ((ksEntropyPartition he P : ℝ) : EReal) := by refine le_antisymm ?_ (le_ksEntropy he P) refine iSup_le fun m => iSup_le fun Q => ?_ rw [EReal.coe_le_coe_iff] have hbound := ksEntropyPartition_le_add_condEntropy_twoSided e he P Q have hzero : condEntropy μ (twoSidedSat e P) Q.cells = 0 := condEntropy_eq_zero_of_ae_measurable (twoSidedSat_le e he P) Q fun i => hgen _ (Q.measurable i) rw [← twoSidedSat_def, hzero, add_zero] at hbound exact hbound end ErgodicTheory.Entropy namespace ErgodicTheory.Krieger open ErgodicTheory.Entropy /-- **The entropy of Krieger's generator.** Let `e` be an ergodic, aperiodic, measure-preserving automorphism of a standard Borel probability space with `h(e) < log k`. Then the `k`-cell two-sided generator mod 0 `P` of Krieger's theorem computes the entropy: `h(e) = h(e, P) ≤ log k`. -/ theorem krieger_finite_generator_entropy {α : Type u} [MeasurableSpace α] [StandardBorelSpace α] {μ : Measure α} [IsProbabilityMeasure μ] {e : α ≃ᵐ α} (he : MeasurePreserving (e : α → α) μ μ) (herg : Ergodic (e : α → α) μ) (hap : Aperiodic e μ) {k : ℕ} (hk : ksEntropy he < ((Real.log k : ℝ) : EReal)) : ∃ P : MeasurePartition μ (Fin k), IsGeneratingTwoSidedMod0 e P ∧ ksEntropy he = ((ksEntropyPartition he P : ℝ) : EReal) ∧ ksEntropyPartition he P ≤ Real.log k := by obtain ⟨P, hP⟩ := krieger_finite_generator he herg hap hk have : Nonempty (Fin k) := P.index_nonempty refine ⟨P, hP, ksEntropy_eq_ksEntropyPartition_of_isGeneratingTwoSidedMod0 e he P hP, ?_⟩ calc ksEntropyPartition he P ≤ entropy μ P.cells := ksEntropyPartition_le_entropy he P _ ≤ Real.log (Fintype.card (Fin k)) := entropy_le_log_card_partition P _ = Real.log k := by rw [Fintype.card_fin] end ErgodicTheory.Krieger