Function of #cas
ChebyshevT
The Chebyshev polynomial in monomials, proved in every commutative ring, and its exact values at rational points.
#cas (ChebyshevT n x)#cas (ChebyshevT n q)#cas [N d] (ChebyshevT n q)ChebyshevT writes the Chebyshev polynomial of the first kind in monomials, or gives its exact value at a rational point. The theorem is unusually general. For the polynomial it is about Mathlib’s Polynomial.Chebyshev.T R n, and it holds in every commutative ring R : Type at once, so a proof can specialize it to the ring it works in, whether that is , or a finite field.
Examples (11)#
Basic Examples (2)
in monomials, with the theorem in every commutative ring:
#cas (ChebyshevT 5 x)
polynomial with integer coefficients
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
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 exact value at a rational point:
#cas (ChebyshevT 5 (1/2))
exact rational value
1/2- Domain
ChebyshevT polynomial at a rational point
Checked by Lean’s kernel: Exact value of ChebyshevT 5
Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 5) = 1 / 2
The certificate: 1 checked step
Exact value of ChebyshevT 5
Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 5) = 1 / 2
Scope (3)
The degree may be a closed integer expression:
#cas (ChebyshevT (2 + 1) x)
polynomial with integer coefficients
4*x^3 - 3*x- Domain
Polynomial.Chebyshev.T R 3, every commutative ring R : Type- Input (polynomial in x)
ChebyshevT 3 x
Checked by Lean’s kernel: Monomial expansion of ChebyshevT 3
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 3 = 4 * Polynomial.X ^ 3 - 3 * Polynomial.X
The certificate: 1 checked step
Monomial expansion of ChebyshevT 3
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 3 = 4 * Polynomial.X ^ 3 - 3 * Polynomial.X
The variable need not be x, and expand prints the same polynomial:
#cas [expand] (ChebyshevT 1 t)
polynomial with integer coefficients
t- Domain
Polynomial.Chebyshev.T R 1, every commutative ring R : Type- Input (polynomial in t)
ChebyshevT 1 t
Checked by Lean’s kernel: Monomial expansion of ChebyshevT 1
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 1 = Polynomial.X
The certificate: 1 checked step
Monomial expansion of ChebyshevT 1
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 1 = Polynomial.X
[N d] adds the first digits of the exact value:
#cas [N 10] (ChebyshevT 5 (1/3))
exact rational value and its first 10 significant digits, truncated
241/243 ≈ 0.9917695473- Domain
ChebyshevT polynomial at a rational point
Checked by Lean’s kernel: Exact value and digits of ChebyshevT 5
Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) = 241 / 243 ∧ 9917695473 / 10 ^ 10 ≤ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) ∧ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) < (9917695473 + 1) / 10 ^ 10
The certificate: 1 checked step
Exact value and digits of ChebyshevT 5
Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) = 241 / 243 ∧ 9917695473 / 10 ^ 10 ≤ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) ∧ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) < (9917695473 + 1) / 10 ^ 10
Applications (1)
A proof can take the printed theorem as a hypothesis and specialize it, here to at :
theorem chebyshevT_five_at_half (h : ∀ (R : Type) [CommRing R], Polynomial.Chebyshev.T R 5 = 16 * Polynomial.X ^ 5 - 20 * Polynomial.X ^ 3 + 5 * Polynomial.X) : (Polynomial.Chebyshev.T ℝ 5).eval (1 / 2) = 1 / 2 := by rw [h ℝ] norm_num #print axioms chebyshevT_five_at_half
chebyshevT_five_at_half depends on the axioms propext, Classical.choice, Quot.sound.
Properties and Relations (2)
. At this gives , and the digits are exact:
#cas [N 5] (ChebyshevT 3 (1/2))
exact rational value and its first 5 significant digits, truncated
-1 = -1.0000- Domain
ChebyshevT polynomial at a rational point
Checked by Lean’s kernel: Exact value and digits of ChebyshevT 3
Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) = -1 ∧ -(10000 + 1) / 10 ^ 4 < Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) ∧ Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) ≤ -10000 / 10 ^ 4
The certificate: 1 checked step
Exact value and digits of ChebyshevT 3
Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) = -1 ∧ -(10000 + 1) / 10 ^ 4 < Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) ∧ Polynomial.eval (1 / 2) (Polynomial.Chebyshev.T ℝ 3) ≤ -10000 / 10 ^ 4
The derivative of is . For it is , with from ChebyshevU:
#cas (ChebyshevU 4 x)
polynomial with integer coefficients
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
Monomial expansion of ChebyshevU 4
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.U R 4 = 16 * Polynomial.X ^ 4 - 12 * Polynomial.X ^ 2 + 1
Possible Issues (3)
The degree is at most 80. Mathlib’s recurrence Polynomial.Chebyshev.T_add_two gives higher degrees from two lower ones:
#cas (ChebyshevT 81 x)
Error
ChebyshevT accepts degrees up to 80
[N d] evaluates at a number, not at a variable:
#cas [N 10] (ChebyshevT 3 x)
Error
`[N d]` evaluates `ChebyshevT n x` at a number; `#cas (ChebyshevT 3 x)` gives the polynomial
The second argument is a variable or a rational number, not an expression in a variable:
#cas (ChebyshevT 2 (x + 1))
Error
the second argument of `ChebyshevT n x` is a variable, for the polynomial, or a rational number, for its value
See Also
ChebyshevU · LegendreP · HermiteHe · expand · N
