|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Lua Viana Reis. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Lua Viana Reis, Oliver Butterley |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.Dynamics.BirkhoffSum.Average |
| 9 | +public import Mathlib.MeasureTheory.MeasurableSpace.Invariants |
| 10 | +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic |
| 11 | +import Mathlib.Algebra.Order.Group.PartialSups |
| 12 | +import Mathlib.Algebra.Order.Ring.Star |
| 13 | +import Mathlib.Data.Real.StarOrdered |
| 14 | +import Mathlib.Dynamics.BirkhoffSum.QuasiMeasurePreserving |
| 15 | +import Mathlib.MeasureTheory.Integral.DominatedConvergence |
| 16 | +import Mathlib.Topology.Algebra.Module.WeakDual |
| 17 | + |
| 18 | +/-! |
| 19 | +# Pointwise Ergodic Theorem |
| 20 | +
|
| 21 | +The Pointwise Ergodic Theorem, also known as Birkhoff's Ergodic Theorem, establishes the convergence |
| 22 | +of time averages for dynamical systems. |
| 23 | +
|
| 24 | +Let `(α, μ)` be a probability space and `f: α → α` be a measure-preserving transformation. The |
| 25 | +result states that, for any integrable function `φ ∈ L¹(μ)`, the time averages |
| 26 | +`(1/n)∑_{k=0}^{n-1} φ(f^k x)` converge almost everywhere as `n → ∞` to a limit function `φ*`. |
| 27 | +Moreover the limit function `φ*` is essentially `f`-invariant and integrable with `∫φ* dμ = ∫φ dμ`. |
| 28 | +If the system is ergodic, then `φ*` equals the constant `∫f dμ` almost everywhere. |
| 29 | +
|
| 30 | +The limit function `φ*` is equal to the conditional expectation of `φ` with respect to the σ-algebra |
| 31 | +of `f`-invariant sets. This is used explicitly during this proof and also in the main statement. |
| 32 | +
|
| 33 | +## Main statements |
| 34 | +
|
| 35 | +* `ae_tendsTo_birkhoffAverage_condExp`: time average coincides with conditional expectation |
| 36 | +
|
| 37 | +-/ |
| 38 | + |
| 39 | +variable {α : Type*} |
| 40 | + |
| 41 | +section BirkhoffMax |
| 42 | + |
| 43 | +/-- The maximum of `birkhoffSum f g i` for `i` ranging from `0` to `n`. -/ |
| 44 | +def birkhoffMax (f : α → α) (g : α → ℝ) : ℕ →o (α → ℝ) := partialSups (birkhoffSum f g) |
| 45 | + |
| 46 | +lemma birkhoffMax_nonneg {f : α → α} {g n} : |
| 47 | + 0 ≤ birkhoffMax f g n := by |
| 48 | + apply (le_partialSups_of_le _ n.zero_le).trans' |
| 49 | + rfl |
| 50 | + |
| 51 | +lemma birkhoffMax_succ {f : α → α} {g n} : |
| 52 | + birkhoffMax f g (n + 1) = 0 ⊔ (g + birkhoffMax f g n ∘ f) := by |
| 53 | + have : birkhoffSum f g ∘ Nat.succ = fun k ↦ g + birkhoffSum f g k ∘ f := by |
| 54 | + funext |
| 55 | + exact birkhoffSum_succ' .. |
| 56 | + erw [partialSups_succ', this, partialSups_const_add, birkhoffSum_zero'] |
| 57 | + funext |
| 58 | + simp [birkhoffMax, partialSups] |
| 59 | + |
| 60 | +example (p : Prop) (h : False ∨ p) : p := h.elim (·.elim) id |
| 61 | + |
| 62 | +lemma birkhoffMax_succ' {f : α → α} {g n x} (hpos : 0 < birkhoffMax f g (n + 1) x) : |
| 63 | + birkhoffMax f g (n + 1) x = g x + birkhoffMax f g n (f x) := by |
| 64 | + erw [birkhoffMax_succ, lt_sup_iff] at hpos |
| 65 | + cases hpos with |
| 66 | + | inl h => absurd h; exact lt_irrefl 0 |
| 67 | + | inr h => |
| 68 | + erw [birkhoffMax_succ, Pi.sup_apply, sup_of_le_right h.le] |
| 69 | + rfl |
| 70 | + |
| 71 | +lemma birkhoffMax_comp_le_succ {f : α → α} {g n} : |
| 72 | + birkhoffMax f g n ≤ birkhoffMax f g (n + 1) := by |
| 73 | + gcongr |
| 74 | + exact n.le_succ |
| 75 | + |
| 76 | +lemma birkhoffMax_le_birkhoffMax {f : α → α} {g n x} (hpos : 0 < birkhoffMax f g n x) : |
| 77 | + birkhoffMax f g n x ≤ g x + birkhoffMax f g n (f x) := by |
| 78 | + match n with |
| 79 | + | 0 => absurd hpos; exact lt_irrefl 0 |
| 80 | + | n + 1 => |
| 81 | + apply le_of_eq_of_le (birkhoffMax_succ' hpos) |
| 82 | + apply add_le_add_right |
| 83 | + exact birkhoffMax_comp_le_succ (f x) |
| 84 | + |
| 85 | +lemma birkhoffMax_pos_of_mem_support {f : α → α} {g : α → ℝ} {n x} |
| 86 | + (hx : x ∈ (birkhoffMax f g n).support) : 0 < birkhoffMax f g n x := by |
| 87 | + apply lt_or_gt_of_ne at hx |
| 88 | + cases hx with |
| 89 | + | inl h => |
| 90 | + absurd h; exact (birkhoffMax_nonneg x).not_gt |
| 91 | + | inr h => exact h |
| 92 | + |
| 93 | +-- TODO: move elsewhere |
| 94 | +@[measurability] |
| 95 | +lemma birkhoffSum_measurable [MeasurableSpace α] {f : α → α} (hf : Measurable f) {g : α → ℝ} |
| 96 | + (hg : Measurable g) {n} : Measurable (birkhoffSum f g n) := by |
| 97 | + apply Finset.measurable_sum |
| 98 | + measurability |
| 99 | + |
| 100 | +@[measurability] |
| 101 | +lemma birkhoffMax_measurable [MeasurableSpace α] {f : α → α} (hf : Measurable f) {g : α → ℝ} |
| 102 | + (hg : Measurable g) {n} : Measurable (birkhoffMax f g n) := by |
| 103 | + unfold birkhoffMax |
| 104 | + induction n <;> measurability |
| 105 | + |
| 106 | +section MeasurePreserving |
| 107 | + |
| 108 | +open MeasureTheory Measure MeasurableSpace Filter Topology |
| 109 | + |
| 110 | +variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {g : α → ℝ} {n} |
| 111 | + (hf : MeasurePreserving f μ μ) (hg : Integrable g μ) |
| 112 | + |
| 113 | +include hf |
| 114 | + |
| 115 | +@[measurability] |
| 116 | +lemma birkhoffSum_aestronglyMeasurable (hg : AEStronglyMeasurable g μ) : |
| 117 | + AEStronglyMeasurable (birkhoffSum f g n) μ := by |
| 118 | + apply Finset.aestronglyMeasurable_fun_sum |
| 119 | + exact fun i _ => hg.comp_measurePreserving (hf.iterate i) |
| 120 | + |
| 121 | +@[measurability] |
| 122 | +lemma birkhoffMax_aestronglyMeasurable (hg : AEStronglyMeasurable g μ) : |
| 123 | + AEStronglyMeasurable (birkhoffMax f g n) μ := by |
| 124 | + unfold birkhoffMax |
| 125 | + induction n <;> measurability |
| 126 | + |
| 127 | +include hg |
| 128 | + |
| 129 | +-- TODO: move elsewhere |
| 130 | +lemma birkhoffSum_integrable : Integrable (birkhoffSum f g n) μ := |
| 131 | + integrable_finset_sum _ fun _ _ ↦ (hf.iterate _).integrable_comp_of_integrable hg |
| 132 | + |
| 133 | +lemma birkhoffMax_integrable : Integrable (birkhoffMax f g n) μ := by |
| 134 | + unfold birkhoffMax |
| 135 | + induction n with |
| 136 | + | zero => exact integrable_zero .. |
| 137 | + | succ n hn => simpa using Integrable.sup hn (birkhoffSum_integrable μ hf hg) |
| 138 | + |
| 139 | +lemma birkhoffMax_integral_le : |
| 140 | + ∫ x, birkhoffMax f g n x ∂μ ≤ |
| 141 | + ∫ x in (birkhoffMax f g n).support, g x ∂μ + |
| 142 | + ∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by |
| 143 | + have := hf.integrable_comp_of_integrable (birkhoffMax_integrable μ hf hg (n := n)) |
| 144 | + rw [←integral_add hg.restrict, ←setIntegral_support] |
| 145 | + · apply setIntegral_mono_on₀ |
| 146 | + · exact (birkhoffMax_integrable μ hf hg).restrict |
| 147 | + · exact .add hg.restrict this.restrict |
| 148 | + · exact AEStronglyMeasurable.nullMeasurableSet_support (by measurability) |
| 149 | + · intro x hx |
| 150 | + exact birkhoffMax_le_birkhoffMax (birkhoffMax_pos_of_mem_support hx) |
| 151 | + · exact this.restrict |
| 152 | + |
| 153 | +lemma setIntegral_nonneg_on_birkhoffMax_support : |
| 154 | + 0 ≤ ∫ x in (birkhoffMax f g n).support, g x ∂μ := by |
| 155 | + have hg₁ : AEStronglyMeasurable (birkhoffMax f g n) μ := by measurability |
| 156 | + have hg₂ : Integrable (birkhoffMax f g n) μ := birkhoffMax_integrable μ hf hg |
| 157 | + have hg₃ : Integrable (birkhoffMax f g n ∘ f) μ := hf.integrable_comp_of_integrable hg₂ |
| 158 | + calc |
| 159 | + 0 ≤ ∫ x in (birkhoffMax f g n).supportᶜ, birkhoffMax f g n (f x) ∂μ := by |
| 160 | + exact integral_nonneg (fun x => birkhoffMax_nonneg (f x)) |
| 161 | + _ = ∫ x, birkhoffMax f g n (f x) ∂μ - |
| 162 | + ∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by |
| 163 | + exact setIntegral_compl₀ hg₁.nullMeasurableSet_support hg₃ |
| 164 | + _ = ∫ x, birkhoffMax f g n x ∂μ - |
| 165 | + ∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by |
| 166 | + rw [←integral_map hf.aemeasurable (hf.map_eq.symm ▸ hg₁), hf.map_eq] |
| 167 | + _ ≤ ∫ x in (birkhoffMax f g n).support, g x ∂μ := by |
| 168 | + grw [birkhoffMax_integral_le μ hf hg] |
| 169 | + grind |
| 170 | + |
| 171 | +end MeasurePreserving |
| 172 | + |
| 173 | +end BirkhoffMax |
| 174 | + |
| 175 | +section PR -- todo: separate PR |
| 176 | + |
| 177 | +variable {ι α : Type*} [Preorder ι] [LocallyFiniteOrderBot ι] [LinearOrder α] |
| 178 | + |
| 179 | +theorem partialSups_exists (f : ι → α) (i : ι) : |
| 180 | + ∃ j ≤ i, partialSups f i = f j := by |
| 181 | + obtain ⟨j, hj⟩ : ∃ j ∈ Finset.Iic i, ∀ k ∈ Finset.Iic i, f k ≤ f j := |
| 182 | + Finset.exists_max_image _ _ ⟨i, Finset.mem_Iic.mpr le_rfl⟩ |
| 183 | + simp_all only [Finset.mem_Iic, partialSups, OrderHom.coe_mk] |
| 184 | + use j, hj.1 |
| 185 | + apply le_antisymm |
| 186 | + · exact Finset.sup'_le _ _ fun k hk => hj.2 k (Finset.mem_Iic.1 hk) |
| 187 | + · exact Finset.le_sup' _ (Finset.mem_Iic.2 hj.1 ) |
| 188 | + |
| 189 | +end PR |
| 190 | + |
| 191 | +section BirkhoffSup |
| 192 | + |
| 193 | +def birkhoffSupSet (f : α → α) (g : α → ℝ) : Set α := {x | ∃ n : ℕ, birkhoffSum f g n x > 0} |
| 194 | + |
| 195 | +lemma birkhoffSupSet_eq_iSup_birkhoffMax_support {f : α → α} {g : α → ℝ} : |
| 196 | + birkhoffSupSet f g = ⋃ n : ℕ, (birkhoffMax f g n).support := by |
| 197 | + ext x |
| 198 | + simp only [birkhoffSupSet, gt_iff_lt, Set.mem_setOf_eq, Set.mem_iUnion, Function.mem_support] |
| 199 | + constructor |
| 200 | + · refine fun ⟨n, hn⟩ => ⟨n, ?_⟩ |
| 201 | + apply ne_of_gt |
| 202 | + apply hn.trans_le |
| 203 | + exact le_partialSups (birkhoffSum f g) _ _ |
| 204 | + · rintro ⟨n, hn⟩ |
| 205 | + apply lt_or_gt_of_ne at hn |
| 206 | + cases hn with |
| 207 | + | inl h => absurd h; exact not_lt_of_ge (birkhoffMax_nonneg x) |
| 208 | + | inr h => |
| 209 | + rw [birkhoffMax, Pi.partialSups_apply] at h |
| 210 | + rcases partialSups_exists (birkhoffSum f g · x) n with ⟨m, _, hm₂⟩ |
| 211 | + exact ⟨m, hm₂ ▸ h⟩ |
| 212 | + |
| 213 | +section MeasurePreserving |
| 214 | + |
| 215 | +open MeasureTheory Measure MeasurableSpace Filter Topology |
| 216 | + |
| 217 | +variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {g : α → ℝ} {n} |
| 218 | + (hf : MeasurePreserving f μ μ) (hg : Integrable g μ) |
| 219 | + |
| 220 | +include hf hg |
| 221 | + |
| 222 | +lemma tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet : |
| 223 | + Tendsto (fun n ↦ ∫ x in (birkhoffMax f g n).support, g x ∂μ) atTop |
| 224 | + (𝓝 <| ∫ x in birkhoffSupSet f g, g x ∂ μ) := by |
| 225 | + rw [birkhoffSupSet_eq_iSup_birkhoffMax_support] |
| 226 | + apply tendsto_setIntegral_of_monotone₀ _ _ hg.integrableOn |
| 227 | + · intros |
| 228 | + exact AEStronglyMeasurable.nullMeasurableSet_support (by measurability) |
| 229 | + · intro i j hij x |
| 230 | + have : 0 ≤ birkhoffMax f g i x := birkhoffMax_nonneg x |
| 231 | + have := (birkhoffMax f g).mono hij x |
| 232 | + grind [Function.mem_support] |
| 233 | + |
| 234 | +/-- The *Maximal Ergodic Theorem* |
| 235 | +
|
| 236 | +The integral of `g` over the set where the supremum of the Birkhoff sums |
| 237 | +is positive is non-negative. -/ |
| 238 | +theorem setIntegral_nonneg_on_birkhoffSupSet : |
| 239 | + 0 ≤ ∫ x in birkhoffSupSet f g, g x ∂μ := by |
| 240 | + apply ge_of_tendsto' (tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet μ hf hg) |
| 241 | + intro n |
| 242 | + exact setIntegral_nonneg_on_birkhoffMax_support μ hf hg |
| 243 | + |
| 244 | +end MeasurePreserving |
| 245 | + |
| 246 | +end BirkhoffSup |
| 247 | + |
0 commit comments