/- 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.Entropy.Ruelle.LocalCount public import ErgodicTheory.Entropy.Ruelle.VolumeDistortion public import ErgodicTheory.Entropy.Ruelle.PositivePartProduct public import ErgodicTheory.Lyapunov.ExteriorNorm.Basic public import ErgodicTheory.Lyapunov.OseledetsLimit.SingularValues public import ErgodicTheory.Smooth.DerivativeCocycle public import ErgodicTheory.Lyapunov.Extensions.ExponentSums public import Mathlib.Analysis.SpecialFunctions.Log.PosLog /-! # The Margulis–Ruelle inequality `h_μ(T) ≤ ∑ λᵢ⁺` Let `T` be a `C¹` self-map of `EuclideanSpace ℝ (Fin d)` and `μ` an ergodic `T`-invariant probability measure supported on a compact set `K` (`μ Kᶜ = 0`). Then the Kolmogorov–Sinai entropy is bounded by the sum of the positive Lyapunov exponents of the derivative cocycle: `h_μ(T) ≤ ∑_{λᵢ > 0} λᵢ`. The compact-support hypothesis is the standard one (Ruelle 1978 states the inequality for `C¹` maps of compact manifolds); without some such hypothesis the inequality fails on non-compact spaces (Riquelme 2017). The Lyapunov exponents are those of any measurable matrix cocycle `A` with `det A ≠ 0` everywhere that agrees with the derivative matrix `μ`-almost everywhere (`ErgodicTheory.margulisRuelle_of_ae_eq_derivativeCocycle`). This allows `T` to have critical points on a `μ`-null set; when `det DT ≠ 0` everywhere one takes `A = derivativeCocycle T` (`ErgodicTheory.margulisRuelle_sharp`). ## Proof This is the classical argument (Ruelle 1978; Mañé, *Ergodic theory and differentiable dynamics*, §IV.12; Katok–Hasselblatt, Thm. S.2.13): 1. `h(T) = h(Tⁿ) / n` (`ErgodicTheory.Entropy.ksEntropy_iterate`). 2. `h(Tⁿ)` is bounded by `h(Tⁿ, P)` for fine dyadic grid partitions `P` (`ErgodicTheory.ksEntropy_le_of_gridPartition`). 3. `h(Tⁿ, P) ≤ ∑_Q μ(Q) log N_Q`, where `N_Q` counts the cells that `Tⁿ` maps a positive-measure part of `Q` into (`ErgodicTheory.Entropy.ksEntropyPartition_le_transitionCount`). 4. For fine grids, `N_Q ≤ C_d ∏ᵢ max(1, σᵢ(D_x Tⁿ))` at every `x ∈ Q ∩ K` (`ErgodicTheory.transitionCount_gridPartition_le`, uniform Taylor estimate plus the anisotropic SVD volume bound), so `h(Tⁿ) ≤ log C_d + ∫ log ∏ᵢ max(1, σᵢ(D_x Tⁿ)) dμ`. 5. By the Oseledets/Kingman limit, `(1/n) log ∏ᵢ max(1, σᵢ(D_x Tⁿ)) → ∑ λᵢ⁺` a.e. (`ErgodicTheory.tendsto_log_matVolProd_cocycle`), and it is bounded on orbits in `K`, so by dominated convergence `h(T) ≤ (log C_d + ∫ …)/n → ∑ λᵢ⁺`. ## Instances The hypotheses of `margulisRuelle_of_ae_eq_derivativeCocycle` are met, with positive entropy, by the Chebyshev map `x ↦ 2x² - 1` with the arcsine law (`ErgodicTheory.Examples.Chebyshev.pesin_formula_cheb`, where `h_μ(T) = ∑ λᵢ⁺ = log 2`); its derivative vanishes at `0`, a null set. The hypotheses of `margulisRuelle_sharp` (derivative invertible everywhere) are met by the identity with a Dirac mass (the `example` at the end of this file); in dimension one they force `h_μ(T) = 0`. ## Main definitions * `ErgodicTheory.matVolProd`: `∏ᵢ max(1, σᵢ(M))` for a square matrix `M`. ## Main results * `ErgodicTheory.continuous_matVolProd`: `matVolProd` is continuous (it is the maximum of the operator norms of the compound matrices). * `ErgodicTheory.tendsto_log_matVolProd_cocycle`: the a.e. orbit growth rate of `matVolProd`. * `ErgodicTheory.margulisRuelle_of_ae_eq_derivativeCocycle`: the Margulis–Ruelle inequality for a cocycle agreeing a.e. with the derivative. * `ErgodicTheory.margulisRuelle_sharp`: the Margulis–Ruelle inequality for the derivative cocycle. ## References * D. Ruelle, *An inequality for the entropy of differentiable maps*, Bol. Soc. Bras. Mat. **9** (1978) 83–87. * R. Mañé, *Ergodic theory and differentiable dynamics*, Springer 1987, §IV.12. * A. Katok, B. Hasselblatt, *Introduction to the modern theory of dynamical systems*, CUP 1995, Supplement, Thm. S.2.13. * F. Riquelme, *Counterexamples to Ruelle's inequality in the noncompact case*, Ann. Inst. Fourier **67** (2017) 23–41. -/ @[expose] public section open MeasureTheory Filter Topology Metric open scoped ENNReal Matrix.Norms.L2Operator namespace ErgodicTheory variable {d : ℕ} /-! ## The positive-part singular-value product of a matrix -/ /-- `∏ᵢ max(1, σᵢ(M))`, the positive-part singular-value product of a square matrix. -/ noncomputable def matVolProd (M : Matrix (Fin d) (Fin d) ℝ) : ℝ := linVolProd (Matrix.toEuclideanLin M) lemma one_le_matVolProd (M : Matrix (Fin d) (Fin d) ℝ) : 1 ≤ matVolProd M := one_le_linVolProd _ lemma matVolProd_pos (M : Matrix (Fin d) (Fin d) ℝ) : 0 < matVolProd M := one_pos.trans_le (one_le_matVolProd M) /-- `matVolProd M` is the largest of the operator norms of the compound matrices `C_k(M)`, `0 ≤ k ≤ d`. -/ lemma matVolProd_eq_sup' (M : Matrix (Fin d) (Fin d) ℝ) : matVolProd M = (Finset.range (d + 1)).sup' Finset.nonempty_range_add_one (fun k => ‖ExteriorNorm.compoundMatrix k M‖) := by rw [matVolProd, linVolProd, prod_max_one_eq_sup_prod_range (Matrix.toEuclideanLin M).singularValues_antitone (Matrix.toEuclideanLin M).singularValues_nonneg d] congr 1 funext k exact ExteriorNorm.prod_singularValues_eq_l2_opNorm_compound k M lemma continuous_compoundMatrix (k : ℕ) : Continuous fun M : Matrix (Fin d) (Fin d) ℝ => ExteriorNorm.compoundMatrix k M := by refine continuous_matrix fun t s => ?_ simp only [ExteriorNorm.compoundMatrix, Matrix.of_apply] exact (continuous_id.matrix_submatrix _ _).matrix_det /-- `matVolProd` is continuous. -/ theorem continuous_matVolProd : Continuous (matVolProd : Matrix (Fin d) (Fin d) ℝ → ℝ) := by have : (matVolProd : Matrix (Fin d) (Fin d) ℝ → ℝ) = fun M => (Finset.range (d + 1)).sup' Finset.nonempty_range_add_one (fun k => ‖ExteriorNorm.compoundMatrix k M‖) := funext matVolProd_eq_sup' rw [this] exact Continuous.finset_sup'_apply _ fun k _ => (continuous_compoundMatrix k).norm /-- `matVolProd M ≤ max(1, ‖M‖)ᵈ`. -/ lemma matVolProd_le_pow (M : Matrix (Fin d) (Fin d) ℝ) : matVolProd M ≤ max 1 ‖M‖ ^ d := by rw [matVolProd, linVolProd] calc ∏ i ∈ Finset.range d, max 1 ((Matrix.toEuclideanLin M).singularValues i) ≤ ∏ _i ∈ Finset.range d, max 1 ‖M‖ := Finset.prod_le_prod₀ (fun _ _ => zero_le_one.trans (le_max_left _ _)) fun i _ => max_le_max le_rfl (sigma_le_opNorm M i) _ = max 1 ‖M‖ ^ d := by rw [Finset.prod_const, Finset.card_range] /-! ## The orbit growth rate for a general cocycle -/ section Rate variable [NeZero d] {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] {T : X → X} (hT : Ergodic T μ) {A : X → Matrix (Fin d) (Fin d) ℝ} (hA : ∀ x, (A x).det ≠ 0) (hAm : Measurable A) (hint : IntegrableLogNorm A μ) (hint' : IntegrableLogNorm (fun x => (A x)⁻¹) μ) include hT hA hAm hint hint' in /-- The truncated exponents sum to the positive-exponent sum. -/ lemma sum_max_zero_exponents_eq_sumPosExp' : ∑ i : Fin d, max 0 (exponents hT hA hAm hint hint' i) = sumPosExp hT hA hAm hint hint' := by classical rw [sumPosExp, ← Finset.sum_filter_add_sum_filter_not Finset.univ (fun i => 0 < exponents hT hA hAm hint hint' i)] rw [Finset.sum_congr rfl (fun i hi => max_eq_right (le_of_lt (Finset.mem_filter.mp hi).2)), Finset.sum_eq_zero (fun i hi => max_eq_left (not_lt.mp (Finset.mem_filter.mp hi).2)), add_zero] /-- **The orbit growth rate.** For `μ`-a.e. `x`, `(1/n) log ∏ᵢ max(1, σᵢ(A⁽ⁿ⁾(x))) → ∑ λᵢ⁺`. -/ theorem tendsto_log_matVolProd_cocycle : ∀ᵐ x ∂μ, Tendsto (fun n : ℕ => (n : ℝ)⁻¹ * Real.log (matVolProd (cocycle A T n x))) atTop (𝓝 (sumPosExp hT hA hAm hint hint')) := by have hall : ∀ᵐ x ∂μ, ∀ i : Fin d, Tendsto (fun n : ℕ => (n : ℝ)⁻¹ * Real.log ((Matrix.toEuclideanLin (cocycle A T n x)).singularValues (i : ℕ))) atTop (𝓝 (exponents hT hA hAm hint hint' i)) := ae_all_iff.2 fun i => exponents_tendsto_log_singularValue hT hA hAm hint hint' i filter_upwards [hall] with x hx have hrw : ∀ n : ℕ, (n : ℝ)⁻¹ * Real.log (matVolProd (cocycle A T n x)) = ∑ i : Fin d, max 0 ((n : ℝ)⁻¹ * Real.log ((Matrix.toEuclideanLin (cocycle A T n x)).singularValues (i : ℕ))) := by intro n rw [matVolProd, linVolProd, ← Entropy.sum_posLog_singularValues_toEuclideanLin_eq, Finset.mul_sum, ← Fin.sum_univ_eq_sum_range] refine Finset.sum_congr rfl fun i _ => ?_ rw [Real.posLog_apply, mul_max_of_nonneg _ _ (by positivity), mul_zero] rw [← sum_max_zero_exponents_eq_sumPosExp' hT hA hAm hint hint'] refine (tendsto_finsetSum Finset.univ fun i _ => ?_).congr fun n => (hrw n).symm exact (tendsto_const_nhds (x := (0 : ℝ))).max (hx i) end Rate /-! ## Iterates of a `C¹` map and the chain rule along good orbits -/ lemma contDiff_iterate {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {T : E → E} (hT : ContDiff ℝ 1 T) (n : ℕ) : ContDiff ℝ 1 (T^[n]) := by induction n with | zero => exact contDiff_id | succ n ih => rw [Function.iterate_succ]; exact ih.comp hT lemma cocycle_eq_of_forall_iterate {X : Type*} {T : X → X} {A B : X → Matrix (Fin d) (Fin d) ℝ} {x : X} (h : ∀ m, A (T^[m] x) = B (T^[m] x)) (n : ℕ) : cocycle A T n x = cocycle B T n x := by induction n generalizing x with | zero => rfl | succ n ih => have h' : ∀ m, A (T^[m] (T x)) = B (T^[m] (T x)) := fun m => by have := h (m + 1); rwa [Function.iterate_succ_apply] at this have h0 : A x = B x := h 0 rw [cocycle_succ, cocycle_succ, ih h', h0] /-- Along an orbit on which `A` agrees with the derivative matrix, `matVolProd` of the cocycle is the positive-part singular-value product of the derivative of the iterate. -/ lemma linVolProd_fderiv_iterate_eq {T : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d)} (hT : Differentiable ℝ T) {A : EuclideanSpace ℝ (Fin d) → Matrix (Fin d) (Fin d) ℝ} {x : EuclideanSpace ℝ (Fin d)} (h : ∀ m, A (T^[m] x) = derivativeCocycle T (T^[m] x)) (n : ℕ) : linVolProd (fderiv ℝ (T^[n]) x : EuclideanSpace ℝ (Fin d) →ₗ[ℝ] EuclideanSpace ℝ (Fin d)) = matVolProd (cocycle A T n x) := by rw [← chainRule_cocycle hT n x, cocycle_eq_of_forall_iterate h n, matVolProd, Matrix.coe_toEuclideanCLM_eq_toEuclideanLin] /-- Cocycle norms along a good orbit: `‖A⁽ⁿ⁾(x)‖ ≤ Bⁿ` if `‖A‖ ≤ B` (with `1 ≤ B`) on the orbit. -/ lemma norm_cocycle_le_pow {X : Type*} {T : X → X} {A : X → Matrix (Fin d) (Fin d) ℝ} {B : ℝ} (hB : 1 ≤ B) {x : X} (h : ∀ m, ‖A (T^[m] x)‖ ≤ B) (n : ℕ) : ‖cocycle A T n x‖ ≤ B ^ n := by induction n generalizing x with | zero => rw [cocycle_zero, pow_zero, ← Matrix.l2_opNorm_toEuclideanCLM, map_one] exact ContinuousLinearMap.norm_id_le | succ n ih => rw [cocycle_succ, pow_succ] refine (Matrix.l2_opNorm_mul _ _).trans ?_ have h' : ∀ m, ‖A (T^[m] (T x))‖ ≤ B := fun m => by have := h (m + 1); rwa [Function.iterate_succ_apply] at this have h0 : ‖A x‖ ≤ B := h 0 exact mul_le_mul (ih h') h0 (norm_nonneg _) (by positivity) /-! ## The Margulis–Ruelle inequality -/ section MargulisRuelle variable [NeZero d] {μ : Measure (EuclideanSpace ℝ (Fin d))} [IsProbabilityMeasure μ] {T : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d)} omit [NeZero d] [IsProbabilityMeasure μ] in /-- The `μ`-full set of points whose whole forward orbit lies in `K` and on which `A` agrees with the derivative matrix. -/ lemma ae_goodOrbit (hT : MeasurePreserving T μ μ) {K : Set (EuclideanSpace ℝ (Fin d))} (hμK : μ Kᶜ = 0) {A : EuclideanSpace ℝ (Fin d) → Matrix (Fin d) (Fin d) ℝ} (hAT : ∀ᵐ x ∂μ, A x = derivativeCocycle T x) : ∀ᵐ x ∂μ, ∀ m, T^[m] x ∈ K ∧ A (T^[m] x) = derivativeCocycle T (T^[m] x) := by have hK : ∀ᵐ x ∂μ, x ∈ K := measure_eq_zero_iff_ae_notMem.1 hμK |>.mono fun x hx => by simpa using hx refine ae_all_iff.2 fun m => ?_ exact (hT.iterate m).quasiMeasurePreserving.ae (hK.and hAT) omit [NeZero d] [IsProbabilityMeasure μ] in /-- A bound `B ≥ 1` for the derivative matrix on the compact set `K`. -/ lemma exists_norm_derivativeCocycle_le (hT1 : ContDiff ℝ 1 T) {K : Set (EuclideanSpace ℝ (Fin d))} (hK : IsCompact K) : ∃ B : ℝ, 1 ≤ B ∧ ∀ x ∈ K, ‖derivativeCocycle T x‖ ≤ B := by have hcont : Continuous fun x => ‖fderiv ℝ T x‖ := (hT1.continuous_fderiv one_ne_zero).norm obtain ⟨B, hB⟩ := hK.exists_bound_of_continuousOn hcont.continuousOn refine ⟨max 1 B, le_max_left _ _, fun x hx => ?_⟩ have := hB x hx rw [Real.norm_of_nonneg (norm_nonneg _)] at this rw [← Matrix.l2_opNorm_toEuclideanCLM, toEuclideanCLM_derivativeCocycle] exact this.trans (le_max_right _ _) variable {K : Set (EuclideanSpace ℝ (Fin d))} {A : EuclideanSpace ℝ (Fin d) → Matrix (Fin d) (Fin d) ℝ} omit [NeZero d] [IsProbabilityMeasure μ] in /-- The a.e. bound `0 ≤ log matVolProd (A⁽ⁿ⁾ x) ≤ n · d · log B`. -/ lemma ae_log_matVolProd_le (hT : MeasurePreserving T μ μ) (hT1 : ContDiff ℝ 1 T) (hK : IsCompact K) (hμK : μ Kᶜ = 0) (hAT : ∀ᵐ x ∂μ, A x = derivativeCocycle T x) : ∃ B : ℝ, 1 ≤ B ∧ ∀ᵐ x ∂μ, ∀ n : ℕ, 0 ≤ Real.log (matVolProd (cocycle A T n x)) ∧ Real.log (matVolProd (cocycle A T n x)) ≤ n * (d * Real.log B) := by obtain ⟨B, hB, hBK⟩ := exists_norm_derivativeCocycle_le hT1 hK refine ⟨B, hB, ?_⟩ filter_upwards [ae_goodOrbit hT hμK hAT] with x hx n refine ⟨Real.log_nonneg (one_le_matVolProd _), ?_⟩ have hbd : ∀ m, ‖A (T^[m] x)‖ ≤ B := fun m => by rw [(hx m).2]; exact hBK _ (hx m).1 have hnorm := norm_cocycle_le_pow hB hbd n have hBn : 1 ≤ B ^ n := one_le_pow₀ hB calc Real.log (matVolProd (cocycle A T n x)) ≤ Real.log (max 1 ‖cocycle A T n x‖ ^ d) := Real.log_le_log (matVolProd_pos _) (matVolProd_le_pow _) _ ≤ Real.log ((B ^ n) ^ d) := Real.log_le_log (pow_pos (one_pos.trans_le (le_max_left _ _)) d) (pow_le_pow_left₀ (zero_le_one.trans (le_max_left _ _)) (max_le hBn hnorm) d) _ = n * (d * Real.log B) := by rw [← pow_mul, Real.log_pow]; push_cast; ring omit [NeZero d] [IsProbabilityMeasure μ] in lemma measurable_log_matVolProd_cocycle (hAm : Measurable A) (hTm : Measurable T) (n : ℕ) : Measurable fun x => Real.log (matVolProd (cocycle A T n x)) := Real.measurable_log.comp (continuous_matVolProd.measurable.comp (measurable_cocycle hAm hTm n)) omit [NeZero d] in lemma integrable_log_matVolProd_cocycle (hT : MeasurePreserving T μ μ) (hT1 : ContDiff ℝ 1 T) (hK : IsCompact K) (hμK : μ Kᶜ = 0) (hAm : Measurable A) (hAT : ∀ᵐ x ∂μ, A x = derivativeCocycle T x) (n : ℕ) : Integrable (fun x => Real.log (matVolProd (cocycle A T n x))) μ := by obtain ⟨B, -, hB⟩ := ae_log_matVolProd_le hT hT1 hK hμK hAT refine Integrable.mono' (integrable_const (n * (d * Real.log B))) (measurable_log_matVolProd_cocycle hAm hT.measurable n).aestronglyMeasurable ?_ filter_upwards [hB] with x hx rw [Real.norm_of_nonneg (hx n).1] exact (hx n).2 /-- **The entropy of `Tⁿ` is bounded by the averaged log volume factor.** -/ theorem ksEntropy_iterate_le_integral (hT : MeasurePreserving T μ μ) (hT1 : ContDiff ℝ 1 T) (hK : IsCompact K) (hμK : μ Kᶜ = 0) (hAm : Measurable A) (hAT : ∀ᵐ x ∂μ, A x = derivativeCocycle T x) (n : ℕ) : Entropy.ksEntropy (hT.iterate n) ≤ ((Real.log (1 + (12 * d) ^ d) + ∫ x, Real.log (matVolProd (cocycle A T n x)) ∂μ : ℝ) : EReal) := by set C : ℝ := 1 + (12 * d) ^ d with hC have hC1 : 1 ≤ C := by rw [hC]; have : (0 : ℝ) ≤ (12 * d) ^ d := by positivity linarith set f : EuclideanSpace ℝ (Fin d) → ℝ := fun x => Real.log C + Real.log (matVolProd (cocycle A T n x)) with hf have hfint : Integrable f μ := (integrable_const _).add (integrable_log_matVolProd_cocycle hT hT1 hK hμK hAm hAT n) refine ksEntropy_le_of_gridPartition (hT.iterate n) ?_ have hgood := ae_goodOrbit hT hμK hAT have hdiff : Differentiable ℝ T := hT1.differentiable one_ne_zero filter_upwards [transitionCount_gridPartition_le (μ := μ) (contDiff_iterate hT1 n) hK hμK] with k hk refine (Entropy.ksEntropyPartition_le_transitionCount (hT.iterate n) _).trans ?_ have hint_eq : ∫ x, f x ∂μ = ∑ c, ∫ x in gridCell k c, f x ∂μ := by rw [← integral_iUnion_fintype (measurableSet_gridCell k) (fun c c' hcc' => Set.disjoint_left.2 fun x hx hx' => hcc' (hx.symm.trans hx')) (fun c => hfint.integrableOn)] rw [show (⋃ c, gridCell k c) = Set.univ from (gridPartition μ k).cover, setIntegral_univ] rw [show Real.log C + ∫ x, Real.log (matVolProd (cocycle A T n x)) ∂μ = ∫ x, f x ∂μ by rw [hf, integral_add (integrable_const _) (integrable_log_matVolProd_cocycle hT hT1 hK hμK hAm hAT n), integral_const, probReal_univ, one_smul], hint_eq] refine Finset.sum_le_sum fun c _ => ?_ rw [gridPartition_cells, ← smul_eq_mul, ← Measure.real_def, ← setIntegral_const] refine setIntegral_mono_ae_restrict (integrable_const _).integrableOn hfint.integrableOn ?_ -- At a.e. point of the cell, the log transition count is bounded by `f`. have hK' : ∀ᵐ x ∂μ, x ∈ K := measure_eq_zero_iff_ae_notMem.1 hμK |>.mono fun x hx => by simpa using hx refine (ae_restrict_iff' (measurableSet_gridCell k c)).2 ?_ filter_upwards [hgood, hK'] with x hx hxK hxc have hN := hk c x ⟨hxc, hxK⟩ rw [linVolProd_fderiv_iterate_eq hdiff (fun m => (hx m).2) n] at hN have hV := one_le_matVolProd (cocycle A T n x) simp only [hf] rw [← Real.log_mul (by positivity) (matVolProd_pos _).ne'] refine Real.log_le_log (by exact_mod_cast lt_of_lt_of_le one_pos (le_max_left _ _)) ?_ push_cast refine max_le ?_ hN nlinarith /-- `n • x ≤ c` in `EReal` (with `n ≥ 1`) gives `x ≤ c / n`. -/ lemma EReal.le_div_of_nsmul_le {x : EReal} {n : ℕ} (hn : 1 ≤ n) {c : ℝ} (h : n • x ≤ (c : EReal)) : x ≤ ((c / n : ℝ) : EReal) := by have hn0 : (0 : ℝ) < n := by exact_mod_cast hn induction x using EReal.rec with | bot => exact bot_le | top => exfalso have htop : ∀ m : ℕ, (m + 1) • (⊤ : EReal) = ⊤ := by intro m induction m with | zero => simp | succ m ih => rw [succ_nsmul, ih]; simp have : n • (⊤ : EReal) = ⊤ := by obtain ⟨m, rfl⟩ : ∃ m, n = m + 1 := ⟨n - 1, by omega⟩ exact htop m rw [this] at h exact EReal.coe_ne_top c (top_le_iff.1 h) | coe r => rw [← EReal.coe_nsmul, nsmul_eq_mul, EReal.coe_le_coe_iff] at h rw [EReal.coe_le_coe_iff, le_div_iff₀ hn0, mul_comm] exact h variable (hT : Ergodic T μ) (hT1 : ContDiff ℝ 1 T) (hK : IsCompact K) (hμK : μ Kᶜ = 0) (hA : ∀ x, (A x).det ≠ 0) (hAm : Measurable A) (hint : IntegrableLogNorm A μ) (hint' : IntegrableLogNorm (fun x => (A x)⁻¹) μ) (hAT : ∀ᵐ x ∂μ, A x = derivativeCocycle T x) include hT hT1 hK hμK hA hAm hint hint' hAT in /-- **The Margulis–Ruelle inequality, for a cocycle agreeing a.e. with the derivative.** Let `T` be a `C¹` self-map of `EuclideanSpace ℝ (Fin d)`, `μ` an ergodic `T`-invariant probability measure with `μ Kᶜ = 0` for a compact set `K`, and `A` a measurable invertible matrix cocycle with log-integrable norms of `A` and `A⁻¹` such that `A = DT` `μ`-almost everywhere. Then `h_μ(T) ≤ ∑ λᵢ⁺`, the sum of the positive Lyapunov exponents of `A`. -/ theorem margulisRuelle_of_ae_eq_derivativeCocycle : Entropy.ksEntropy hT.toMeasurePreserving ≤ ((sumPosExp hT hA hAm hint hint' : ℝ) : EReal) := by have hmp := hT.toMeasurePreserving set L := sumPosExp hT hA hAm hint hint' set c : ℕ → ℝ := fun n => (Real.log (1 + (12 * d) ^ d) + ∫ x, Real.log (matVolProd (cocycle A T n x)) ∂μ) / n with hc -- `h(T) ≤ cₙ` for all `n ≥ 1`. have hle : ∀ n : ℕ, 1 ≤ n → Entropy.ksEntropy hmp ≤ ((c n : ℝ) : EReal) := by intro n hn have h1 := ksEntropy_iterate_le_integral hmp hT1 hK hμK hAm hAT n rw [Entropy.ksEntropy_iterate hmp] at h1 exact EReal.le_div_of_nsmul_le hn h1 -- `cₙ → ∑ λᵢ⁺`. have hlim : Tendsto c atTop (𝓝 L) := by obtain ⟨B, -, hB⟩ := ae_log_matVolProd_le hmp hT1 hK hμK hAT have hdom : Tendsto (fun n : ℕ => ∫ x, (n : ℝ)⁻¹ * Real.log (matVolProd (cocycle A T n x)) ∂μ) atTop (𝓝 (∫ _x, L ∂μ)) := by refine tendsto_integral_of_dominated_convergence (fun _ => |d * Real.log B|) (fun n => ((measurable_log_matVolProd_cocycle hAm hmp.measurable n).const_mul _).aestronglyMeasurable) (integrable_const _) (fun n => ?_) (tendsto_log_matVolProd_cocycle hT hA hAm hint hint') filter_upwards [hB] with x hx rcases Nat.eq_zero_or_pos n with rfl | hn · simp only [Nat.cast_zero, inv_zero, zero_mul, norm_zero]; exact abs_nonneg _ have hn0 : (0 : ℝ) < n := by exact_mod_cast hn rw [Real.norm_of_nonneg (mul_nonneg (by positivity) (hx n).1)] calc (n : ℝ)⁻¹ * Real.log (matVolProd (cocycle A T n x)) ≤ (n : ℝ)⁻¹ * (n * (d * Real.log B)) := mul_le_mul_of_nonneg_left (hx n).2 (by positivity) _ = d * Real.log B := by field_simp _ ≤ |d * Real.log B| := le_abs_self _ rw [integral_const, probReal_univ, one_smul] at hdom have h0 : Tendsto (fun n : ℕ => Real.log (1 + (12 * d) ^ d) / n) atTop (𝓝 0) := tendsto_const_nhds.div_atTop tendsto_natCast_atTop_atTop have hsum := h0.add hdom rw [zero_add] at hsum refine hsum.congr' ?_ filter_upwards [eventually_ge_atTop 1] with n hn simp only [hc] rw [add_div, integral_const_mul, div_eq_inv_mul (∫ x, _ ∂μ)] -- Pass to the limit in `EReal`. induction h : Entropy.ksEntropy hmp using EReal.rec with | bot => exact bot_le | top => have := hle 1 le_rfl rw [h] at this exact absurd (top_le_iff.1 this) (EReal.coe_ne_top _) | coe r => rw [EReal.coe_le_coe_iff] refine ge_of_tendsto hlim ?_ filter_upwards [eventually_ge_atTop 1] with n hn have := hle n hn rwa [h, EReal.coe_le_coe_iff] at this end MargulisRuelle section Classical variable [NeZero d] {μ : Measure (EuclideanSpace ℝ (Fin d))} [IsProbabilityMeasure μ] {T : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d)} (hT : Ergodic T μ) (hdet : ∀ x, (derivativeCocycle T x).det ≠ 0) (hint : IntegrableLogNorm (derivativeCocycle T) μ) (hint' : IntegrableLogNorm (fun x => (derivativeCocycle T x)⁻¹) μ) include hT hdet hint hint' in /-- **The Margulis–Ruelle inequality** `h_μ(T) ≤ ∑ λᵢ⁺`. For a `C¹` self-map `T` of `EuclideanSpace ℝ (Fin d)` with everywhere invertible derivative and an ergodic invariant probability measure `μ` supported on a compact set `K` (`μ Kᶜ = 0`), the Kolmogorov–Sinai entropy is at most the sum of the positive Lyapunov exponents of the derivative cocycle. -/ theorem margulisRuelle_sharp (hT1 : ContDiff ℝ 1 T) {K : Set (EuclideanSpace ℝ (Fin d))} (hK : IsCompact K) (hμK : μ Kᶜ = 0) : Entropy.ksEntropy hT.toMeasurePreserving ≤ ((sumPosExp hT hdet (measurable_derivativeCocycle T) hint hint' : ℝ) : EReal) := margulisRuelle_of_ae_eq_derivativeCocycle hT hT1 hK hμK hdet (measurable_derivativeCocycle T) hint hint' (Eventually.of_forall fun _ => rfl) end Classical section Examples /-! The hypotheses of `margulisRuelle_sharp` are jointly satisfiable: the identity of `EuclideanSpace ℝ (Fin 1)` with a Dirac mass. (Every `C¹` map of `ℝ` with nonvanishing derivative is strictly monotone, so in dimension one the entropy is `0` for every instance; the positive-entropy instances of the inequality, with critical points, go through `margulisRuelle_of_ae_eq_derivativeCocycle`.) -/ /-- The derivative cocycle of the identity is the identity matrix. -/ theorem derivativeCocycle_id (x : EuclideanSpace ℝ (Fin d)) : derivativeCocycle (id : EuclideanSpace ℝ (Fin d) → _) x = 1 := by simp [derivativeCocycle, ContinuousLinearMap.one_def] example (x₀ : EuclideanSpace ℝ (Fin 1)) : ∃ (herg : Ergodic (id : EuclideanSpace ℝ (Fin 1) → _) (Measure.dirac x₀)) (hdet : ∀ x, (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _) x).det ≠ 0) (hint : IntegrableLogNorm (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _)) (Measure.dirac x₀)) (hint' : IntegrableLogNorm (fun x => (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _) x)⁻¹) (Measure.dirac x₀)), Entropy.ksEntropy herg.toMeasurePreserving ≤ ((sumPosExp herg hdet (measurable_derivativeCocycle _) hint hint' : ℝ) : EReal) := by have herg : Ergodic (id : EuclideanSpace ℝ (Fin 1) → _) (Measure.dirac x₀) := by refine ⟨MeasurePreserving.id _, ⟨fun s _ _ => ?_⟩⟩ rw [Filter.eventuallyEmptyOrUniv_iff, ae_dirac_eq, Filter.eventually_pure, Filter.eventually_pure] exact em _ have hdet : ∀ x, (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _) x).det ≠ 0 := by intro x; simp [derivativeCocycle_id] have hint : IntegrableLogNorm (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _)) (Measure.dirac x₀) := by simp only [IntegrableLogNorm, derivativeCocycle_id]; exact integrable_const _ have hint' : IntegrableLogNorm (fun x => (derivativeCocycle (id : EuclideanSpace ℝ (Fin 1) → _) x)⁻¹) (Measure.dirac x₀) := by simp only [IntegrableLogNorm, derivativeCocycle_id, inv_one]; exact integrable_const _ exact ⟨herg, hdet, hint, hint', margulisRuelle_sharp herg hdet hint hint' contDiff_id (isCompact_singleton (x := x₀)) (by simp)⟩ end Examples end ErgodicTheory