awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))) =
    HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
        HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
      HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))
a :
  (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) +
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
            HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
          HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 * (⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
          (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (T R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))))) =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) +
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
            HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
          HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
          (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (T R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))))) =
    0

Tactic:
push_cast
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))) =
    HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
        HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
      HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))
a :
  HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) (↑k : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) (↑k : R[X]) * (↑(k - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[k] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2 =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) +
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
            HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
          HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 * (⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
          (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (T R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))))) =
    0

Tactic:
ring_nf
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))) =
    HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) X +
        HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) -
      HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))
a :
  HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) (↑k : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) (↑k : R[X]) * (↑(k - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[k] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2 =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n) =
    (HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
      (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
        (⇑derivative : (a : R[X]) → R[X])^[k] (T R n)

Tactic:
linear_combination (norm := (push_cast; ring_nf)) h
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
h :
  (⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 2] (T R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (HMul.hMul (α := ℕ) 2 0)
              ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 1] (T R n)) *
            X +
        HSMul.hSMul (β := R[X]) (0 * HSub.hSub (α := ℕ) 0 1) ((⇑derivative : (a : R[X]) → R[X])^[0] (T R n))) =
    HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 1] (T R n)) X +
        HSMul.hSMul (α := ℕ) (β := R[X]) 0 ((⇑derivative : (a : R[X]) → R[X])^[0] (T R n)) -
      HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (T R n))
⊢ HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (T R n)) (↑0 : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (T R n)) (↑0 : R[X]) *
          (↑(HSub.hSub (α := ℕ) 0 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[0] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑0 : R[X]) 2 =
    0

Tactic:
grind
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
n_1 : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 2] (T R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 2] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * (n_1 + 1)) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 1] (T R n)) * X +
        HSMul.hSMul (β := R[X]) ((n_1 + 1) * (n_1 + 1 - 1)) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n))) =
    HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 1] (T R n)) X +
        HSMul.hSMul (β := R[X]) (n_1 + 1) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n)) -
      HMul.hMul (α := R[X]) (↑(HPow.hPow (β := ℕ) n 2) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n))
⊢ HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n)) (↑(n_1 + 1) : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n)) (↑(n_1 + 1) : R[X]) *
          (↑(n_1 + 1 - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (T R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑(n_1 + 1) : R[X]) 2 =
    0

Tactic:
grind
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
⊢ (⇑derivative : (a : R[X]) → R[X])^[k]
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[2] (U R n)) =
    (⇑derivative : (a : R[X]) → R[X])^[k]
      (HMul.hMul (β := R[X]) (HMul.hMul (α := R[X]) 3 X) ((derivative : (a : R[X]) → R[X]) (U R n) : R[X]) -
        HAdd.hAdd (α := R[X]) (↑n : R[X]) 2 * (↑n : R[X]) * U R n)

Tactic:
have h := congr_arg derivative^[k] <| one_sub_X_sq_mul_derivative_derivative_U_eq_poly_in_U
    (R := R) n
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k]
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[2] (U R n)) =
    (⇑derivative : (a : R[X]) → R[X])^[k]
      (HMul.hMul (β := R[X]) (HMul.hMul (α := R[X]) 3 X) ((derivative : (a : R[X]) → R[X]) (U R n) : R[X]) -
        HAdd.hAdd (α := R[X]) (↑n : R[X]) 2 * (↑n : R[X]) * U R n)
⊢ (⇑derivative : (a : R[X]) → R[X])^[k]
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[2] (U R n)) =
    (⇑derivative : (a : R[X]) → R[X])^[k]
      (HMul.hMul (β := R[X]) (HMul.hMul (α := R[X]) 3 X) ((derivative : (a : R[X]) → R[X]) (U R n) : R[X]) -
        HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) (U R n))

Tactic:
norm_cast at h
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k]
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[2] (U R n)) =
    (⇑derivative : (a : R[X]) → R[X])^[k]
      (HMul.hMul (β := R[X]) (HMul.hMul (α := R[X]) 3 X) ((derivative : (a : R[X]) → R[X]) (U R n) : R[X]) -
        HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) (U R n))
⊢ (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
          HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))

Tactic:
rw [sub_mul, iterate_derivative_sub, one_mul, ← Function.iterate_add_apply, mul_comm (X ^ 2),
    iterate_derivative_sub, mul_assoc 3, ← Nat.cast_three, iterate_derivative_natCast_mul,
    mul_comm X, iterate_derivative_intCast_mul, iterate_derivative_derivative_mul_X_sq,
    iterate_derivative_derivative_mul_X] at h

Premises used: Function.iterate_add_apply, mul_assoc, Polynomial.iterate_derivative_derivative_mul_X_sq, Polynomial.iterate_derivative_natCast_mul, Polynomial.iterate_derivative_derivative_mul_X, sub_mul, Nat.cast_three, HPow.hPow, Polynomial.iterate_derivative_sub, mul_comm, Polynomial.iterate_derivative_intCast_mul, OfNat.ofNat, Polynomial.X, one_mul
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
          HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))
a :
  (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) +
        (3 *
            (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
              HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
          HAdd.hAdd (α := R[X]) (↑n : R[X]) 2 * (↑n : R[X]) * (⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 3) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n) -
          (HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑n : R[X]) 1) 2 -
              HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑k : R[X]) 1) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (U R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))))) =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) +
        ((↑3 : R[X]) *
            (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
              HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
          HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 3) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n) -
          (HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑n : R[X]) 1) 2 -
              HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑k : R[X]) 1) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (U R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))))) =
    0

Tactic:
push_cast
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
          HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))
a :
  HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) (↑k : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) (↑k : R[X]) * (↑(k - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[k] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2 =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) +
        (3 *
            (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
              HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
          HAdd.hAdd (α := R[X]) (↑n : R[X]) 2 * (↑n : R[X]) * (⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) -
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 3) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n) -
          (HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑n : R[X]) 1) 2 -
              HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑k : R[X]) 1) 2) *
            (⇑derivative : (a : R[X]) → R[X])^[k] (U R n) +
        ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
          ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
              HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
            HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))))) =
    0

Tactic:
ring_nf
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * k) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) * X +
        HSMul.hSMul (β := R[X]) (k * (k - 1)) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n)) X +
          HSMul.hSMul (β := R[X]) k ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n))
a :
  HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) (↑k : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[k] (U R n)) (↑k : R[X]) * (↑(k - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[k] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2 =
    0
⊢ (1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (U R n) =
    (HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 3) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (U R n) -
      (HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑n : R[X]) 1) 2 -
          HPow.hPow (β := ℕ) (HAdd.hAdd (α := R[X]) (↑k : R[X]) 1) 2) *
        (⇑derivative : (a : R[X]) → R[X])^[k] (U R n)

Tactic:
linear_combination (norm := (push_cast; ring_nf)) h
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
h :
  (⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (HMul.hMul (α := ℕ) 2 0)
              ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 1] (U R n)) *
            X +
        HSMul.hSMul (β := R[X]) (0 * HSub.hSub (α := ℕ) 0 1) ((⇑derivative : (a : R[X]) → R[X])^[0] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[HAdd.hAdd (α := ℕ) 0 1] (U R n)) X +
          HSMul.hSMul (α := ℕ) (β := R[X]) 0 ((⇑derivative : (a : R[X]) → R[X])^[0] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (U R n))
⊢ HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (U R n)) (↑0 : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[0] (U R n)) (↑0 : R[X]) *
          (↑(HSub.hSub (α := ℕ) 0 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[0] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑0 : R[X]) 2 =
    0

Tactic:
grind
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
n_1 : ℕ
h :
  (⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 2] (U R n) -
      ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 2] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) X 2 +
          HSMul.hSMul (β := R[X]) (2 * (n_1 + 1)) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 1] (U R n)) * X +
        HSMul.hSMul (β := R[X]) ((n_1 + 1) * (n_1 + 1 - 1)) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n))) =
    (↑3 : R[X]) *
        (HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1 + 1] (U R n)) X +
          HSMul.hSMul (β := R[X]) (n_1 + 1) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n))) -
      HMul.hMul (α := R[X]) (↑((n + 2) * n) : R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n))
⊢ HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n)) (↑(n_1 + 1) : R[X]) +
        HMul.hMul (α := R[X]) ((⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n)) (↑(n_1 + 1) : R[X]) *
          (↑(n_1 + 1 - 1) : R[X]) -
      (⇑derivative : (a : R[X]) → R[X])^[n_1 + 1] (U R n) * HPow.hPow (α := R[X]) (β := ℕ) (↑(n_1 + 1) : R[X]) 2 =
    0

Tactic:
grind
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
x : R
⊢ Eq.{u_1 + 1} (α := R)
    ((fun (p : R[X]) ↦ eval x p)
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n)))
    ((fun (p : R[X]) ↦ eval x p)
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
        (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
          (⇑derivative : (a : R[X]) → R[X])^[k] (T R n)))

Tactic:
have h := congr_arg (fun (p : R[X]) => p.eval x) <|
    one_sub_X_sq_mul_iterate_derivative_T_eq_poly_in_T n k
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
x : R
h :
  Eq.{u_1 + 1} (α := R)
    ((fun (p : R[X]) ↦ eval x p)
      ((1 - HPow.hPow (α := R[X]) (β := ℕ) X 2) * (⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n)))
    ((fun (p : R[X]) ↦ eval x p)
      ((HMul.hMul (α := R[X]) 2 (↑k : R[X]) + 1) * X * (⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n) -
        (HPow.hPow (α := R[X]) (β := ℕ) (↑n : R[X]) 2 - HPow.hPow (α := R[X]) (β := ℕ) (↑k : R[X]) 2) *
          (⇑derivative : (a : R[X]) → R[X])^[k] (T R n)))
⊢ (1 - HPow.hPow (β := ℕ) x 2) * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n)) =
    (HMul.hMul (α := R) 2 (↑k : R) + 1) * x * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) -
      (HPow.hPow (α := R) (β := ℕ) (↑n : R) 2 - HPow.hPow (α := R) (β := ℕ) (↑k : R) 2) *
        eval x ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))

Tactic:
simp only [eval_mul, eval_sub, eval_one, eval_pow,
    eval_X, eval_add, eval_ofNat, eval_natCast, eval_intCast] at h

Premises used: Polynomial.eval_X, Polynomial.eval_pow, Polynomial.eval_natCast, Polynomial.eval_mul, Polynomial.eval_intCast, Polynomial.eval_add, Polynomial.eval_one, Polynomial.eval_ofNat, Polynomial.eval_sub
-- Module: Mathlib.RingTheory.Polynomial.Chebyshev
Goal:
R : Type u_1
inst : CommRing R
n : ℤ
k : ℕ
x : R
h :
  (1 - HPow.hPow (β := ℕ) x 2) * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n)) =
    (HMul.hMul (α := R) 2 (↑k : R) + 1) * x * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) -
      (HPow.hPow (α := R) (β := ℕ) (↑n : R) 2 - HPow.hPow (α := R) (β := ℕ) (↑k : R) 2) *
        eval x ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))
⊢ (1 - HPow.hPow (β := ℕ) x 2) * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n)) +
        ((HMul.hMul (α := R) 2 (↑k : R) + 1) * x * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) -
          (HPow.hPow (α := R) (β := ℕ) (↑n : R) 2 - HPow.hPow (α := R) (β := ℕ) (↑k : R) 2) *
            eval x ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n))) -
      ((HMul.hMul (α := R) 2 (↑k : R) + 1) * x * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 1] (T R n)) -
          (HPow.hPow (α := R) (β := ℕ) (↑n : R) 2 - HPow.hPow (α := R) (β := ℕ) (↑k : R) 2) *
            eval x ((⇑derivative : (a : R[X]) → R[X])^[k] (T R n)) +
        (1 - HPow.hPow (β := ℕ) x 2) * eval x ((⇑derivative : (a : R[X]) → R[X])^[k + 2] (T R n))) =
    0

Tactic:
ring_nf