Function of #cas

ChebyshevU

The Chebyshev polynomial Un in monomials, proved in every commutative ring, and its exact values at rational points.

#cas (ChebyshevU n x)
gives the Chebyshev polynomial of the second kind Un in the variable x, in monomials with integer coefficients, and proves the expansion in every commutative ring.
#cas (ChebyshevU n q)
gives the exact value of Un at the rational number q and proves it.
#cas [N d] (ChebyshevU n q)
gives the exact value of Un at q with its first d significant digits, truncated toward zero, and proves their decimal bounds.

ChebyshevU writes the Chebyshev polynomial of the second kind in monomials, or gives its exact value at a rational point. As with ChebyshevT, the theorem for the polynomial is about Mathlib’s Polynomial.Chebyshev.U R n, and it holds in every commutative ring R : Type at once, so one statement serves whichever ring your proof works in.

Details and Options

  • n is a natural number with n≤80, a literal or a closed integer expression.
  • The second argument is a variable or a rational number. The polynomial is written in the variable, which may have any name other than pi, π, Pi, e and E.
  • For the polynomial the theorem is ∀ (R : Type) [CommRing R], Polynomial.Chebyshev.U R n = p for the printed p, written in Polynomial.X. The kernel evaluates the coefficient list of degree n, and CAS.Analysis.SpecialFunctions.chebyshevU_eq_intPoly, proved from Mathlib’s recurrence Polynomial.Chebyshev.U_add_two, identifies it with Mathlib’s polynomial.
  • At a rational q the theorem is Polynomial.eval q (Polynomial.Chebyshev.U ℝ n) = v. With [N d] it adds the first d significant digits of v, truncated toward zero, and their decimal bounds. The report prints v = digits when the digits are exact and v ≈ digits otherwise.
  • With [N d], 1≤d≤2000, as for N.
  • #cas [expand] (ChebyshevU n x) prints the same polynomial as #cas (ChebyshevU n x).
  • There are no options.

Examples (6)#

Basic Examples (1)

U4 in monomials, with the theorem in every commutative ring:

In[1]:=
#cas (ChebyshevU 4 x)
Out[1]=

polynomial with integer coefficients

16x4−12x2+1
16*x^4 - 12*x^2 + 1
Domain
Polynomial.Chebyshev.U R 4, every commutative ring R : Type
Input (polynomial in x)
ChebyshevU 4 x

Checked by Lean’s kernel: Monomial expansion of ChebyshevU 4

∀ (R : Type) [inst : CommRing R],
  Polynomial.Chebyshev.U R 4 = 16 * Polynomial.X ^ 4 - 12 * Polynomial.X ^ 2 + 1
The certificate: 1 checked step
  1. Monomial expansion of ChebyshevU 4

    ∀ (R : Type) [inst : CommRing R],
      Polynomial.Chebyshev.U R 4 = 16 * Polynomial.X ^ 4 - 12 * Polynomial.X ^ 2 + 1

    Checked by Lean’s kernel

Scope (2)

expand prints the same polynomial:

In[2]:=
#cas [expand] (ChebyshevU 2 x)
Out[2]=

polynomial with integer coefficients

4x2−1
4*x^2 - 1
Domain
Polynomial.Chebyshev.U R 2, every commutative ring R : Type
Input (polynomial in x)
ChebyshevU 2 x

Checked by Lean’s kernel: Monomial expansion of ChebyshevU 2

∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.U R 2 = 4 * Polynomial.X ^ 2 - 1
The certificate: 1 checked step
  1. Monomial expansion of ChebyshevU 2

    ∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.U R 2 = 4 * Polynomial.X ^ 2 - 1

    Checked by Lean’s kernel


At a rational point the call gives the exact value, and [N d] adds its first digits. With Un(cosθ)=sin((n+1)θ)/sinθ at cos2π3=−12, the value is U3(−12)=sin8π3/sin2π3=1, and the digits are exact:

In[3]:=
#cas [N 10] (ChebyshevU 3 (-1/2))
Out[3]=

exact rational value and its first 10 significant digits, truncated

1 = 1.000000000
Domain
ChebyshevU polynomial at a rational point

Checked by Lean’s kernel: Exact value and digits of ChebyshevU 3

Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) = 1 ∧
  1000000000 / 10 ^ 9 ≤ Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) ∧
    Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) < (1000000000 + 1) / 10 ^ 9
The certificate: 1 checked step
  1. Exact value and digits of ChebyshevU 3

    Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) = 1 ∧
      1000000000 / 10 ^ 9 ≤ Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) ∧
        Polynomial.eval (-(1 / 2)) (Polynomial.Chebyshev.U ℝ 3) < (1000000000 + 1) / 10 ^ 9

    Checked by Lean’s kernel

Applications (1)

A proof can take the printed theorem as a hypothesis and specialize it, here to R=ℝ at x=1, where Un(1)=n+1:

In[4]:=
theorem chebyshevU_four_at_one
    (h : ∀ (R : Type) [CommRing R], Polynomial.Chebyshev.U R 4 =
      16 * Polynomial.X ^ 4 - 12 * Polynomial.X ^ 2 + 1) :
    (Polynomial.Chebyshev.U ℝ 4).eval 1 = 5 := by
  rw [h ℝ]
  norm_num

#print axioms chebyshevU_four_at_one
Out[4]=

chebyshevU_four_at_one depends on the axioms propext, Classical.choice, Quot.sound.

Properties and Relations (1)

The derivative of the polynomial of the first kind is Tn′=nUn−1. The ChebyshevT polynomial T5 has T5′=80x4−60x2+5=5U4:

In[5]:=
#cas (ChebyshevT 5 x)
Out[5]=

polynomial with integer coefficients

16x5−20x3+5x
16*x^5 - 20*x^3 + 5*x
Domain
Polynomial.Chebyshev.T R 5, every commutative ring R : Type
Input (polynomial in x)
ChebyshevT 5 x

Checked by Lean’s kernel: Monomial expansion of ChebyshevT 5

∀ (R : Type) [inst : CommRing R],
  Polynomial.Chebyshev.T R 5 = 16 * Polynomial.X ^ 5 - 20 * Polynomial.X ^ 3 + 5 * Polynomial.X
The certificate: 1 checked step
  1. Monomial expansion of ChebyshevT 5

    ∀ (R : Type) [inst : CommRing R],
      Polynomial.Chebyshev.T R 5 = 16 * Polynomial.X ^ 5 - 20 * Polynomial.X ^ 3 + 5 * Polynomial.X

    Checked by Lean’s kernel

Possible Issues (1)

The degree is at most 80. Mathlib’s recurrence Polynomial.Chebyshev.U_add_two gives higher degrees from two lower ones:

In[6]:=
#cas (ChebyshevU 81 x)
Out[6]=

Error

ChebyshevU accepts degrees up to 80

See Also

ChebyshevT · LegendreP · HermiteHe · expand · N