Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Probability/Process/     Datei vom 15.10.2026 mit Größe 12 kB image not shown  

SSL LimitProcess.lean   Sprache: Lean

 

/-
Copyright (c) 2026 Etienne Marion. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Etienne Marion, Kexing Ying, Rémy Degenne
-/

module

public import Mathlib.Probability.Process.Filtration
public import Mathlib.Probability.Process.Indistinguishable

/-!
# Limit of a stochastic process

Under certain assumptions, classical familes of processes such as martingales converge as time
goes to infinity, and several important properties of the process can be inferred from this limit,
so that it is useful to be able to refer to this limit via a definition.
This file thus provides a definition `��.limitProcess X P`, which is the limit of the process `X`
under the measure `P` with an ambient filtration `��`. This is defined for any `X : ι → Ω → E`,
but of course it only makes sense if `X` converges. Moreover, in concrete use cases, `X` will
be strongly adapted to the filtration `��`, so that the limit will be `⨆ t, �� t`-strongly measurable.
Therefore we define `��.limitProcess X P` to be a `⨆ t, �� t`-strongly measurable almost everywhere
limit if it exists, and `0` otherwise.

This definition is for example used to phrase the a.e. martingale convergence theorem
`Submartingale.ae_tendsto_limitProcess` where an L¹-bounded submartingale `X` adapted to `��`
converges to `limitProcess X �� P` `P`-almost everywhere.

In this file we provide the definition and prove basic preservation properties of the limit
under continuous maps.

Because several properties often rely on the fact that the limit exists, we also define a predicate
`HasLimitProcess X �� P` which states that `X` does converge `P`-almost surely towards a
`⨆ t, �� t`-strongly measurable function.
-/


public section

open MeasureTheory Filter
open scoped Topology ENNReal NNReal

namespace MeasureTheory.Filtration

variable {ι Ω E F G : Type*} [Preorder ι] {mΩ : MeasurableSpace Ω} [TopologicalSpace E]
  [TopologicalSpace F] [TopologicalSpace G] {P : Measure Ω} {�� : Filtration ι mΩ}
  {X Y : ι → Ω → E} {Z : ι → Ω → F} {g : Ω → E}

section HasLimitProcess

/-! ### `HasLimitProcess` predicate -/

/-- A stochastic process `X` satisfies `��.HasLimitProcess X P` if it converges `P`-almost surely
towards a `⨆ t, �� t`-strongly measurable random variable. -/

@[expose]
def HasLimitProcess (X : ι → Ω → E) (�� : Filtration ι mΩ) (P : Measure Ω) : Prop :=
  ∃ g : Ω → E, StronglyMeasurable[⨆ t, �� t] g ∧ ∀ᵐ ω ∂P, Tendsto (X · ω) atTop (�� (g ω))

lemma HasLimitProcess.congr (h : X ≡ᵐ[P] Y) (hX : HasLimitProcess X �� P) :
    HasLimitProcess Y �� P := by
  obtain ⟨g, mg, hg⟩ := hX
  refine ⟨g, mg, ?_⟩
  filter_upwards [h, hg] with ω h1 h2
  simp_all

lemma hasLimitProcess_congr_iff (h : X ≡ᵐ[P] Y) :
    HasLimitProcess X �� P ↔ HasLimitProcess Y �� P where
  mp h' := h'.congr h
  mpr h' := h'.congr h.symm

lemma HasLimitProcess.comp {f : E → F} (hX : HasLimitProcess X �� P) (hf : Continuous f) :
    HasLimitProcess (fun t ω ↦ f (X t ω)) �� P := by
  obtain ⟨g, mg, hg⟩ := hX
  refine ⟨f ∘ g, hf.comp_stronglyMeasurable mg, ?_⟩
  filter_upwards [hg] with ω h using (hf.tendsto _).comp h

lemma HasLimitProcess.comp₂ {f : E → F → G} (hX : HasLimitProcess X �� P)
    (hZ : HasLimitProcess Z �� P) (hf : Continuous f.uncurry) :
    HasLimitProcess (fun t ω ↦ f (X t ω) (Z t ω)) �� P := by
  obtain ⟨g, mg, hg⟩ := hX
  obtain ⟨h, mh, hh⟩ := hZ
  refine ⟨f.uncurry ∘ (Function.prod g h), hf.comp_stronglyMeasurable (mg.prodMk mh), ?_⟩
  filter_upwards [hg, hh] with ω h1 h2 using (hf.tendsto _).comp (h1.prodMk_nhds h2)

@[to_additive]
lemma HasLimitProcess.smul {G : Type*} [SMul G E] [ContinuousConstSMul G E] (c : G)
    (hX : HasLimitProcess X �� P) :
    HasLimitProcess (c • X) �� P :=
  hX.comp (continuous_const_smul c)

@[to_additive]
lemma hasLimitProcess_smul_iff {G : Type*} [Group G] [MulAction G E] [ContinuousConstSMul G E]
    {c : G} :
    HasLimitProcess (c • X) �� P ↔ HasLimitProcess X �� P where
  mp h := by
    convert h.comp (continuous_const_smul c⁻¹)
    simp
  mpr h := h.smul c

@[to_additive]
alias ⟨HasLimitProcess.of_smul, _⟩ := hasLimitProcess_smul_iff

lemma hasLimitProcess_smul_iff₀ {G : Type*} [GroupWithZero G] [MulAction G E]
    [ContinuousConstSMul G E] {c : G} (hc : c ≠ 0) :
    HasLimitProcess (c • X) �� P ↔ HasLimitProcess X �� P where
  mp h := by
    convert h.comp (continuous_const_smul c⁻¹)
    simp [hc]
  mpr h := h.smul c

alias ⟨HasLimitProcess.of_smul₀, _⟩ := hasLimitProcess_smul_iff₀

@[to_additive]
lemma HasLimitProcess.inv [Inv E] [ContinuousInv E] (hX : HasLimitProcess X �� P) :
    HasLimitProcess (X⁻¹) �� P :=
  hX.comp continuous_inv

@[to_additive]
lemma hasLimitProcess_inv_iff [InvolutiveInv E] [ContinuousInv E] :
    HasLimitProcess (X⁻¹) �� P ↔ HasLimitProcess X �� P where
  mp h := by
    convert h.comp continuous_inv
    simp
  mpr h := h.inv

@[to_additive]
alias ⟨HasLimitProcess.of_inv, _⟩ := hasLimitProcess_inv_iff

@[to_additive]
lemma HasLimitProcess.mul [Mul E] [ContinuousMul E] (hX : HasLimitProcess X �� P)
    (hY : HasLimitProcess Y �� P) :
    HasLimitProcess (X * Y) �� P :=
  hX.comp₂ hY continuous_mul

@[to_additive sub]
lemma HasLimitProcess.div' [Div E] [ContinuousDiv E] (hX : HasLimitProcess X �� P)
    (hY : HasLimitProcess Y �� P) :
    HasLimitProcess (X / Y) �� P :=
  hX.comp₂ hY continuous_div'

lemma HasLimitProcess.prodMk (hX : HasLimitProcess X �� P) (hZ : HasLimitProcess Z �� P) :
    HasLimitProcess (fun t ω ↦ (X t ω, Z t ω)) �� P :=
  hX.comp₂ hZ continuous_id

end HasLimitProcess

section limitProcess

/-! ### The limit of a process -/

section Def

variable [Zero E]

open scoped Classical in
/-- Given a process `X` and a filtration `��`, if `X` converges to some `g` almost everywhere and
`g` is `⨆ t, �� t`-measurable (i.e. `HasLimitProcess X �� P` holds),
then `limitProcess X �� P` chooses said `g`, else it returns 0.

This definition is used to phrase the a.e. martingale convergence theorem
`Submartingale.ae_tendsto_limitProcess` where an L¹-bounded submartingale `X` adapted to `��`
converges to `limitProcess X �� P` `P`-almost everywhere. -/

noncomputable def limitProcess (X : ι → Ω → E) (�� : Filtration ι mΩ) (P : Measure Ω) :=
  if h : ��.HasLimitProcess X P then h.choose else 0

lemma HasLimitProcess.ae_tendsto_limitProcess (h : HasLimitProcess X �� P) :
    ∀ᵐ ω ∂P, Tendsto (X · ω) atTop (�� (��.limitProcess X P ω)) := by
  rw [limitProcess, dite_eq_left h]
  exact h.choose_spec.2

theorem stronglyMeasurable_limitProcess : StronglyMeasurable[⨆ t, �� t] (limitProcess X �� P) := by
  rw [limitProcess]
  split_ifs with h
  exacts [h.choose_spec.1, stronglyMeasurable_zero]

theorem stronglyMeasurable_limit_process' : StronglyMeasurable[mΩ] (limitProcess X �� P) :=
  stronglyMeasurable_limitProcess.mono (iSup_le ��.le)

end Def

section Preserved

variable [IsDirectedOrder ι] [Nonempty ι]

section Basic

variable [T2Space E] [Zero E]

/-- If `X` converges almost surely towards `g` a `⨆ t, �� t`-strongly measurable function,
then `g` is almost surely equal to `��.limitProcess X P`. -/

lemma limitProcess_ae_eq (mg : StronglyMeasurable[⨆ t, �� t] g)
    (hg : ∀ᵐ ω ∂P, Tendsto (X · ω) atTop (�� (g ω))) :
    ��.limitProcess X P =ᵐ[P] g := by
  have : HasLimitProcess X �� P := ⟨g, mg, hg⟩
  rw [limitProcess, dite_eq_left this]
  filter_upwards [hg, this.choose_spec.2] with ω h1 h2 using tendsto_nhds_unique h2 h1

omit [Nonempty ι] in
@[gcongr]
lemma limitProcess_congr (hXY : X ≡ᵐ[P] Y) :
    ��.limitProcess X P =ᵐ[P] ��.limitProcess Y P := by
  obtain h | _ := isEmpty_or_nonempty ι
  · have : X = Y := by ext i; exact h.elim' i
    rw [this]
  rw [limitProcess]
  split_ifs with h
  · symm
    apply limitProcess_ae_eq h.choose_spec.1
    filter_upwards [h.choose_spec.2, hXY] with ω h1 h2 using h1.congr h2
  · rw [limitProcess, dite_eq_right ((hasLimitProcess_congr_iff hXY).not.1 h)]

lemma limitProcess_const (c : E) :
    ��.limitProcess (fun _ _ ↦ c) P =ᵐ[P] (fun _ ↦ c) :=
  limitProcess_ae_eq stronglyMeasurable_const (by simp)

lemma limitProcess_zero :
    ��.limitProcess (0 : ι → Ω → E) P =ᵐ[P] 0 := limitProcess_const 0

end Basic

section Maps

variable {F G : Type*} [Zero F] [TopologicalSpace F] [Zero G] [TopologicalSpace G]

@[to_fun limitProcess_fun_comp]
lemma HasLimitProcess.limitProcess_comp [Zero E] [T2Space F] {f : E → F} (hf : Continuous f)
    (hX : HasLimitProcess X �� P) :
    ��.limitProcess (fun t ω ↦ f (X t ω)) P =ᵐ[P] f ∘ (��.limitProcess X P) := by
  apply ��.limitProcess_ae_eq (hf.comp_stronglyMeasurable ��.stronglyMeasurable_limitProcess)
  filter_upwards [hX.ae_tendsto_limitProcess] with ω h using (hf.tendsto _).comp h

lemma HasLimitProcess.limitProcess_comp₂ [Zero E] [T2Space G] {f : E → F → G}
    (hf : Continuous f.uncurry) {Y : ι → Ω → F}
    (hX : HasLimitProcess X �� P) (hY : HasLimitProcess Y �� P) :
    ��.limitProcess (fun t ω ↦ f (X t ω) (Y t ω)) P =ᵐ[P]
      fun ω ↦ f (��.limitProcess X P ω) (��.limitProcess Y P ω) := by
  apply ��.limitProcess_ae_eq (hf.comp_stronglyMeasurable
    (��.stronglyMeasurable_limitProcess.prodMk ��.stronglyMeasurable_limitProcess))
  filter_upwards [hX.ae_tendsto_limitProcess, hY.ae_tendsto_limitProcess] with
    ω h1 h2 using (hf.tendsto _).comp (h1.prodMk_nhds h2)

variable [T2Space E] [T2Space F]

@[to_fun limitProcess_fun_vadd]
lemma HasLimitProcess.limitProcess_vadd [Zero E] {G : Type*} [VAdd G E]
    [ContinuousConstVAdd G E] (c : G) (hX : HasLimitProcess X �� P) :
    ��.limitProcess (c +ᵥ X) P =ᵐ[P] c +ᵥ ��.limitProcess X P :=
  hX.limitProcess_comp (continuous_const_vadd c)

@[to_fun limitProcess_fun_smul]
lemma limitProcess_smul [Zero E] {G : Type*} [GroupWithZero G] [MulActionWithZero G E]
    [ContinuousConstSMul G E] (X : ι → Ω → E) (c : G) :
    ��.limitProcess (c • X) P =ᵐ[P] c • ��.limitProcess X P := by
  obtain rfl | hc := eq_or_ne c 0
  · simp [limitProcess_zero]
  nth_rw 2 [limitProcess]
  split_ifs with h
  · apply limitProcess_ae_eq (h.choose_spec.1.const_smul c)
    filter_upwards [h.choose_spec.2] with ω h1 using h1.const_smul c
  rw [limitProcess, dite_eq_right ((hasLimitProcess_smul_iff₀ hc).not.2 h)]
  simp

@[to_fun limitProcess_fun_neg]
lemma limitProcess_neg [AddGroup E] [ContinuousNeg E] (X : ι → Ω → E) :
    ��.limitProcess (-X) P =ᵐ[P] -��.limitProcess X P := by
  nth_rw 2 [limitProcess]
  split_ifs with h
  · apply limitProcess_ae_eq h.choose_spec.1.neg
    filter_upwards [h.choose_spec.2] with ω h1 using h1.neg
  rw [limitProcess, dite_eq_right]
  · simp
  contrapose h
  obtain ⟨g, hg1, hg2⟩ := h
  refine ⟨-g, hg1.neg, ?_⟩
  filter_upwards [hg2] with ω h1
  simpa using h1.neg

@[to_fun (attr := to_additive) limitProcess_fun_mul]
lemma limitProcess_mul [Zero E] [Mul E] [ContinuousMul E]
    (hX : HasLimitProcess X �� P) (hY : HasLimitProcess Y �� P) :
    ��.limitProcess (X * Y) P =ᵐ[P] ��.limitProcess X P * ��.limitProcess Y P :=
  hX.limitProcess_comp₂ continuous_mul hY

@[to_fun limitProcess_fun_div']
lemma limitProcess_div' [Zero E] [Div E] [ContinuousDiv E]
    (hX : HasLimitProcess X �� P) (hY : HasLimitProcess Y �� P) :
    ��.limitProcess (X / Y) P =ᵐ[P] ��.limitProcess X P / ��.limitProcess Y P :=
  hX.limitProcess_comp₂ continuous_div' hY

attribute [to_additive limitProcess_sub] limitProcess_div'
attribute [to_additive limitProcess_fun_sub] limitProcess_fun_div'

lemma limitProcess_prodMk [Zero E] (hX : HasLimitProcess X �� P) (hY : HasLimitProcess Y �� P) :
    ��.limitProcess (fun t ω ↦ (X t ω, Y t ω)) P =ᵐ[P]
      fun ω ↦ (��.limitProcess X P ω, ��.limitProcess Y P ω) :=
  hX.limitProcess_comp₂ (f := fun x y ↦ (x, y)) continuous_id hY

end Maps

end Preserved

/-- If a stochastic process is bounded in `Lp` then its limit is in `Lp`. -/
theorem memLp_limitProcess_of_eLpNorm_bdd {p : ℝ≥0∞} {F : Type*} [SeminormedAddGroup F]
    {�� : Filtration ℕ mΩ} {X : ℕ → Ω → F} (hfm : ∀ n, AEStronglyMeasurable (X n) P)
    (hbdd : ⨆ n, eLpNorm (X n) p P < ∞) : MemLp (limitProcess X �� P) p P := by
  rw [limitProcess]
  split_ifs with h
  swap; · exact .zero
  refine (Lp.eLpNorm_lim_le_liminf_eLpNorm hfm _ ?_ (Classical.choose_spec h).2).trans_lt ?_
  · exact StronglyMeasurable.aestronglyMeasurable
      ((Classical.choose_spec h).1.mono (sSup_le fun m ⟨n, hn⟩ ↦ hn ▸ ��.le _))
  · grw [liminf_le_limsup, limsup_le_iSup, hbdd]

end limitProcess

end MeasureTheory.Filtration

Messung
CHZG
9410010097

¤ Dauer der Verarbeitung: 0.4 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland