Theorem: MeasureTheory.Martingale.eq_condexp_of_tendsto_eLpNorm
File: Mathlib/Probability/Martingale/Convergence.lean

Proof steps:
state_before: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
⊢ f n =ᶠ[ae μ] μ[g|↑ℱ n]
state_after: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
tactic: rw [← sub_ae_eq_zero, ← eLpNorm_eq_zero_iff (((hf.stronglyMeasurable n).mono (ℱ.le _)).sub
    (stronglyMeasurable_condexp.mono (ℱ.le _))).aestronglyMeasurable one_ne_zero]
state_before: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
state_after: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
ht : Tendsto (fun m => eLpNorm (μ[f m - g|↑ℱ n]) 1 μ) atTop (𝓝 0)
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
tactic: have ht : Tendsto (fun m => eLpNorm (μ[f m - g|ℱ n]) 1 μ) atTop (𝓝 0) :=
    haveI hint : ∀ m, Integrable (f m - g) μ := fun m => (hf.integrable m).sub hg
    tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hgtends (fun m => zero_le _)
      fun m => eLpNorm_one_condexp_le_eLpNorm _
state_before: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
ht : Tendsto (fun m => eLpNorm (μ[f m - g|↑ℱ n]) 1 μ) atTop (𝓝 0)
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
state_after: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
ht : Tendsto (fun m => eLpNorm (μ[f m - g|↑ℱ n]) 1 μ) atTop (𝓝 0)
hev : ∀ m ≥ n, eLpNorm (μ[f m - g|↑ℱ n]) 1 μ = eLpNorm (f n - μ[g|↑ℱ n]) 1 μ
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
tactic: have hev : ∀ m ≥ n, eLpNorm (μ[f m - g|ℱ n]) 1 μ = eLpNorm (f n - μ[g|ℱ n]) 1 μ := by
    refine fun m hm => eLpNorm_congr_ae ((condexp_sub (hf.integrable m) hg).trans ?_)
    filter_upwards [hf.2 n m hm] with x hx
    simp only [hx, Pi.sub_apply]
state_before: Ω : Type u_1
ι : Type u_2
m0 : MeasurableSpace Ω
μ✝ : Measure Ω
ℱ : Filtration ℕ m0
a b : ℝ
f : ℕ → Ω → ℝ
ω : Ω
R : ℝ≥0
inst✝ : IsFiniteMeasure μ✝
g : Ω → ℝ
μ : Measure Ω
hf : Martingale f ℱ μ
hg : Integrable g μ
hgtends : Tendsto (fun n => eLpNorm (f n - g) 1 μ) atTop (𝓝 0)
n : ℕ
ht : Tendsto (fun m => eLpNorm (μ[f m - g|↑ℱ n]) 1 μ) atTop (𝓝 0)
hev : ∀ m ≥ n, eLpNorm (μ[f m - g|↑ℱ n]) 1 μ = eLpNorm (f n - μ[g|↑ℱ n]) 1 μ
⊢ eLpNorm (f n - μ[g|↑ℱ n]) 1 μ = 0
state_after: no goals
tactic: exact tendsto_nhds_unique (tendsto_atTop_of_eventually_const hev) ht