Download lean/OAI/GroupTheory/PolycyclicRecognition/Analysis/BoundedProbabilityMean.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
theorembounded_mean_tendsto_zero_of_bad_probabilities
{X : Type*} [MeasurableSpaceX]
(μ : ℕ→ProbabilityMeasureX) (f : ℕ→X→ℝ)
(hf : ∀ n, Measurable (f n)) {C : ℝ}
(hbound : ∀ n x, 0≤ f n x ∧ f n x ≤C)
(hbad : ∀ε : ℝ, 0 < ε →Tendsto (fun n => (μ n : MeasureX) {x | ε ≤ f n x}) atTop (𝓝 0)) :
Tendsto (fun n =>∫ x, f n x ∂(μ n : MeasureX)) atTop (𝓝 0) :=by
proof · 38
lines
have hint (n) : Integrable (f n) (μ n : MeasureX) :=
(integrable_const C).mono' (hf n).aestronglyMeasurable
(ae_of_all _ (fun x =>by
simpa only [Real.norm_eq_abs, abs_of_nonneg (hbound n x).1]
using (hbound n x).2))
have hestimate (n) (ε : ℝ) (hε : 0 < ε) :
(∫ x, f n x ∂(μ n : MeasureX)) ≤
ε + ((μ n : MeasureX) {x | ε ≤ f n x}).toReal * C:=bylet bad := {x | ε ≤ f n x}
havehb : MeasurableSet bad := isClosed_Ici.measurableSet.preimage (hf n)
havehi : Integrable (bad.indicator (fun _ =>C)) (μ n : MeasureX) :=
(integrable_const C).indicator hb
calc
(∫ x, f n x ∂(μ n : MeasureX)) ≤∫ x, ε + bad.indicator (fun _ =>C) x ∂(μ n : MeasureX) :=by
apply integral_mono (hint n) ((integrable_const ε).add hi)
intro x
change f n x ≤ ε + bad.indicator (fun _ =>C) x
by_cases hx : x ∈ bad
· rw [indicator_of_mem hx]
exact (hbound n x).2.trans (by linarith)
· rw [indicator_of_notMem hx, add_zero]
exact (lt_of_not_ge hx).le
_ = ε + ((μ n : MeasureX) bad).toReal * C:=by
rw [integral_add (integrable_const ε) hi, integral_indicator hb]
simp only [integral_const, measureReal_def, measure_univ, ENNReal.toReal_one,
smul_eq_mul, one_mul, Measure.restrict_apply_univ]
apply Metric.tendsto_nhds.mpr
intro ε hε
havehprob : Tendsto (fun n => ((μ n : MeasureX) {x | ε / 2≤ f n x}).toReal * C)
atTop (𝓝 0) :=by
simpa only [Function.comp_apply, ENNReal.toReal_zero, zero_mul] using
((ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp (hbad (ε / 2) (half_pos hε))).mul_const C
filter_upwards [hprob.eventually (gt_mem_nhds (half_pos hε))] with n hn
havehnonneg : 0≤∫ x, f n x ∂(μ n : MeasureX) :=
integral_nonneg (fun x => (hbound n x).1)
rw [Real.dist_eq, sub_zero, abs_of_nonneg hnonneg]
exact (hestimate n (ε / 2) (half_pos hε)).trans_lt (by linarith)