Skip to content

Commit 6eedf69

Browse files
committed
feat(Probability): Generalize some theorems by replacing StronglyAdapted with Adapted (leanprover-community#34381)
I changed the name from `hittingBtwn_isStoppingTime` to `Adapted.isStoppingTime_hittingBtwn`. This allows us to take advantage of the dot notation, so that for example, we can prove the following theorem in one line: ``` theorem StronglyAdapted.isStoppingTime_hittingBtwn [ConditionallyCompleteLinearOrder ι] [WellFoundedLT ι] [Countable ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] {f : Filtration ι m} {u : ι → Ω → β} {s : Set β} {n n' : ι} (hu : StronglyAdapted f u) (hs : MeasurableSet s) : IsStoppingTime f (fun ω ↦ (hittingBtwn u s n n' ω : ι)) := hu.adapted.isStoppingTime_hittingBtwn hs ``` I also golfed some proofs.
1 parent be60ca1 commit 6eedf69

4 files changed

Lines changed: 31 additions & 41 deletions

File tree

Mathlib/Probability/Martingale/BorelCantelli.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ noncomputable def leastGE (f : ℕ → Ω → ℝ) (r : ℝ) : Ω → ℕ∞ :=
5555

5656
theorem StronglyAdapted.isStoppingTime_leastGE (r : ℝ) (hf : StronglyAdapted ℱ f) :
5757
IsStoppingTime ℱ (leastGE f r) :=
58-
hittingAfter_isStoppingTime hf measurableSet_Ici
58+
hf.adapted.isStoppingTime_hittingAfter measurableSet_Ici
5959

6060
/-- The stopped process of `f` above `r` is the process that is equal to `f` until `leastGE f r`
6161
(the first time `f` passes above `r`), and then is constant afterwards. -/

Mathlib/Probability/Martingale/OptionalStopping.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ theorem smul_le_stoppedValue_hittingBtwn [IsFiniteMeasure μ] (hsub : Submarting
134134
have h := setIntegral_ge_of_const_le_real (measurableSet_le measurable_const
135135
(Finset.measurable_range_sup'' fun n _ => (hsub.stronglyMeasurable n).measurable.le (𝒢.le n)))
136136
(measure_ne_top _ _) this (Integrable.integrableOn (hsub.integrable_stoppedValue
137-
(hittingBtwn_isStoppingTime hsub.stronglyAdapted measurableSet_Ici)
137+
(hsub.stronglyAdapted.adapted.isStoppingTime_hittingBtwn measurableSet_Ici)
138138
(mod_cast hittingBtwn_le)))
139139
rw [ENNReal.le_ofReal_iff_toReal_le, ENNReal.toReal_smul]
140140
· exact h
@@ -197,7 +197,7 @@ theorem maximal_ineq [IsFiniteMeasure μ] (hsub : Submartingale f 𝒢 μ) (hnon
197197
· exact (hsub.integrable n).integrableOn
198198
· refine Integrable.integrableOn ?_
199199
refine hsub.integrable_stoppedValue ?_ (fun ω ↦ mod_cast hittingBtwn_le ω)
200-
exact hittingBtwn_isStoppingTime hsub.stronglyAdapted measurableSet_Ici
200+
exact hsub.stronglyAdapted.adapted.isStoppingTime_hittingBtwn measurableSet_Ici
201201
· exact nullMeasurableSet_lt (Finset.measurable_range_sup'' fun n _ ↦
202202
(hsub.stronglyMeasurable n).measurable.le (𝒢.le n)).aemeasurable aemeasurable_const
203203
rw [Set.mem_setOf_eq] at hω
@@ -226,17 +226,17 @@ theorem maximal_ineq [IsFiniteMeasure μ] (hsub : Submartingale f 𝒢 μ) (hnon
226226
· exact measurableSet_lt (Finset.measurable_range_sup'' fun n _ =>
227227
(hsub.stronglyMeasurable n).measurable.le (𝒢.le n)) measurable_const
228228
· exact Integrable.integrableOn (hsub.integrable_stoppedValue
229-
(hittingBtwn_isStoppingTime hsub.stronglyAdapted measurableSet_Ici)
229+
(hsub.stronglyAdapted.adapted.isStoppingTime_hittingBtwn measurableSet_Ici)
230230
(fun ω ↦ mod_cast hittingBtwn_le ω))
231231
· exact Integrable.integrableOn (hsub.integrable_stoppedValue
232-
(hittingBtwn_isStoppingTime hsub.stronglyAdapted measurableSet_Ici)
232+
(hsub.stronglyAdapted.adapted.isStoppingTime_hittingBtwn measurableSet_Ici)
233233
(fun ω ↦ mod_cast hittingBtwn_le ω))
234234
exacts [integral_nonneg fun x => hnonneg _ _, integral_nonneg fun x => hnonneg _ _]
235235
_ ≤ ENNReal.ofReal (μ[f n]) := by
236236
refine ENNReal.ofReal_le_ofReal ?_
237237
rw [← stoppedValue_const f n]
238238
refine hsub.expected_stoppedValue_mono
239-
(hittingBtwn_isStoppingTime hsub.stronglyAdapted measurableSet_Ici)
239+
(hsub.stronglyAdapted.adapted.isStoppingTime_hittingBtwn measurableSet_Ici)
240240
(isStoppingTime_const _ _) (fun ω ↦ ?_) (fun _ => mod_cast le_rfl)
241241
simp [hittingBtwn_le]
242242

Mathlib/Probability/Martingale/Upcrossing.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ theorem StronglyAdapted.isStoppingTime_crossing (hf : StronglyAdapted ℱ f) :
319319
| zero =>
320320
refine ⟨isStoppingTime_const _ 0, ?_⟩
321321
simp only [lowerCrossingTime_zero, Nat.bot_eq_zero]
322-
exact hittingBtwn_isStoppingTime hf measurableSet_Iic
322+
exact hf.adapted.isStoppingTime_hittingBtwn measurableSet_Iic
323323
| succ k ih =>
324324
have : IsStoppingTime ℱ (fun ω ↦ (upperCrossingTime a b f N (k + 1) ω : ℕ)) := by
325325
intro n
326326
simp_rw [upperCrossingTime_succ_eq]
327-
refine isStoppingTime_hittingBtwn_isStoppingTime ih.2 ?_ measurableSet_Ici hf _
327+
refine hf.adapted.isStoppingTime_hittingBtwn_isStoppingTime ih.2 ?_ measurableSet_Ici _
328328
simp [lowerCrossingTime_le]
329329
refine ⟨this, fun n ↦ ?_⟩
330-
refine isStoppingTime_hittingBtwn_isStoppingTime this ?_ measurableSet_Iic hf _
330+
refine hf.adapted.isStoppingTime_hittingBtwn_isStoppingTime this ?_ measurableSet_Iic _
331331
simp [upperCrossingTime_le]
332332

333333
theorem StronglyAdapted.isStoppingTime_upperCrossingTime (hf : StronglyAdapted ℱ f) :

Mathlib/Probability/Process/HittingTime.lean

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -420,38 +420,31 @@ lemma hittingAfter_apply_mono (u : ι → Ω → β) (s : Set β) (ω : Ω) :
420420
end Inequalities
421421

422422
/-- A discrete hitting time is a stopping time. -/
423-
theorem hittingBtwn_isStoppingTime [ConditionallyCompleteLinearOrder ι] [WellFoundedLT ι]
424-
[Countable ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
425-
{f : Filtration ι m} {u : ι → Ω → β} {s : Set β} {n n' : ι} (hu : StronglyAdapted f u)
426-
(hs : MeasurableSet s) : IsStoppingTime f (fun ω ↦ (hittingBtwn u s n n' ω : ι)) := by
423+
theorem Adapted.isStoppingTime_hittingBtwn [ConditionallyCompleteLinearOrder ι] [WellFoundedLT ι]
424+
[Countable ι] {_ : MeasurableSpace β} {f : Filtration ι m} {u : ι → Ω → β} {s : Set β}
425+
{n n' : ι} (hu : Adapted f u) (hs : MeasurableSet s) :
426+
IsStoppingTime f (fun ω ↦ (hittingBtwn u s n n' ω : ι)) := by
427427
intro i
428428
rcases le_or_gt n' i with hi | hi
429429
· have h_le : ∀ ω, hittingBtwn u s n n' ω ≤ i := fun x => (hittingBtwn_le x).trans hi
430430
simp [h_le]
431431
· have h_set_eq_Union : {ω | hittingBtwn u s n n' ω ≤ i} = ⋃ j ∈ Set.Icc n i, u j ⁻¹' s := by
432-
ext x
433-
rw [Set.mem_setOf_eq, hittingBtwn_le_iff_of_lt _ hi]
434-
simp only [Set.mem_Icc, exists_prop, Set.mem_iUnion, Set.mem_preimage]
435-
simp_rw [WithTop.coe_le_coe, h_set_eq_Union]
436-
exact MeasurableSet.iUnion fun j =>
437-
MeasurableSet.iUnion fun hj => f.mono hj.2 _ ((hu j).measurable hs)
432+
ext; simp [hittingBtwn_le_iff_of_lt _ hi]
433+
simpa [h_set_eq_Union] using MeasurableSet.iUnion fun j =>
434+
MeasurableSet.iUnion fun hj => f.mono hj.2 _ ((hu j) hs)
438435

439-
@[deprecated (since := "2025-10-25")] alias hitting_isStoppingTime := hittingBtwn_isStoppingTime
436+
@[deprecated (since := "2025-10-25")] alias hitting_isStoppingTime :=
437+
Adapted.isStoppingTime_hittingBtwn
440438

441-
/-- A discrete hitting time is a stopping time. -/
442-
theorem hittingAfter_isStoppingTime [ConditionallyCompleteLinearOrder ι] [WellFoundedLT ι]
443-
[Countable ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
444-
{f : Filtration ι m} {u : ι → Ω → β} {s : Set β} {n : ι}
445-
(hu : StronglyAdapted f u) (hs : MeasurableSet s) :
439+
theorem Adapted.isStoppingTime_hittingAfter [ConditionallyCompleteLinearOrder ι]
440+
[WellFoundedLT ι] [Countable ι] {_ : MeasurableSpace β} {f : Filtration ι m} {u : ι → Ω → β}
441+
{s : Set β} {n : ι} (hu : Adapted f u) (hs : MeasurableSet s) :
446442
IsStoppingTime f (hittingAfter u s n) := by
447443
intro i
448444
have h_set_eq_Union : {ω | hittingAfter u s n ω ≤ i} = ⋃ j ∈ Set.Icc n i, u j ⁻¹' s := by
449-
ext x
450-
rw [Set.mem_setOf_eq, hittingAfter_le_iff]
451-
simp only [Set.mem_Icc, exists_prop, Set.mem_iUnion, Set.mem_preimage]
452-
rw [h_set_eq_Union]
453-
exact MeasurableSet.iUnion fun j =>
454-
MeasurableSet.iUnion fun hj => f.mono hj.2 _ ((hu j).measurable hs)
445+
ext; simp [hittingAfter_le_iff]
446+
simpa [h_set_eq_Union] using MeasurableSet.iUnion fun j =>
447+
MeasurableSet.iUnion fun hj => f.mono hj.2 _ ((hu j) hs)
455448

456449
theorem stoppedValue_hittingBtwn_mem [ConditionallyCompleteLinearOrder ι] [WellFoundedLT ι]
457450
{u : ι → Ω → β} {s : Set β} {n m : ι} {ω : Ω} (h : ∃ j ∈ Set.Icc n m, u j ω ∈ s) :
@@ -466,12 +459,11 @@ theorem stoppedValue_hittingBtwn_mem [ConditionallyCompleteLinearOrder ι] [Well
466459

467460
/-- The hitting time of a discrete process with the starting time indexed by a stopping time
468461
is a stopping time. -/
469-
theorem isStoppingTime_hittingBtwn_isStoppingTime [ConditionallyCompleteLinearOrder ι]
462+
theorem Adapted.isStoppingTime_hittingBtwn_isStoppingTime [ConditionallyCompleteLinearOrder ι]
470463
[WellFoundedLT ι] [Countable ι] [TopologicalSpace ι] [OrderTopology ι]
471-
[FirstCountableTopology ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β]
472-
[BorelSpace β] {f : Filtration ι m} {u : ι → Ω → β} {τ : Ω → WithTop ι}
473-
(hτ : IsStoppingTime f τ)
474-
{N : ι} (hτbdd : ∀ x, τ x ≤ N) {s : Set β} (hs : MeasurableSet s) (hf : StronglyAdapted f u) :
464+
[FirstCountableTopology ι] [MeasurableSpace β] {f : Filtration ι m} {u : ι → Ω → β}
465+
{τ : Ω → WithTop ι} (hτ : IsStoppingTime f τ)
466+
{N : ι} (hτbdd : ∀ x, τ x ≤ N) {s : Set β} (hs : MeasurableSet s) (hf : Adapted f u) :
475467
IsStoppingTime f fun x ↦ (hittingBtwn u s (τ x).untopA N x : ι) := by
476468
intro n
477469
have h₁ : {x | hittingBtwn u s (τ x).untopA N x ≤ n} =
@@ -494,15 +486,13 @@ theorem isStoppingTime_hittingBtwn_isStoppingTime [ConditionallyCompleteLinearOr
494486
lift τ x to ι using h_top with t
495487
rw [hτ] at hτbdd
496488
exact mod_cast hτbdd
497-
simp only [WithTop.coe_le_coe]
498-
rw [h₁, h₂, Set.union_empty]
489+
simp only [WithTop.coe_le_coe, h₁, h₂, Set.union_empty]
499490
refine MeasurableSet.iUnion fun i => MeasurableSet.iUnion fun hi =>
500491
(f.mono hi _ (hτ.measurableSet_eq i)).inter ?_
501-
have h := hittingBtwn_isStoppingTime (n := i) (n' := N) hf hs n
502-
simpa only [WithTop.coe_le_coe] using h
492+
simpa using hf.isStoppingTime_hittingBtwn hs n
503493

504494
@[deprecated (since := "2025-10-25")] alias isStoppingTime_hitting_isStoppingTime :=
505-
isStoppingTime_hittingBtwn_isStoppingTime
495+
Adapted.isStoppingTime_hittingBtwn_isStoppingTime
506496

507497
section CompleteLattice
508498

0 commit comments

Comments
 (0)