Theorem: Polynomial.Chebyshev.add_one_mul_T_eq_poly_in_U
File: Mathlib/RingTheory/Polynomial/Chebyshev.lean

tactic: have h : derivative (T R (n + 2)) = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) +
    2 * X * U R n - (1 - X ^ 2) * derivative (U R n) := by
  conv_lhs => rw [T_eq_X_mul_T_sub_pol_U]
  simp only [derivative_sub, derivative_mul, derivative_X, derivative_one, derivative_X_pow,
    one_mul, T_derivative_eq_U]
  rw [T_eq_U_sub_X_mul_U, C_eq_nat_cast]
  ring
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
⊢ (↑n + 1) * T R (n + 1) = X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: calc
  ((n : R[X]) + 1) * T R (n + 1) =
      ((n : R[X]) + 1 + 1) * (X * U R n + T R (n + 1)) - X * ((n + 1 : R[X]) * U R n) -
        (X * U R n + T R (n + 1)) :=
    by ring
  _ = derivative (T R (n + 2)) - X * derivative (T R (n + 1)) - U R (n + 1) := by
    rw [← U_eq_X_mul_U_add_T, ← T_derivative_eq_U, ← Nat.cast_one, ← Nat.cast_add, Nat.cast_one, ←
      T_derivative_eq_U (n + 1)]
  _ = U R (n + 1) - X * U R n + X * derivative (T R (n + 1)) + 2 * X * U R n -
            (1 - X ^ 2) * derivative (U R n) -
          X * derivative (T R (n + 1)) -
        U R (n + 1) :=
    by rw [h]
  _ = X * U R n - (1 - X ^ 2) * derivative (U R n) := by ring
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
h :
  ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)
⊢ (↑n + 1) * T R (n + 1) = X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: conv_lhs => rw [T_eq_X_mul_T_sub_pol_U]
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
⊢ ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: simp only [derivative_sub, derivative_mul, derivative_X, derivative_one, derivative_X_pow,
  one_mul, T_derivative_eq_U]
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
⊢ ↑derivative (X * T R (n + 1) - (1 - X ^ 2) * U R n) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: rw [T_eq_U_sub_X_mul_U, C_eq_nat_cast]
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
⊢ T R (n + 1) + X * ((↑n + 1) * U R n) - ((0 - ↑C ↑2 * X ^ (2 - 1)) * U R n + (1 - X ^ 2) * ↑derivative (U R n)) =
    U R (n + 1) - X * U R n + X * ((↑n + 1) * U R n) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: ring
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
⊢ U R (n + 1) - X * U R n + X * ((↑n + 1) * U R n) -
      ((0 - ↑2 * X ^ (2 - 1)) * U R n + (1 - X ^ 2) * ↑derivative (U R n)) =
    U R (n + 1) - X * U R n + X * ((↑n + 1) * U R n) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)

tactic: ring
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
h :
  ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)
⊢ (↑n + 1) * T R (n + 1) = (↑n + 1 + 1) * (X * U R n + T R (n + 1)) - X * ((↑n + 1) * U R n) - (X * U R n + T R (n + 1))

tactic: rw [← U_eq_X_mul_U_add_T, ← T_derivative_eq_U, ← Nat.cast_one, ← Nat.cast_add, Nat.cast_one, ←
  T_derivative_eq_U (n + 1)]
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
h :
  ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)
⊢ (↑n + 1 + 1) * (X * U R n + T R (n + 1)) - X * ((↑n + 1) * U R n) - (X * U R n + T R (n + 1)) =
    ↑derivative (T R (n + 2)) - X * ↑derivative (T R (n + 1)) - U R (n + 1)

tactic: rw [h]
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
h :
  ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)
⊢ ↑derivative (T R (n + 2)) - X * ↑derivative (T R (n + 1)) - U R (n + 1) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n) -
        X * ↑derivative (T R (n + 1)) -
      U R (n + 1)

tactic: ring
state_before: R : Type u_1
S : Type ?u.79032
inst✝¹ : CommRing R
inst✝ : CommRing S
n : ℕ
h :
  ↑derivative (T R (n + 2)) =
    U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n)
⊢ U R (n + 1) - X * U R n + X * ↑derivative (T R (n + 1)) + 2 * X * U R n - (1 - X ^ 2) * ↑derivative (U R n) -
        X * ↑derivative (T R (n + 1)) -
      U R (n + 1) =
    X * U R n - (1 - X ^ 2) * ↑derivative (U R n)