# mathlib3documentation

data.polynomial.laurent

# Laurent polynomials #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

We introduce Laurent polynomials over a semiring R. Mathematically, they are expressions of the form $$\sum_{i \in \mathbb{Z}} a_i T ^ i$$ where the sum extends over a finite subset of ℤ. Thus, negative exponents are allowed. The coefficients come from the semiring R and the variable T commutes with everything.

Since we are going to convert back and forth between polynomials and Laurent polynomials, we decided to maintain some distinction by using the symbol T, rather than X, as the variable for Laurent polynomials

## Notation #

The symbol R[T;T⁻¹] stands for laurent_polynomial R. We also define

• C : R →+* R[T;T⁻¹] the inclusion of constant polynomials, analogous to the one for R[X];
• T : ℤ → R[T;T⁻¹] the sequence of powers of the variable T.

## Implementation notes #

We define Laurent polynomials as add_monoid_algebra R ℤ. Thus, they are essentially finsupps ℤ →₀ R. This choice differs from the current irreducible design of polynomial, that instead shields away the implementation via finsupps. It is closer to the original definition of polynomials.

As a consequence, laurent_polynomial plays well with polynomials, but there is a little roughness in establishing the API, since the finsupp implementation of R[X] is well-shielded.

Unlike the case of polynomials, I felt that the exponent notation was not too easy to use, as only natural exponents would be allowed. Moreover, in the end, it seems likely that we should aim to perform computations on exponents in ℤ anyway and separating this via the symbol T seems convenient.

I made a heavy use of simp lemmas, aiming to bring Laurent polynomials to the form C a * T n. Any comments or suggestions for improvements is greatly appreciated!

## Future work #

Lots is missing! -- (Riccardo) add inclusion into Laurent series. -- (Riccardo) giving a morphism (as R-alg, so in the commutative case) from R[T,T⁻¹] to S is the same as choosing a unit of S. -- A "better" definition of trunc would be as an R-linear map. This works: -- lean -- def trunc : R[T;T⁻¹] →[R] R[X] := -- begin -- refine (_ : add_monoid_algebra R ℕ →[R] R[X]).comp _, -- { exact ⟨(to_finsupp_iso R).symm, by simp⟩ }, -- { refine ⟨λ r, comap_domain _ r (set.inj_on_of_injective (λ a b ab, int.of_nat.inj ab) _), _⟩, -- exact λ r f, comap_domain_smul _ _ _ } -- end -- -- but it would make sense to bundle the maps better, for a smoother user experience. -- I (DT) did not have the strength to embark on this (possibly short!) journey, after getting to -- this stage of the Laurent process! -- This would likely involve adding a comap_domain analogue of -- add_monoid_algebra.map_domain_alg_hom and an R-linear version of -- polynomial.to_finsupp_iso. -- Add degree, int_degree, int_trailing_degree, leading_coeff, trailing_coeff,....

@[reducible]
def laurent_polynomial (R : Type u_1) [semiring R] :
Type u_1

The semiring of Laurent polynomials with coefficients in the semiring R. We denote it by R[T;T⁻¹]. The ring homomorphism C : R →+* R[T;T⁻¹] includes R as the constant polynomials.

noncomputable def polynomial.to_laurent {R : Type u_1} [semiring R] :

The ring homomorphism, taking a polynomial with coefficients in R to a Laurent polynomial with coefficients in R.

Equations
theorem polynomial.to_laurent_apply {R : Type u_1} [semiring R] (p : polynomial R) :

This is not a simp lemma, as it is usually preferable to use the lemmas about C and X instead.

noncomputable def polynomial.to_laurent_alg {R : Type u_1}  :

The R-algebra map, taking a polynomial with coefficients in R to a Laurent polynomial with coefficients in R.

Equations
@[simp]
theorem polynomial.to_laurent_alg_apply {R : Type u_1} (f : polynomial R) :

### The functions C and T. #

noncomputable def laurent_polynomial.C {R : Type u_1} [semiring R] :

The ring homomorphism C, including R into the ring of Laurent polynomials over R as the constant Laurent polynomials.

Equations
theorem laurent_polynomial.algebra_map_apply {R : Type u_1} {A : Type u_2} [semiring A] [ A] (r : R) :
theorem laurent_polynomial.C_eq_algebra_map {R : Type u_1} (r : R) :
= r

When we have [comm_semiring R], the function C is the same as algebra_map R R[T;T⁻¹]. (But note that C is defined when R is not necessarily commutative, in which case algebra_map is not available.)

theorem laurent_polynomial.single_eq_C {R : Type u_1} [semiring R] (r : R) :
noncomputable def laurent_polynomial.T {R : Type u_1} [semiring R] (n : ) :

The function n ↦ T ^ n, implemented as a sequence ℤ → R[T;T⁻¹].

Using directly T ^ n does not work, since we want the exponents to be of Type ℤ and there is no ℤ-power defined on R[T;T⁻¹]. Using that T is a unit introduces extra coercions. For these reasons, the definition of T is as a sequence.

Equations
Instances for laurent_polynomial.T
@[simp]
theorem laurent_polynomial.T_zero {R : Type u_1} [semiring R] :
theorem laurent_polynomial.T_add {R : Type u_1} [semiring R] (m n : ) :
theorem laurent_polynomial.T_sub {R : Type u_1} [semiring R] (m n : ) :
@[simp]
theorem laurent_polynomial.T_pow {R : Type u_1} [semiring R] (m : ) (n : ) :
@[simp]
theorem laurent_polynomial.mul_T_assoc {R : Type u_1} [semiring R] (f : laurent_polynomial R) (m n : ) :

The simp version of mul_assoc, in the presence of T's.

@[simp]
theorem laurent_polynomial.single_eq_C_mul_T {R : Type u_1} [semiring R] (r : R) (n : ) :
@[simp]
theorem polynomial.to_laurent_C_mul_T {R : Type u_1} [semiring R] (n : ) (r : R) :
@[simp]
theorem polynomial.to_laurent_C {R : Type u_1} [semiring R] (r : R) :
@[simp]
theorem polynomial.to_laurent_X {R : Type u_1} [semiring R] :
@[simp]
theorem polynomial.to_laurent_one {R : Type u_1} [semiring R] :
@[simp]
theorem polynomial.to_laurent_C_mul_eq {R : Type u_1} [semiring R] (r : R) (f : polynomial R) :
@[simp]
theorem polynomial.to_laurent_X_pow {R : Type u_1} [semiring R] (n : ) :
@[simp]
theorem polynomial.to_laurent_C_mul_X_pow {R : Type u_1} [semiring R] (n : ) (r : R) :
@[protected, instance]
noncomputable def laurent_polynomial.invertible_T {R : Type u_1} [semiring R] (n : ) :
Equations
@[simp]
theorem laurent_polynomial.inv_of_T {R : Type u_1} [semiring R] (n : ) :
theorem laurent_polynomial.is_unit_T {R : Type u_1} [semiring R] (n : ) :
@[protected]
theorem laurent_polynomial.induction_on {R : Type u_1} [semiring R] {M : Prop} (p : laurent_polynomial R) (h_C : (a : R), ) (h_add : {p q : , M p M q M (p + q)) (h_C_mul_T : (n : ) (a : R), M * laurent_polynomial.T (n + 1))) (h_C_mul_T_Z : (n : ) (a : R), M M ) :
M p
@[protected]
theorem laurent_polynomial.induction_on' {R : Type u_1} [semiring R] {M : Prop} (p : laurent_polynomial R) (h_add : (p q : , M p M q M (p + q)) (h_C_mul_T : (n : ) (a : R), ) :
M p

To prove something about Laurent polynomials, it suffices to show that

• the condition is closed under taking sums, and
• it holds for monomials.
theorem laurent_polynomial.commute_T {R : Type u_1} [semiring R] (n : ) (f : laurent_polynomial R) :
@[simp]
theorem laurent_polynomial.T_mul {R : Type u_1} [semiring R] (n : ) (f : laurent_polynomial R) :
noncomputable def laurent_polynomial.trunc {R : Type u_1} [semiring R] :

trunc : R[T;T⁻¹] →+ R[X] maps a Laurent polynomial f to the polynomial whose terms of nonnegative degree coincide with the ones of f. The terms of negative degree of f "vanish". trunc is a left-inverse to polynomial.to_laurent.

Equations
@[simp]
theorem laurent_polynomial.trunc_C_mul_T {R : Type u_1} [semiring R] (n : ) (r : R) :
= ite (0 n) r) 0
@[simp]
@[simp]
theorem polynomial.trunc_to_laurent {R : Type u_1} [semiring R] (f : polynomial R) :
@[simp]
theorem polynomial.to_laurent_inj {R : Type u_1} [semiring R] (f g : polynomial R) :
theorem polynomial.to_laurent_ne_zero {R : Type u_1} [semiring R] {f : polynomial R} :
f 0
theorem laurent_polynomial.exists_T_pow {R : Type u_1} [semiring R] (f : laurent_polynomial R) :
(n : ) (f' : ,
theorem laurent_polynomial.induction_on_mul_T {R : Type u_1} [semiring R] {Q : Prop} (f : laurent_polynomial R) (Qf : {f : {n : }, ) :
Q f

This is a version of exists_T_pow stated as an induction principle.

theorem laurent_polynomial.reduce_to_polynomial_of_mul_T {R : Type u_1} [semiring R] (f : laurent_polynomial R) {Q : Prop} (Qf : (f : , ) (QT : (f : , Q Q f) :
Q f

Suppose that Q is a statement about Laurent polynomials such that

• Q is true on ordinary polynomials;
• Q (f * T) implies Q f; it follow that Q is true on all Laurent polynomials.
theorem laurent_polynomial.support_C_mul_T {R : Type u_1} [semiring R] (a : R) (n : ) :
theorem laurent_polynomial.support_C_mul_T_of_ne_zero {R : Type u_1} [semiring R] {a : R} (a0 : a 0) (n : ) :

The support of a polynomial f is a finset in ℕ. The lemma to_laurent_support f shows that the support of f.to_laurent is the same finset, but viewed in ℤ under the natural inclusion ℕ ↪ ℤ.

The degree of a Laurent polynomial takes values in with_bot ℤ. If f : R[T;T⁻¹] is a Laurent polynomial, then f.degree is the maximum of its support of f, or ⊥, if f = 0.

Equations
@[simp]
@[simp]
@[simp]
theorem laurent_polynomial.degree_C_mul_T {R : Type u_1} [semiring R] (n : ) (a : R) (a0 : a 0) :
theorem laurent_polynomial.degree_C_mul_T_ite {R : Type u_1} [semiring R] (n : ) (a : R) :
= ite (a = 0) n
@[simp]
theorem laurent_polynomial.degree_T {R : Type u_1} [semiring R] [nontrivial R] (n : ) :
theorem laurent_polynomial.degree_C {R : Type u_1} [semiring R] {a : R} (a0 : a 0) :
theorem laurent_polynomial.degree_C_ite {R : Type u_1} [semiring R] (a : R) :
= ite (a = 0) 0
theorem laurent_polynomial.degree_C_mul_T_le {R : Type u_1} [semiring R] (n : ) (a : R) :
theorem laurent_polynomial.degree_T_le {R : Type u_1} [semiring R] (n : ) :
theorem laurent_polynomial.degree_C_le {R : Type u_1} [semiring R] (a : R) :
@[protected, instance]
noncomputable def laurent_polynomial.module {R : Type u_1} [semiring R] :
Equations
@[protected, instance]
@[protected, instance]
noncomputable def laurent_polynomial.algebra_polynomial (R : Type u_1)  :
Equations
@[simp]