|
| 1 | +/- |
| 2 | +Copyright (c) 2022 Rémy Degenne. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Rémy Degenne |
| 5 | +
|
| 6 | +! This file was ported from Lean 3 source module probability.martingale.centering |
| 7 | +! leanprover-community/mathlib commit bea6c853b6edbd15e9d0941825abd04d77933ed0 |
| 8 | +! Please do not edit these lines, except to modify the commit id |
| 9 | +! if you have ported upstream changes. |
| 10 | +-/ |
| 11 | +import Mathlib.Probability.Martingale.Basic |
| 12 | + |
| 13 | +/-! |
| 14 | +# Centering lemma for stochastic processes |
| 15 | +
|
| 16 | +Any `ℕ`-indexed stochastic process which is adapted and integrable can be written as the sum of a |
| 17 | +martingale and a predictable process. This result is also known as **Doob's decomposition theorem**. |
| 18 | +From a process `f`, a filtration `ℱ` and a measure `μ`, we define two processes |
| 19 | +`martingalePart f ℱ μ` and `predictablePart f ℱ μ`. |
| 20 | +
|
| 21 | +## Main definitions |
| 22 | +
|
| 23 | +* `MeasureTheory.predictablePart f ℱ μ`: a predictable process such that |
| 24 | + `f = predictablePart f ℱ μ + martingalePart f ℱ μ` |
| 25 | +* `MeasureTheory.martingalePart f ℱ μ`: a martingale such that |
| 26 | + `f = predictablePart f ℱ μ + martingalePart f ℱ μ` |
| 27 | +
|
| 28 | +## Main statements |
| 29 | +
|
| 30 | +* `MeasureTheory.adapted_predictablePart`: `(fun n => predictablePart f ℱ μ (n+1))` is adapted. |
| 31 | + That is, `predictablePart` is predictable. |
| 32 | +* `MeasureTheory.martingale_martingalePart`: `martingalePart f ℱ μ` is a martingale. |
| 33 | +
|
| 34 | +-/ |
| 35 | + |
| 36 | + |
| 37 | +open TopologicalSpace Filter |
| 38 | + |
| 39 | +open scoped NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators |
| 40 | + |
| 41 | +namespace MeasureTheory |
| 42 | + |
| 43 | +variable {Ω E : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [NormedAddCommGroup E] |
| 44 | + [NormedSpace ℝ E] [CompleteSpace E] {f : ℕ → Ω → E} {ℱ : Filtration ℕ m0} {n : ℕ} |
| 45 | + |
| 46 | +/-- Any `ℕ`-indexed stochastic process can be written as the sum of a martingale and a predictable |
| 47 | +process. This is the predictable process. See `martingalePart` for the martingale. -/ |
| 48 | +noncomputable def predictablePart {m0 : MeasurableSpace Ω} (f : ℕ → Ω → E) (ℱ : Filtration ℕ m0) |
| 49 | + (μ : Measure Ω) : ℕ → Ω → E := fun n => ∑ i in Finset.range n, μ[f (i + 1) - f i|ℱ i] |
| 50 | +#align measure_theory.predictable_part MeasureTheory.predictablePart |
| 51 | + |
| 52 | +@[simp] |
| 53 | +theorem predictablePart_zero : predictablePart f ℱ μ 0 = 0 := by |
| 54 | + simp_rw [predictablePart, Finset.range_zero, Finset.sum_empty] |
| 55 | +#align measure_theory.predictable_part_zero MeasureTheory.predictablePart_zero |
| 56 | + |
| 57 | +theorem adapted_predictablePart : Adapted ℱ fun n => predictablePart f ℱ μ (n + 1) := fun _ => |
| 58 | + Finset.stronglyMeasurable_sum' _ fun _ hin => |
| 59 | + stronglyMeasurable_condexp.mono (ℱ.mono (Finset.mem_range_succ_iff.mp hin)) |
| 60 | +#align measure_theory.adapted_predictable_part MeasureTheory.adapted_predictablePart |
| 61 | + |
| 62 | +theorem adapted_predictablePart' : Adapted ℱ fun n => predictablePart f ℱ μ n := fun _ => |
| 63 | + Finset.stronglyMeasurable_sum' _ fun _ hin => |
| 64 | + stronglyMeasurable_condexp.mono (ℱ.mono (Finset.mem_range_le hin)) |
| 65 | +#align measure_theory.adapted_predictable_part' MeasureTheory.adapted_predictablePart' |
| 66 | + |
| 67 | +/-- Any `ℕ`-indexed stochastic process can be written as the sum of a martingale and a predictable |
| 68 | +process. This is the martingale. See `predictablePart` for the predictable process. -/ |
| 69 | +noncomputable def martingalePart {m0 : MeasurableSpace Ω} (f : ℕ → Ω → E) (ℱ : Filtration ℕ m0) |
| 70 | + (μ : Measure Ω) : ℕ → Ω → E := fun n => f n - predictablePart f ℱ μ n |
| 71 | +#align measure_theory.martingale_part MeasureTheory.martingalePart |
| 72 | + |
| 73 | +theorem martingalePart_add_predictablePart (ℱ : Filtration ℕ m0) (μ : Measure Ω) (f : ℕ → Ω → E) : |
| 74 | + martingalePart f ℱ μ + predictablePart f ℱ μ = f := |
| 75 | + sub_add_cancel _ _ |
| 76 | +#align measure_theory.martingale_part_add_predictable_part MeasureTheory.martingalePart_add_predictablePart |
| 77 | + |
| 78 | +theorem martingalePart_eq_sum : martingalePart f ℱ μ = fun n => |
| 79 | + f 0 + ∑ i in Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|ℱ i]) := by |
| 80 | + unfold martingalePart predictablePart |
| 81 | + ext1 n |
| 82 | + rw [Finset.eq_sum_range_sub f n, ← add_sub, ← Finset.sum_sub_distrib] |
| 83 | +#align measure_theory.martingale_part_eq_sum MeasureTheory.martingalePart_eq_sum |
| 84 | + |
| 85 | +theorem adapted_martingalePart (hf : Adapted ℱ f) : Adapted ℱ (martingalePart f ℱ μ) := |
| 86 | + Adapted.sub hf adapted_predictablePart' |
| 87 | +#align measure_theory.adapted_martingale_part MeasureTheory.adapted_martingalePart |
| 88 | + |
| 89 | +theorem integrable_martingalePart (hf_int : ∀ n, Integrable (f n) μ) (n : ℕ) : |
| 90 | + Integrable (martingalePart f ℱ μ n) μ := by |
| 91 | + rw [martingalePart_eq_sum] |
| 92 | + exact (hf_int 0).add |
| 93 | + (integrable_finset_sum' _ fun i _ => ((hf_int _).sub (hf_int _)).sub integrable_condexp) |
| 94 | +#align measure_theory.integrable_martingale_part MeasureTheory.integrable_martingalePart |
| 95 | + |
| 96 | +theorem martingale_martingalePart (hf : Adapted ℱ f) (hf_int : ∀ n, Integrable (f n) μ) |
| 97 | + [SigmaFiniteFiltration μ ℱ] : Martingale (martingalePart f ℱ μ) ℱ μ := by |
| 98 | + refine' ⟨adapted_martingalePart hf, fun i j hij => _⟩ |
| 99 | + -- ⊢ μ[martingalePart f ℱ μ j | ℱ i] =ᵐ[μ] martingalePart f ℱ μ i |
| 100 | + have h_eq_sum : μ[martingalePart f ℱ μ j|ℱ i] =ᵐ[μ] |
| 101 | + f 0 + ∑ k in Finset.range j, (μ[f (k + 1) - f k|ℱ i] - μ[μ[f (k + 1) - f k|ℱ k]|ℱ i]) := by |
| 102 | + rw [martingalePart_eq_sum] |
| 103 | + refine' (condexp_add (hf_int 0) _).trans _ |
| 104 | + · exact integrable_finset_sum' _ fun i _ => ((hf_int _).sub (hf_int _)).sub integrable_condexp |
| 105 | + refine' (EventuallyEq.add EventuallyEq.rfl (condexp_finset_sum fun i _ => _)).trans _ |
| 106 | + · exact ((hf_int _).sub (hf_int _)).sub integrable_condexp |
| 107 | + refine' EventuallyEq.add _ _ |
| 108 | + · rw [condexp_of_stronglyMeasurable (ℱ.le _) _ (hf_int 0)] |
| 109 | + · exact (hf 0).mono (ℱ.mono (zero_le i)) |
| 110 | + · exact eventuallyEq_sum fun k _ => condexp_sub ((hf_int _).sub (hf_int _)) integrable_condexp |
| 111 | + refine' h_eq_sum.trans _ |
| 112 | + have h_ge : ∀ k, i ≤ k → μ[f (k + 1) - f k|ℱ i] - μ[μ[f (k + 1) - f k|ℱ k]|ℱ i] =ᵐ[μ] 0 := by |
| 113 | + intro k hk |
| 114 | + have : μ[μ[f (k + 1) - f k|ℱ k]|ℱ i] =ᵐ[μ] μ[f (k + 1) - f k|ℱ i] := |
| 115 | + condexp_condexp_of_le (ℱ.mono hk) (ℱ.le k) |
| 116 | + filter_upwards [this] with x hx |
| 117 | + rw [Pi.sub_apply, Pi.zero_apply, hx, sub_self] |
| 118 | + have h_lt : ∀ k, k < i → μ[f (k + 1) - f k|ℱ i] - μ[μ[f (k + 1) - f k|ℱ k]|ℱ i] =ᵐ[μ] |
| 119 | + f (k + 1) - f k - μ[f (k + 1) - f k|ℱ k] := by |
| 120 | + refine' fun k hk => EventuallyEq.sub _ _ |
| 121 | + · rw [condexp_of_stronglyMeasurable] |
| 122 | + · exact ((hf (k + 1)).mono (ℱ.mono (Nat.succ_le_of_lt hk))).sub ((hf k).mono (ℱ.mono hk.le)) |
| 123 | + · exact (hf_int _).sub (hf_int _) |
| 124 | + · rw [condexp_of_stronglyMeasurable] |
| 125 | + · exact stronglyMeasurable_condexp.mono (ℱ.mono hk.le) |
| 126 | + · exact integrable_condexp |
| 127 | + rw [martingalePart_eq_sum] |
| 128 | + refine' EventuallyEq.add EventuallyEq.rfl _ |
| 129 | + rw [← Finset.sum_range_add_sum_Ico _ hij, ← |
| 130 | + add_zero (∑ i in Finset.range i, (f (i + 1) - f i - μ[f (i + 1) - f i|ℱ i]))] |
| 131 | + refine' (eventuallyEq_sum fun k hk => h_lt k (Finset.mem_range.mp hk)).add _ |
| 132 | + refine' (eventuallyEq_sum fun k hk => h_ge k (Finset.mem_Ico.mp hk).1).trans _ |
| 133 | + simp only [Finset.sum_const_zero, Pi.zero_apply] |
| 134 | + rfl |
| 135 | +#align measure_theory.martingale_martingale_part MeasureTheory.martingale_martingalePart |
| 136 | + |
| 137 | +-- The following two lemmas demonstrate the essential uniqueness of the decomposition |
| 138 | +theorem martingalePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} |
| 139 | + (hf : Martingale f ℱ μ) (hg : Adapted ℱ fun n => g (n + 1)) (hg0 : g 0 = 0) |
| 140 | + (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : martingalePart (f + g) ℱ μ n =ᵐ[μ] f n := by |
| 141 | + set h := f - martingalePart (f + g) ℱ μ with hhdef |
| 142 | + have hh : h = predictablePart (f + g) ℱ μ - g := by |
| 143 | + rw [hhdef, sub_eq_sub_iff_add_eq_add, add_comm (predictablePart (f + g) ℱ μ), |
| 144 | + martingalePart_add_predictablePart] |
| 145 | + have hhpred : Adapted ℱ fun n => h (n + 1) := by |
| 146 | + rw [hh] |
| 147 | + exact adapted_predictablePart.sub hg |
| 148 | + have hhmgle : Martingale h ℱ μ := hf.sub (martingale_martingalePart |
| 149 | + (hf.adapted.add <| Predictable.adapted hg <| hg0.symm ▸ stronglyMeasurable_zero) fun n => |
| 150 | + (hf.integrable n).add <| hgint n) |
| 151 | + refine' (eventuallyEq_iff_sub.2 _).symm |
| 152 | + filter_upwards [hhmgle.eq_zero_of_predictable hhpred n] with ω hω |
| 153 | + rw [Pi.sub_apply] at hω |
| 154 | + rw [hω, Pi.sub_apply, martingalePart] |
| 155 | + simp [hg0] |
| 156 | +#align measure_theory.martingale_part_add_ae_eq MeasureTheory.martingalePart_add_ae_eq |
| 157 | + |
| 158 | +theorem predictablePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} |
| 159 | + (hf : Martingale f ℱ μ) (hg : Adapted ℱ fun n => g (n + 1)) (hg0 : g 0 = 0) |
| 160 | + (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : predictablePart (f + g) ℱ μ n =ᵐ[μ] g n := by |
| 161 | + filter_upwards [martingalePart_add_ae_eq hf hg hg0 hgint n] with ω hω |
| 162 | + rw [← add_right_inj (f n ω)] |
| 163 | + conv_rhs => rw [← Pi.add_apply, ← Pi.add_apply, ← martingalePart_add_predictablePart ℱ μ (f + g)] |
| 164 | + rw [Pi.add_apply, Pi.add_apply, hω] |
| 165 | +#align measure_theory.predictable_part_add_ae_eq MeasureTheory.predictablePart_add_ae_eq |
| 166 | + |
| 167 | +section Difference |
| 168 | + |
| 169 | +theorem predictablePart_bdd_difference {R : ℝ≥0} {f : ℕ → Ω → ℝ} (ℱ : Filtration ℕ m0) |
| 170 | + (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) : |
| 171 | + ∀ᵐ ω ∂μ, ∀ i, |predictablePart f ℱ μ (i + 1) ω - predictablePart f ℱ μ i ω| ≤ R := by |
| 172 | + simp_rw [predictablePart, Finset.sum_apply, Finset.sum_range_succ_sub_sum] |
| 173 | + exact ae_all_iff.2 fun i => ae_bdd_condexp_of_ae_bdd <| ae_all_iff.1 hbdd i |
| 174 | +#align measure_theory.predictable_part_bdd_difference MeasureTheory.predictablePart_bdd_difference |
| 175 | + |
| 176 | +theorem martingalePart_bdd_difference {R : ℝ≥0} {f : ℕ → Ω → ℝ} (ℱ : Filtration ℕ m0) |
| 177 | + (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) : |
| 178 | + ∀ᵐ ω ∂μ, ∀ i, |martingalePart f ℱ μ (i + 1) ω - martingalePart f ℱ μ i ω| ≤ ↑(2 * R) := by |
| 179 | + filter_upwards [hbdd, predictablePart_bdd_difference ℱ hbdd] with ω hω₁ hω₂ i |
| 180 | + simp only [two_mul, martingalePart, Pi.sub_apply] |
| 181 | + have : |f (i + 1) ω - predictablePart f ℱ μ (i + 1) ω - (f i ω - predictablePart f ℱ μ i ω)| = |
| 182 | + |f (i + 1) ω - f i ω - (predictablePart f ℱ μ (i + 1) ω - predictablePart f ℱ μ i ω)| := by |
| 183 | + ring_nf -- `ring` suggests `ring_nf` despite proving the goal |
| 184 | + rw [this] |
| 185 | + exact (abs_sub _ _).trans (add_le_add (hω₁ i) (hω₂ i)) |
| 186 | +#align measure_theory.martingale_part_bdd_difference MeasureTheory.martingalePart_bdd_difference |
| 187 | + |
| 188 | +end Difference |
| 189 | + |
| 190 | +end MeasureTheory |
0 commit comments