Theorem: ProbabilityTheory.IsMeasurableRatCDF.tendsto_stieltjesFunction_atTop
File: Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
tactic: have h_exists : ∀ x : ℝ, ∃ q : ℚ, x - 1 < q ∧ ↑q < x := fun x ↦ exists_rat_btwn (sub_one_lt x)
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
tactic: let qs : ℝ → ℚ := fun x ↦ (h_exists x).choose
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
tactic: have hqs_tendsto : Tendsto qs atTop atTop := by
    rw [tendsto_atTop_atTop]
    refine fun q ↦ ⟨q + 1, fun y hy ↦ ?_⟩
    have h_le : y - 1 ≤ qs y := (h_exists y).choose_spec.1.le
    rw [sub_le_iff_le_add] at h_le
    exact_mod_cast le_of_add_le_add_right (hy.trans h_le)
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
⊢ Tendsto (↑(hf.stieltjesFunction a)) atTop (𝓝 1)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
⊢ f a ∘ qs ≤ ↑(hf.stieltjesFunction a)
tactic: refine tendsto_of_tendsto_of_tendsto_of_le_of_le ((hf.tendsto_atTop_one a).comp hqs_tendsto)
      tendsto_const_nhds ?_ (stieltjesFunction_le_one hf a)
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
⊢ f a ∘ qs ≤ ↑(hf.stieltjesFunction a)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
x : ℝ
⊢ (f a ∘ qs) x ≤ ↑(hf.stieltjesFunction a) x
tactic: intro x
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
x : ℝ
⊢ (f a ∘ qs) x ≤ ↑(hf.stieltjesFunction a) x
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
x : ℝ
⊢ ↑(hf.stieltjesFunction a) ↑(qs x) ≤ ↑(hf.stieltjesFunction a) x
tactic: rw [Function.comp_apply, ← stieltjesFunction_eq hf]
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
inst✝ : MeasurableSpace α
f : α → ℚ → ℝ
hf : IsMeasurableRatCDF f
a : α
h_exists : ∀ (x : ℝ), ∃ q, x - 1 < ↑q ∧ ↑q < x
qs : ℝ → ℚ := fun x => ⋯.choose
hqs_tendsto : Tendsto qs atTop atTop
x : ℝ
⊢ ↑(hf.stieltjesFunction a) ↑(qs x) ≤ ↑(hf.stieltjesFunction a) x
state_after: no goals
tactic: exact (hf.stieltjesFunction a).mono (le_of_lt (h_exists x).choose_spec.2)