awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this_2 :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
this :
  (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
⊢ (↑π : ℂ) * z * A * B / (↑C : ℂ) =
    (↑π : ℂ) * z * A *
        ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
          ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ)) /
      (↑((HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C) : ℂ)
have rw : (↑π : ℂ) * z * A * B / (↑C : ℂ) =
  (↑π : ℂ) * z * A * ((HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B) /
    ((↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) : ℂ) / (↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) : ℂ) * (↑C : ℂ))
Tactic: rw [this, Complex.ofReal_mul, Complex.ofReal_div]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this_2 :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
this :
  (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
⊢ (↑π : ℂ) * z * A * B / (↑C : ℂ) =
    (↑π : ℂ) * z * A * ((HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B) /
      ((↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) : ℂ) / (↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) : ℂ) * (↑C : ℂ))
have this₁ : (↑C : ℂ) ≠ 0
Tactic: have : (C : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (integral_cos_pow_pos _).ne'
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this_2 :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
this_3 :
  (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
this : (↑C : ℂ) ≠ 0
⊢ HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1 ≠ 0
have h : HMul.hMul (α := ℂ) 2 (↑n : ℂ) = (↑(2 * n) : ℂ)
Tactic: convert! (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this_2 :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
this_3 :
  (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
this : (↑C : ℂ) ≠ 0
⊢ (↑π : ℂ) * z * A * B / (↑C : ℂ) =
    (↑π : ℂ) * z * A * ((HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B) /
      ((↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) : ℂ) / (↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) : ℂ) * (↑C : ℂ))
have this₁ : HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1 ≠ 0
Tactic: have : 2 * (n : ℂ) + 1 ≠ 0 := by
        convert! (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)
        simp
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this_2 :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
this_3 :
  (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
this_4 : (↑C : ℂ) ≠ 0
this : HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1 ≠ 0
⊢ (↑π : ℂ) * z * A * B / (↑C : ℂ) =
    (↑π : ℂ) * z * A * ((HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B) /
      ((↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) : ℂ) / (↑(HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) : ℂ) * (↑C : ℂ))
have this₁ : HAdd.hAdd (α := ℂ) (↑n : ℂ) 1 ≠ 0
Tactic: have : (n : ℂ) + 1 ≠ 0 := Nat.cast_add_one_ne_zero n
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
⊢ (↑π : ℂ) * z * A * B / (↑C : ℂ) =
    (↑π : ℂ) * z * A *
        ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
          ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ)) /
      (↑((HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C) : ℂ)
have inr : (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
    ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
  (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
Tactic: suffices
      (((1 : ℂ) - z ^ 2 / (n.succ : ℂ) ^ 2) *
          ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) =
        (2 * n + 1) / (2 * n + 2) * B by
      rw [this, Complex.ofReal_mul, Complex.ofReal_div]
      have : (C : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (integral_cos_pow_pos _).ne'
      have : 2 * (n : ℂ) + 1 ≠ 0 := by
        convert! (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)
        simp
      have : (n : ℂ) + 1 ≠ 0 := Nat.cast_add_one_ne_zero n
      simp [field]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
⊢ (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 1) / (HMul.hMul (α := ℂ) 2 (↑n : ℂ) + 2) * B
have h : (↑n.succ : ℂ) = HAdd.hAdd (α := ℂ) (↑n : ℂ) 1
Tactic: convert! integral_cos_mul_cos_pow_even n hz
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
hz : z ≠ 0
n : ℕ
A : ℂ := ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)
B : ℂ := ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)
C : ℝ := ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)
hn : Complex.sin ((↑π : ℂ) * z) = (↑π : ℂ) * z * A * B / (↑C : ℂ)
aux' : 2 * n.succ = 2 * n + 2
this_1 :
  ∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n.succ) =
    (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 1) / (HMul.hMul (α := ℝ) 2 (↑n : ℝ) + 2) * C
this :
  (↑π : ℂ) * z * (A * (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑n : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ) =
    (↑π : ℂ) * z * A *
      ((1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (α := ℂ) (β := ℕ) (↑n.succ : ℂ) 2) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n.succ))
⊢ (↑n.succ : ℂ) = HAdd.hAdd (α := ℂ) (↑n : ℂ) 1
have h : HAdd.hAdd (α := ℂ) (↑n : ℂ) 1 = HAdd.hAdd (α := ℂ) (↑n : ℂ) 1
Tactic: rw [Nat.cast_succ]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
n : ℕ
hz : z ≠ 0
⊢ Complex.sin ((↑π : ℂ) * z) =
    (((↑π : ℂ) * z *
          ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)) /
      (↑(∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)) : ℂ)
have inr : Complex.sin ((↑π : ℂ) * z) =
  (((↑π : ℂ) * z *
        ∏ j ∈ Finset.range 0, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)) *
      ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ HMul.hMul (α := ℕ) 2 0) /
    (↑(∫ (x : ℝ) in 0..π / 2, cos x ^ HMul.hMul (α := ℕ) 2 0) : ℂ)
Tactic: induction n with
  | zero =>
    simp_rw [mul_zero, pow_zero, mul_one, Finset.prod_range_zero, mul_one,
      integral_one, sub_zero]
    rw [integral_cos_mul_complex (mul_ne_zero two_ne_zero hz), Complex.ofReal_zero,
      mul_zero, Complex.sin_zero, zero_div, sub_zero,
      (by push_cast; ring : 2 * z * ↑(π / 2) = π * z)]
    simp [field]
  | succ n hn =>
    rw [hn, Finset.prod_range_succ]
    set A := ∏ j ∈ Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2)
    set B := ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n)
    set C := ∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n)
    have aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add, mul_one]
    have : (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n.succ)) = (2 * (n : ℝ) + 1) / (2 * n + 2) * C := by
      rw [integral_cos_pow_eq]
      dsimp only [C]
      rw [integral_cos_pow_eq, aux', integral_sin_pow, sin_zero, sin_pi, pow_succ',
        zero_mul, zero_mul, zero_mul, sub_zero, zero_div,
        zero_add, ← mul_assoc, ← mul_assoc, mul_comm (1 / 2 : ℝ) _, Nat.cast_mul, Nat.cast_ofNat]
    rw [this]
    change
      π * z * A * B / C =
        (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) *
            ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) /
          ((2 * n + 1) / (2 * n + 2) * C : ℝ)
    have :
      (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) *
          ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) =
        π * z * A *
          (((1 : ℂ) - z ^ 2 / (n.succ : ℂ) ^ 2) *
            ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) := by
      grind
    rw [this]
    suffices
      (((1 : ℂ) - z ^ 2 / (n.succ : ℂ) ^ 2) *
          ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) =
        (2 * n + 1) / (2 * n + 2) * B by
      rw [this, Complex.ofReal_mul, Complex.ofReal_div]
      have : (C : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (integral_cos_pow_pos _).ne'
      have : 2 * (n : ℂ) + 1 ≠ 0 := by
        convert! (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)
        simp
      have : (n : ℂ) + 1 ≠ 0 := Nat.cast_add_one_ne_zero n
      simp [field]
    convert! integral_cos_mul_cos_pow_even n hz
    rw [Nat.cast_succ]
Cleared hypotheses: n
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
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))
have simp_rw : Tendsto
  (fun (n : ℕ) ↦
    HSMul.hSMul (α := ℝ) (β := ℂ)
      (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
          fun (x : ℝ) ↦ cos x ^ n)⁻¹
      (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
        fun (x : ℝ) ↦ cos x ^ n • f x))
  atTop (𝓝 (f 0))
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]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
⊢ Tendsto
    (fun (n : ℕ) ↦
      HSMul.hSMul (α := ℝ) (β := ℂ)
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
            fun (x : ℝ) ↦ cos x ^ n)⁻¹
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
          fun (x : ℝ) ↦ cos x ^ n • f x))
    atTop (𝓝 (f 0))
have c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 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)
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 0
⊢ Tendsto
    (fun (n : ℕ) ↦
      HSMul.hSMul (α := ℝ) (β := ℂ)
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
            fun (x : ℝ) ↦ cos x ^ n)⁻¹
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
          fun (x : ℝ) ↦ cos x ^ n • f x))
    atTop (𝓝 (f 0))
have c_nonneg : ∀ x ∈ Icc 0 (π / 2), 0 ≤ cos x
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)
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 0
c_nonneg : ∀ x ∈ Icc 0 (π / 2), 0 ≤ cos x
⊢ 0 < cos 0
have rw : LT.lt (α := ℝ) 0 1
Tactic: rw [cos_zero]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 0
c_nonneg : ∀ x ∈ Icc 0 (π / 2), 0 ≤ cos x
⊢ Tendsto
    (fun (n : ℕ) ↦
      HSMul.hSMul (α := ℝ) (β := ℂ)
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
            fun (x : ℝ) ↦ cos x ^ n)⁻¹
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
          fun (x : ℝ) ↦ cos x ^ n • f x))
    atTop (𝓝 (f 0))
have c_zero_pos : 0 < cos 0
Tactic: have c_zero_pos : 0 < cos 0 := by rw [cos_zero]; exact zero_lt_one
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 0
c_nonneg : ∀ x ∈ Icc 0 (π / 2), 0 ≤ cos x
c_zero_pos : 0 < cos 0
⊢ 0 ∈ closure (interior (Icc 0 (π / 2)))
have rw : 0 ≤ π / 2
Tactic: rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
f : ℝ → ℂ
hf : ContinuousOn f (Icc 0 (π / 2))
c_lt : ∀ y ∈ Icc 0 (π / 2), y ≠ 0 → cos y < cos 0
c_nonneg : ∀ x ∈ Icc 0 (π / 2), 0 ≤ cos x
c_zero_pos : 0 < cos 0
⊢ Tendsto
    (fun (n : ℕ) ↦
      HSMul.hSMul (α := ℝ) (β := ℂ)
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
            fun (x : ℝ) ↦ cos x ^ n)⁻¹
        (@MeasureTheory.integral _ _ _ _ measurableSpace (MeasureTheory.Measure.restrict volume (Icc 0 (π / 2)))
          fun (x : ℝ) ↦ cos x ^ n • f x))
    atTop (𝓝 (f 0))
have zero_mem : 0 ∈ closure (interior (Icc 0 (π / 2)))
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
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
z : ℂ
⊢ Tendsto
    (fun (n : ℕ) ↦
      (↑π : ℂ) * z *
        ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2))
    atTop (𝓝 (Complex.sin ((↑π : ℂ) * z)))
have A : Tendsto
  (fun (n : ℕ) ↦
    (((↑π : ℂ) * z *
          ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)) *
        ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)) /
      (↑(∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)) : ℂ))
  atTop (𝓝 (Complex.sin ((↑π : ℂ) * z)))
Tactic: have A :
    Tendsto
      (fun n : ℕ =>
        ((π * z * ∏ j ∈ Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2)) *
            ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n)) /
          (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n) : ℝ))
      atTop (𝓝 <| _) :=
    Tendsto.congr (fun n => sin_pi_mul_eq z n) tendsto_const_nhds
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (goal)
Goal:
z : ℂ
A :
  Tendsto
    (fun (n : ℕ) ↦
      (((↑π : ℂ) * z *
            ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)) *
          ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)) /
        (↑(∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)) : ℂ))
    atTop (𝓝 (Complex.sin ((↑π : ℂ) * z)))
⊢ 𝓝 (Complex.sin ((↑π : ℂ) * z)) = 𝓝 (Complex.sin ((↑π : ℂ) * z) * 1)
have rw : 𝓝 (Complex.sin ((↑π : ℂ) * z)) = 𝓝 (Complex.sin ((↑π : ℂ) * z))
Tactic: rw [mul_one]
-- Lean 4 proof step from Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd (hypothesis)
Goal:
z : ℂ
A :
  Tendsto
    (fun (n : ℕ) ↦
      (((↑π : ℂ) * z *
            ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2)) *
          ∫ (x : ℝ) in 0..π / 2, Complex.cos (2 * z * (↑x : ℂ)) * (↑(cos x) : ℂ) ^ (2 * n)) /
        (↑(∫ (x : ℝ) in 0..π / 2, cos x ^ (2 * n)) : ℂ))
    atTop (𝓝 (Complex.sin ((↑π : ℂ) * z)))
⊢ Tendsto
    (fun (n : ℕ) ↦
      (↑π : ℂ) * z *
        ∏ j ∈ Finset.range n, (1 - HPow.hPow (β := ℕ) z 2 / HPow.hPow (β := ℕ) (HAdd.hAdd (α := ℂ) (↑j : ℂ) 1) 2))
    atTop (𝓝 (Complex.sin ((↑π : ℂ) * z)))
have this : 𝓝 (Complex.sin ((↑π : ℂ) * z)) = 𝓝 (Complex.sin ((↑π : ℂ) * z) * 1)
Tactic: have : 𝓝 (Complex.sin (π * z)) = 𝓝 (Complex.sin (π * z) * 1) := by rw [mul_one]