File: Mathlib/Probability/Martingale/Upcrossing.lean

full_name: MeasureTheory.lowerCrossingTimeAux
code: /-- `lowerCrossingTimeAux a f c N` is the first time `f` reached below `a` after time `c` before
time `N`. -/
noncomputable def lowerCrossingTimeAux [Preorder ι] [InfSet ι] (a : ℝ) (f : ι → Ω → ℝ) (c N : ι) :
    Ω → ι 
goal: Ω → ι

full_name: MeasureTheory.upperCrossingTime
code: /-- `upperCrossingTime a b f N n` is the first time before time `N`, `f` reaches
above `b` after `f` reached below `a` for the `n - 1`-th time. -/
noncomputable def upperCrossingTime [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ)
    (N : ι) : ℕ → Ω → ι
  
goal: ℕ → Ω → ι

full_name: MeasureTheory.lowerCrossingTime
code: /-- `lowerCrossingTime a b f N n` is the first time before time `N`, `f` reaches
below `a` after `f` reached above `b` for the `n`-th time. -/
noncomputable def lowerCrossingTime [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ)
    (N : ι) (n : ℕ) : Ω → ι 
goal: Ω → ι

full_name: MeasureTheory.upperCrossingTime_zero
code: @[simp]
theorem upperCrossingTime_zero : upperCrossingTime a b f N 0 = ⊥ 
goal: MeasureTheory.upperCrossingTime a b f N 0 = ⊥

full_name: MeasureTheory.lowerCrossingTime_zero
code: @[simp]
theorem lowerCrossingTime_zero : lowerCrossingTime a b f N 0 = hitting f (Set.Iic a) ⊥ N 
goal: MeasureTheory.lowerCrossingTime a b f N 0 = MeasureTheory.hitting f (Set.Iic a) ⊥ N

full_name: MeasureTheory.upperCrossingTime_succ
code: theorem upperCrossingTime_succ : upperCrossingTime a b f N (n + 1) ω =
    hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n ω) N ω) N ω 
goal: MeasureTheory.upperCrossingTime a b f N (n + 1) ω =
  MeasureTheory.hitting f (Set.Ici b)
    (MeasureTheory.lowerCrossingTimeAux a f (MeasureTheory.upperCrossingTime a b f N n ω) N ω) N ω

full_name: MeasureTheory.upperCrossingTime_succ_eq
code: theorem upperCrossingTime_succ_eq (ω : Ω) : upperCrossingTime a b f N (n + 1) ω =
    hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) N ω 
goal: MeasureTheory.upperCrossingTime a b f N (n + 1) ω =
  MeasureTheory.hitting f (Set.Ici b) (MeasureTheory.lowerCrossingTime a b f N n ω) N ω

full_name: MeasureTheory.upperCrossingTime_le
code: theorem upperCrossingTime_le : upperCrossingTime a b f N n ω ≤ N 
goal: MeasureTheory.upperCrossingTime a b f N n ω ≤ N

full_name: MeasureTheory.upperCrossingTime_zero'
code: @[simp]
theorem upperCrossingTime_zero' : upperCrossingTime a b f ⊥ n ω = ⊥ 
goal: MeasureTheory.upperCrossingTime a b f ⊥ n ω = ⊥

full_name: MeasureTheory.lowerCrossingTime_le
code: theorem lowerCrossingTime_le : lowerCrossingTime a b f N n ω ≤ N 
goal: MeasureTheory.lowerCrossingTime a b f N n ω ≤ N

full_name: MeasureTheory.upperCrossingTime_le_lowerCrossingTime
code: theorem upperCrossingTime_le_lowerCrossingTime :
    upperCrossingTime a b f N n ω ≤ lowerCrossingTime a b f N n ω 
goal: MeasureTheory.upperCrossingTime a b f N n ω ≤ MeasureTheory.lowerCrossingTime a b f N n ω

full_name: MeasureTheory.lowerCrossingTime_le_upperCrossingTime_succ
code: theorem lowerCrossingTime_le_upperCrossingTime_succ :
    lowerCrossingTime a b f N n ω ≤ upperCrossingTime a b f N (n + 1) ω 
goal: MeasureTheory.lowerCrossingTime a b f N n ω ≤ MeasureTheory.upperCrossingTime a b f N (n + 1) ω

full_name: MeasureTheory.lowerCrossingTime_mono
code: theorem lowerCrossingTime_mono (hnm : n ≤ m) :
    lowerCrossingTime a b f N n ω ≤ lowerCrossingTime a b f N m ω 
goal: MeasureTheory.lowerCrossingTime a b f N n ω ≤ MeasureTheory.lowerCrossingTime a b f N m ω

full_name: MeasureTheory.upperCrossingTime_mono
code: theorem upperCrossingTime_mono (hnm : n ≤ m) :
    upperCrossingTime a b f N n ω ≤ upperCrossingTime a b f N m ω 
goal: MeasureTheory.upperCrossingTime a b f N n ω ≤ MeasureTheory.upperCrossingTime a b f N m ω

full_name: MeasureTheory.stoppedValue_lowerCrossingTime
code: theorem stoppedValue_lowerCrossingTime (h : lowerCrossingTime a b f N n ω ≠ N) :
    stoppedValue f (lowerCrossingTime a b f N n) ω ≤ a 
goal: MeasureTheory.stoppedValue f (MeasureTheory.lowerCrossingTime a b f N n) ω ≤ a

full_name: MeasureTheory.stoppedValue_upperCrossingTime
code: theorem stoppedValue_upperCrossingTime (h : upperCrossingTime a b f N (n + 1) ω ≠ N) :
    b ≤ stoppedValue f (upperCrossingTime a b f N (n + 1)) ω 
goal: b ≤ MeasureTheory.stoppedValue f (MeasureTheory.upperCrossingTime a b f N (n + 1)) ω

full_name: MeasureTheory.upperCrossingTime_lt_lowerCrossingTime
code: theorem upperCrossingTime_lt_lowerCrossingTime (hab : a < b)
    (hn : lowerCrossingTime a b f N (n + 1) ω ≠ N) :
    upperCrossingTime a b f N (n + 1) ω < lowerCrossingTime a b f N (n + 1) ω 
goal: MeasureTheory.upperCrossingTime a b f N (n + 1) ω < MeasureTheory.lowerCrossingTime a b f N (n + 1) ω

full_name: MeasureTheory.lowerCrossingTime_lt_upperCrossingTime
code: theorem lowerCrossingTime_lt_upperCrossingTime (hab : a < b)
    (hn : upperCrossingTime a b f N (n + 1) ω ≠ N) :
    lowerCrossingTime a b f N n ω < upperCrossingTime a b f N (n + 1) ω 
goal: MeasureTheory.lowerCrossingTime a b f N n ω < MeasureTheory.upperCrossingTime a b f N (n + 1) ω

full_name: MeasureTheory.upperCrossingTime_lt_succ
code: theorem upperCrossingTime_lt_succ (hab : a < b) (hn : upperCrossingTime a b f N (n + 1) ω ≠ N) :
    upperCrossingTime a b f N n ω < upperCrossingTime a b f N (n + 1) ω 
goal: MeasureTheory.upperCrossingTime a b f N n ω < MeasureTheory.upperCrossingTime a b f N (n + 1) ω

full_name: MeasureTheory.lowerCrossingTime_stabilize
code: theorem lowerCrossingTime_stabilize (hnm : n ≤ m) (hn : lowerCrossingTime a b f N n ω = N) :
    lowerCrossingTime a b f N m ω = N 
goal: MeasureTheory.lowerCrossingTime a b f N m ω = N

full_name: MeasureTheory.upperCrossingTime_stabilize
code: theorem upperCrossingTime_stabilize (hnm : n ≤ m) (hn : upperCrossingTime a b f N n ω = N) :
    upperCrossingTime a b f N m ω = N 
goal: MeasureTheory.upperCrossingTime a b f N m ω = N

full_name: MeasureTheory.lowerCrossingTime_stabilize'
code: theorem lowerCrossingTime_stabilize' (hnm : n ≤ m) (hn : N ≤ lowerCrossingTime a b f N n ω) :
    lowerCrossingTime a b f N m ω = N 
goal: MeasureTheory.lowerCrossingTime a b f N m ω = N

full_name: MeasureTheory.upperCrossingTime_stabilize'
code: theorem upperCrossingTime_stabilize' (hnm : n ≤ m) (hn : N ≤ upperCrossingTime a b f N n ω) :
    upperCrossingTime a b f N m ω = N 
goal: MeasureTheory.upperCrossingTime a b f N m ω = N

full_name: MeasureTheory.exists_upperCrossingTime_eq
code: theorem exists_upperCrossingTime_eq (f : ℕ → Ω → ℝ) (N : ℕ) (ω : Ω) (hab : a < b) :
    ∃ n, upperCrossingTime a b f N n ω = N 
goal: ∃ n, MeasureTheory.upperCrossingTime a b f N n ω = N

full_name: MeasureTheory.upperCrossingTime_lt_bddAbove
code: theorem upperCrossingTime_lt_bddAbove (hab : a < b) :
    BddAbove {n | upperCrossingTime a b f N n ω < N} 
goal: BddAbove {n | MeasureTheory.upperCrossingTime a b f N n ω < N}

full_name: MeasureTheory.upperCrossingTime_lt_nonempty
code: theorem upperCrossingTime_lt_nonempty (hN : 0 < N) :
    {n | upperCrossingTime a b f N n ω < N}.Nonempty 
goal: {n | MeasureTheory.upperCrossingTime a b f N n ω < N}.Nonempty

full_name: MeasureTheory.upperCrossingTime_bound_eq
code: theorem upperCrossingTime_bound_eq (f : ℕ → Ω → ℝ) (N : ℕ) (ω : Ω) (hab : a < b) :
    upperCrossingTime a b f N N ω = N 
goal: MeasureTheory.upperCrossingTime a b f N N ω = N

full_name: MeasureTheory.upperCrossingTime_eq_of_bound_le
code: theorem upperCrossingTime_eq_of_bound_le (hab : a < b) (hn : N ≤ n) :
    upperCrossingTime a b f N n ω = N 
goal: MeasureTheory.upperCrossingTime a b f N n ω = N

full_name: MeasureTheory.Adapted.isStoppingTime_crossing
code: theorem Adapted.isStoppingTime_crossing (hf : Adapted ℱ f) :
    IsStoppingTime ℱ (upperCrossingTime a b f N n) ∧
      IsStoppingTime ℱ (lowerCrossingTime a b f N n) 
goal: MeasureTheory.IsStoppingTime ℱ (MeasureTheory.upperCrossingTime a b f N n) ∧
  MeasureTheory.IsStoppingTime ℱ (MeasureTheory.lowerCrossingTime a b f N n)

full_name: MeasureTheory.Adapted.isStoppingTime_upperCrossingTime
code: theorem Adapted.isStoppingTime_upperCrossingTime (hf : Adapted ℱ f) :
    IsStoppingTime ℱ (upperCrossingTime a b f N n) 
goal: MeasureTheory.IsStoppingTime ℱ (MeasureTheory.upperCrossingTime a b f N n)

full_name: MeasureTheory.Adapted.isStoppingTime_lowerCrossingTime
code: theorem Adapted.isStoppingTime_lowerCrossingTime (hf : Adapted ℱ f) :
    IsStoppingTime ℱ (lowerCrossingTime a b f N n) 
goal: MeasureTheory.IsStoppingTime ℱ (MeasureTheory.lowerCrossingTime a b f N n)

full_name: MeasureTheory.upcrossingStrat
code: /-- `upcrossingStrat a b f N n` is 1 if `n` is between a consecutive pair of lower and upper
crossings and is 0 otherwise. `upcrossingStrat` is shifted by one index so that it is adapted
rather than predictable. -/
noncomputable def upcrossingStrat (a b : ℝ) (f : ℕ → Ω → ℝ) (N n : ℕ) (ω : Ω) : ℝ 
goal: ℝ

full_name: MeasureTheory.upcrossingStrat_nonneg
code: theorem upcrossingStrat_nonneg : 0 ≤ upcrossingStrat a b f N n ω 
goal: 0 ≤ MeasureTheory.upcrossingStrat a b f N n ω

full_name: MeasureTheory.upcrossingStrat_le_one
code: theorem upcrossingStrat_le_one : upcrossingStrat a b f N n ω ≤ 1 
goal: MeasureTheory.upcrossingStrat a b f N n ω ≤ 1

full_name: MeasureTheory.Adapted.upcrossingStrat_adapted
code: theorem Adapted.upcrossingStrat_adapted (hf : Adapted ℱ f) :
    Adapted ℱ (upcrossingStrat a b f N) 
goal: MeasureTheory.Adapted ℱ (MeasureTheory.upcrossingStrat a b f N)

full_name: MeasureTheory.Submartingale.sum_upcrossingStrat_mul
code: theorem Submartingale.sum_upcrossingStrat_mul [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (a b : ℝ) (N : ℕ) : Submartingale (fun n : ℕ =>
      ∑ k ∈ Finset.range n, upcrossingStrat a b f N k * (f (k + 1) - f k)) ℱ μ 
goal: MeasureTheory.Submartingale (fun n => ∑ k ∈ Finset.range n, MeasureTheory.upcrossingStrat a b f N k * (f (k + 1) - f k))
  ℱ μ

full_name: MeasureTheory.Submartingale.sum_sub_upcrossingStrat_mul
code: theorem Submartingale.sum_sub_upcrossingStrat_mul [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (a b : ℝ) (N : ℕ) : Submartingale (fun n : ℕ =>
      ∑ k ∈ Finset.range n, (1 - upcrossingStrat a b f N k) * (f (k + 1) - f k)) ℱ μ 
goal: MeasureTheory.Submartingale
  (fun n => ∑ k ∈ Finset.range n, (1 - MeasureTheory.upcrossingStrat a b f N k) * (f (k + 1) - f k)) ℱ μ

full_name: MeasureTheory.Submartingale.sum_mul_upcrossingStrat_le
code: theorem Submartingale.sum_mul_upcrossingStrat_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) :
    μ[∑ k ∈ Finset.range n, upcrossingStrat a b f N k * (f (k + 1) - f k)] ≤ μ[f n] - μ[f 0] 
goal: ∫ (x : Ω), (∑ k ∈ Finset.range n, MeasureTheory.upcrossingStrat a b f N k * (f (k + 1) - f k)) x ∂μ ≤
  ∫ (x : Ω), f n x ∂μ - ∫ (x : Ω), f 0 x ∂μ

full_name: MeasureTheory.upcrossingsBefore
code: /-- The number of upcrossings (strictly) before time `N`. -/
noncomputable def upcrossingsBefore [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ)
    (N : ι) (ω : Ω) : ℕ 
goal: ℕ

full_name: MeasureTheory.upcrossingsBefore_bot
code: @[simp]
theorem upcrossingsBefore_bot [Preorder ι] [OrderBot ι] [InfSet ι] {a b : ℝ} {f : ι → Ω → ℝ}
    {ω : Ω} : upcrossingsBefore a b f ⊥ ω = ⊥ 
goal: MeasureTheory.upcrossingsBefore a b f ⊥ ω = ⊥

full_name: MeasureTheory.upcrossingsBefore_zero
code: theorem upcrossingsBefore_zero : upcrossingsBefore a b f 0 ω = 0 
goal: MeasureTheory.upcrossingsBefore a b f 0 ω = 0

full_name: MeasureTheory.upcrossingsBefore_zero'
code: @[simp]
theorem upcrossingsBefore_zero' : upcrossingsBefore a b f 0 = 0 
goal: MeasureTheory.upcrossingsBefore a b f 0 = 0

full_name: MeasureTheory.upperCrossingTime_lt_of_le_upcrossingsBefore
code: theorem upperCrossingTime_lt_of_le_upcrossingsBefore (hN : 0 < N) (hab : a < b)
    (hn : n ≤ upcrossingsBefore a b f N ω) : upperCrossingTime a b f N n ω < N 
goal: MeasureTheory.upperCrossingTime a b f N n ω < N

full_name: MeasureTheory.upperCrossingTime_eq_of_upcrossingsBefore_lt
code: theorem upperCrossingTime_eq_of_upcrossingsBefore_lt (hab : a < b)
    (hn : upcrossingsBefore a b f N ω < n) : upperCrossingTime a b f N n ω = N 
goal: MeasureTheory.upperCrossingTime a b f N n ω = N

full_name: MeasureTheory.upcrossingsBefore_le
code: theorem upcrossingsBefore_le (f : ℕ → Ω → ℝ) (ω : Ω) (hab : a < b) :
    upcrossingsBefore a b f N ω ≤ N 
goal: MeasureTheory.upcrossingsBefore a b f N ω ≤ N

full_name: MeasureTheory.crossing_eq_crossing_of_lowerCrossingTime_lt
code: theorem crossing_eq_crossing_of_lowerCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : lowerCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω 
goal: MeasureTheory.upperCrossingTime a b f M n ω = MeasureTheory.upperCrossingTime a b f N n ω ∧
  MeasureTheory.lowerCrossingTime a b f M n ω = MeasureTheory.lowerCrossingTime a b f N n ω

full_name: MeasureTheory.crossing_eq_crossing_of_upperCrossingTime_lt
code: theorem crossing_eq_crossing_of_upperCrossingTime_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N (n + 1) ω < N) :
    upperCrossingTime a b f M (n + 1) ω = upperCrossingTime a b f N (n + 1) ω ∧
      lowerCrossingTime a b f M n ω = lowerCrossingTime a b f N n ω 
goal: MeasureTheory.upperCrossingTime a b f M (n + 1) ω = MeasureTheory.upperCrossingTime a b f N (n + 1) ω ∧
  MeasureTheory.lowerCrossingTime a b f M n ω = MeasureTheory.lowerCrossingTime a b f N n ω

full_name: MeasureTheory.upperCrossingTime_eq_upperCrossingTime_of_lt
code: theorem upperCrossingTime_eq_upperCrossingTime_of_lt {M : ℕ} (hNM : N ≤ M)
    (h : upperCrossingTime a b f N n ω < N) :
    upperCrossingTime a b f M n ω = upperCrossingTime a b f N n ω 
goal: MeasureTheory.upperCrossingTime a b f M n ω = MeasureTheory.upperCrossingTime a b f N n ω

full_name: MeasureTheory.upcrossingsBefore_mono
code: theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω 
goal: Monotone fun N ω => MeasureTheory.upcrossingsBefore a b f N ω

full_name: MeasureTheory.upcrossingsBefore_lt_of_exists_upcrossing
code: theorem upcrossingsBefore_lt_of_exists_upcrossing (hab : a < b) {N₁ N₂ : ℕ} (hN₁ : N ≤ N₁)
    (hN₁' : f N₁ ω < a) (hN₂ : N₁ ≤ N₂) (hN₂' : b < f N₂ ω) :
    upcrossingsBefore a b f N ω < upcrossingsBefore a b f (N₂ + 1) ω 
goal: MeasureTheory.upcrossingsBefore a b f N ω < MeasureTheory.upcrossingsBefore a b f (N₂ + 1) ω

full_name: MeasureTheory.lowerCrossingTime_lt_of_lt_upcrossingsBefore
code: theorem lowerCrossingTime_lt_of_lt_upcrossingsBefore (hN : 0 < N) (hab : a < b)
    (hn : n < upcrossingsBefore a b f N ω) : lowerCrossingTime a b f N n ω < N 
goal: MeasureTheory.lowerCrossingTime a b f N n ω < N

full_name: MeasureTheory.le_sub_of_le_upcrossingsBefore
code: theorem le_sub_of_le_upcrossingsBefore (hN : 0 < N) (hab : a < b)
    (hn : n < upcrossingsBefore a b f N ω) :
    b - a ≤ stoppedValue f (upperCrossingTime a b f N (n + 1)) ω -
      stoppedValue f (lowerCrossingTime a b f N n) ω 
goal: b - a ≤
  MeasureTheory.stoppedValue f (MeasureTheory.upperCrossingTime a b f N (n + 1)) ω -
    MeasureTheory.stoppedValue f (MeasureTheory.lowerCrossingTime a b f N n) ω

full_name: MeasureTheory.sub_eq_zero_of_upcrossingsBefore_lt
code: theorem sub_eq_zero_of_upcrossingsBefore_lt (hab : a < b) (hn : upcrossingsBefore a b f N ω < n) :
    stoppedValue f (upperCrossingTime a b f N (n + 1)) ω -
      stoppedValue f (lowerCrossingTime a b f N n) ω = 0 
goal: MeasureTheory.stoppedValue f (MeasureTheory.upperCrossingTime a b f N (n + 1)) ω -
    MeasureTheory.stoppedValue f (MeasureTheory.lowerCrossingTime a b f N n) ω =
  0

full_name: MeasureTheory.mul_upcrossingsBefore_le
code: theorem mul_upcrossingsBefore_le (hf : a ≤ f N ω) (hab : a < b) :
    (b - a) * upcrossingsBefore a b f N ω ≤
    ∑ k ∈ Finset.range N, upcrossingStrat a b f N k ω * (f (k + 1) - f k) ω 
goal: (b - a) * ↑(MeasureTheory.upcrossingsBefore a b f N ω) ≤
  ∑ k ∈ Finset.range N, MeasureTheory.upcrossingStrat a b f N k ω * (f (k + 1) - f k) ω

full_name: MeasureTheory.integral_mul_upcrossingsBefore_le_integral
code: theorem integral_mul_upcrossingsBefore_le_integral [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hfN : ∀ ω, a ≤ f N ω) (hfzero : 0 ≤ f 0) (hab : a < b) :
    (b - a) * μ[upcrossingsBefore a b f N] ≤ μ[f N] 
goal: (b - a) * ∫ (x : Ω), ↑(MeasureTheory.upcrossingsBefore a b f N x) ∂μ ≤ ∫ (x : Ω), f N x ∂μ

full_name: MeasureTheory.crossing_pos_eq
code: theorem crossing_pos_eq (hab : a < b) :
    upperCrossingTime 0 (b - a) (fun n ω => (f n ω - a)⁺) N n = upperCrossingTime a b f N n ∧
      lowerCrossingTime 0 (b - a) (fun n ω => (f n ω - a)⁺) N n = lowerCrossingTime a b f N n 
goal: MeasureTheory.upperCrossingTime 0 (b - a) (fun n ω => (f n ω - a)⁺) N n = MeasureTheory.upperCrossingTime a b f N n ∧
  MeasureTheory.lowerCrossingTime 0 (b - a) (fun n ω => (f n ω - a)⁺) N n = MeasureTheory.lowerCrossingTime a b f N n

full_name: MeasureTheory.upcrossingsBefore_pos_eq
code: theorem upcrossingsBefore_pos_eq (hab : a < b) :
    upcrossingsBefore 0 (b - a) (fun n ω => (f n ω - a)⁺) N ω = upcrossingsBefore a b f N ω 
goal: MeasureTheory.upcrossingsBefore 0 (b - a) (fun n ω => (f n ω - a)⁺) N ω = MeasureTheory.upcrossingsBefore a b f N ω

full_name: MeasureTheory.mul_integral_upcrossingsBefore_le_integral_pos_part_aux
code: theorem mul_integral_upcrossingsBefore_le_integral_pos_part_aux [IsFiniteMeasure μ]
    (hf : Submartingale f ℱ μ) (hab : a < b) :
    (b - a) * μ[upcrossingsBefore a b f N] ≤ μ[fun ω => (f N ω - a)⁺] 
goal: (b - a) * ∫ (x : Ω), ↑(MeasureTheory.upcrossingsBefore a b f N x) ∂μ ≤ ∫ (x : Ω), (fun ω => (f N ω - a)⁺) x ∂μ

full_name: MeasureTheory.Submartingale.mul_integral_upcrossingsBefore_le_integral_pos_part
code: /-- **Doob's upcrossing estimate**: given a real valued discrete submartingale `f` and real
values `a` and `b`, we have `(b - a) * 𝔼[upcrossingsBefore a b f N] ≤ 𝔼[(f N - a)⁺]` where
`upcrossingsBefore a b f N` is the number of times the process `f` crossed from below `a` to above
`b` before the time `N`. -/
theorem Submartingale.mul_integral_upcrossingsBefore_le_integral_pos_part [IsFiniteMeasure μ]
    (a b : ℝ) (hf : Submartingale f ℱ μ) (N : ℕ) :
    (b - a) * μ[upcrossingsBefore a b f N] ≤ μ[fun ω => (f N ω - a)⁺] 
goal: (b - a) * ∫ (x : Ω), ↑(MeasureTheory.upcrossingsBefore a b f N x) ∂μ ≤ ∫ (x : Ω), (fun ω => (f N ω - a)⁺) x ∂μ

full_name: MeasureTheory.upcrossingsBefore_eq_sum
code: theorem upcrossingsBefore_eq_sum (hab : a < b) : upcrossingsBefore a b f N ω =
    ∑ i ∈ Finset.Ico 1 (N + 1), {n | upperCrossingTime a b f N n ω < N}.indicator 1 i 
goal: MeasureTheory.upcrossingsBefore a b f N ω =
  ∑ i ∈ Finset.Ico 1 (N + 1), {n | MeasureTheory.upperCrossingTime a b f N n ω < N}.indicator 1 i

full_name: MeasureTheory.Adapted.measurable_upcrossingsBefore
code: theorem Adapted.measurable_upcrossingsBefore (hf : Adapted ℱ f) (hab : a < b) :
    Measurable (upcrossingsBefore a b f N) 
goal: Measurable (MeasureTheory.upcrossingsBefore a b f N)

full_name: MeasureTheory.Adapted.integrable_upcrossingsBefore
code: theorem Adapted.integrable_upcrossingsBefore [IsFiniteMeasure μ] (hf : Adapted ℱ f) (hab : a < b) :
    Integrable (fun ω => (upcrossingsBefore a b f N ω : ℝ)) μ 
goal: MeasureTheory.Integrable (fun ω => ↑(MeasureTheory.upcrossingsBefore a b f N ω)) μ

full_name: MeasureTheory.upcrossings
code: /-- The number of upcrossings of a realization of a stochastic process (`upcrossings` takes value
in `ℝ≥0∞` and so is allowed to be `∞`). -/
noncomputable def upcrossings [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ)
    (ω : Ω) : ℝ≥0∞ 
goal: ℝ≥0∞

full_name: MeasureTheory.Adapted.measurable_upcrossings
code: theorem Adapted.measurable_upcrossings (hf : Adapted ℱ f) (hab : a < b) :
    Measurable (upcrossings a b f) 
goal: Measurable (MeasureTheory.upcrossings a b f)

full_name: MeasureTheory.upcrossings_lt_top_iff
code: theorem upcrossings_lt_top_iff :
    upcrossings a b f ω < ∞ ↔ ∃ k, ∀ N, upcrossingsBefore a b f N ω ≤ k 
goal: MeasureTheory.upcrossings a b f ω < ⊤ ↔ ∃ k, ∀ (N : ℕ), MeasureTheory.upcrossingsBefore a b f N ω ≤ k

full_name: MeasureTheory.Submartingale.mul_lintegral_upcrossings_le_lintegral_pos_part
code: /-- A variant of Doob's upcrossing estimate obtained by taking the supremum on both sides. -/
theorem Submartingale.mul_lintegral_upcrossings_le_lintegral_pos_part [IsFiniteMeasure μ] (a b : ℝ)
    (hf : Submartingale f ℱ μ) : ENNReal.ofReal (b - a) * ∫⁻ ω, upcrossings a b f ω ∂μ ≤
      ⨆ N, ∫⁻ ω, ENNReal.ofReal ((f N ω - a)⁺) ∂μ 
goal: ENNReal.ofReal (b - a) * ∫⁻ (ω : Ω), MeasureTheory.upcrossings a b f ω ∂μ ≤
  ⨆ N, ∫⁻ (ω : Ω), ENNReal.ofReal (f N ω - a)⁺ ∂μ