Skip to content

Commit b5100c7

Browse files
committed
feat(BirkhoffSum.Pointwise): maximal inequality
1 parent a8a0f78 commit b5100c7

File tree

1 file changed

+316
-0
lines changed

1 file changed

+316
-0
lines changed
Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
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+
public import Mathlib.Algebra.Order.Group.PartialSups
12+
public import Mathlib.Algebra.Order.Ring.Star
13+
public import Mathlib.Data.Real.StarOrdered
14+
public import Mathlib.Dynamics.BirkhoffSum.QuasiMeasurePreserving
15+
public import Mathlib.MeasureTheory.Integral.DominatedConvergence
16+
public 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+
open MeasureTheory Measure MeasurableSpace Filter Topology
42+
43+
section BirkhoffMax
44+
45+
/-- The maximum of `birkhoffSum f g i` for `i` ranging from `0` to `n`. -/
46+
def birkhoffMax (f : α → α) (g : α → ℝ) : ℕ →o (α → ℝ) := partialSups (birkhoffSum f g)
47+
48+
lemma birkhoffMax_nonneg {f : α → α} {g n} :
49+
0 ≤ birkhoffMax f g n := by
50+
apply (le_partialSups_of_le _ n.zero_le).trans'
51+
rfl
52+
53+
lemma birkhoffMax_succ {f : α → α} {g n} :
54+
birkhoffMax f g (n + 1) = 0 ⊔ (g + birkhoffMax f g n ∘ f) := by
55+
have : birkhoffSum f g ∘ Nat.succ = fun k ↦ g + birkhoffSum f g k ∘ f := by
56+
funext
57+
exact birkhoffSum_succ' ..
58+
erw [partialSups_succ', this, partialSups_const_add, birkhoffSum_zero']
59+
funext
60+
simp [birkhoffMax, partialSups]
61+
62+
example (p : Prop) (h : False ∨ p) : p := h.elim (·.elim) id
63+
64+
lemma birkhoffMax_succ' {f : α → α} {g n x} (hpos : 0 < birkhoffMax f g (n + 1) x) :
65+
birkhoffMax f g (n + 1) x = g x + birkhoffMax f g n (f x) := by
66+
erw [birkhoffMax_succ, lt_sup_iff] at hpos
67+
cases hpos with
68+
| inl h => absurd h; exact lt_irrefl 0
69+
| inr h =>
70+
erw [birkhoffMax_succ, Pi.sup_apply, sup_of_le_right h.le]
71+
rfl
72+
73+
lemma birkhoffMax_comp_le_succ {f : α → α} {g n} :
74+
birkhoffMax f g n ≤ birkhoffMax f g (n + 1) := by
75+
gcongr
76+
exact n.le_succ
77+
78+
lemma birkhoffMax_le_birkhoffMax {f : α → α} {g n x} (hpos : 0 < birkhoffMax f g n x) :
79+
birkhoffMax f g n x ≤ g x + birkhoffMax f g n (f x) := by
80+
match n with
81+
| 0 => absurd hpos; exact lt_irrefl 0
82+
| n + 1 =>
83+
apply le_of_eq_of_le (birkhoffMax_succ' hpos)
84+
apply add_le_add_right
85+
exact birkhoffMax_comp_le_succ (f x)
86+
87+
lemma birkhoffMax_pos_of_mem_support {f : α → α} {g : α → ℝ} {n x}
88+
(hx : x ∈ (birkhoffMax f g n).support) : 0 < birkhoffMax f g n x := by
89+
apply lt_or_gt_of_ne at hx
90+
cases hx with
91+
| inl h =>
92+
absurd h; exact (birkhoffMax_nonneg x).not_gt
93+
| inr h => exact h
94+
95+
-- TODO: move elsewhere
96+
@[measurability]
97+
lemma birkhoffSum_measurable [MeasurableSpace α] {f : α → α} (hf : Measurable f) {g : α → ℝ}
98+
(hg : Measurable g) {n} : Measurable (birkhoffSum f g n) := by
99+
apply Finset.measurable_sum
100+
measurability
101+
102+
@[measurability]
103+
lemma birkhoffMax_measurable [MeasurableSpace α] {f : α → α} (hf : Measurable f) {g : α → ℝ}
104+
(hg : Measurable g) {n} : Measurable (birkhoffMax f g n) := by
105+
unfold birkhoffMax
106+
induction n <;> measurability
107+
108+
section MeasurePreserving
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 α :=
194+
{x | ∃ n : ℕ, 0 < birkhoffSum f g n x}
195+
196+
lemma birkhoffSupSet_eq_iSup_birkhoffMax_support {f : α → α} {g : α → ℝ} :
197+
birkhoffSupSet f g = ⋃ n : ℕ, (birkhoffMax f g n).support := by
198+
ext x
199+
simp only [birkhoffSupSet, Set.mem_setOf_eq, Set.mem_iUnion, Function.mem_support]
200+
constructor
201+
· refine fun ⟨n, hn⟩ => ⟨n, ?_⟩
202+
apply ne_of_gt
203+
apply hn.trans_le
204+
exact le_partialSups (birkhoffSum f g) _ _
205+
· rintro ⟨n, hn⟩
206+
apply lt_or_gt_of_ne at hn
207+
cases hn with
208+
| inl h => absurd h; exact not_lt_of_ge (birkhoffMax_nonneg x)
209+
| inr h =>
210+
rw [birkhoffMax, Pi.partialSups_apply] at h
211+
rcases partialSups_exists (birkhoffSum f g · x) n with ⟨m, _, hm₂⟩
212+
exact ⟨m, hm₂ ▸ h⟩
213+
214+
def birkhoffAverageSupSet (f : α → α) (g : α → ℝ) (a : ℝ) : Set α :=
215+
{x | ∃ n : ℕ, a < birkhoffAverage ℝ f g n x}
216+
217+
theorem birkhoffAverage_iff_birkhoffSum {f : α → α} {x n g} {a : ℝ} (hn : 0 < n) :
218+
a < birkhoffAverage ℝ f g n x ↔ 0 < birkhoffSum f (g - fun _ ↦ a) n x := by
219+
nth_rw 2 [←smul_lt_smul_iff_of_pos_left (a := (↑n : ℝ)⁻¹) (by norm_num [hn])]
220+
rw [smul_zero, ←birkhoffAverage, birkhoffAverage_sub]
221+
simp only [Pi.sub_apply, sub_pos]
222+
nth_rw 2 [birkhoffAverage_of_comp_eq rfl hn.ne']
223+
224+
theorem birkhoffAverageSupSet_eq_birkhoffSupSet {f : α → α} {g a} (ha : 0 < a) :
225+
birkhoffAverageSupSet f g a = birkhoffSupSet f (g - fun _ ↦ a) := by
226+
unfold birkhoffAverageSupSet birkhoffSupSet
227+
have {n x} : a < birkhoffAverage ℝ f g n x ↔ 0 < birkhoffSum f (g - fun _ ↦ a) n x := by
228+
cases n with
229+
| zero =>
230+
refine ⟨fun h => ?_, fun h => ?_⟩
231+
· exfalso; rw [birkhoffAverage_zero] at h; exact lt_asymm ha h
232+
· exfalso; rw [birkhoffSum_zero] at h; exact lt_irrefl 0 h
233+
| succ n => exact birkhoffAverage_iff_birkhoffSum (by norm_num)
234+
conv =>
235+
enter [1, 1, x, 1, n]
236+
rw [this]
237+
238+
section MeasurePreserving
239+
240+
variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {n}
241+
(hf : MeasurePreserving f μ μ)
242+
243+
include hf
244+
245+
section Real
246+
247+
variable {g : α → ℝ} (hg : Integrable g μ)
248+
249+
include hg
250+
251+
lemma tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet :
252+
Tendsto (fun n ↦ ∫ x in (birkhoffMax f g n).support, g x ∂μ) atTop
253+
(𝓝 <| ∫ x in birkhoffSupSet f g, g x ∂ μ) := by
254+
rw [birkhoffSupSet_eq_iSup_birkhoffMax_support]
255+
apply tendsto_setIntegral_of_monotone₀ _ _ hg.integrableOn
256+
· intros
257+
exact AEStronglyMeasurable.nullMeasurableSet_support (by measurability)
258+
· intro i j hij x
259+
have : 0 ≤ birkhoffMax f g i x := birkhoffMax_nonneg x
260+
have := (birkhoffMax f g).mono hij x
261+
grind [Function.mem_support]
262+
263+
/-- The *Maximal Ergodic Theorem*
264+
265+
The integral of `g` over the set where the supremum of the Birkhoff sums
266+
is positive is non-negative. -/
267+
theorem setIntegral_nonneg_on_birkhoffSupSet :
268+
0 ≤ ∫ x in birkhoffSupSet f g, g x ∂μ := by
269+
apply ge_of_tendsto' (tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet μ hf hg)
270+
intro n
271+
exact setIntegral_nonneg_on_birkhoffMax_support μ hf hg
272+
273+
variable [IsFiniteMeasure μ]
274+
275+
theorem meas_birkhoffAverageSupSet_mul_le_integral (a : ℝ) (ha : 0 < a) :
276+
μ.real (birkhoffAverageSupSet f g a) • a ≤ ∫ x in birkhoffAverageSupSet f g a, g x ∂μ := by
277+
have p₁ := Integrable.sub hg (integrable_const a)
278+
calc
279+
_ = ∫ x in birkhoffSupSet f (g - fun _ ↦ a), a ∂μ := by
280+
rw [setIntegral_const, birkhoffAverageSupSet_eq_birkhoffSupSet ha]
281+
_ ≤ ∫ x in birkhoffSupSet f (g - fun _ ↦ a), a ∂μ +
282+
∫ x in birkhoffSupSet f (g - fun _ ↦ a), g x - a ∂μ := by
283+
exact le_add_of_nonneg_right (setIntegral_nonneg_on_birkhoffSupSet μ hf p₁)
284+
_ = ∫ x in birkhoffAverageSupSet f g a, g x ∂μ := by
285+
rw [← integral_add, birkhoffAverageSupSet_eq_birkhoffSupSet ha]
286+
· rcongr; grind
287+
· exact (integrable_const a).restrict
288+
· exact p₁.restrict
289+
290+
end Real
291+
292+
section NormedAddCommGroup
293+
294+
variable {E : Type*} [NormedAddCommGroup E] {g : α → E} (hg : Integrable g μ) [IsFiniteMeasure μ]
295+
296+
include hg
297+
298+
theorem meas_birkhoffAverageSupSet_mul_le_norm (a : ℝ) (ha : 0 < a) :
299+
μ.real (birkhoffAverageSupSet f (fun x ↦ ‖g x‖) a) • a ≤ ∫ x, ‖g x‖ ∂μ :=
300+
calc
301+
_ ≤ ∫ x in birkhoffAverageSupSet f (fun x ↦ ‖g x‖) a, ‖g x‖ ∂μ := by
302+
exact meas_birkhoffAverageSupSet_mul_le_integral μ hf hg.norm a ha
303+
_ ≤ ∫ x, ‖g x‖ ∂μ := setIntegral_le_integral hg.norm (ae_of_all _ (norm_nonneg <| g ·))
304+
305+
end NormedAddCommGroup
306+
307+
end MeasurePreserving
308+
309+
end BirkhoffSup
310+
311+
noncomputable section BirkhoffAverage
312+
313+
variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {g : α → ℝ} {n}
314+
(hf : MeasurePreserving f μ μ) (hg : Integrable g μ)
315+
316+
end BirkhoffAverage

0 commit comments

Comments
 (0)