Theorem: EulerSine.tendsto_integral_cos_pow_mul_div
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean

tactic: simp_rw [div_eq_inv_mul (α := ℂ), ← Complex.ofReal_inv, integral_of_le pi_div_two_pos.le,
  ← MeasureTheory.integral_Icc_eq_integral_Ioc, ← Complex.ofReal_pow, ← Complex.real_smul]
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
⊢ Tendsto (fun n => (∫ (x : ℝ) in 0 ..π / 2, ↑(cos x) ^ n * f x) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n)) atTop (𝓝 (f 0))

tactic: have c_lt : ∀ y : ℝ, y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0 := fun y hy hy' =>
  cos_lt_cos_of_nonneg_of_le_pi_div_two (le_refl 0) hy.2 (lt_of_le_of_ne hy.1 hy'.symm)
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
⊢ Tendsto (fun n => (∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n)⁻¹ • ∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n • f t) atTop
    (𝓝 (f 0))

tactic: have c_nonneg : ∀ x : ℝ, x ∈ Icc 0 (π / 2) → 0 ≤ cos x := fun x hx =>
  cos_nonneg_of_mem_Icc ((Icc_subset_Icc_left (neg_nonpos_of_nonneg pi_div_two_pos.le)) hx)
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
⊢ Tendsto (fun n => (∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n)⁻¹ • ∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n • f t) atTop
    (𝓝 (f 0))

tactic: have c_zero_pos : 0 < cos 0 := by rw [cos_zero]; exact zero_lt_one
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
⊢ Tendsto (fun n => (∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n)⁻¹ • ∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n • f t) atTop
    (𝓝 (f 0))

tactic: have zero_mem : (0 : ℝ) ∈ closure (interior (Icc 0 (π / 2))) := by
  rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]
  exact pi_div_two_pos.le
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
c_zero_pos : 0 < cos 0
⊢ Tendsto (fun n => (∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n)⁻¹ • ∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n • f t) atTop
    (𝓝 (f 0))

tactic: exact
  tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn isCompact_Icc
    continuousOn_cos c_lt c_nonneg c_zero_pos zero_mem hf
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
c_zero_pos : 0 < cos 0
zero_mem : 0 ∈ closure (interior (Icc 0 (π / 2)))
⊢ Tendsto (fun n => (∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n)⁻¹ • ∫ (t : ℝ) in Icc 0 (π / 2), cos t ^ n • f t) atTop
    (𝓝 (f 0))

tactic: rw [cos_zero]
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
⊢ 0 < cos 0

tactic: exact zero_lt_one
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
⊢ 0 < 1

tactic: rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
c_zero_pos : 0 < cos 0
⊢ 0 ∈ closure (interior (Icc 0 (π / 2)))

tactic: exact pi_div_two_pos.le
state_before: f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0
c_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x
c_zero_pos : 0 < cos 0
⊢ 0 ≤ π / 2