-- Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean
theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
    HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c : HasDerivAt (fun x => Complex.sin (2 * z * ↑x) / (2 * z)) (Complex.cos (2 * z * ↑x)) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
exact c

Result:
no goals

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c :
  HasDerivAt (fun x => (Complex.sin ∘ fun y => y * (2 * z)) ↑x / (2 * z))
    (Complex.cos (↑x * (2 * z)) * (2 * z) / (2 * z)) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
field_simp at c

Result:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c : HasDerivAt (fun x => Complex.sin (↑x * (2 * z)) / (2 * z)) (Complex.cos (↑x * (2 * z))) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
have a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _

Result:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
have c := b.comp_ofReal.div_const (2 * z)

Result:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c :
  HasDerivAt (fun x => (Complex.sin ∘ fun y => y * (2 * z)) ↑x / (2 * z))
    (Complex.cos (↑x * (2 * z)) * (2 * z) / (2 * z)) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
have b : HasDerivAt (Complex.sin ∘ fun y : ℂ => (y * (2 * z))) _ x :=
  HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a

Result:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Proof state:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c : HasDerivAt (fun x => Complex.sin (↑x * (2 * z)) / (2 * z)) (Complex.cos (↑x * (2 * z))) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x

Tactic:
simp only [fun y => mul_comm y (2 * z)] at c

Result:
z : ℂ
hz : z ≠ 0
x : ℝ
a : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x
b : HasDerivAt (Complex.sin ∘ fun y => y * (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x
c : HasDerivAt (fun x => Complex.sin (2 * z * ↑x) / (2 * z)) (Complex.cos (2 * z * ↑x)) x
⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x