l3lab/ntp-mathlib huggingface dataset:
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
    leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
  classical
  refine' le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) _
  by_cases hle : π ω ≤ leastGE f r n ω
  · rw [min_eq_left hle, leastGE]
    by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
    · refine' hle.trans (Eq.le _)
      rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h]
    · 

Proof state:
case neg
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
π : Ω → ℕ
r : ℝ
ω : Ω
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
hle : π ω ≤ leastGE f r n ω
h : ¬∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
⊢ π ω ≤ hitting f (Set.Ici r) 0 (π ω) ω

Next tactic:
simp only [hitting, if_neg h, le_rfl]
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
    leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
  classical
  refine' le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) _
  by_cases hle : π ω ≤ leastGE f r n ω
  · rw [min_eq_left hle, leastGE]
    by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
    · refine' hle.trans (Eq.le _)
      rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h]
    · simp only [hitting, if_neg h, le_rfl]
  · 

Proof state:
case neg
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
π : Ω → ℕ
r : ℝ
ω : Ω
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
hle : ¬π ω ≤ leastGE f r n ω
⊢ min (π ω) (leastGE f r n ω) ≤ leastGE f r (π ω) ω

Next tactic:
rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ←
      hitting_eq_hitting_of_exists (hπn ω) _]
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
    leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
  classical
  refine' le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) _
  by_cases hle : π ω ≤ leastGE f r n ω
  · rw [min_eq_left hle, leastGE]
    by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
    · refine' hle.trans (Eq.le _)
      rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h]
    · simp only [hitting, if_neg h, le_rfl]
  · rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ←
      hitting_eq_hitting_of_exists (hπn ω) _]
    

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
π : Ω → ℕ
r : ℝ
ω : Ω
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
hle : ¬π ω ≤ leastGE f r n ω
⊢ ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r

Next tactic:
rw [not_le, leastGE, hitting_lt_iff _ (hπn ω)] at hle
theorem leastGE_eq_min (π : Ω → ℕ) (r : ℝ) (ω : Ω) {n : ℕ} (hπn : ∀ ω, π ω ≤ n) :
    leastGE f r (π ω) ω = min (π ω) (leastGE f r n ω) := by
  classical
  refine' le_antisymm (le_min (leastGE_le _) (leastGE_mono (hπn ω) r ω)) _
  by_cases hle : π ω ≤ leastGE f r n ω
  · rw [min_eq_left hle, leastGE]
    by_cases h : ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r
    · refine' hle.trans (Eq.le _)
      rw [leastGE, ← hitting_eq_hitting_of_exists (hπn ω) h]
    · simp only [hitting, if_neg h, le_rfl]
  · rw [min_eq_right (not_le.1 hle).le, leastGE, leastGE, ←
      hitting_eq_hitting_of_exists (hπn ω) _]
    rw [not_le, leastGE, hitting_lt_iff _ (hπn ω)] at hle
    

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
π : Ω → ℕ
r : ℝ
ω : Ω
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
hle : ∃ j ∈ Set.Ico 0 (π ω), f j ω ∈ Set.Ici r
⊢ ∃ j ∈ Set.Icc 0 (π ω), f j ω ∈ Set.Ici r

Next tactic:
exact
      let ⟨j, hj₁, hj₂⟩ := hle
      ⟨j, ⟨hj₁.1, hj₁.2.le⟩, hj₂⟩
theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ}
    (hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π =
      stoppedValue (stoppedProcess f (leastGE f r n)) π := by
  

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f✝ : ℕ → Ω → ℝ
ω : Ω
f : ℕ → Ω → ℝ
π : Ω → ℕ
r : ℝ
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
⊢ stoppedValue (fun i => stoppedValue f (leastGE f r i)) π = stoppedValue (stoppedProcess f (leastGE f r n)) π

Next tactic:
ext1 ω
theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ}
    (hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π =
      stoppedValue (stoppedProcess f (leastGE f r n)) π := by
  ext1 ω
  

Proof state:
case h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f✝ : ℕ → Ω → ℝ
ω✝ : Ω
f : ℕ → Ω → ℝ
π : Ω → ℕ
r : ℝ
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
ω : Ω
⊢ stoppedValue (fun i => stoppedValue f (leastGE f r i)) π ω = stoppedValue (stoppedProcess f (leastGE f r n)) π ω

Next tactic:
simp (config := { unfoldPartialApp := true }) only [stoppedProcess, stoppedValue]
theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ}
    (hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π =
      stoppedValue (stoppedProcess f (leastGE f r n)) π := by
  ext1 ω
  simp (config := { unfoldPartialApp := true }) only [stoppedProcess, stoppedValue]
  

Proof state:
case h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f✝ : ℕ → Ω → ℝ
ω✝ : Ω
f : ℕ → Ω → ℝ
π : Ω → ℕ
r : ℝ
n : ℕ
hπn : ∀ (ω : Ω), π ω ≤ n
ω : Ω
⊢ f (leastGE f r (π ω) ω) ω = f (min (π ω) (leastGE f r n ω)) ω

Next tactic:
rw [leastGE_eq_min _ _ _ hπn]
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
⊢ Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ

Next tactic:
rw [submartingale_iff_expected_stoppedValue_mono]
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · 

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
⊢ ∀ (τ π : Ω → ℕ),
    IsStoppingTime ℱ τ →
      IsStoppingTime ℱ π →
        τ ≤ π →
          (∃ N, ∀ (x : Ω), π x ≤ N) →
            ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) τ x ∂μ ≤
              ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) π x ∂μ

Next tactic:
intro σ π hσ hπ hσ_le_π hπ_bdd
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
hπ_bdd : ∃ N, ∀ (x : Ω), π x ≤ N
⊢ ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) σ x ∂μ ≤
    ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) π x ∂μ

Next tactic:
obtain ⟨n, hπ_le_n⟩ := hπ_bdd
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    

Proof state:
case intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) σ x ∂μ ≤
    ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) π x ∂μ

Next tactic:
simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    

Proof state:
case intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ ∫ (x : Ω), stoppedValue (stoppedProcess f (leastGE f r n)) σ x ∂μ ≤
    ∫ (x : Ω), stoppedValue (fun i => stoppedValue f (leastGE f r i)) π x ∂μ

Next tactic:
simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    

Proof state:
case intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ ∫ (x : Ω), stoppedValue (stoppedProcess f (leastGE f r n)) σ x ∂μ ≤
    ∫ (x : Ω), stoppedValue (stoppedProcess f (leastGE f r n)) π x ∂μ

Next tactic:
refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
    · 

Proof state:
case intro.refine'_1
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ IsStoppingTime ℱ fun x => min (σ x) (leastGE f r n x)

Next tactic:
exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
    · exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · 

Proof state:
case intro.refine'_2
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ IsStoppingTime ℱ fun x => min (π x) (leastGE f r n x)

Next tactic:
exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _)
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
    · exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · 

Proof state:
case intro.refine'_3
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
σ π : Ω → ℕ
hσ : IsStoppingTime ℱ σ
hπ : IsStoppingTime ℱ π
hσ_le_π : σ ≤ π
n : ℕ
hπ_le_n : ∀ (x : Ω), π x ≤ n
⊢ (fun x => min (σ x) (leastGE f r n x)) ≤ fun x => min (π x) (leastGE f r n x)

Next tactic:
exact fun ω => min_le_min (hσ_le_π ω) le_rfl
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
    · exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · exact fun ω => min_le_min (hσ_le_π ω) le_rfl
  · 

Proof state:
case hadp
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
⊢ Adapted ℱ fun i => stoppedValue f (leastGE f r i)

Next tactic:
exact fun i => stronglyMeasurable_stoppedValue_of_le hf.adapted.progMeasurable_of_discrete
      (hf.adapted.isStoppingTime_leastGE _ _) leastGE_le
theorem Submartingale.stoppedValue_leastGE [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (r : ℝ) :
    Submartingale (fun i => stoppedValue f (leastGE f r i)) ℱ μ := by
  rw [submartingale_iff_expected_stoppedValue_mono]
  · intro σ π hσ hπ hσ_le_π hπ_bdd
    obtain ⟨n, hπ_le_n⟩ := hπ_bdd
    simp_rw [stoppedValue_stoppedValue_leastGE f σ r fun i => (hσ_le_π i).trans (hπ_le_n i)]
    simp_rw [stoppedValue_stoppedValue_leastGE f π r hπ_le_n]
    refine' hf.expected_stoppedValue_mono _ _ _ fun ω => (min_le_left _ _).trans (hπ_le_n ω)
    · exact hσ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · exact hπ.min (hf.adapted.isStoppingTime_leastGE _ _)
    · exact fun ω => min_le_min (hσ_le_π ω) le_rfl
  · exact fun i => stronglyMeasurable_stoppedValue_of_le hf.adapted.progMeasurable_of_discrete
      (hf.adapted.isStoppingTime_leastGE _ _) leastGE_le
  · 

Proof state:
case hint
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
r : ℝ
⊢ ∀ (i : ℕ), Integrable (stoppedValue f (leastGE f r i))

Next tactic:
exact fun i => integrable_stoppedValue _ (hf.adapted.isStoppingTime_leastGE _ _) hf.integrable
      leastGE_le
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
⊢ ∀ᵐ (ω : Ω) ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + ↑R

Next tactic:
filter_upwards [hbdd] with ω hbddω
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  

Proof state:
case h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
⊢ stoppedValue f (leastGE f r i) ω ≤ r + ↑R

Next tactic:
change f (leastGE f r i ω) ω ≤ r + R
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  

Proof state:
case h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
⊢ f (leastGE f r i ω) ω ≤ r + ↑R

Next tactic:
by_cases heq : leastGE f r i ω = 0
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · 

Proof state:
case pos
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : leastGE f r i ω = 0
⊢ f (leastGE f r i ω) ω ≤ r + ↑R

Next tactic:
rw [heq, hf0, Pi.zero_apply]
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    

Proof state:
case pos
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : leastGE f r i ω = 0
⊢ 0 ≤ r + ↑R

Next tactic:
exact add_nonneg hr R.coe_nonneg
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    exact add_nonneg hr R.coe_nonneg
  · 

Proof state:
case neg
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : ¬leastGE f r i ω = 0
⊢ f (leastGE f r i ω) ω ≤ r + ↑R

Next tactic:
obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    exact add_nonneg hr R.coe_nonneg
  · obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
    

Proof state:
case neg.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : ¬leastGE f r i ω = 0
k : ℕ
hk : leastGE f r i ω = Nat.succ k
⊢ f (leastGE f r i ω) ω ≤ r + ↑R

Next tactic:
rw [hk, add_comm, ← sub_le_iff_le_add]
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    exact add_nonneg hr R.coe_nonneg
  · obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
    rw [hk, add_comm, ← sub_le_iff_le_add]
    

Proof state:
case neg.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : ¬leastGE f r i ω = 0
k : ℕ
hk : leastGE f r i ω = Nat.succ k
⊢ f (Nat.succ k) ω - r ≤ ↑R

Next tactic:
have := not_mem_of_lt_hitting (hk.symm ▸ k.lt_succ_self : k < leastGE f r i ω) (zero_le _)
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    exact add_nonneg hr R.coe_nonneg
  · obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
    rw [hk, add_comm, ← sub_le_iff_le_add]
    have := not_mem_of_lt_hitting (hk.symm ▸ k.lt_succ_self : k < leastGE f r i ω) (zero_le _)
    

Proof state:
case neg.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : ¬leastGE f r i ω = 0
k : ℕ
hk : leastGE f r i ω = Nat.succ k
this : f k ω ∉ Set.Ici r
⊢ f (Nat.succ k) ω - r ≤ ↑R

Next tactic:
simp only [Set.mem_union, Set.mem_Iic, Set.mem_Ici, not_or, not_le] at this
theorem norm_stoppedValue_leastGE_le (hr : 0 ≤ r) (hf0 : f 0 = 0)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    ∀ᵐ ω ∂μ, stoppedValue f (leastGE f r i) ω ≤ r + R := by
  filter_upwards [hbdd] with ω hbddω
  change f (leastGE f r i ω) ω ≤ r + R
  by_cases heq : leastGE f r i ω = 0
  · rw [heq, hf0, Pi.zero_apply]
    exact add_nonneg hr R.coe_nonneg
  · obtain ⟨k, hk⟩ := Nat.exists_eq_succ_of_ne_zero heq
    rw [hk, add_comm, ← sub_le_iff_le_add]
    have := not_mem_of_lt_hitting (hk.symm ▸ k.lt_succ_self : k < leastGE f r i ω) (zero_le _)
    simp only [Set.mem_union, Set.mem_Iic, Set.mem_Ici, not_or, not_le] at this
    

Proof state:
case neg.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω✝ : Ω
r : ℝ
R : ℝ≥0
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
ω : Ω
hbddω : ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
heq : ¬leastGE f r i ω = 0
k : ℕ
hk : leastGE f r i ω = Nat.succ k
this : f k ω < r
⊢ f (Nat.succ k) ω - r ≤ ↑R

Next tactic:
exact (sub_lt_sub_left this _).le.trans ((le_abs_self _).trans (hbddω _))
theorem Submartingale.stoppedValue_leastGE_snorm_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hr : 0 ≤ r) (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    snorm (stoppedValue f (leastGE f r i)) 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal (r + R) := by
  

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
ℱ : Filtration ℕ m0
f : ℕ → Ω → ℝ
ω : Ω
r : ℝ
R : ℝ≥0
inst✝ : IsFiniteMeasure μ
hf : Submartingale f ℱ μ
hr : 0 ≤ r
hf0 : f 0 = 0
hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R
i : ℕ
⊢ snorm (stoppedValue f (leastGE f r i)) 1 μ ≤ 2 * ↑↑μ Set.univ * ENNReal.ofReal (r + ↑R)

Next tactic:
refine' snorm_one_le_of_le' ((hf.stoppedValue_leastGE r).integrable _) _
    (norm_stoppedValue_leastGE_le hr hf0 hbdd i)