Theorem: MeasureTheory.maximal_ineq
File: Mathlib/Probability/Martingale/OptionalStopping.lean

tactic: rwa [hadd, ENNReal.add_le_add_iff_right ENNReal.ofReal_ne_top] at this
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
hadd :
  ENNReal.ofReal (∫ (ω : Ω), f n ω ∂μ) =
    ENNReal.ofReal (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ) +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ)
⊢ ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ≤
    ENNReal.ofReal (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ)
state_after: no goals

tactic: rw [← ENNReal.ofReal_add, ← integral_union]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ ENNReal.ofReal (∫ (ω : Ω), f n ω ∂μ) =
    ENNReal.ofReal (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ) +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ ENNReal.ofReal (∫ (ω : Ω), f n ω ∂μ) =
    ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ∂μ)

case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ Disjoint {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

case ht
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ MeasurableSet {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

case hfs
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ IntegrableOn (f n) {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} μ

case hft
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ IntegrableOn (f n) {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} μ

case hp
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ

case hq
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ

tactic: exacts [(hsub.integrable _).integrableOn, (hsub.integrable _).integrableOn,
  integral_nonneg (hnonneg _), integral_nonneg (hnonneg _)]
state_before: case hfs
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ IntegrableOn (f n) {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} μ

case hft
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ IntegrableOn (f n) {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} μ

case hp
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ

case hq
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ
state_after: no goals

tactic: rw [← integral_univ]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ ENNReal.ofReal (∫ (ω : Ω), f n ω ∂μ) =
    ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ ENNReal.ofReal (∫ (x : Ω) in Set.univ, f n x ∂μ) =
    ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ∂μ)

tactic: convert rfl
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ ENNReal.ofReal (∫ (x : Ω) in Set.univ, f n x ∂μ) =
    ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ∂μ)
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} = Set.univ

tactic: ext ω
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} = Set.univ
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
⊢ ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ↔
    ω ∈ Set.univ

tactic: change (ε : ℝ) ≤ _ ∨ _ < (ε : ℝ) ↔ _
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
⊢ ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ↔
    ω ∈ Set.univ
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
⊢ (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) ∨ ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε ↔ ω ∈ Set.univ

tactic: simp only [le_or_lt, Set.mem_univ]
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
⊢ (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) ∨ ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε ↔ ω ∈ Set.univ
state_after: no goals

tactic: rw [disjoint_iff_inf_le]
state_before: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ Disjoint {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ⊓ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ≤ ⊥

tactic: rintro ω ⟨hω₁, hω₂⟩
state_before: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ⊓ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ≤ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₁ : ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ ω ∈ ⊥

tactic: change (ε : ℝ) ≤ _ at hω₁
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₁ : ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ ω ∈ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
⊢ ω ∈ ⊥

tactic: change _ < (ε : ℝ) at hω₂
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
⊢ ω ∈ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
hω₂ : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ω ∈ ⊥

tactic: exact (not_le.2 hω₂) hω₁
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
ω : Ω
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
hω₂ : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ω ∈ ⊥
state_after: no goals

tactic: exact measurableSet_lt (Finset.measurable_range_sup'' fun n _ =>
  (hsub.stronglyMeasurable n).measurable.le (𝒢.le n)) measurable_const
state_before: case ht
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
this :
  ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
⊢ MeasurableSet {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: no goals

tactic: refine add_le_add (smul_le_stoppedValue_hitting hsub _)
  (ENNReal.ofReal_le_ofReal (setIntegral_mono_on (hsub.integrable n).integrableOn
    (Integrable.integrableOn (hsub.integrable_stoppedValue
      (hitting_isStoppingTime hsub.adapted measurableSet_Ici) hitting_le))
        (measurableSet_lt (Finset.measurable_range_sup'' fun n _ =>
          (hsub.stronglyMeasurable n).measurable.le (𝒢.le n)) measurable_const) ?_))
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} +
      ENNReal.ofReal (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n ω ∂μ) ≤
    ENNReal.ofReal
        (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω},
          stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ) +
      ENNReal.ofReal
        (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
          stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∀ x ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x

tactic: intro ω hω
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∀ x ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, f n x ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω

tactic: rw [Set.mem_setOf_eq] at hω
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω

tactic: have : hitting f {y : ℝ | ↑ε ≤ y} 0 n ω = n := by
  classical simp only [hitting, Set.mem_setOf_eq, exists_prop, Pi.natCast_def, Nat.cast_id,
    ite_eq_right_iff, forall_exists_index, and_imp]
  intro m hm hεm
  exact False.elim
    ((not_le.2 hω) ((le_sup'_iff _).2 ⟨m, mem_range.2 (Nat.lt_succ_of_le hm.2), hεm⟩))
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
this : hitting f {y | ↑ε ≤ y} 0 n ω = n
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω

tactic: simp_rw [stoppedValue, this, le_rfl]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
this : hitting f {y | ↑ε ≤ y} 0 n ω = n
⊢ f n ω ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
state_after: no goals

tactic: classical simp only [hitting, Set.mem_setOf_eq, exists_prop, Pi.natCast_def, Nat.cast_id,
  ite_eq_right_iff, forall_exists_index, and_imp]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ hitting f {y | ↑ε ≤ y} 0 n ω = n
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ∀ x ∈ Set.Icc 0 n, ↑ε ≤ f x ω → sInf (Set.Icc 0 n ∩ {i | ↑ε ≤ f i ω}) = n

tactic: intro m hm hεm
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ∀ x ∈ Set.Icc 0 n, ↑ε ≤ f x ω → sInf (Set.Icc 0 n ∩ {i | ↑ε ≤ f i ω}) = n
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
m : ℕ
hm : m ∈ Set.Icc 0 n
hεm : ↑ε ≤ f m ω
⊢ sInf (Set.Icc 0 n ∩ {i | ↑ε ≤ f i ω}) = n

tactic: exact False.elim
  ((not_le.2 hω) ((le_sup'_iff _).2 ⟨m, mem_range.2 (Nat.lt_succ_of_le hm.2), hεm⟩))
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
m : ℕ
hm : m ∈ Set.Icc 0 n
hεm : ↑ε ≤ f m ω
⊢ sInf (Set.Icc 0 n ∩ {i | ↑ε ≤ f i ω}) = n
state_after: no goals

tactic: simp only [hitting, Set.mem_setOf_eq, exists_prop, Pi.natCast_def, Nat.cast_id,
ite_eq_right_iff, forall_exists_index, and_imp]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ hitting f {y | ↑ε ≤ y} 0 n ω = n
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ∀ x ∈ Set.Icc 0 n, ↑ε ≤ f x ω → sInf (Set.Icc 0 n ∩ {i | ↑ε ≤ f i ω}) = n

tactic: rw [← ENNReal.ofReal_add, ← integral_union]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal
        (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω},
          stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ) +
      ENNReal.ofReal
        (∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
          stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ) =
    ENNReal.ofReal (∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
        stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ) =
    ENNReal.ofReal (∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)

case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ Disjoint {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

case ht
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ MeasurableSet {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

case hfs
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ IntegrableOn (stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n)) {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} μ

case hft
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ IntegrableOn (stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n)) {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} μ

case hp
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ

case hq
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ

tactic: exacts [integral_nonneg fun x => hnonneg _ _, integral_nonneg fun x => hnonneg _ _]
state_before: case hp
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ

case hq
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ
state_after: no goals

tactic: rw [← integral_univ (μ := μ)]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
        stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ) =
    ENNReal.ofReal (∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
        stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ) =
    ENNReal.ofReal (∫ (x : Ω) in Set.univ, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ)

tactic: convert rfl
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal
      (∫ (x : Ω) in
        {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε},
        stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ) =
    ENNReal.ofReal (∫ (x : Ω) in Set.univ, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ)
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ Set.univ = {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

tactic: ext ω
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ Set.univ = {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
⊢ ω ∈ Set.univ ↔
    ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}

tactic: change _ ↔ (ε : ℝ) ≤ _ ∨ _ < (ε : ℝ)
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
⊢ ω ∈ Set.univ ↔
    ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ∪ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
⊢ ω ∈ Set.univ ↔ (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) ∨ ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε

tactic: simp only [le_or_lt, Set.mem_univ]
state_before: case h.e'_3.h.e'_1.h.e'_6.h.e'_4.h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
⊢ ω ∈ Set.univ ↔ (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) ∨ ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
state_after: no goals

tactic: rw [disjoint_iff_inf_le]
state_before: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ Disjoint {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ⊓ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ≤ ⊥

tactic: rintro ω ⟨hω₁, hω₂⟩
state_before: case hst
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ⊓ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} ≤ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₁ : ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ ω ∈ ⊥

tactic: change (ε : ℝ) ≤ _ at hω₁
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₁ : ω ∈ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
⊢ ω ∈ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
⊢ ω ∈ ⊥

tactic: change _ < (ε : ℝ) at hω₂
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₂ : ω ∈ {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
⊢ ω ∈ ⊥
state_after: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
hω₂ : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ω ∈ ⊥

tactic: exact (not_le.2 hω₂) hω₁
state_before: case hst.intro
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
ω : Ω
hω₁ : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω
hω₂ : ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε
⊢ ω ∈ ⊥
state_after: no goals

tactic: exact measurableSet_lt (Finset.measurable_range_sup'' fun n _ =>
  (hsub.stronglyMeasurable n).measurable.le (𝒢.le n)) measurable_const
state_before: case ht
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ MeasurableSet {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε}
state_after: no goals

tactic: exact Integrable.integrableOn (hsub.integrable_stoppedValue
  (hitting_isStoppingTime hsub.adapted measurableSet_Ici) hitting_le)
state_before: case hfs
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ IntegrableOn (stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n)) {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} μ
state_after: no goals

tactic: exact Integrable.integrableOn (hsub.integrable_stoppedValue
  (hitting_isStoppingTime hsub.adapted measurableSet_Ici) hitting_le)
state_before: case hft
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ IntegrableOn (stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n)) {ω | ((range (n + 1)).sup' ⋯ fun k => f k ω) < ↑ε} μ
state_after: no goals

tactic: refine ENNReal.ofReal_le_ofReal ?_
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ENNReal.ofReal (∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ) ≤ ENNReal.ofReal (∫ (x : Ω), f n x ∂μ)
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ ≤ ∫ (x : Ω), f n x ∂μ

tactic: rw [← stoppedValue_const f n]
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ ≤ ∫ (x : Ω), f n x ∂μ
state_after: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ ≤ ∫ (x : Ω), stoppedValue f (fun x => n) x ∂μ

tactic: exact hsub.expected_stoppedValue_mono (hitting_isStoppingTime hsub.adapted measurableSet_Ici)
  (isStoppingTime_const _ _) (fun ω => hitting_le ω) (fun _ => le_refl n)
state_before: Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
τ π : Ω → ℕ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
hnonneg : 0 ≤ f
ε : ℝ≥0
n : ℕ
⊢ ∫ (ω : Ω), stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ ≤ ∫ (x : Ω), stoppedValue f (fun x => n) x ∂μ
state_after: no goals