Skip to content

Commit 2bb1464

Browse files
committed
add missing docstring
1 parent 592989b commit 2bb1464

File tree

1 file changed

+290
-0
lines changed

1 file changed

+290
-0
lines changed
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
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
5+
-/
6+
module
7+
8+
public import Mathlib.MeasureTheory.Integral.Bochner.Basic
9+
import Mathlib.MeasureTheory.Integral.Bochner.Set
10+
import Mathlib.Algebra.Order.Group.PartialSups
11+
import Mathlib.Algebra.Order.Ring.Star
12+
import Mathlib.Analysis.InnerProductSpace.Basic
13+
import Mathlib.Analysis.RCLike.Lemmas
14+
import Mathlib.Data.Real.StarOrdered
15+
import Mathlib.Dynamics.BirkhoffSum.Average
16+
17+
/-!
18+
# Maximal ergodic theorem.
19+
20+
We define the set `birkhoffAverageSupSet f g a` of points `x` where the supremum of
21+
`birkhoffAverage ℝ f g n x` for varying `n` is greater than `a`. Then, we show its
22+
measure multiplied by `a` is bounded above by the integral of `g` on this set. In particular,
23+
for a positive `g`, this integral is bounded above by the `L1` norm of `g`, so for `g`
24+
taking values in a `NormedAddCommGroup`, we get an inequality involving the norm.
25+
26+
## Main results
27+
28+
* `meas_birkhoffAverageSupSet_smul_const_le_integral`: the measure of `birkhoffAverageSupSet f g a`
29+
multiplied by `a` is bounded above by the integral of `g` on the same set.
30+
* `meas_birkhoffAverageSupSet_smul_const_le_norm`: the measure of `birkhoffAverageSupSet f ‖g‖ a`
31+
multiplied by `a` is bounded above by the `L1` norm of `g`.
32+
-/
33+
34+
variable {α : Type*} {f : α → α}
35+
36+
open MeasureTheory Measure MeasurableSpace Filter Topology
37+
38+
section BirkhoffMax
39+
40+
/-- The maximum of `birkhoffSum f g i` for `i` ranging from `0` to `n`. -/
41+
def birkhoffMax (f : α → α) (g : α → ℝ) : ℕ →o (α → ℝ) :=
42+
partialSups (birkhoffSum f g)
43+
44+
lemma birkhoffMax_nonneg {g n} :
45+
0 ≤ birkhoffMax f g n := by
46+
apply (le_partialSups_of_le _ n.zero_le).trans'
47+
rfl
48+
49+
lemma birkhoffMax_succ {g n} :
50+
birkhoffMax f g (n + 1) = 0 ⊔ (g + birkhoffMax f g n ∘ f) := by
51+
have : birkhoffSum f g ∘ Nat.succ = fun k ↦ g + birkhoffSum f g k ∘ f := by
52+
funext
53+
exact birkhoffSum_succ' ..
54+
erw [partialSups_succ', this, partialSups_const_add, birkhoffSum_zero']
55+
funext
56+
simp [birkhoffMax, partialSups]
57+
58+
lemma birkhoffMax_succ' {g n x} (hpos : 0 < birkhoffMax f g (n + 1) x) :
59+
birkhoffMax f g (n + 1) x = g x + birkhoffMax f g n (f x) := by
60+
erw [birkhoffMax_succ, lt_sup_iff] at hpos
61+
cases hpos with
62+
| inl h => absurd h; exact lt_irrefl 0
63+
| inr h =>
64+
erw [birkhoffMax_succ, Pi.sup_apply, sup_of_le_right h.le]
65+
rfl
66+
67+
lemma birkhoffMax_comp_le_succ {g n} :
68+
birkhoffMax f g n ≤ birkhoffMax f g (n + 1) := by
69+
gcongr
70+
exact n.le_succ
71+
72+
lemma birkhoffMax_le_birkhoffMax {g n x} (hpos : 0 < birkhoffMax f g n x) :
73+
birkhoffMax f g n x ≤ g x + birkhoffMax f g n (f x) := by
74+
match n with
75+
| 0 => absurd hpos; exact lt_irrefl 0
76+
| n + 1 =>
77+
apply le_of_eq_of_le (birkhoffMax_succ' hpos)
78+
apply add_le_add_right
79+
exact birkhoffMax_comp_le_succ (f x)
80+
81+
lemma birkhoffMax_pos_of_mem_support {g n x}
82+
(hx : x ∈ (birkhoffMax f g n).support) : 0 < birkhoffMax f g n x := by
83+
apply lt_or_gt_of_ne at hx
84+
cases hx with
85+
| inl h =>
86+
absurd h; exact (birkhoffMax_nonneg x).not_gt
87+
| inr h => exact h
88+
89+
-- TODO: move elsewhere
90+
@[measurability]
91+
lemma birkhoffSum_measurable [MeasurableSpace α] {f : α → α} (hf : Measurable f) {g : α → ℝ}
92+
(hg : Measurable g) {n} : Measurable (birkhoffSum f g n) := by
93+
apply Finset.measurable_sum
94+
measurability
95+
96+
-- TODO: move elsewhere
97+
@[measurability]
98+
lemma birkhoffMax_measurable [MeasurableSpace α] (hf : Measurable f) {g : α → ℝ}
99+
(hg : Measurable g) {n} : Measurable (birkhoffMax f g n) := by
100+
unfold birkhoffMax
101+
induction n <;> measurability
102+
103+
section MeasurePreserving
104+
105+
variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {g : α → ℝ} {n}
106+
(hf : MeasurePreserving f μ μ) (hg : Integrable g μ)
107+
108+
include hf
109+
110+
-- todo: move elsewhere
111+
@[measurability]
112+
lemma birkhoffSum_aestronglyMeasurable (hg : AEStronglyMeasurable g μ) :
113+
AEStronglyMeasurable (birkhoffSum f g n) μ := by
114+
apply Finset.aestronglyMeasurable_fun_sum
115+
exact fun i _ => hg.comp_measurePreserving (hf.iterate i)
116+
117+
-- todo: move elsewhere
118+
@[measurability]
119+
lemma birkhoffMax_aestronglyMeasurable (hg : AEStronglyMeasurable g μ) :
120+
AEStronglyMeasurable (birkhoffMax f g n) μ := by
121+
unfold birkhoffMax
122+
induction n <;> measurability
123+
124+
include hg
125+
126+
-- todo: move elsewhere
127+
lemma birkhoffSum_integrable : Integrable (birkhoffSum f g n) μ :=
128+
integrable_finset_sum _ fun _ _ ↦ (hf.iterate _).integrable_comp_of_integrable hg
129+
130+
-- todo: move elsewhere
131+
lemma birkhoffMax_integrable : Integrable (birkhoffMax f g n) μ := by
132+
unfold birkhoffMax
133+
induction n with
134+
| zero => exact integrable_zero ..
135+
| succ n hn => simpa using Integrable.sup hn (birkhoffSum_integrable μ hf hg)
136+
137+
lemma birkhoffMax_integral_le :
138+
∫ x, birkhoffMax f g n x ∂μ ≤
139+
∫ x in (birkhoffMax f g n).support, g x ∂μ +
140+
∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by
141+
have := hf.integrable_comp_of_integrable (birkhoffMax_integrable μ hf hg (n := n))
142+
rw [←integral_add hg.restrict, ←setIntegral_support]
143+
· apply setIntegral_mono_on₀
144+
· exact (birkhoffMax_integrable μ hf hg).restrict
145+
· exact .add hg.restrict this.restrict
146+
· exact AEStronglyMeasurable.nullMeasurableSet_support (by measurability)
147+
· intro x hx
148+
exact birkhoffMax_le_birkhoffMax (birkhoffMax_pos_of_mem_support hx)
149+
· exact this.restrict
150+
151+
lemma setIntegral_nonneg_on_birkhoffMax_support :
152+
0 ≤ ∫ x in (birkhoffMax f g n).support, g x ∂μ := by
153+
have hg₁ : AEStronglyMeasurable (birkhoffMax f g n) μ := by measurability
154+
have hg₂ : Integrable (birkhoffMax f g n) μ := birkhoffMax_integrable μ hf hg
155+
have hg₃ : Integrable (birkhoffMax f g n ∘ f) μ := hf.integrable_comp_of_integrable hg₂
156+
calc
157+
0 ≤ ∫ x in (birkhoffMax f g n).supportᶜ, birkhoffMax f g n (f x) ∂μ := by
158+
exact integral_nonneg (fun x => birkhoffMax_nonneg (f x))
159+
_ = ∫ x, birkhoffMax f g n (f x) ∂μ -
160+
∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by
161+
exact setIntegral_compl₀ hg₁.nullMeasurableSet_support hg₃
162+
_ = ∫ x, birkhoffMax f g n x ∂μ -
163+
∫ x in (birkhoffMax f g n).support, birkhoffMax f g n (f x) ∂μ := by
164+
rw [←integral_map hf.aemeasurable (hf.map_eq.symm ▸ hg₁), hf.map_eq]
165+
_ ≤ ∫ x in (birkhoffMax f g n).support, g x ∂μ := by
166+
grw [birkhoffMax_integral_le μ hf hg]
167+
grind
168+
169+
end MeasurePreserving
170+
171+
end BirkhoffMax
172+
173+
def birkhoffSupSet (f : α → α) (g : α → ℝ) : Set α :=
174+
{x | ∃ n : ℕ, 0 < birkhoffSum f g n x}
175+
176+
lemma birkhoffSupSet_eq_iSup_birkhoffMax_support {f : α → α} {g : α → ℝ} :
177+
birkhoffSupSet f g = ⋃ n : ℕ, (birkhoffMax f g n).support := by
178+
ext x
179+
simp only [birkhoffSupSet, Set.mem_setOf_eq, Set.mem_iUnion, Function.mem_support]
180+
constructor
181+
· refine fun ⟨n, hn⟩ => ⟨n, ?_⟩
182+
apply ne_of_gt (hn.trans_le _)
183+
exact le_partialSups (birkhoffSum f g) _ _
184+
· rintro ⟨n, hn⟩
185+
apply lt_or_gt_of_ne at hn
186+
cases hn with
187+
| inl h => absurd h; exact not_lt_of_ge (birkhoffMax_nonneg x)
188+
| inr h =>
189+
rw [birkhoffMax, Pi.partialSups_apply] at h
190+
rcases exists_partialSups_eq (birkhoffSum f g · x) n with ⟨m, _, hm₂⟩
191+
exact ⟨m, hm₂ ▸ h⟩
192+
193+
/-- The set of `x` for which `birkhoffAverage ℝ f g n x` greater than some `a`
194+
for at least one value of `n`. -/
195+
public def birkhoffAverageSupSet (f : α → α) (g : α → ℝ) (a : ℝ) : Set α :=
196+
{x | ∃ n : ℕ, a < birkhoffAverage ℝ f g n x}
197+
198+
theorem birkhoffAverage_iff_birkhoffSum {f : α → α} {x n g} {a : ℝ} (hn : 0 < n) :
199+
a < birkhoffAverage ℝ f g n x ↔ 0 < birkhoffSum f (g - fun _ ↦ a) n x := by
200+
nth_rw 2 [←smul_lt_smul_iff_of_pos_left (a := (↑n : ℝ)⁻¹) (by positivity)]
201+
rw [smul_zero, ←birkhoffAverage, birkhoffAverage_sub]
202+
simp only [Pi.sub_apply, sub_pos]
203+
nth_rw 2 [birkhoffAverage_of_comp_eq rfl hn.ne']
204+
205+
theorem birkhoffAverageSupSet_eq_birkhoffSupSet {f : α → α} {g a} (ha : 0 < a) :
206+
birkhoffAverageSupSet f g a = birkhoffSupSet f (g - fun _ ↦ a) := by
207+
unfold birkhoffAverageSupSet birkhoffSupSet
208+
have {n x} : a < birkhoffAverage ℝ f g n x ↔ 0 < birkhoffSum f (g - fun _ ↦ a) n x := by
209+
cases n with
210+
| zero =>
211+
refine ⟨fun h => ?_, fun h => ?_⟩
212+
· exfalso; rw [birkhoffAverage_zero] at h; exact lt_asymm ha h
213+
· exfalso; rw [birkhoffSum_zero] at h; exact lt_irrefl 0 h
214+
| succ n => exact birkhoffAverage_iff_birkhoffSum (by positivity)
215+
conv =>
216+
enter [1, 1, x, 1, n]
217+
rw [this]
218+
219+
section MeasurePreserving
220+
221+
variable {f : α → α} [MeasurableSpace α] (μ : Measure α := by volume_tac) {n}
222+
(hf : MeasurePreserving f μ μ)
223+
224+
include hf
225+
226+
section Real
227+
228+
variable {g : α → ℝ} (hg : Integrable g μ)
229+
230+
include hg
231+
232+
lemma tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet :
233+
Tendsto (fun n ↦ ∫ x in (birkhoffMax f g n).support, g x ∂μ) atTop
234+
(𝓝 <| ∫ x in birkhoffSupSet f g, g x ∂ μ) := by
235+
rw [birkhoffSupSet_eq_iSup_birkhoffMax_support]
236+
apply tendsto_setIntegral_of_monotone₀ _ _ hg.integrableOn
237+
· intros
238+
exact AEStronglyMeasurable.nullMeasurableSet_support (by measurability)
239+
· intro i j hij x
240+
have : 0 ≤ birkhoffMax f g i x := birkhoffMax_nonneg x
241+
have := (birkhoffMax f g).mono hij x
242+
grind [Function.mem_support]
243+
theorem setIntegral_nonneg_on_birkhoffSupSet :
244+
0 ≤ ∫ x in birkhoffSupSet f g, g x ∂μ := by
245+
apply ge_of_tendsto' (tendsto_setIntegral_on_birkhoffMax_support_birkhoffSupSet μ hf hg)
246+
intro n
247+
exact setIntegral_nonneg_on_birkhoffMax_support μ hf hg
248+
249+
variable [IsFiniteMeasure μ]
250+
251+
/-- **Maximal ergodic theorem**: The measure of the set where the supremum of the Birkhoff
252+
averages of `g` is greater than `a`, multiplied by `a`, is bounded above by the integral of
253+
`g` on this set. -/
254+
public theorem meas_birkhoffAverageSupSet_smul_const_le_integral (a : ℝ) (ha : 0 < a) :
255+
μ.real (birkhoffAverageSupSet f g a) • a ≤ ∫ x in birkhoffAverageSupSet f g a, g x ∂μ := by
256+
have p₁ := Integrable.sub hg (integrable_const a)
257+
calc
258+
_ = ∫ x in birkhoffSupSet f (g - fun _ ↦ a), a ∂μ := by
259+
rw [setIntegral_const, birkhoffAverageSupSet_eq_birkhoffSupSet ha]
260+
_ ≤ ∫ x in birkhoffSupSet f (g - fun _ ↦ a), a ∂μ +
261+
∫ x in birkhoffSupSet f (g - fun _ ↦ a), g x - a ∂μ := by
262+
exact le_add_of_nonneg_right (setIntegral_nonneg_on_birkhoffSupSet μ hf p₁)
263+
_ = ∫ x in birkhoffAverageSupSet f g a, g x ∂μ := by
264+
rw [← integral_add, birkhoffAverageSupSet_eq_birkhoffSupSet ha]
265+
· rcongr; grind
266+
· exact (integrable_const a).restrict
267+
· exact p₁.restrict
268+
269+
end Real
270+
271+
section NormedAddCommGroup
272+
273+
variable {E : Type*} [NormedAddCommGroup E] {g : α → E} (hg : Integrable g μ) [IsFiniteMeasure μ]
274+
275+
include hg
276+
277+
/-- **Maximal ergodic theorem** for group-valued functions: The measure of the set where
278+
the supremum of the Birkhoff averages of `‖g‖` is greater than `a`, multiplied by `a`, is
279+
bounded above by the norm of `g`. -/
280+
public theorem meas_birkhoffAverageSupSet_smul_const_le_norm (a : ℝ) (ha : 0 < a) :
281+
μ.real (birkhoffAverageSupSet f (fun x ↦ ‖g x‖) a) • a ≤ ∫ x, ‖g x‖ ∂μ :=
282+
calc
283+
_ ≤ ∫ x in birkhoffAverageSupSet f (fun x ↦ ‖g x‖) a, ‖g x‖ ∂μ := by
284+
exact meas_birkhoffAverageSupSet_smul_const_le_integral μ hf hg.norm a ha
285+
_ ≤ ∫ x, ‖g x‖ ∂μ := by
286+
exact setIntegral_le_integral hg.norm (ae_of_all _ (norm_nonneg <| g ·))
287+
288+
end NormedAddCommGroup
289+
290+
end MeasurePreserving

0 commit comments

Comments
 (0)