Theorem: Monotone.ae_hasDerivAt
File: Mathlib/Analysis/Calculus/Monotone.lean

tactic: filter_upwards [hf.stieltjesFunction.ae_hasDerivAt,
  hf.countable_not_continuousAt.ae_not_mem volume] with x hx h'x
state_before: f : ℝ → ℝ
hf : Monotone f
⊢ ∀ᵐ (x : ℝ), HasDerivAt f (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x

tactic: have A : hf.stieltjesFunction x = f x := by
  rw [Classical.not_not, hf.continuousAt_iff_leftLim_eq_rightLim] at h'x
  apply le_antisymm _ (hf.le_rightLim (le_refl _))
  rw [← h'x]
  exact hf.leftLim_le (le_refl _)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : ¬¬ContinuousAt f x
⊢ HasDerivAt f (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x

tactic: rw [hasDerivAt_iff_tendsto_slope, (nhds_left'_sup_nhds_right' x).symm, tendsto_sup,
  slope_fun_def_field, A] at hx
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ HasDerivAt f (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x

tactic: rw [hasDerivAt_iff_tendsto_slope, slope_fun_def_field, (nhds_left'_sup_nhds_right' x).symm,
  tendsto_sup]
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
L2 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ HasDerivAt f (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x

tactic: exact ⟨L2, L1⟩
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
L2 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun b => (f b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (f b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))

tactic: rw [Classical.not_not, hf.continuousAt_iff_leftLim_eq_rightLim] at h'x
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : ¬¬ContinuousAt f x
⊢ ↑(stieltjesFunction hf) x = f x

tactic: apply le_antisymm _ (hf.le_rightLim (le_refl _))
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : leftLim f x = rightLim f x
⊢ ↑(stieltjesFunction hf) x = f x

tactic: rw [← h'x]
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : leftLim f x = rightLim f x
⊢ rightLim f x ≤ f x

tactic: exact hf.leftLim_le (le_refl _)
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  HasDerivAt (↑(stieltjesFunction hf))
    (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)) x
h'x : leftLim f x = rightLim f x
⊢ leftLim f x ≤ f x

tactic: apply tendsto_of_tendsto_of_tendsto_of_le_of_le' this hx.2
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))

tactic: apply tendsto_apply_add_mul_sq_div_sub (nhds_right'_le_nhds_ne x) hx.2
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))

tactic: apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝[Ioi x] x) (𝓝[Ioi x] x)

tactic: apply Tendsto.mono_left _ nhdsWithin_le_nhds
state_before: case h1
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝[Ioi x] x) (𝓝 x)

tactic: have : Tendsto (fun y : ℝ => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -↑1 * (x - x) ^ 2)) :=
  tendsto_id.add (((tendsto_id.sub_const x).pow 2).const_mul (-1))
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 x)

tactic: simpa using this
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Tendsto (fun y => y + -1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -1 * (x - x) ^ 2))
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 x)

tactic: have : Ioo x (x + 1) ∈ 𝓝[>] x := by
  apply Ioo_mem_nhdsWithin_Ioi; exact ⟨le_refl _, by linarith⟩
state_before: case h2
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ ∀ᶠ (x_1 : ℝ) in 𝓝[Ioi x] x, x_1 + -↑1 * (x_1 - x) ^ 2 ∈ Ioi x

tactic: filter_upwards [this]
state_before: case h2
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Ioo x (x + 1) ∈ 𝓝[Ioi x] x
⊢ ∀ᶠ (x_1 : ℝ) in 𝓝[Ioi x] x, x_1 + -↑1 * (x_1 - x) ^ 2 ∈ Ioi x

tactic: rintro y ⟨hy : x < y, h'y : y < x + 1⟩
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Ioo x (x + 1) ∈ 𝓝[Ioi x] x
⊢ ∀ (a : ℝ), a ∈ Ioo x (x + 1) → a + -↑1 * (a - x) ^ 2 ∈ Ioi x

tactic: rw [mem_Ioi]
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Ioo x (x + 1) ∈ 𝓝[Ioi x] x
y : ℝ
hy : x < y
h'y : y < x + 1
⊢ y + -↑1 * (y - x) ^ 2 ∈ Ioi x

tactic: norm_num
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Ioo x (x + 1) ∈ 𝓝[Ioi x] x
y : ℝ
hy : x < y
h'y : y < x + 1
⊢ x < y + -↑1 * (y - x) ^ 2

tactic: nlinarith
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this : Ioo x (x + 1) ∈ 𝓝[Ioi x] x
y : ℝ
hy : x < y
h'y : y < x + 1
⊢ x + (y - x) ^ 2 < y

tactic: apply Ioo_mem_nhdsWithin_Ioi
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ Ioo x (x + 1) ∈ 𝓝[Ioi x] x

tactic: exact ⟨le_refl _, by linarith⟩
state_before: case H
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ x ∈ Ico x (x + 1)

tactic: linarith
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
⊢ x < x + 1

tactic: filter_upwards [self_mem_nhdsWithin]
state_before: case hgf
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ᶠ (b : ℝ) in 𝓝[Ioi x] x, (↑(stieltjesFunction hf) (b + -↑1 * (b - x) ^ 2) - f x) / (b - x) ≤ (f b - f x) / (b - x)

tactic: rintro y (hy : x < y)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ (a : ℝ), a ∈ Ioi x → (↑(stieltjesFunction hf) (a + -↑1 * (a - x) ^ 2) - f x) / (a - x) ≤ (f a - f x) / (a - x)

tactic: have : ↑0 < (y - x) ^ 2 := sq_pos_of_pos (sub_pos.2 hy)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
⊢ (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x) ≤ (f y - f x) / (y - x)

tactic: apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
this : 0 < (y - x) ^ 2
⊢ (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x) ≤ (f y - f x) / (y - x)

tactic: exact (sub_le_sub_iff_right _).2 (hf.rightLim_le (by norm_num; linarith))
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
this : 0 < (y - x) ^ 2
⊢ ↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x ≤ f y - f x

tactic: norm_num
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
this : 0 < (y - x) ^ 2
⊢ y + -↑1 * (y - x) ^ 2 < y

tactic: linarith
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
this : 0 < (y - x) ^ 2
⊢ 0 < (y - x) ^ 2

tactic: filter_upwards [self_mem_nhdsWithin]
state_before: case hfh
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ᶠ (b : ℝ) in 𝓝[Ioi x] x, (f b - f x) / (b - x) ≤ (↑(stieltjesFunction hf) b - f x) / (b - x)

tactic: rintro y (hy : x < y)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ (a : ℝ), a ∈ Ioi x → (f a - f x) / (a - x) ≤ (↑(stieltjesFunction hf) a - f x) / (a - x)

tactic: apply div_le_div_of_le_of_nonneg _ (sub_pos.2 hy).le
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
⊢ (f y - f x) / (y - x) ≤ (↑(stieltjesFunction hf) y - f x) / (y - x)

tactic: exact (sub_le_sub_iff_right _).2 (hf.le_rightLim (le_refl y))
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : x < y
⊢ f y - f x ≤ ↑(stieltjesFunction hf) y - f x

tactic: apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hx.1 this
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))

tactic: apply tendsto_apply_add_mul_sq_div_sub (nhds_left'_le_nhds_ne x) hx.1
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))

tactic: apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝[Iio x] x) (𝓝[Iio x] x)

tactic: apply Tendsto.mono_left _ nhdsWithin_le_nhds
state_before: case h1
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝[Iio x] x) (𝓝 x)

tactic: have : Tendsto (fun y : ℝ => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -↑1 * (x - x) ^ 2)) :=
  tendsto_id.add (((tendsto_id.sub_const x).pow 2).const_mul (-1))
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 x)

tactic: simpa using this
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Tendsto (fun y => y + -1 * (y - x) ^ 2) (𝓝 x) (𝓝 (x + -1 * (x - x) ^ 2))
⊢ Tendsto (fun y => y + -↑1 * (y - x) ^ 2) (𝓝 x) (𝓝 x)

tactic: have : Ioo (x - 1) x ∈ 𝓝[<] x := by
  apply Ioo_mem_nhdsWithin_Iio; exact ⟨by linarith, le_refl _⟩
state_before: case h2
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ᶠ (x_1 : ℝ) in 𝓝[Iio x] x, x_1 + -↑1 * (x_1 - x) ^ 2 ∈ Iio x

tactic: filter_upwards [this]
state_before: case h2
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Ioo (x - 1) x ∈ 𝓝[Iio x] x
⊢ ∀ᶠ (x_1 : ℝ) in 𝓝[Iio x] x, x_1 + -↑1 * (x_1 - x) ^ 2 ∈ Iio x

tactic: rintro y ⟨hy : x - 1 < y, h'y : y < x⟩
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Ioo (x - 1) x ∈ 𝓝[Iio x] x
⊢ ∀ (a : ℝ), a ∈ Ioo (x - 1) x → a + -↑1 * (a - x) ^ 2 ∈ Iio x

tactic: rw [mem_Iio]
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Ioo (x - 1) x ∈ 𝓝[Iio x] x
y : ℝ
hy : x - 1 < y
h'y : y < x
⊢ y + -↑1 * (y - x) ^ 2 ∈ Iio x

tactic: norm_num
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Ioo (x - 1) x ∈ 𝓝[Iio x] x
y : ℝ
hy : x - 1 < y
h'y : y < x
⊢ y + -↑1 * (y - x) ^ 2 < x

tactic: nlinarith
state_before: case h.intro
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this : Ioo (x - 1) x ∈ 𝓝[Iio x] x
y : ℝ
hy : x - 1 < y
h'y : y < x
⊢ y < x + (y - x) ^ 2

tactic: apply Ioo_mem_nhdsWithin_Iio
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ Ioo (x - 1) x ∈ 𝓝[Iio x] x

tactic: exact ⟨by linarith, le_refl _⟩
state_before: case H
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ x ∈ Ioc (x - 1) x

tactic: linarith
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ x - 1 < x

tactic: filter_upwards [self_mem_nhdsWithin]
state_before: case hgf
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ᶠ (b : ℝ) in 𝓝[Iio x] x, (↑(stieltjesFunction hf) b - f x) / (b - x) ≤ (f b - f x) / (b - x)

tactic: rintro y (hy : y < x)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ (a : ℝ), a ∈ Iio x → (↑(stieltjesFunction hf) a - f x) / (a - x) ≤ (f a - f x) / (a - x)

tactic: apply div_le_div_of_nonpos_of_le (sub_neg.2 hy).le
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
⊢ (↑(stieltjesFunction hf) y - f x) / (y - x) ≤ (f y - f x) / (y - x)

tactic: exact (sub_le_sub_iff_right _).2 (hf.le_rightLim (le_refl _))
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
⊢ f y - f x ≤ ↑(stieltjesFunction hf) y - f x

tactic: filter_upwards [self_mem_nhdsWithin]
state_before: case hfh
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ᶠ (b : ℝ) in 𝓝[Iio x] x, (f b - f x) / (b - x) ≤ (↑(stieltjesFunction hf) (b + -↑1 * (b - x) ^ 2) - f x) / (b - x)

tactic: rintro y (hy : y < x)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
⊢ ∀ (a : ℝ), a ∈ Iio x → (f a - f x) / (a - x) ≤ (↑(stieltjesFunction hf) (a + -↑1 * (a - x) ^ 2) - f x) / (a - x)

tactic: have : ↑0 < (y - x) ^ 2 := sq_pos_of_neg (sub_neg.2 hy)
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
⊢ (f y - f x) / (y - x) ≤ (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)

tactic: apply div_le_div_of_nonpos_of_le (sub_neg.2 hy).le
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
this : 0 < (y - x) ^ 2
⊢ (f y - f x) / (y - x) ≤ (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)

tactic: exact (sub_le_sub_iff_right _).2 (hf.rightLim_le (by norm_num; linarith))
state_before: case h
f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
this : 0 < (y - x) ^ 2
⊢ ↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x ≤ f y - f x

tactic: norm_num
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
this : 0 < (y - x) ^ 2
⊢ y + -↑1 * (y - x) ^ 2 < y

tactic: linarith
state_before: f : ℝ → ℝ
hf : Monotone f
x : ℝ
hx :
  Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Iio x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x))) ∧
    Tendsto (fun b => (↑(stieltjesFunction hf) b - f x) / (b - x)) (𝓝[Ioi x] x)
      (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
h'x : ¬¬ContinuousAt f x
A : ↑(stieltjesFunction hf) x = f x
L1 :
  Tendsto (fun y => (f y - f x) / (y - x)) (𝓝[Ioi x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
this✝ :
  Tendsto (fun y => (↑(stieltjesFunction hf) (y + -↑1 * (y - x) ^ 2) - f x) / (y - x)) (𝓝[Iio x] x)
    (𝓝 (ENNReal.toReal (rnDeriv (StieltjesFunction.measure (stieltjesFunction hf)) volume x)))
y : ℝ
hy : y < x
this : 0 < (y - x) ^ 2
⊢ 0 < (y - x) ^ 2