Skip to content

Commit 0c8813a

Browse files
committed
refactor(Probability): change stopping times to take values in WithTop (#29430)
This PR changes stopping times to have type `Ω → WithTop ι` instead of `Ω → ι`. Previously, a stopping time for a filtration indexed by Nat had to have value in Nat. That's not representative of the way stopping times are used in probability. A typical stopping time is the first time at which we see a head in an infinite sequence of coin flips. That time could be infinite (although it is almost surely finite). We can't represent it with a `Ω → Nat` stopping time: if we choose an arbitrary value in Nat for the event that it is infinite, we destroy the stopping time property. We faced that issue in the `BorelCantelli` file, in which we avoided such a possibly infinite stopping time by introducing a sequence of bounded stopping times. We had to prove additional lemmas about them since we could not directly use the API for stopped processes. With the new type, that file is greatly simplified as the API is directly usable, and we can write the proof as we would on paper. The issue with the previous stopping time implementation was noted in [Ying and Degenne, A Formalization of Doob’s Martingale Convergence Theorems in mathlib, CPP 2023, https://dl.acm.org/doi/pdf/10.1145/3573105.3575675]. Other changes: - the sigma-algebra generated by a stopping time is now a sub-sigma algebra by definition - `measurableSet_eq_stopping_time` is generalized and the now useless `measurableSet_eq_stopping_time_of_countable` is removed - `hitting` is renamed to `hittingBtwn` - a new `hittingAfter` is introduced and used in the Borel-Cantelli proof. That proof is now much simpler since we can use a stopped process as intended instead of going around the limitations of the previous stopping time implementation. Co-authored-by: Remy Degenne <remydegenne@gmail.com>
1 parent a5c1f74 commit 0c8813a

File tree

8 files changed

+951
-561
lines changed

8 files changed

+951
-561
lines changed

Mathlib/Order/WithBot.lean

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,31 @@ protected theorem _root_.IsMin.withTop (h : IsMin a) : IsMin (a : WithTop α) :=
868868

869869
lemma untop_le_iff (hx : x ≠ ⊤) : untop x hx ≤ b ↔ x ≤ b := by lift x to α using id hx; simp
870870
lemma le_untop_iff (hy : y ≠ ⊤) : a ≤ untop y hy ↔ a ≤ y := by lift y to α using id hy; simp
871+
872+
lemma untopD_le_iff (hy : y ≠ ⊤) : y.untopD a ≤ b ↔ y ≤ b := by lift y to α using id hy; simp
871873
lemma le_untopD_iff (hy : y = ⊤ → a ≤ b) : a ≤ y.untopD b ↔ a ≤ y := by cases y <;> simp [hy]
872874

875+
lemma untopA_le_iff [Nonempty α] (hy : y ≠ ⊤) : y.untopA ≤ b ↔ y ≤ b := untopD_le_iff hy
876+
lemma le_untopA_iff [Nonempty α] (hy : y ≠ ⊤) : a ≤ y.untopA ↔ a ≤ y := by
877+
lift y to α using id hy; simp
878+
879+
lemma untop_mono (hx : x ≠ ⊤) (hy : y ≠ ⊤) (h : x ≤ y) :
880+
x.untop hx ≤ y.untop hy := by
881+
lift x to α using id hx
882+
lift y to α using id hy
883+
simp only [untop_coe]
884+
exact mod_cast h
885+
886+
lemma untopD_mono (hy : y ≠ ⊤) (h : x ≤ y) :
887+
x.untopD a ≤ y.untopD a := by
888+
lift y to α using hy
889+
cases x with
890+
| top => simp at h
891+
| coe a => simp only [WithTop.untopD_coe]; exact mod_cast h
892+
893+
lemma untopA_mono [Nonempty α] (hy : y ≠ ⊤) (h : x ≤ y) :
894+
x.untopA ≤ y.untopA := untopD_mono hy h
895+
873896
end LE
874897

875898
section LT
@@ -902,7 +925,14 @@ protected lemma lt_top_iff_ne_top : x < ⊤ ↔ x ≠ ⊤ := by cases x <;> simp
902925

903926
@[simp] lemma lt_untop_iff (hy : y ≠ ⊤) : a < y.untop hy ↔ a < y := by lift y to α using id hy; simp
904927
@[simp] lemma untop_lt_iff (hx : x ≠ ⊤) : x.untop hx < b ↔ x < b := by lift x to α using id hx; simp
928+
905929
lemma lt_untopD_iff (hy : y = ⊤ → a < b) : a < y.untopD b ↔ a < y := by cases y <;> simp [hy]
930+
lemma untopD_lt_iff (hx : x ≠ ⊤) : x.untopD a < b ↔ x < b := by
931+
lift x to α using id hx; simp
932+
933+
lemma lt_untopA_iff [Nonempty α] (hy : y ≠ ⊤) : a < y.untopA ↔ a < y := by
934+
lift y to α using id hy; simp
935+
lemma untopA_lt_iff [Nonempty α] (hx : x ≠ ⊤) : x.untopA < b ↔ x < b := untopD_lt_iff hx
906936

907937
end LT
908938

@@ -975,7 +1005,15 @@ lemma forall_coe_le_iff_le [NoTopOrder α] : (∀ a : α, a ≤ x → a ≤ y)
9751005
end Preorder
9761006

9771007
section PartialOrder
978-
variable [PartialOrder α] [NoTopOrder α] {x y : WithTop α}
1008+
variable [PartialOrder α] {x y : WithTop α}
1009+
1010+
lemma untopD_le (hy : y ≤ b) : y.untopD a ≤ b := by
1011+
rwa [untopD_le_iff]
1012+
exact ne_top_of_le_ne_top (by simp) hy
1013+
1014+
lemma untopA_le [Nonempty α] (hy : y ≤ b) : y.untopA ≤ b := untopD_le hy
1015+
1016+
variable [NoTopOrder α]
9791017

9801018
lemma eq_of_forall_coe_le_iff (h : ∀ a : α, a ≤ x ↔ a ≤ y) : x = y :=
9811019
WithBot.eq_of_forall_le_coe_iff (α := αᵒᵈ) h

Mathlib/Probability/Martingale/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ theorem Martingale.eq_zero_of_predictable [SigmaFiniteFiltration μ 𝒢] {f :
446446
namespace Submartingale
447447

448448
protected theorem integrable_stoppedValue [LE E] {f : ℕ → Ω → E} (hf : Submartingale f 𝒢 μ)
449-
{τ : Ω → ℕ} (hτ : IsStoppingTime 𝒢 τ) {N : ℕ} (hbdd : ∀ ω, τ ω ≤ N) :
449+
{τ : Ω → ℕ} (hτ : IsStoppingTime 𝒢 τ) {N : ℕ} (hbdd : ∀ ω, τ ω ≤ N) :
450450
Integrable (stoppedValue f τ) μ :=
451451
integrable_stoppedValue ℕ hτ hf.integrable hbdd
452452

Mathlib/Probability/Martingale/BorelCantelli.lean

Lines changed: 60 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -45,122 +45,93 @@ variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtrat
4545
### One sided martingale bound
4646
-/
4747

48+
/-- `leastGE f r` is the stopping time corresponding to the first time `f ≥ r`. -/
49+
noncomputable def leastGE (f : ℕ → Ω → ℝ) (r : ℝ) : Ω → ℕ∞ :=
50+
hittingAfter f (Set.Ici r) 0
4851

49-
-- TODO: `leastGE` should be defined taking values in `WithTop ℕ` once the `stoppedProcess`
50-
-- refactor is complete
51-
/-- `leastGE f r n` is the stopping time corresponding to the first time `f ≥ r`. -/
52-
noncomputable def leastGE (f : ℕ → Ω → ℝ) (r : ℝ) (n : ℕ) :=
53-
hitting f (Set.Ici r) 0 n
54-
55-
theorem Adapted.isStoppingTime_leastGE (r : ℝ) (n : ℕ) (hf : Adapted ℱ f) :
56-
IsStoppingTime ℱ (leastGE f r n) :=
57-
hitting_isStoppingTime hf measurableSet_Ici
58-
59-
theorem leastGE_le {i : ℕ} {r : ℝ} (ω : Ω) : leastGE f r i ω ≤ i :=
60-
hitting_le ω
61-
62-
-- The following four lemmas shows `leastGE` behaves like a stopped process. Ideally we should
63-
-- define `leastGE` as a stopping time and take its stopped process. However, we can't do that
64-
-- with our current definition since a stopping time takes only finite indices. An upcoming
65-
-- refactor should hopefully make it possible to have stopping times taking infinity as a value
66-
theorem leastGE_mono {n m : ℕ} (hnm : n ≤ m) (r : ℝ) (ω : Ω) : leastGE f r n ω ≤ leastGE f r m ω :=
67-
hitting_mono hnm
68-
69-
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
70-
leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
71-
classical
72-
refine le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) ?_
73-
by_cases hle : π ω ≤ leastGE f r n ω
74-
· rw [min_eq_left hle, leastGE]
75-
by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
76-
· refine hle.trans (Eq.le ?_)
77-
rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h]
78-
· simp only [hitting, if_neg h, le_rfl]
79-
· rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ←
80-
hitting_eq_hitting_of_exists (hπn ω) _]
81-
rw [not_le, leastGE, hitting_lt_iff _ (hπn ω)] at hle
82-
exact
83-
let ⟨j, hj₁, hj₂⟩ := hle
84-
⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩
85-
86-
theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ}
87-
(hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π =
88-
stoppedValue (stoppedProcess f (leastGE f r n)) π := by
89-
ext1 ω
90-
simp +unfoldPartialApp only [stoppedProcess, stoppedValue]
91-
rw [leastGE_eq_min _ _ _ hπn]
92-
93-
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
94-
Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
95-
rw [submartingale_iff_expected_stoppedValue_mono]
96-
· intro σ π hσ hπ hσ_le_π hπ_bdd
97-
obtain ⟨n, hπ_le_n⟩ := hπ_bdd
98-
simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
99-
simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
100-
refine hf.expected_stoppedValue_mono ?_ ?_ ?_ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
101-
· exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
102-
· exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _)
103-
· exact fun ω => min_le_min (hσ_le_π ω) le_rfl
104-
· exact fun i => stronglyMeasurable_stoppedValue_of_le hf.adapted.progMeasurable_of_discrete
105-
(hf.adapted.isStoppingTime_leastGE _ _) leastGE_le
106-
· exact fun i => integrable_stoppedValue _ (hf.adapted.isStoppingTime_leastGE _ _) hf.integrable
107-
leastGE_le
52+
theorem Adapted.isStoppingTime_leastGE (r : ℝ) (hf : Adapted ℱ f) :
53+
IsStoppingTime ℱ (leastGE f r) :=
54+
hittingAfter_isStoppingTime hf measurableSet_Ici
55+
56+
/-- The stopped process of `f` above `r` is the process that is equal to `f` until `leastGE f r`
57+
(the first time `f` passes above `r`), and then is constant afterwards. -/
58+
noncomputable def stoppedAbove (f : ℕ → Ω → ℝ) (r : ℝ) : ℕ → Ω → ℝ :=
59+
stoppedProcess f (leastGE f r)
60+
61+
protected lemma Submartingale.stoppedAbove [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
62+
Submartingale (stoppedAbove f r) ℱ μ :=
63+
hf.stoppedProcess (hf.adapted.isStoppingTime_leastGE r)
64+
65+
@[deprecated (since := "2025-10-25")] alias Submartingale.stoppedValue_leastGE :=
66+
Submartingale.stoppedAbove
10867

10968
variable {r : ℝ} {R : ℝ≥0}
11069

111-
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
70+
theorem stoppedAbove_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
11271
(hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
113-
∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
72+
∀ᵐ ω ∂μ, stoppedAbove f r i ω ≤ r + R := by
11473
filter_upwards [hbdd] with ω hbddω
115-
change f (leastGE f r i ω) ω ≤ r + R
116-
by_cases heq : leastGE f r i ω = 0
117-
· rw [heq, hf0, Pi.zero_apply]
118-
exact add_nonneg hr R.coe_nonneg
119-
· obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
120-
rw [hk, add_comm, ← sub_le_iff_le_add]
121-
have := notMem_of_lt_hitting (hk.symm ▸ k.lt_succ_self : k < leastGE f r i ω) (zero_le _)
122-
simp only [Set.mem_Ici, not_le] at this
74+
rw [stoppedAbove, stoppedProcess, ENat.some_eq_coe]
75+
by_cases h_zero : (min (i : ℕ∞) (leastGE f r ω)).untopA = 0
76+
· simp only [h_zero, hf0, Pi.zero_apply]
77+
positivity
78+
obtain ⟨k, hk⟩ := Nat.exists_eq_add_one_of_ne_zero h_zero
79+
rw [hk, add_comm r, ← sub_le_iff_le_add]
80+
have := notMem_of_lt_hittingAfter (?_ : k < leastGE f r ω)
81+
· simp only [zero_le, Set.mem_Ici, not_le, forall_const] at this
12382
exact (sub_lt_sub_left this _).le.trans ((le_abs_self _).trans (hbddω _))
83+
· suffices (k : ℕ∞) < min (i : ℕ∞) (leastGE f r ω) from this.trans_le (min_le_right _ _)
84+
have h_top : min (i : ℕ∞) (leastGE f r ω) ≠ ⊤ :=
85+
ne_top_of_le_ne_top (by simp) (min_le_left _ _)
86+
lift min (i : ℕ∞) (leastGE f r ω) to ℕ using h_top with p
87+
simp only [untopD_coe_enat, Nat.cast_lt, gt_iff_lt] at *
88+
omega
12489

125-
theorem Submartingale.stoppedValue_leastGE_eLpNorm_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
90+
@[deprecated (since := "2025-10-25")] alias norm_stoppedValue_leastGE_le := stoppedAbove_le
91+
92+
theorem Submartingale.eLpNorm_stoppedAbove_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
12693
(hr : 0 ≤ r) (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
127-
eLpNorm (stoppedValue f (leastGE f r i)) 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal (r + R) := by
128-
refine eLpNorm_one_le_of_le' ((hf.stoppedValue_leastGE r).integrable _) ?_
129-
(norm_stoppedValue_leastGE_le hr hf0 hbdd i)
94+
eLpNorm (stoppedAbove f r i) 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal (r + R) := by
95+
refine eLpNorm_one_le_of_le' ((hf.stoppedAbove r).integrable _) ?_
96+
(stoppedAbove_le hr hf0 hbdd i)
13097
rw [← setIntegral_univ]
131-
refine le_trans ?_ ((hf.stoppedValue_leastGE r).setIntegral_le (zero_le _) MeasurableSet.univ)
132-
simp_rw [stoppedValue, leastGE, hitting_of_le le_rfl, hf0, integral_zero', le_rfl]
98+
refine le_trans ?_ ((hf.stoppedAbove r).setIntegral_le (zero_le _) MeasurableSet.univ)
99+
simp [stoppedAbove, stoppedProcess, hf0]
100+
101+
@[deprecated (since := "2025-10-25")] alias Submartingale.stoppedValue_leastGE_eLpNorm_le :=
102+
Submartingale.eLpNorm_stoppedAbove_le
133103

134-
theorem Submartingale.stoppedValue_leastGE_eLpNorm_le' [IsFiniteMeasure μ]
104+
theorem Submartingale.eLpNorm_stoppedAbove_le' [IsFiniteMeasure μ]
135105
(hf : Submartingale f ℱ μ) (hr : 0 ≤ r) (hf0 : f 0 = 0)
136106
(hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
137-
eLpNorm (stoppedValue f (leastGE f r i)) 1 μ
138-
ENNReal.toNNReal (2 * μ Set.univ * ENNReal.ofReal (r + R)) := by
139-
refine (hf.stoppedValue_leastGE_eLpNorm_le hr hf0 hbdd i).trans ?_
107+
eLpNorm (stoppedAbove f r i) 1 μ
108+
ENNReal.toNNReal (2 * μ Set.univ * ENNReal.ofReal (r + R)) := by
109+
refine (hf.eLpNorm_stoppedAbove_le hr hf0 hbdd i).trans ?_
140110
simp [ENNReal.coe_toNNReal (measure_ne_top μ _), ENNReal.coe_toNNReal]
141111

112+
@[deprecated (since := "2025-10-25")] alias Submartingale.stoppedValue_leastGE_eLpNorm_le' :=
113+
Submartingale.eLpNorm_stoppedAbove_le'
114+
142115
/-- This lemma is superseded by `Submartingale.bddAbove_iff_exists_tendsto`. -/
143116
theorem Submartingale.exists_tendsto_of_abs_bddAbove_aux [IsFiniteMeasure μ]
144117
(hf : Submartingale f ℱ μ) (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
145118
∀ᵐ ω ∂μ, BddAbove (Set.range fun n => f n ω) → ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c) := by
146-
have ht :
147-
∀ᵐ ω ∂μ, ∀ i : ℕ, ∃ c, Tendsto (fun n => stoppedValue f (leastGE f i n) ω) atTop (𝓝 c) := by
119+
have ht : ∀ᵐ ω ∂μ, ∀ i : ℕ, ∃ c, Tendsto (fun n => stoppedAbove f i n ω) atTop (𝓝 c) := by
148120
rw [ae_all_iff]
149-
exact fun i => Submartingale.exists_ae_tendsto_of_bdd (hf.stoppedValue_leastGE i)
150-
(hf.stoppedValue_leastGE_eLpNorm_le' i.cast_nonneg hf0 hbdd)
121+
exact fun i Submartingale.exists_ae_tendsto_of_bdd (hf.stoppedAbove i)
122+
(hf.eLpNorm_stoppedAbove_le' i.cast_nonneg hf0 hbdd)
151123
filter_upwards [ht] with ω hω hωb
152124
rw [BddAbove] at hωb
153125
obtain ⟨i, hi⟩ := exists_nat_gt hωb.some
154126
have hib : ∀ n, f n ω < i := by
155127
intro n
156128
exact lt_of_le_of_lt ((mem_upperBounds.1 hωb.some_mem) _ ⟨n, rfl⟩) hi
157-
have heq : ∀ n, stoppedValue f (leastGE f i n) ω = f n ω := by
129+
have heq : ∀ n, stoppedAbove f i n ω = f n ω := by
158130
intro n
159-
rw [leastGE]; unfold hitting; rw [stoppedValue]
160-
rw [if_neg]
161-
simp only [Set.mem_Icc, Set.mem_Ici]
162-
push_neg
163-
exact fun j _ => hib j
131+
rw [stoppedAbove, stoppedProcess, leastGE, hittingAfter_eq_top_iff.mpr]
132+
· simp only [le_top, inf_of_le_left]
133+
congr
134+
· simp [hib]
164135
simp only [← heq, hω i]
165136

166137
theorem Submartingale.bddAbove_iff_exists_tendsto_aux [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)

Mathlib/Probability/Martingale/OptionalSampling.lean

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ variable {Ω E : Type*} {m : MeasurableSpace Ω} {μ : Measure Ω} [NormedAddCom
4343
section FirstCountableTopology
4444

4545
variable {ι : Type*} [LinearOrder ι] [TopologicalSpace ι] [OrderTopology ι]
46-
[FirstCountableTopology ι] {ℱ : Filtration ι m} [SigmaFiniteFiltration μ ℱ] {τ σ : Ω → ι}
46+
[FirstCountableTopology ι] {ℱ : Filtration ι m} [SigmaFiniteFiltration μ ℱ] {τ σ : Ω → WithTop ι}
4747
{f : ι → Ω → E} {i n : ι}
4848

49-
theorem condExp_stopping_time_ae_eq_restrict_eq_const
50-
[(Filter.atTop : Filter ι).IsCountablyGenerated] (h : Martingale f ℱ μ)
49+
theorem condExp_stopping_time_ae_eq_restrict_eq_const (h : Martingale f ℱ μ)
5150
(hτ : IsStoppingTime ℱ τ) [SigmaFinite (μ.trim hτ.measurableSpace_le)] (hin : i ≤ n) :
5251
μ[f n|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] f i := by
5352
refine Filter.EventuallyEq.trans ?_ (ae_restrict_of_ae (h.condExp_ae_eq hin))
@@ -67,8 +66,10 @@ theorem condExp_stopping_time_ae_eq_restrict_eq_const_of_le_const (h : Martingal
6766
· suffices {x : Ω | τ x = i} = ∅ by simp [this]; norm_cast
6867
ext1 x
6968
simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false]
70-
rintro rfl
71-
exact hin (hτ_le x)
69+
contrapose! hin
70+
exact_mod_cast hin ▸ hτ_le x
71+
72+
variable [Nonempty ι]
7273

7374
theorem stoppedValue_ae_eq_restrict_eq (h : Martingale f ℱ μ) (hτ : IsStoppingTime ℱ τ)
7475
(hτ_le : ∀ x, τ x ≤ n) [SigmaFinite (μ.trim (hτ.measurableSpace_le_of_le hτ_le))] (i : ι) :
@@ -78,7 +79,7 @@ theorem stoppedValue_ae_eq_restrict_eq (h : Martingale f ℱ μ) (hτ : IsStoppi
7879
rw [Filter.EventuallyEq, ae_restrict_iff' (ℱ.le _ _ (hτ.measurableSet_eq i))]
7980
refine Filter.Eventually.of_forall fun x hx => ?_
8081
rw [Set.mem_setOf_eq] at hx
81-
simp_rw [stoppedValue, hx]
82+
simp [stoppedValue, hx]
8283

8384
/-- The value of a martingale `f` at a stopping time `τ` bounded by `n` is the conditional
8485
expectation of `f n` with respect to the σ-algebra generated by `τ`. -/
@@ -92,7 +93,14 @@ theorem stoppedValue_ae_eq_condExp_of_le_const_of_countable_range (h : Martingal
9293
Set.mem_iUnion, Set.mem_setOf_eq, exists_apply_eq_apply']
9394
nth_rw 1 [← @Measure.restrict_univ Ω _ μ]
9495
rw [this, ae_eq_restrict_biUnion_iff _ h_countable_range]
95-
exact fun i _ => stoppedValue_ae_eq_restrict_eq h _ hτ_le i
96+
intro i hi
97+
have h_top : i ≠ ⊤ := fun h ↦ by
98+
simp only [h, Set.mem_range] at hi
99+
obtain ⟨ω , hω⟩ := hi
100+
specialize hτ_le ω
101+
simp [hω] at hτ_le
102+
lift i to ι using h_top with i
103+
exact stoppedValue_ae_eq_restrict_eq h _ hτ_le i
96104

97105
/-- The value of a martingale `f` at a stopping time `τ` bounded by `n` is the conditional
98106
expectation of `f n` with respect to the σ-algebra generated by `τ`. -/
@@ -143,7 +151,7 @@ and is a measurable space with the Borel σ-algebra. -/
143151

144152
variable {ι : Type*} [LinearOrder ι] [LocallyFiniteOrder ι] [OrderBot ι] [TopologicalSpace ι]
145153
[DiscreteTopology ι] [MeasurableSpace ι] [BorelSpace ι] [MeasurableSpace E] [BorelSpace E]
146-
[SecondCountableTopology E] {ℱ : Filtration ι m} {τ σ : Ω → ι} {f : ι → Ω → E} {i : ι}
154+
[SecondCountableTopology E] {ℱ : Filtration ι m} {τ σ : Ω → WithTop ι} {f : ι → Ω → E} {i : ι}
147155

148156
theorem condExp_stoppedValue_stopping_time_ae_eq_restrict_le (h : Martingale f ℱ μ)
149157
(hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ) [SigmaFinite (μ.trim hσ.measurableSpace_le)]

0 commit comments

Comments
 (0)