Documentation

Mathlib.Algebra.Polynomial.RingDivision

Theory of univariate polynomials #

This file starts looking like the ring theory of $R[X]$

Main definitions #

Main statements #

theorem Polynomial.natDegree_pos_of_aeval_root {R : Type u} {S : Type v} [CommRing R] [Semiring S] [Algebra R S] {p : Polynomial R} (hp : p 0) {z : S} (hz : (Polynomial.aeval z) p = 0) (inj : ∀ (x : R), (algebraMap R S) x = 0x = 0) :
0 < p.natDegree
theorem Polynomial.degree_pos_of_aeval_root {R : Type u} {S : Type v} [CommRing R] [Semiring S] [Algebra R S] {p : Polynomial R} (hp : p 0) {z : S} (hz : (Polynomial.aeval z) p = 0) (inj : ∀ (x : R), (algebraMap R S) x = 0x = 0) :
0 < p.degree
theorem Polynomial.modByMonic_eq_of_dvd_sub {R : Type u} [CommRing R] {q : Polynomial R} (hq : q.Monic) {p₁ : Polynomial R} {p₂ : Polynomial R} (h : q p₁ - p₂) :
p₁.modByMonic q = p₂.modByMonic q
theorem Polynomial.add_modByMonic {R : Type u} [CommRing R] {q : Polynomial R} (p₁ : Polynomial R) (p₂ : Polynomial R) :
(p₁ + p₂).modByMonic q = p₁.modByMonic q + p₂.modByMonic q
theorem Polynomial.smul_modByMonic {R : Type u} [CommRing R] {q : Polynomial R} (c : R) (p : Polynomial R) :
(c p).modByMonic q = c p.modByMonic q
@[simp]
theorem Polynomial.modByMonicHom_apply {R : Type u} [CommRing R] (q : Polynomial R) (p : Polynomial R) :
q.modByMonicHom p = p.modByMonic q

_ %ₘ q as an R-linear map.

Equations
  • q.modByMonicHom = { toFun := fun (p : Polynomial R) => p.modByMonic q, map_add' := , map_smul' := }
Instances For
    theorem Polynomial.neg_modByMonic {R : Type u} [CommRing R] (p : Polynomial R) (mod : Polynomial R) :
    (-p).modByMonic mod = -p.modByMonic mod
    theorem Polynomial.sub_modByMonic {R : Type u} [CommRing R] (a : Polynomial R) (b : Polynomial R) (mod : Polynomial R) :
    (a - b).modByMonic mod = a.modByMonic mod - b.modByMonic mod
    theorem Polynomial.aeval_modByMonic_eq_self_of_root {R : Type u} {S : Type v} [CommRing R] [Ring S] [Algebra R S] {p : Polynomial R} {q : Polynomial R} (hq : q.Monic) {x : S} (hx : (Polynomial.aeval x) q = 0) :
    (Polynomial.aeval x) (p.modByMonic q) = (Polynomial.aeval x) p
    theorem Polynomial.natDegree_mul {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (hp : p 0) (hq : q 0) :
    (p * q).natDegree = p.natDegree + q.natDegree
    theorem Polynomial.trailingDegree_mul {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} :
    (p * q).trailingDegree = p.trailingDegree + q.trailingDegree
    @[simp]
    theorem Polynomial.natDegree_pow {R : Type u} [Semiring R] [NoZeroDivisors R] (p : Polynomial R) (n : ) :
    (p ^ n).natDegree = n * p.natDegree
    theorem Polynomial.degree_le_mul_left {R : Type u} [Semiring R] [NoZeroDivisors R] {q : Polynomial R} (p : Polynomial R) (hq : q 0) :
    p.degree (p * q).degree
    theorem Polynomial.natDegree_le_of_dvd {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h1 : p q) (h2 : q 0) :
    p.natDegree q.natDegree
    theorem Polynomial.degree_le_of_dvd {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h1 : p q) (h2 : q 0) :
    p.degree q.degree
    theorem Polynomial.eq_zero_of_dvd_of_degree_lt {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h₁ : p q) (h₂ : q.degree < p.degree) :
    q = 0
    theorem Polynomial.eq_zero_of_dvd_of_natDegree_lt {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h₁ : p q) (h₂ : q.natDegree < p.natDegree) :
    q = 0
    theorem Polynomial.not_dvd_of_degree_lt {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h0 : q 0) (hl : q.degree < p.degree) :
    ¬p q
    theorem Polynomial.not_dvd_of_natDegree_lt {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h0 : q 0) (hl : q.natDegree < p.natDegree) :
    ¬p q
    theorem Polynomial.natDegree_sub_eq_of_prod_eq {R : Type u} [Semiring R] [NoZeroDivisors R] {p₁ : Polynomial R} {p₂ : Polynomial R} {q₁ : Polynomial R} {q₂ : Polynomial R} (hp₁ : p₁ 0) (hq₁ : q₁ 0) (hp₂ : p₂ 0) (hq₂ : q₂ 0) (h_eq : p₁ * q₂ = p₂ * q₁) :
    p₁.natDegree - q₁.natDegree = p₂.natDegree - q₂.natDegree

    This lemma is useful for working with the intDegree of a rational function.

    theorem Polynomial.natDegree_eq_zero_of_isUnit {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} (h : IsUnit p) :
    p.natDegree = 0
    theorem Polynomial.degree_eq_zero_of_isUnit {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} [Nontrivial R] (h : IsUnit p) :
    p.degree = 0
    @[simp]
    theorem Polynomial.degree_coe_units {R : Type u} [Semiring R] [NoZeroDivisors R] [Nontrivial R] (u : (Polynomial R)ˣ) :
    (u).degree = 0
    theorem Polynomial.isUnit_iff {R : Type u} [Semiring R] [NoZeroDivisors R] {p : Polynomial R} :
    IsUnit p ∃ (r : R), IsUnit r Polynomial.C r = p

    Characterization of a unit of a polynomial ring over an integral domain R. See Polynomial.isUnit_iff_coeff_isUnit_isNilpotent when R is a commutative ring.

    theorem Polynomial.not_isUnit_of_degree_pos {R : Type u} [Semiring R] [NoZeroDivisors R] (p : Polynomial R) (hpl : 0 < p.degree) :
    theorem Polynomial.not_isUnit_of_natDegree_pos {R : Type u} [Semiring R] [NoZeroDivisors R] (p : Polynomial R) (hpl : 0 < p.natDegree) :
    theorem Polynomial.irreducible_of_monic {R : Type u} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} (hp : p.Monic) (hp1 : p 1) :
    Irreducible p ∀ (f g : Polynomial R), f.Monicg.Monicf * g = pf = 1 g = 1
    theorem Polynomial.Monic.irreducible_iff_natDegree {R : Type u} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} (hp : p.Monic) :
    Irreducible p p 1 ∀ (f g : Polynomial R), f.Monicg.Monicf * g = pf.natDegree = 0 g.natDegree = 0
    theorem Polynomial.Monic.irreducible_iff_natDegree' {R : Type u} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} (hp : p.Monic) :
    Irreducible p p 1 ∀ (f g : Polynomial R), f.Monicg.Monicf * g = pg.natDegreeFinset.Ioc 0 (p.natDegree / 2)
    theorem Polynomial.Monic.irreducible_iff_lt_natDegree_lt {R : Type u} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} (hp : p.Monic) (hp1 : p 1) :
    Irreducible p ∀ (q : Polynomial R), q.Monicq.natDegree Finset.Ioc 0 (p.natDegree / 2)¬q p

    Alternate phrasing of Polynomial.Monic.irreducible_iff_natDegree' where we only have to check one divisor at a time.

    theorem Polynomial.Monic.not_irreducible_iff_exists_add_mul_eq_coeff {R : Type u} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} (hm : p.Monic) (hnd : p.natDegree = 2) :
    ¬Irreducible p ∃ (c₁ : R) (c₂ : R), p.coeff 0 = c₁ * c₂ p.coeff 1 = c₁ + c₂
    theorem Polynomial.root_mul {R : Type u} {a : R} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} :
    (p * q).IsRoot a p.IsRoot a q.IsRoot a
    theorem Polynomial.root_or_root_of_root_mul {R : Type u} {a : R} [CommSemiring R] [NoZeroDivisors R] {p : Polynomial R} {q : Polynomial R} (h : (p * q).IsRoot a) :
    p.IsRoot a q.IsRoot a
    Equations
    • =
    theorem Polynomial.Monic.C_dvd_iff_isUnit {R : Type u} [CommSemiring R] {p : Polynomial R} (hp : p.Monic) {a : R} :
    Polynomial.C a p IsUnit a
    theorem Polynomial.degree_pos_of_not_isUnit_of_dvd_monic {R : Type u} [CommSemiring R] {a : Polynomial R} {p : Polynomial R} (ha : ¬IsUnit a) (hap : a p) (hp : p.Monic) :
    0 < a.degree
    theorem Polynomial.natDegree_pos_of_not_isUnit_of_dvd_monic {R : Type u} [CommSemiring R] {a : Polynomial R} {p : Polynomial R} (ha : ¬IsUnit a) (hap : a p) (hp : p.Monic) :
    0 < a.natDegree
    theorem Polynomial.degree_pos_of_monic_of_not_isUnit {R : Type u} [CommSemiring R] {a : Polynomial R} (hu : ¬IsUnit a) (ha : a.Monic) :
    0 < a.degree
    theorem Polynomial.natDegree_pos_of_monic_of_not_isUnit {R : Type u} [CommSemiring R] {a : Polynomial R} (hu : ¬IsUnit a) (ha : a.Monic) :
    0 < a.natDegree
    theorem Polynomial.le_rootMultiplicity_iff {R : Type u} [CommRing R] {p : Polynomial R} (p0 : p 0) {a : R} {n : } :
    n Polynomial.rootMultiplicity a p (Polynomial.X - Polynomial.C a) ^ n p

    The multiplicity of a as root of a nonzero polynomial p is at least n iff (X - a) ^ n divides p.

    theorem Polynomial.rootMultiplicity_le_iff {R : Type u} [CommRing R] {p : Polynomial R} (p0 : p 0) (a : R) (n : ) :
    Polynomial.rootMultiplicity a p n ¬(Polynomial.X - Polynomial.C a) ^ (n + 1) p
    theorem Polynomial.pow_rootMultiplicity_not_dvd {R : Type u} [CommRing R] {p : Polynomial R} (p0 : p 0) (a : R) :
    ¬(Polynomial.X - Polynomial.C a) ^ (Polynomial.rootMultiplicity a p + 1) p
    theorem Polynomial.X_sub_C_pow_dvd_iff {R : Type u} [CommRing R] {p : Polynomial R} {t : R} {n : } :
    (Polynomial.X - Polynomial.C t) ^ n p Polynomial.X ^ n p.comp (Polynomial.X + Polynomial.C t)
    theorem Polynomial.comp_X_add_C_eq_zero_iff {R : Type u} [CommRing R] {p : Polynomial R} (t : R) :
    p.comp (Polynomial.X + Polynomial.C t) = 0 p = 0
    theorem Polynomial.comp_X_add_C_ne_zero_iff {R : Type u} [CommRing R] {p : Polynomial R} (t : R) :
    p.comp (Polynomial.X + Polynomial.C t) 0 p 0
    theorem Polynomial.rootMultiplicity_eq_rootMultiplicity {R : Type u} [CommRing R] {p : Polynomial R} {t : R} :
    Polynomial.rootMultiplicity t p = Polynomial.rootMultiplicity 0 (p.comp (Polynomial.X + Polynomial.C t))
    theorem Polynomial.rootMultiplicity_eq_natTrailingDegree {R : Type u} [CommRing R] {p : Polynomial R} {t : R} :
    Polynomial.rootMultiplicity t p = (p.comp (Polynomial.X + Polynomial.C t)).natTrailingDegree
    theorem Polynomial.eval_divByMonic_eq_trailingCoeff_comp {R : Type u} [CommRing R] {p : Polynomial R} {t : R} :
    Polynomial.eval t (p.divByMonic ((Polynomial.X - Polynomial.C t) ^ Polynomial.rootMultiplicity t p)) = (p.comp (Polynomial.X + Polynomial.C t)).trailingCoeff
    theorem Polynomial.rootMultiplicity_mul_X_sub_C_pow {R : Type u} [CommRing R] {p : Polynomial R} {a : R} {n : } (h : p 0) :
    Polynomial.rootMultiplicity a (p * (Polynomial.X - Polynomial.C a) ^ n) = Polynomial.rootMultiplicity a p + n
    theorem Polynomial.rootMultiplicity_X_sub_C_pow {R : Type u} [CommRing R] [Nontrivial R] (a : R) (n : ) :
    Polynomial.rootMultiplicity a ((Polynomial.X - Polynomial.C a) ^ n) = n

    The multiplicity of a as root of (X - a) ^ n is n.

    theorem Polynomial.rootMultiplicity_X_sub_C_self {R : Type u} [CommRing R] [Nontrivial R] {x : R} :
    Polynomial.rootMultiplicity x (Polynomial.X - Polynomial.C x) = 1
    theorem Polynomial.rootMultiplicity_X_sub_C {R : Type u} [CommRing R] [Nontrivial R] [DecidableEq R] {x : R} {y : R} :
    Polynomial.rootMultiplicity x (Polynomial.X - Polynomial.C y) = if x = y then 1 else 0

    The multiplicity of p + q is at least the minimum of the multiplicities.

    theorem Polynomial.rootMultiplicity_mul' {R : Type u} [CommRing R] {p : Polynomial R} {q : Polynomial R} {x : R} (hpq : Polynomial.eval x (p.divByMonic ((Polynomial.X - Polynomial.C x) ^ Polynomial.rootMultiplicity x p)) * Polynomial.eval x (q.divByMonic ((Polynomial.X - Polynomial.C x) ^ Polynomial.rootMultiplicity x q)) 0) :
    theorem Polynomial.prime_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (r : R) :
    Prime (Polynomial.X - Polynomial.C r)
    theorem Polynomial.prime_X {R : Type u} [CommRing R] [IsDomain R] :
    Prime Polynomial.X
    theorem Polynomial.Monic.prime_of_degree_eq_one {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp1 : p.degree = 1) (hm : p.Monic) :
    theorem Polynomial.irreducible_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (r : R) :
    Irreducible (Polynomial.X - Polynomial.C r)
    theorem Polynomial.irreducible_X {R : Type u} [CommRing R] [IsDomain R] :
    Irreducible Polynomial.X
    theorem Polynomial.Monic.irreducible_of_degree_eq_one {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp1 : p.degree = 1) (hm : p.Monic) :
    theorem Polynomial.exists_multiset_roots {R : Type u} [CommRing R] [IsDomain R] [DecidableEq R] {p : Polynomial R} :
    p 0∃ (s : Multiset R), (Multiset.card s) p.degree ∀ (a : R), Multiset.count a s = Polynomial.rootMultiplicity a p
    noncomputable def Polynomial.roots {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) :

    roots p noncomputably gives a multiset containing all the roots of p, including their multiplicities.

    Equations
    Instances For
      theorem Polynomial.roots_def {R : Type u} [CommRing R] [IsDomain R] [DecidableEq R] (p : Polynomial R) [Decidable (p = 0)] :
      p.roots = if h : p = 0 then else Classical.choose
      theorem Polynomial.card_roots {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp0 : p 0) :
      (Multiset.card p.roots) p.degree
      theorem Polynomial.card_roots' {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) :
      Multiset.card p.roots p.natDegree
      theorem Polynomial.card_roots_sub_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {a : R} (hp0 : 0 < p.degree) :
      (Multiset.card (p - Polynomial.C a).roots) p.degree
      theorem Polynomial.card_roots_sub_C' {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {a : R} (hp0 : 0 < p.degree) :
      Multiset.card (p - Polynomial.C a).roots p.natDegree
      @[simp]
      @[simp]
      theorem Polynomial.mem_roots' {R : Type u} {a : R} [CommRing R] [IsDomain R] {p : Polynomial R} :
      a p.roots p 0 p.IsRoot a
      theorem Polynomial.mem_roots {R : Type u} {a : R} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p 0) :
      a p.roots p.IsRoot a
      theorem Polynomial.ne_zero_of_mem_roots {R : Type u} {a : R} [CommRing R] [IsDomain R] {p : Polynomial R} (h : a p.roots) :
      p 0
      theorem Polynomial.isRoot_of_mem_roots {R : Type u} {a : R} [CommRing R] [IsDomain R] {p : Polynomial R} (h : a p.roots) :
      p.IsRoot a
      theorem Polynomial.mem_roots_iff_aeval_eq_zero {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {x : R} (w : p 0) :
      x p.roots (Polynomial.aeval x) p = 0
      theorem Polynomial.card_le_degree_of_subset_roots {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {Z : Finset R} (h : Z.val p.roots) :
      Z.card p.natDegree
      theorem Polynomial.finite_setOf_isRoot {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p 0) :
      {x : R | p.IsRoot x}.Finite
      theorem Polynomial.eq_zero_of_infinite_isRoot {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) (h : {x : R | p.IsRoot x}.Infinite) :
      p = 0
      theorem Polynomial.exists_max_root {R : Type u} [CommRing R] [IsDomain R] [LinearOrder R] (p : Polynomial R) (hp : p 0) :
      ∃ (x₀ : R), ∀ (x : R), p.IsRoot xx x₀
      theorem Polynomial.exists_min_root {R : Type u} [CommRing R] [IsDomain R] [LinearOrder R] (p : Polynomial R) (hp : p 0) :
      ∃ (x₀ : R), ∀ (x : R), p.IsRoot xx₀ x
      theorem Polynomial.eq_of_infinite_eval_eq {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) (q : Polynomial R) (h : {x : R | Polynomial.eval x p = Polynomial.eval x q}.Infinite) :
      p = q
      theorem Polynomial.roots_mul {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (hpq : p * q 0) :
      (p * q).roots = p.roots + q.roots
      theorem Polynomial.roots.le_of_dvd {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (h : q 0) :
      p qp.roots q.roots
      theorem Polynomial.mem_roots_sub_C' {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {a : R} {x : R} :
      x (p - Polynomial.C a).roots p Polynomial.C a Polynomial.eval x p = a
      theorem Polynomial.mem_roots_sub_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {a : R} {x : R} (hp0 : 0 < p.degree) :
      x (p - Polynomial.C a).roots Polynomial.eval x p = a
      @[simp]
      theorem Polynomial.roots_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (r : R) :
      (Polynomial.X - Polynomial.C r).roots = {r}
      @[simp]
      theorem Polynomial.roots_X {R : Type u} [CommRing R] [IsDomain R] :
      Polynomial.X.roots = {0}
      @[simp]
      theorem Polynomial.roots_C {R : Type u} [CommRing R] [IsDomain R] (x : R) :
      (Polynomial.C x).roots = 0
      @[simp]
      theorem Polynomial.roots_C_mul {R : Type u} {a : R} [CommRing R] [IsDomain R] (p : Polynomial R) (ha : a 0) :
      (Polynomial.C a * p).roots = p.roots
      @[simp]
      theorem Polynomial.roots_smul_nonzero {R : Type u} {a : R} [CommRing R] [IsDomain R] (p : Polynomial R) (ha : a 0) :
      (a p).roots = p.roots
      @[simp]
      theorem Polynomial.roots_neg {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) :
      (-p).roots = p.roots
      theorem Polynomial.roots_list_prod {R : Type u} [CommRing R] [IsDomain R] (L : List (Polynomial R)) :
      0LL.prod.roots = (L).bind Polynomial.roots
      theorem Polynomial.roots_multiset_prod {R : Type u} [CommRing R] [IsDomain R] (m : Multiset (Polynomial R)) :
      0mm.prod.roots = m.bind Polynomial.roots
      theorem Polynomial.roots_prod {R : Type u} [CommRing R] [IsDomain R] {ι : Type u_1} (f : ιPolynomial R) (s : Finset ι) :
      s.prod f 0(s.prod f).roots = s.val.bind fun (i : ι) => (f i).roots
      @[simp]
      theorem Polynomial.roots_pow {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) (n : ) :
      (p ^ n).roots = n p.roots
      theorem Polynomial.roots_X_pow {R : Type u} [CommRing R] [IsDomain R] (n : ) :
      (Polynomial.X ^ n).roots = n {0}
      theorem Polynomial.roots_C_mul_X_pow {R : Type u} {a : R} [CommRing R] [IsDomain R] (ha : a 0) (n : ) :
      (Polynomial.C a * Polynomial.X ^ n).roots = n {0}
      @[simp]
      theorem Polynomial.roots_monomial {R : Type u} {a : R} [CommRing R] [IsDomain R] (ha : a 0) (n : ) :
      ((Polynomial.monomial n) a).roots = n {0}
      theorem Polynomial.roots_prod_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (s : Finset R) :
      (s.prod fun (a : R) => Polynomial.X - Polynomial.C a).roots = s.val
      @[simp]
      theorem Polynomial.roots_multiset_prod_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (s : Multiset R) :
      (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) s).prod.roots = s
      @[simp]
      theorem Polynomial.natDegree_multiset_prod_X_sub_C_eq_card {R : Type u} [CommRing R] [IsDomain R] (s : Multiset R) :
      (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) s).prod.natDegree = Multiset.card s
      theorem Polynomial.card_roots_X_pow_sub_C {R : Type u} [CommRing R] [IsDomain R] {n : } (hn : 0 < n) (a : R) :
      Multiset.card (Polynomial.X ^ n - Polynomial.C a).roots n
      def Polynomial.nthRoots {R : Type u} [CommRing R] [IsDomain R] (n : ) (a : R) :

      nthRoots n a noncomputably returns the solutions to x ^ n = a

      Equations
      Instances For
        @[simp]
        theorem Polynomial.mem_nthRoots {R : Type u} [CommRing R] [IsDomain R] {n : } (hn : 0 < n) {a : R} {x : R} :
        @[simp]
        theorem Polynomial.nthRoots_zero {R : Type u} [CommRing R] [IsDomain R] (r : R) :
        theorem Polynomial.card_nthRoots {R : Type u} [CommRing R] [IsDomain R] (n : ) (a : R) :
        Multiset.card (Polynomial.nthRoots n a) n
        def Polynomial.nthRootsFinset (n : ) (R : Type u_1) [CommRing R] [IsDomain R] :

        The multiset nthRoots ↑n (1 : R) as a Finset.

        Equations
        Instances For
          @[simp]
          theorem Polynomial.mem_nthRootsFinset {R : Type u} [CommRing R] [IsDomain R] {n : } (h : 0 < n) {x : R} :
          theorem Polynomial.mul_mem_nthRootsFinset {R : Type u} {n : } [CommRing R] [IsDomain R] {η₁ : R} {η₂ : R} (hη₁ : η₁ Polynomial.nthRootsFinset n R) (hη₂ : η₂ Polynomial.nthRootsFinset n R) :
          theorem Polynomial.ne_zero_of_mem_nthRootsFinset {R : Type u} {n : } [CommRing R] [IsDomain R] {η : R} (hη : η Polynomial.nthRootsFinset n R) :
          η 0
          theorem Polynomial.Monic.comp {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (hp : p.Monic) (hq : q.Monic) (h : q.natDegree 0) :
          (p.comp q).Monic
          theorem Polynomial.Monic.comp_X_add_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p.Monic) (r : R) :
          (p.comp (Polynomial.X + Polynomial.C r)).Monic
          theorem Polynomial.Monic.comp_X_sub_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p.Monic) (r : R) :
          (p.comp (Polynomial.X - Polynomial.C r)).Monic
          theorem Polynomial.units_coeff_zero_smul {R : Type u} [CommRing R] [IsDomain R] (c : (Polynomial R)ˣ) (p : Polynomial R) :
          (c).coeff 0 p = c * p
          @[simp]
          theorem Polynomial.natDegree_coe_units {R : Type u} [CommRing R] [IsDomain R] (u : (Polynomial R)ˣ) :
          (u).natDegree = 0
          theorem Polynomial.comp_eq_zero_iff {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} :
          p.comp q = 0 p = 0 Polynomial.eval (q.coeff 0) p = 0 q = Polynomial.C (q.coeff 0)
          theorem Polynomial.zero_of_eval_zero {R : Type u} [CommRing R] [IsDomain R] [Infinite R] (p : Polynomial R) (h : ∀ (x : R), Polynomial.eval x p = 0) :
          p = 0
          theorem Polynomial.funext {R : Type u} [CommRing R] [IsDomain R] [Infinite R] {p : Polynomial R} {q : Polynomial R} (ext : ∀ (r : R), Polynomial.eval r p = Polynomial.eval r q) :
          p = q
          @[reducible, inline]
          noncomputable abbrev Polynomial.aroots {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :

          Given a polynomial p with coefficients in a ring T and a T-algebra S, aroots p S is the multiset of roots of p regarded as a polynomial over S.

          Equations
          Instances For
            theorem Polynomial.aroots_def {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
            p.aroots S = (Polynomial.map (algebraMap T S) p).roots
            theorem Polynomial.mem_aroots' {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] {p : Polynomial T} {a : S} :
            a p.aroots S Polynomial.map (algebraMap T S) p 0 (Polynomial.aeval a) p = 0
            theorem Polynomial.mem_aroots {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {p : Polynomial T} {a : S} :
            a p.aroots S p 0 (Polynomial.aeval a) p = 0
            theorem Polynomial.aroots_mul {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {p : Polynomial T} {q : Polynomial T} (hpq : p * q 0) :
            (p * q).aroots S = p.aroots S + q.aroots S
            @[simp]
            theorem Polynomial.aroots_X_sub_C {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (r : T) :
            (Polynomial.X - Polynomial.C r).aroots S = {(algebraMap T S) r}
            @[simp]
            theorem Polynomial.aroots_X {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] :
            Polynomial.X.aroots S = {0}
            @[simp]
            theorem Polynomial.aroots_C {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (a : T) :
            (Polynomial.C a).aroots S = 0
            @[simp]
            theorem Polynomial.aroots_zero {T : Type w} [CommRing T] (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
            @[simp]
            theorem Polynomial.aroots_one {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] :
            @[simp]
            theorem Polynomial.aroots_neg {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (p : Polynomial T) :
            (-p).aroots S = p.aroots S
            @[simp]
            theorem Polynomial.aroots_C_mul {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {a : T} (p : Polynomial T) (ha : a 0) :
            (Polynomial.C a * p).aroots S = p.aroots S
            @[simp]
            theorem Polynomial.aroots_smul_nonzero {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {a : T} (p : Polynomial T) (ha : a 0) :
            (a p).aroots S = p.aroots S
            @[simp]
            theorem Polynomial.aroots_pow {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (p : Polynomial T) (n : ) :
            (p ^ n).aroots S = n p.aroots S
            theorem Polynomial.aroots_X_pow {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (n : ) :
            (Polynomial.X ^ n).aroots S = n {0}
            theorem Polynomial.aroots_C_mul_X_pow {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {a : T} (ha : a 0) (n : ) :
            (Polynomial.C a * Polynomial.X ^ n).aroots S = n {0}
            @[simp]
            theorem Polynomial.aroots_monomial {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {a : T} (ha : a 0) (n : ) :
            ((Polynomial.monomial n) a).aroots S = n {0}
            def Polynomial.rootSet {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
            Set S

            The set of distinct roots of p in S.

            If you have a non-separable polynomial, use Polynomial.aroots for the multiset where multiple roots have the appropriate multiplicity.

            Equations
            • p.rootSet S = (p.aroots S).toFinset
            Instances For
              theorem Polynomial.rootSet_def {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] [DecidableEq S] :
              p.rootSet S = (p.aroots S).toFinset
              @[simp]
              theorem Polynomial.rootSet_C {S : Type v} {T : Type w} [CommRing T] [CommRing S] [IsDomain S] [Algebra T S] (a : T) :
              (Polynomial.C a).rootSet S =
              @[simp]
              theorem Polynomial.rootSet_zero {T : Type w} [CommRing T] (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
              @[simp]
              theorem Polynomial.rootSet_one {T : Type w} [CommRing T] (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
              @[simp]
              theorem Polynomial.rootSet_neg {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
              (-p).rootSet S = p.rootSet S
              instance Polynomial.rootSetFintype {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
              Fintype (p.rootSet S)
              Equations
              theorem Polynomial.rootSet_finite {T : Type w} [CommRing T] (p : Polynomial T) (S : Type u_1) [CommRing S] [IsDomain S] [Algebra T S] :
              (p.rootSet S).Finite
              theorem Polynomial.bUnion_roots_finite {R : Type u_1} {S : Type u_2} [Semiring R] [CommRing S] [IsDomain S] [DecidableEq S] (m : R →+* S) (d : ) {U : Set R} (h : U.Finite) :
              (⋃ (f : Polynomial R), ⋃ (_ : f.natDegree d ∀ (i : ), f.coeff i U), (Polynomial.map m f).roots.toFinset).Finite

              The set of roots of all polynomials of bounded degree and having coefficients in a finite set is finite.

              theorem Polynomial.mem_rootSet' {T : Type w} [CommRing T] {p : Polynomial T} {S : Type u_1} [CommRing S] [IsDomain S] [Algebra T S] {a : S} :
              a p.rootSet S Polynomial.map (algebraMap T S) p 0 (Polynomial.aeval a) p = 0
              theorem Polynomial.mem_rootSet {T : Type w} [CommRing T] {p : Polynomial T} {S : Type u_1} [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] {a : S} :
              a p.rootSet S p 0 (Polynomial.aeval a) p = 0
              theorem Polynomial.mem_rootSet_of_ne {T : Type w} [CommRing T] {p : Polynomial T} {S : Type u_1} [CommRing S] [IsDomain S] [Algebra T S] [NoZeroSMulDivisors T S] (hp : p 0) {a : S} :
              a p.rootSet S (Polynomial.aeval a) p = 0
              theorem Polynomial.rootSet_maps_to' {T : Type w} [CommRing T] {p : Polynomial T} {S : Type u_1} {S' : Type u_2} [CommRing S] [IsDomain S] [Algebra T S] [CommRing S'] [IsDomain S'] [Algebra T S'] (hp : Polynomial.map (algebraMap T S') p = 0Polynomial.map (algebraMap T S) p = 0) (f : S →ₐ[T] S') :
              Set.MapsTo (f) (p.rootSet S) (p.rootSet S')
              theorem Polynomial.ne_zero_of_mem_rootSet {S : Type v} {T : Type w} [CommRing T] {p : Polynomial T} [CommRing S] [IsDomain S] [Algebra T S] {a : S} (h : a p.rootSet S) :
              p 0
              theorem Polynomial.aeval_eq_zero_of_mem_rootSet {S : Type v} {T : Type w} [CommRing T] {p : Polynomial T} [CommRing S] [IsDomain S] [Algebra T S] {a : S} (hx : a p.rootSet S) :
              theorem Polynomial.rootSet_mapsTo {T : Type w} [CommRing T] {p : Polynomial T} {S : Type u_1} {S' : Type u_2} [CommRing S] [IsDomain S] [Algebra T S] [CommRing S'] [IsDomain S'] [Algebra T S'] [NoZeroSMulDivisors T S'] (f : S →ₐ[T] S') :
              Set.MapsTo (f) (p.rootSet S) (p.rootSet S')
              theorem Polynomial.coeff_coe_units_zero_ne_zero {R : Type u} [CommRing R] [IsDomain R] (u : (Polynomial R)ˣ) :
              (u).coeff 0 0
              theorem Polynomial.degree_eq_degree_of_associated {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (h : Associated p q) :
              p.degree = q.degree
              theorem Polynomial.degree_eq_one_of_irreducible_of_root {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hi : Irreducible p) {x : R} (hx : p.IsRoot x) :
              p.degree = 1
              theorem Polynomial.leadingCoeff_divByMonic_of_monic {R : Type u} [CommRing R] {p : Polynomial R} {q : Polynomial R} (hmonic : q.Monic) (hdegree : q.degree p.degree) :
              (p.divByMonic q).leadingCoeff = p.leadingCoeff

              Division by a monic polynomial doesn't change the leading coefficient.

              theorem Polynomial.leadingCoeff_divByMonic_X_sub_C {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) (hp : p.degree 0) (a : R) :
              (p.divByMonic (Polynomial.X - Polynomial.C a)).leadingCoeff = p.leadingCoeff
              theorem Polynomial.eq_of_dvd_of_natDegree_le_of_leadingCoeff {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (hpq : p q) (h₁ : q.natDegree p.natDegree) (h₂ : p.leadingCoeff = q.leadingCoeff) :
              p = q
              theorem Polynomial.associated_of_dvd_of_natDegree_le_of_leadingCoeff {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} {q : Polynomial R} (hpq : p q) (h₁ : q.natDegree p.natDegree) (h₂ : q.leadingCoeff p.leadingCoeff) :
              theorem Polynomial.associated_of_dvd_of_natDegree_le {K : Type u_1} [Field K] {p : Polynomial K} {q : Polynomial K} (hpq : p q) (hq : q 0) (h₁ : q.natDegree p.natDegree) :
              theorem Polynomial.associated_of_dvd_of_degree_eq {K : Type u_1} [Field K] {p : Polynomial K} {q : Polynomial K} (hpq : p q) (h₁ : p.degree = q.degree) :
              theorem Polynomial.eq_leadingCoeff_mul_of_monic_of_dvd_of_natDegree_le {R : Type u_1} [CommRing R] {p : Polynomial R} {q : Polynomial R} (hp : p.Monic) (hdiv : p q) (hdeg : q.natDegree p.natDegree) :
              q = Polynomial.C q.leadingCoeff * p
              theorem Polynomial.eq_of_monic_of_dvd_of_natDegree_le {R : Type u_1} [CommRing R] {p : Polynomial R} {q : Polynomial R} (hp : p.Monic) (hq : q.Monic) (hdiv : p q) (hdeg : q.natDegree p.natDegree) :
              q = p
              theorem Polynomial.eq_zero_of_natDegree_lt_card_of_eval_eq_zero {R : Type u_1} [CommRing R] [IsDomain R] (p : Polynomial R) {ι : Type u_2} [Fintype ι] {f : ιR} (hf : Function.Injective f) (heval : ∀ (i : ι), Polynomial.eval (f i) p = 0) (hcard : p.natDegree < Fintype.card ι) :
              p = 0
              theorem Polynomial.eq_zero_of_natDegree_lt_card_of_eval_eq_zero' {R : Type u_1} [CommRing R] [IsDomain R] (p : Polynomial R) (s : Finset R) (heval : is, Polynomial.eval i p = 0) (hcard : p.natDegree < s.card) :
              p = 0
              theorem Polynomial.eq_zero_of_forall_eval_zero_of_natDegree_lt_card {R : Type u} [CommRing R] [IsDomain R] (f : Polynomial R) (hf : ∀ (r : R), Polynomial.eval r f = 0) (hfR : f.natDegree < Cardinal.mk R) :
              f = 0
              theorem Polynomial.exists_eval_ne_zero_of_natDegree_lt_card {R : Type u} [CommRing R] [IsDomain R] (f : Polynomial R) (hf : f 0) (hfR : f.natDegree < Cardinal.mk R) :
              ∃ (r : R), Polynomial.eval r f 0
              theorem Polynomial.isCoprime_X_sub_C_of_isUnit_sub {R : Type u_1} [CommRing R] {a : R} {b : R} (h : IsUnit (a - b)) :
              IsCoprime (Polynomial.X - Polynomial.C a) (Polynomial.X - Polynomial.C b)
              theorem Polynomial.pairwise_coprime_X_sub_C {K : Type u_1} [Field K] {I : Type v} {s : IK} (H : Function.Injective s) :
              Pairwise (IsCoprime on fun (i : I) => Polynomial.X - Polynomial.C (s i))
              theorem Polynomial.monic_prod_multiset_X_sub_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} :
              (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod.Monic
              theorem Polynomial.prod_multiset_root_eq_finset_root {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} [DecidableEq R] :
              (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod = p.roots.toFinset.prod fun (a : R) => (Polynomial.X - Polynomial.C a) ^ Polynomial.rootMultiplicity a p
              theorem Polynomial.prod_multiset_X_sub_C_dvd {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) :
              (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod p

              The product ∏ (X - a) for a inside the multiset p.roots divides p.

              theorem Multiset.prod_X_sub_C_dvd_iff_le_roots {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p 0) (s : Multiset R) :
              (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) s).prod p s p.roots

              A Galois connection.

              theorem Polynomial.exists_prod_multiset_X_sub_C_mul {R : Type u} [CommRing R] [IsDomain R] (p : Polynomial R) :
              ∃ (q : Polynomial R), (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod * q = p Multiset.card p.roots + q.natDegree = p.natDegree q.roots = 0
              theorem Polynomial.C_leadingCoeff_mul_prod_multiset_X_sub_C {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hroots : Multiset.card p.roots = p.natDegree) :
              Polynomial.C p.leadingCoeff * (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod = p

              A polynomial p that has as many roots as its degree can be written p = p.leadingCoeff * ∏(X - a), for a in p.roots.

              theorem Polynomial.prod_multiset_X_sub_C_of_monic_of_roots_card_eq {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (hp : p.Monic) (hroots : Multiset.card p.roots = p.natDegree) :
              (Multiset.map (fun (a : R) => Polynomial.X - Polynomial.C a) p.roots).prod = p

              A monic polynomial p that has as many roots as its degree can be written p = ∏(X - a), for a in p.roots.

              theorem Polynomial.Monic.isUnit_leadingCoeff_of_dvd {R : Type u} [CommRing R] [IsDomain R] {a : Polynomial R} {p : Polynomial R} (hp : p.Monic) (hap : a p) :
              IsUnit a.leadingCoeff
              theorem Polynomial.Monic.irreducible_iff_degree_lt {R : Type u} [CommRing R] [IsDomain R] {p : Polynomial R} (p_monic : p.Monic) (p_1 : p 1) :
              Irreducible p ∀ (q : Polynomial R), q.degree (p.natDegree / 2)q pIsUnit q

              To check a monic polynomial is irreducible, it suffices to check only for divisors that have smaller degree.

              See also: Polynomial.Monic.irreducible_iff_natDegree.

              theorem Polynomial.count_map_roots {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [DecidableEq B] {p : Polynomial A} {f : A →+* B} (hmap : Polynomial.map f p 0) (b : B) :
              theorem Polynomial.map_roots_le {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [IsDomain B] {p : Polynomial A} {f : A →+* B} (h : Polynomial.map f p 0) :
              Multiset.map (f) p.roots (Polynomial.map f p).roots
              theorem Polynomial.map_roots_le_of_injective {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [IsDomain B] (p : Polynomial A) {f : A →+* B} (hf : Function.Injective f) :
              Multiset.map (f) p.roots (Polynomial.map f p).roots
              theorem Polynomial.card_roots_le_map {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [IsDomain B] {p : Polynomial A} {f : A →+* B} (h : Polynomial.map f p 0) :
              Multiset.card p.roots Multiset.card (Polynomial.map f p).roots
              theorem Polynomial.card_roots_le_map_of_injective {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [IsDomain B] {p : Polynomial A} {f : A →+* B} (hf : Function.Injective f) :
              Multiset.card p.roots Multiset.card (Polynomial.map f p).roots
              theorem Polynomial.roots_map_of_injective_of_card_eq_natDegree {A : Type u_1} {B : Type u_2} [CommRing A] [CommRing B] [IsDomain A] [IsDomain B] {p : Polynomial A} {f : A →+* B} (hf : Function.Injective f) (hroots : Multiset.card p.roots = p.natDegree) :
              Multiset.map (f) p.roots = (Polynomial.map f p).roots
              theorem Polynomial.isUnit_of_isUnit_leadingCoeff_of_isUnit_map {R : Type u} {S : Type v} [Semiring R] [CommRing S] [IsDomain S] (φ : R →+* S) {f : Polynomial R} (hf : IsUnit f.leadingCoeff) (H : IsUnit (Polynomial.map φ f)) :
              theorem Polynomial.Monic.irreducible_of_irreducible_map {R : Type u} {S : Type v} [CommRing R] [IsDomain R] [CommRing S] [IsDomain S] (φ : R →+* S) (f : Polynomial R) (h_mon : f.Monic) (h_irr : Irreducible (Polynomial.map φ f)) :

              A polynomial over an integral domain R is irreducible if it is monic and irreducible after mapping into an integral domain S.

              A special case of this lemma is that a polynomial over is irreducible if it is monic and irreducible over ℤ/pℤ for some prime p.