-- Mathlib/Probability/Martingale/OptionalStopping.lean
theorem smul_le_stoppedValue_hitting [IsFiniteMeasure μ] (hsub : Submartingale f 𝒢 μ) {ε : ℝ≥0}
    (n : ℕ) : ε • μ {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω} ≤
    ENNReal.ofReal (∫ ω in {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω},
      stoppedValue f (hitting f {y : ℝ | ↑ε ≤ y} 0 n) ω ∂μ)

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ ↑ENNReal.ofNNRealHom.toMonoidWithZeroHom ε ≠ ⊤

Tactic:
simp

Result:
no goals

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k x
⊢ ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x

Tactic:
simp_rw [le_sup'_iff, mem_range, Nat.lt_succ_iff] at hx

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x

Proof state:
case ha
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ≠ ⊤

Tactic:
exact ENNReal.mul_ne_top (by simp) (measure_ne_top _ _)

Result:
no goals

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
⊢ ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω

Tactic:
intro x hx

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k x
⊢ ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
⊢ Set.Icc 0 n = {k | k ≤ n}

Tactic:
ext x

Result:
case h
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n x : ℕ
⊢ x ∈ Set.Icc 0 n ↔ x ∈ {k | k ≤ n}

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ≤
    ENNReal.ofReal
      (∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)

Tactic:
rw [ENNReal.le_ofReal_iff_toReal_le, ENNReal.toReal_smul]

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ ε • (μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}).toReal ≤
    ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ

case ha
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ ε • μ {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω} ≠ ⊤

case hb
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
this : ∀ (ω : Ω), (↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω) → ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω
h :
  ↑ε * (μ {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}).toReal ≤
    ∫ (x : Ω) in {a | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k a}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x ∂μ
⊢ 0 ≤ ∫ (ω : Ω) in {ω | ↑ε ≤ (range (n + 1)).sup' ⋯ fun k => f k ω}, stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ∃ j ≤ n, ↑ε ≤ f j x

Tactic:
exact
  let ⟨j, hj₁, hj₂⟩ := hx
  ⟨j, hj₁, hj₂⟩

Result:
no goals

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ↑ε ≤ stoppedValue f (hitting f {y | ↑ε ≤ y} 0 n) x

Tactic:
refine stoppedValue_hitting_mem ?_

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ∃ j ∈ Set.Icc 0 n, f j x ∈ {y | ↑ε ≤ y}

Proof state:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ∃ j ∈ Set.Icc 0 n, f j x ∈ {y | ↑ε ≤ y}

Tactic:
simp only [Set.mem_setOf_eq, exists_prop, hn]

Result:
Ω : Type u_1
m0 : MeasurableSpace Ω
μ : Measure Ω
𝒢 : Filtration ℕ m0
f : ℕ → Ω → ℝ
inst✝ : IsFiniteMeasure μ
hsub : Submartingale f 𝒢 μ
ε : ℝ≥0
n : ℕ
hn : Set.Icc 0 n = {k | k ≤ n}
x : Ω
hx : ∃ b ≤ n, ↑ε ≤ f b x
⊢ ∃ j ≤ n, ↑ε ≤ f j x