File: Mathlib/Algebra/Polynomial/Basic.lean

full_name: Polynomial.toFinsupp
code: /-- `Polynomial R` is the type of univariate polynomials over `R`.

Polynomials should be seen as (semi-)rings with the additional constructor `X`.
The embedding from `R` is called `C`. -/
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
  toFinsupp : AddMonoidAlgebra R ℕ
goal: R[ℕ]

full_name: Polynomial.ofFinsupp
code: /-- `Polynomial R` is the type of univariate polynomials over `R`.

Polynomials should be seen as (semi-)rings with the additional constructor `X`.
The embedding from `R` is called `C`. -/
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
  toFinsupp : AddMonoidAlgebra R ℕ
goal: R[X]

full_name: Polynomial
code: /-- `Polynomial R` is the type of univariate polynomials over `R`.

Polynomials should be seen as (semi-)rings with the additional constructor `X`.
The embedding from `R` is called `C`. -/
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
  toFinsupp : AddMonoidAlgebra R ℕ
goal: Type u_1

full_name: Polynomial.«_aux_Mathlib_Algebra_Polynomial_Basic___macroRules_Polynomial_term_[X]_1»
code: @[inherit_doc] scoped[Polynomial] notation:9000 R "[X]" => Polynomial R
goal: Lean.Macro

full_name: Polynomial._aux_Mathlib_Algebra_Polynomial_Basic___unexpand_Polynomial_1
code: @[inherit_doc] scoped[Polynomial] notation:9000 R "[X]" => Polynomial R
goal: Lean.PrettyPrinter.Unexpander

full_name: Polynomial.forall_iff_forall_finsupp
code: theorem forall_iff_forall_finsupp (P : R[X] → Prop) :
    (∀ p, P p) ↔ ∀ q : R[ℕ], P ⟨q⟩ 
goal: (∀ (p : R[X]), P p) ↔ ∀ (q : R[ℕ]), P { toFinsupp := q }

full_name: Polynomial.exists_iff_exists_finsupp
code: theorem exists_iff_exists_finsupp (P : R[X] → Prop) :
    (∃ p, P p) ↔ ∃ q : R[ℕ], P ⟨q⟩ 
goal: (∃ p, P p) ↔ ∃ q, P { toFinsupp := q }

full_name: Polynomial.eta
code: @[simp]
theorem eta (f : R[X]) : Polynomial.ofFinsupp f.toFinsupp = f 
goal: { toFinsupp := f.toFinsupp } = f

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.add
code: private irreducible_def add : R[X] → R[X] → R[X]
  
goal: R[X] → R[X] → R[X]

full_name: Polynomial.wrapped._@.Mathlib.Algebra.Polynomial.Basic._hyg.663
code: private irreducible_def add : R[X] → R[X] → R[X]
  
goal: Subtype (Eq @Polynomial.definition✝)

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.add_def
code: private irreducible_def add : R[X] → R[X] → R[X]
  
goal: ∀ (x x_1 : R[X]),
  Polynomial.add x x_1 =
    match x, x_1 with
    | { toFinsupp := a }, { toFinsupp := b } => { toFinsupp := a + b }

full_name: Polynomial.definition._@.Mathlib.Algebra.Polynomial.Basic._hyg.663
code: private irreducible_def add : R[X] → R[X] → R[X]
  
goal: R[X] → R[X] → R[X]

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.neg_def
code: private irreducible_def neg {R : Type u} [Ring R] : R[X] → R[X]
  
goal: ∀ (x : R[X]),
  Polynomial.neg x =
    match x with
    | { toFinsupp := a } => { toFinsupp := -a }

full_name: Polynomial.definition._@.Mathlib.Algebra.Polynomial.Basic._hyg.911
code: private irreducible_def neg {R : Type u} [Ring R] : R[X] → R[X]
  
goal: R[X] → R[X]

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.neg
code: private irreducible_def neg {R : Type u} [Ring R] : R[X] → R[X]
  
goal: R[X] → R[X]

full_name: Polynomial.wrapped._@.Mathlib.Algebra.Polynomial.Basic._hyg.911
code: private irreducible_def neg {R : Type u} [Ring R] : R[X] → R[X]
  
goal: Subtype (Eq @Polynomial.definition✝)

full_name: Polynomial.definition._@.Mathlib.Algebra.Polynomial.Basic._hyg.1138
code: private irreducible_def mul : R[X] → R[X] → R[X]
  
goal: R[X] → R[X] → R[X]

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.mul
code: private irreducible_def mul : R[X] → R[X] → R[X]
  
goal: R[X] → R[X] → R[X]

full_name: Polynomial.wrapped._@.Mathlib.Algebra.Polynomial.Basic._hyg.1138
code: private irreducible_def mul : R[X] → R[X] → R[X]
  
goal: Subtype (Eq @Polynomial.definition✝)

full_name: _private.Mathlib.Algebra.Polynomial.Basic.0.Polynomial.mul_def
code: private irreducible_def mul : R[X] → R[X] → R[X]
  
goal: ∀ (x x_1 : R[X]),
  Polynomial.mul x x_1 =
    match x, x_1 with
    | { toFinsupp := a }, { toFinsupp := b } => { toFinsupp := a * b }

full_name: Polynomial.zero
code: instance zero : Zero R[X] 
goal: Zero R[X]

full_name: Polynomial.one
code: instance one : One R[X] 
goal: One R[X]

full_name: Polynomial.add'
code: instance add' : Add R[X] 
goal: Add R[X]

full_name: Polynomial.neg'
code: instance neg' {R : Type u} [Ring R] : Neg R[X] 
goal: Neg R[X]

full_name: Polynomial.sub
code: instance sub {R : Type u} [Ring R] : Sub R[X] 
goal: Sub R[X]

full_name: Polynomial.mul'
code: instance mul' : Mul R[X] 
goal: Mul R[X]

full_name: Polynomial.add_eq_add
code: @[simp] theorem add_eq_add : add p q = p + q 
goal: Polynomial.add p q = p + q

full_name: Polynomial.mul_eq_mul
code: @[simp] theorem mul_eq_mul : mul p q = p * q 
goal: Polynomial.mul p q = p * q

full_name: Polynomial.smulZeroClass
code: instance smulZeroClass {S : Type*} [SMulZeroClass S R] : SMulZeroClass S R[X] 
goal: SMulZeroClass S R[X]

full_name: Polynomial.pow
code: instance (priority := 1) pow : Pow R[X] ℕ 
goal: Pow R[X] ℕ

full_name: Polynomial.ofFinsupp_zero
code: @[simp]
theorem ofFinsupp_zero : (⟨0⟩ : R[X]) = 0 
goal: { toFinsupp := 0 } = 0

full_name: Polynomial.ofFinsupp_one
code: @[simp]
theorem ofFinsupp_one : (⟨1⟩ : R[X]) = 1 
goal: { toFinsupp := 1 } = 1

full_name: Polynomial.ofFinsupp_add
code: @[simp]
theorem ofFinsupp_add {a b} : (⟨a + b⟩ : R[X]) = ⟨a⟩ + ⟨b⟩ 
goal: { toFinsupp := a + b } = { toFinsupp := a } + { toFinsupp := b }

full_name: Polynomial.ofFinsupp_neg
code: @[simp]
theorem ofFinsupp_neg {R : Type u} [Ring R] {a} : (⟨-a⟩ : R[X]) = -⟨a⟩ 
goal: { toFinsupp := -a } = -{ toFinsupp := a }

full_name: Polynomial.ofFinsupp_sub
code: @[simp]
theorem ofFinsupp_sub {R : Type u} [Ring R] {a b} : (⟨a - b⟩ : R[X]) = ⟨a⟩ - ⟨b⟩ 
goal: { toFinsupp := a - b } = { toFinsupp := a } - { toFinsupp := b }

full_name: Polynomial.ofFinsupp_mul
code: @[simp]
theorem ofFinsupp_mul (a b) : (⟨a * b⟩ : R[X]) = ⟨a⟩ * ⟨b⟩ 
goal: { toFinsupp := a * b } = { toFinsupp := a } * { toFinsupp := b }

full_name: Polynomial.ofFinsupp_smul
code: @[simp]
theorem ofFinsupp_smul {S : Type*} [SMulZeroClass S R] (a : S) (b) :
    (⟨a • b⟩ : R[X]) = (a • ⟨b⟩ : R[X]) 
goal: { toFinsupp := a • b } = a • { toFinsupp := b }

full_name: Polynomial.ofFinsupp_pow
code: @[simp]
theorem ofFinsupp_pow (a) (n : ℕ) : (⟨a ^ n⟩ : R[X]) = ⟨a⟩ ^ n 
goal: { toFinsupp := a ^ n } = { toFinsupp := a } ^ n

full_name: Polynomial.toFinsupp_zero
code: @[simp]
theorem toFinsupp_zero : (0 : R[X]).toFinsupp = 0 
goal: Polynomial.toFinsupp 0 = 0

full_name: Polynomial.toFinsupp_one
code: @[simp]
theorem toFinsupp_one : (1 : R[X]).toFinsupp = 1 
goal: Polynomial.toFinsupp 1 = 1

full_name: Polynomial.toFinsupp_add
code: @[simp]
theorem toFinsupp_add (a b : R[X]) : (a + b).toFinsupp = a.toFinsupp + b.toFinsupp 
goal: (a + b).toFinsupp = a.toFinsupp + b.toFinsupp

full_name: Polynomial.toFinsupp_neg
code: @[simp]
theorem toFinsupp_neg {R : Type u} [Ring R] (a : R[X]) : (-a).toFinsupp = -a.toFinsupp 
goal: (-a).toFinsupp = -a.toFinsupp

full_name: Polynomial.toFinsupp_sub
code: @[simp]
theorem toFinsupp_sub {R : Type u} [Ring R] (a b : R[X]) :
    (a - b).toFinsupp = a.toFinsupp - b.toFinsupp 
goal: (a - b).toFinsupp = a.toFinsupp - b.toFinsupp

full_name: Polynomial.toFinsupp_mul
code: @[simp]
theorem toFinsupp_mul (a b : R[X]) : (a * b).toFinsupp = a.toFinsupp * b.toFinsupp 
goal: (a * b).toFinsupp = a.toFinsupp * b.toFinsupp

full_name: Polynomial.toFinsupp_smul
code: @[simp]
theorem toFinsupp_smul {S : Type*} [SMulZeroClass S R] (a : S) (b : R[X]) :
    (a • b).toFinsupp = a • b.toFinsupp 
goal: (a • b).toFinsupp = a • b.toFinsupp

full_name: Polynomial.toFinsupp_pow
code: @[simp]
theorem toFinsupp_pow (a : R[X]) (n : ℕ) : (a ^ n).toFinsupp = a.toFinsupp ^ n 
goal: (a ^ n).toFinsupp = a.toFinsupp ^ n

full_name: IsSMulRegular.polynomial
code: theorem _root_.IsSMulRegular.polynomial {S : Type*} [Monoid S] [DistribMulAction S R] {a : S}
    (ha : IsSMulRegular R a) : IsSMulRegular R[X] a
  
goal: IsSMulRegular R[X] a

full_name: Polynomial.toFinsupp_injective
code: theorem toFinsupp_injective : Function.Injective (toFinsupp : R[X] → AddMonoidAlgebra _ _) 
goal: Function.Injective Polynomial.toFinsupp

full_name: Polynomial.toFinsupp_inj
code: @[simp]
theorem toFinsupp_inj {a b : R[X]} : a.toFinsupp = b.toFinsupp ↔ a = b 
goal: a.toFinsupp = b.toFinsupp ↔ a = b

full_name: Polynomial.toFinsupp_eq_zero
code: @[simp]
theorem toFinsupp_eq_zero {a : R[X]} : a.toFinsupp = 0 ↔ a = 0 
goal: a.toFinsupp = 0 ↔ a = 0

full_name: Polynomial.toFinsupp_eq_one
code: @[simp]
theorem toFinsupp_eq_one {a : R[X]} : a.toFinsupp = 1 ↔ a = 1 
goal: a.toFinsupp = 1 ↔ a = 1

full_name: Polynomial.ofFinsupp_inj
code: /-- A more convenient spelling of `Polynomial.ofFinsupp.injEq` in terms of `Iff`. -/
theorem ofFinsupp_inj {a b} : (⟨a⟩ : R[X]) = ⟨b⟩ ↔ a = b 
goal: { toFinsupp := a } = { toFinsupp := b } ↔ a = b

full_name: Polynomial.ofFinsupp_eq_zero
code: @[simp]
theorem ofFinsupp_eq_zero {a} : (⟨a⟩ : R[X]) = 0 ↔ a = 0 
goal: { toFinsupp := a } = 0 ↔ a = 0

full_name: Polynomial.ofFinsupp_eq_one
code: @[simp]
theorem ofFinsupp_eq_one {a} : (⟨a⟩ : R[X]) = 1 ↔ a = 1 
goal: { toFinsupp := a } = 1 ↔ a = 1

full_name: Polynomial.inhabited
code: instance inhabited : Inhabited R[X] 
goal: Inhabited R[X]

full_name: Polynomial.instNatCast
code: instance instNatCast : NatCast R[X] 
goal: NatCast R[X]

full_name: Polynomial.semiring
code: instance semiring : Semiring R[X] 
goal: Semiring R[X]

full_name: Polynomial.distribSMul
code: instance distribSMul {S} [DistribSMul S R] : DistribSMul S R[X] 
goal: DistribSMul S R[X]

full_name: Polynomial.distribMulAction
code: instance distribMulAction {S} [Monoid S] [DistribMulAction S R] : DistribMulAction S R[X] 
goal: DistribMulAction S R[X]

full_name: Polynomial.faithfulSMul
code: instance faithfulSMul {S} [SMulZeroClass S R] [FaithfulSMul S R] : FaithfulSMul S R[X] 
goal: FaithfulSMul S R[X]

full_name: Polynomial.module
code: instance module {S} [Semiring S] [Module S R] : Module S R[X] 
goal: Module S R[X]

full_name: Polynomial.smulCommClass
code: instance smulCommClass {S₁ S₂} [SMulZeroClass S₁ R] [SMulZeroClass S₂ R] [SMulCommClass S₁ S₂ R] :
  SMulCommClass S₁ S₂ R[X] 
goal: SMulCommClass S₁ S₂ R[X]

full_name: Polynomial.isScalarTower
code: instance isScalarTower {S₁ S₂} [SMul S₁ S₂] [SMulZeroClass S₁ R] [SMulZeroClass S₂ R]
  [IsScalarTower S₁ S₂ R] : IsScalarTower S₁ S₂ R[X] 
goal: IsScalarTower S₁ S₂ R[X]

full_name: Polynomial.isScalarTower_right
code: instance isScalarTower_right {α K : Type*} [Semiring K] [DistribSMul α K] [IsScalarTower α K K] :
    IsScalarTower α K[X] K[X] 
goal: IsScalarTower α K[X] K[X]

full_name: Polynomial.isCentralScalar
code: instance isCentralScalar {S} [SMulZeroClass S R] [SMulZeroClass Sᵐᵒᵖ R] [IsCentralScalar S R] :
  IsCentralScalar S R[X] 
goal: IsCentralScalar S R[X]

full_name: Polynomial.unique
code: instance unique [Subsingleton R] : Unique R[X] 
goal: Unique R[X]

full_name: Polynomial.toFinsuppIso_symm_apply
code: /-- Ring isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps apply symm_apply]
def toFinsuppIso : R[X] ≃+* R[ℕ] 
goal: (Polynomial.toFinsuppIso R).symm toFinsupp = { toFinsupp := toFinsupp }

full_name: Polynomial.toFinsuppIso_apply
code: /-- Ring isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps apply symm_apply]
def toFinsuppIso : R[X] ≃+* R[ℕ] 
goal: (Polynomial.toFinsuppIso R) self = self.toFinsupp

full_name: Polynomial.toFinsuppIso
code: /-- Ring isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps apply symm_apply]
def toFinsuppIso : R[X] ≃+* R[ℕ] 
goal: R[X] ≃+* R[ℕ]

full_name: Polynomial.instDecidableEq
code: instance [DecidableEq R] : DecidableEq R[X] 
goal: DecidableEq R[X]

full_name: Polynomial.ofFinsupp_sum
code: theorem ofFinsupp_sum {ι : Type*} (s : Finset ι) (f : ι → R[ℕ]) :
    (⟨∑ i ∈ s, f i⟩ : R[X]) = ∑ i ∈ s, ⟨f i⟩ 
goal: { toFinsupp := ∑ i ∈ s, f i } = ∑ i ∈ s, { toFinsupp := f i }

full_name: Polynomial.toFinsupp_sum
code: theorem toFinsupp_sum {ι : Type*} (s : Finset ι) (f : ι → R[X]) :
    (∑ i ∈ s, f i : R[X]).toFinsupp = ∑ i ∈ s, (f i).toFinsupp 
goal: (∑ i ∈ s, f i).toFinsupp = ∑ i ∈ s, (f i).toFinsupp

full_name: Polynomial.support
code: /-- The set of all `n` such that `X^n` has a non-zero coefficient.
-/
-- @[simp] -- Porting note: The original generated theorem is same to `support_ofFinsupp` and
           --               the new generated theorem is different, so this attribute should be
           --               removed.
def support : R[X] → Finset ℕ
  
goal: R[X] → Finset ℕ

full_name: Polynomial.support_ofFinsupp
code: @[simp]
theorem support_ofFinsupp (p) : support (⟨p⟩ : R[X]) = p.support 
goal: { toFinsupp := p }.support = p.support

full_name: Polynomial.support_toFinsupp
code: theorem support_toFinsupp (p : R[X]) : p.toFinsupp.support = p.support 
goal: p.toFinsupp.support = p.support

full_name: Polynomial.support_zero
code: @[simp]
theorem support_zero : (0 : R[X]).support = ∅ 
goal: Polynomial.support 0 = ∅

full_name: Polynomial.support_eq_empty
code: @[simp]
theorem support_eq_empty : p.support = ∅ ↔ p = 0 
goal: p.support = ∅ ↔ p = 0

full_name: Polynomial.support_nonempty
code: @[simp] lemma support_nonempty : p.support.Nonempty ↔ p ≠ 0 
goal: p.support.Nonempty ↔ p ≠ 0

full_name: Polynomial.card_support_eq_zero
code: theorem card_support_eq_zero : p.support.card = 0 ↔ p = 0 
goal: p.support.card = 0 ↔ p = 0

full_name: Polynomial.monomial
code: /-- `monomial s a` is the monomial `a * X^s` -/
def monomial (n : ℕ) : R →ₗ[R] R[X] 
goal: R →ₗ[R] R[X]

full_name: Polynomial.toFinsupp_monomial
code: @[simp]
theorem toFinsupp_monomial (n : ℕ) (r : R) : (monomial n r).toFinsupp = Finsupp.single n r 
goal: ((Polynomial.monomial n) r).toFinsupp = Finsupp.single n r

full_name: Polynomial.ofFinsupp_single
code: @[simp]
theorem ofFinsupp_single (n : ℕ) (r : R) : (⟨Finsupp.single n r⟩ : R[X]) = monomial n r 
goal: { toFinsupp := Finsupp.single n r } = (Polynomial.monomial n) r

full_name: Polynomial.monomial_zero_right
code: theorem monomial_zero_right (n : ℕ) : monomial n (0 : R) = 0 
goal: (Polynomial.monomial n) 0 = 0

full_name: Polynomial.monomial_zero_one
code: theorem monomial_zero_one : monomial 0 (1 : R) = 1 
goal: (Polynomial.monomial 0) 1 = 1

full_name: Polynomial.monomial_add
code: theorem monomial_add (n : ℕ) (r s : R) : monomial n (r + s) = monomial n r + monomial n s 
goal: (Polynomial.monomial n) (r + s) = (Polynomial.monomial n) r + (Polynomial.monomial n) s

full_name: Polynomial.monomial_mul_monomial
code: theorem monomial_mul_monomial (n m : ℕ) (r s : R) :
    monomial n r * monomial m s = monomial (n + m) (r * s) 
goal: (Polynomial.monomial n) r * (Polynomial.monomial m) s = (Polynomial.monomial (n + m)) (r * s)

full_name: Polynomial.monomial_pow
code: @[simp]
theorem monomial_pow (n : ℕ) (r : R) (k : ℕ) : monomial n r ^ k = monomial (n * k) (r ^ k) 
goal: (Polynomial.monomial n) r ^ k = (Polynomial.monomial (n * k)) (r ^ k)

full_name: Polynomial.smul_monomial
code: theorem smul_monomial {S} [SMulZeroClass S R] (a : S) (n : ℕ) (b : R) :
    a • monomial n b = monomial n (a • b) 
goal: a • (Polynomial.monomial n) b = (Polynomial.monomial n) (a • b)

full_name: Polynomial.monomial_injective
code: theorem monomial_injective (n : ℕ) : Function.Injective (monomial n : R → R[X]) 
goal: Function.Injective ⇑(Polynomial.monomial n)

full_name: Polynomial.monomial_eq_zero_iff
code: @[simp]
theorem monomial_eq_zero_iff (t : R) (n : ℕ) : monomial n t = 0 ↔ t = 0 
goal: (Polynomial.monomial n) t = 0 ↔ t = 0

full_name: Polynomial.support_add
code: theorem support_add : (p + q).support ⊆ p.support ∪ q.support 
goal: (p + q).support ⊆ p.support ∪ q.support

full_name: Polynomial.C
code: /-- `C a` is the constant polynomial `a`.
`C` is provided as a ring homomorphism.
-/
def C : R →+* R[X] 
goal: R →+* R[X]

full_name: Polynomial.monomial_zero_left
code: @[simp]
theorem monomial_zero_left (a : R) : monomial 0 a = C a 
goal: (Polynomial.monomial 0) a = Polynomial.C a

full_name: Polynomial.toFinsupp_C
code: @[simp]
theorem toFinsupp_C (a : R) : (C a).toFinsupp = single 0 a 
goal: (Polynomial.C a).toFinsupp = AddMonoidAlgebra.single 0 a

full_name: Polynomial.C_0
code: theorem C_0 : C (0 : R) = 0 
goal: Polynomial.C 0 = 0

full_name: Polynomial.C_1
code: theorem C_1 : C (1 : R) = 1 
goal: Polynomial.C 1 = 1

full_name: Polynomial.C_mul
code: theorem C_mul : C (a * b) = C a * C b 
goal: Polynomial.C (a * b) = Polynomial.C a * Polynomial.C b

full_name: Polynomial.C_add
code: theorem C_add : C (a + b) = C a + C b 
goal: Polynomial.C (a + b) = Polynomial.C a + Polynomial.C b

full_name: Polynomial.smul_C
code: @[simp]
theorem smul_C {S} [SMulZeroClass S R] (s : S) (r : R) : s • C r = C (s • r) 
goal: s • Polynomial.C r = Polynomial.C (s • r)

full_name: Polynomial.C_pow
code: theorem C_pow : C (a ^ n) = C a ^ n 
goal: Polynomial.C (a ^ n) = Polynomial.C a ^ n

full_name: Polynomial.C_eq_natCast
code: theorem C_eq_natCast (n : ℕ) : C (n : R) = (n : R[X]) 
goal: Polynomial.C ↑n = ↑n

full_name: Polynomial.C_mul_monomial
code: @[simp]
theorem C_mul_monomial : C a * monomial n b = monomial n (a * b) 
goal: Polynomial.C a * (Polynomial.monomial n) b = (Polynomial.monomial n) (a * b)

full_name: Polynomial.monomial_mul_C
code: @[simp]
theorem monomial_mul_C : monomial n a * C b = monomial n (a * b) 
goal: (Polynomial.monomial n) a * Polynomial.C b = (Polynomial.monomial n) (a * b)

full_name: Polynomial.X
code: /-- `X` is the polynomial variable (aka indeterminate). -/
def X : R[X] 
goal: R[X]

full_name: Polynomial.monomial_one_one_eq_X
code: theorem monomial_one_one_eq_X : monomial 1 (1 : R) = X 
goal: (Polynomial.monomial 1) 1 = Polynomial.X

full_name: Polynomial.monomial_one_right_eq_X_pow
code: theorem monomial_one_right_eq_X_pow (n : ℕ) : monomial n (1 : R) = X ^ n 
goal: (Polynomial.monomial n) 1 = Polynomial.X ^ n

full_name: Polynomial.toFinsupp_X
code: @[simp]
theorem toFinsupp_X : X.toFinsupp = Finsupp.single 1 (1 : R) 
goal: Polynomial.X.toFinsupp = Finsupp.single 1 1

full_name: Polynomial.X_mul
code: /-- `X` commutes with everything, even when the coefficients are noncommutative. -/
theorem X_mul : X * p = p * X 
goal: Polynomial.X * p = p * Polynomial.X

full_name: Polynomial.X_pow_mul
code: theorem X_pow_mul {n : ℕ} : X ^ n * p = p * X ^ n 
goal: Polynomial.X ^ n * p = p * Polynomial.X ^ n

full_name: Polynomial.X_mul_C
code: /-- Prefer putting constants to the left of `X`.

This lemma is the loop-avoiding `simp` version of `Polynomial.X_mul`. -/
@[simp]
theorem X_mul_C (r : R) : X * C r = C r * X 
goal: Polynomial.X * Polynomial.C r = Polynomial.C r * Polynomial.X

full_name: Polynomial.X_pow_mul_C
code: /-- Prefer putting constants to the left of `X ^ n`.

This lemma is the loop-avoiding `simp` version of `X_pow_mul`. -/
@[simp]
theorem X_pow_mul_C (r : R) (n : ℕ) : X ^ n * C r = C r * X ^ n 
goal: Polynomial.X ^ n * Polynomial.C r = Polynomial.C r * Polynomial.X ^ n

full_name: Polynomial.X_pow_mul_assoc
code: theorem X_pow_mul_assoc {n : ℕ} : p * X ^ n * q = p * q * X ^ n 
goal: p * Polynomial.X ^ n * q = p * q * Polynomial.X ^ n

full_name: Polynomial.X_pow_mul_assoc_C
code: /-- Prefer putting constants to the left of `X ^ n`.

This lemma is the loop-avoiding `simp` version of `X_pow_mul_assoc`. -/
@[simp]
theorem X_pow_mul_assoc_C {n : ℕ} (r : R) : p * X ^ n * C r = p * C r * X ^ n 
goal: p * Polynomial.X ^ n * Polynomial.C r = p * Polynomial.C r * Polynomial.X ^ n

full_name: Polynomial.commute_X
code: theorem commute_X (p : R[X]) : Commute X p 
goal: Commute Polynomial.X p

full_name: Polynomial.commute_X_pow
code: theorem commute_X_pow (p : R[X]) (n : ℕ) : Commute (X ^ n) p 
goal: Commute (Polynomial.X ^ n) p

full_name: Polynomial.monomial_mul_X
code: @[simp]
theorem monomial_mul_X (n : ℕ) (r : R) : monomial n r * X = monomial (n + 1) r 
goal: (Polynomial.monomial n) r * Polynomial.X = (Polynomial.monomial (n + 1)) r

full_name: Polynomial.monomial_mul_X_pow
code: @[simp]
theorem monomial_mul_X_pow (n : ℕ) (r : R) (k : ℕ) :
    monomial n r * X ^ k = monomial (n + k) r 
goal: (Polynomial.monomial n) r * Polynomial.X ^ k = (Polynomial.monomial (n + k)) r

full_name: Polynomial.X_mul_monomial
code: @[simp]
theorem X_mul_monomial (n : ℕ) (r : R) : X * monomial n r = monomial (n + 1) r 
goal: Polynomial.X * (Polynomial.monomial n) r = (Polynomial.monomial (n + 1)) r

full_name: Polynomial.X_pow_mul_monomial
code: @[simp]
theorem X_pow_mul_monomial (k n : ℕ) (r : R) : X ^ k * monomial n r = monomial (n + k) r 
goal: Polynomial.X ^ k * (Polynomial.monomial n) r = (Polynomial.monomial (n + k)) r

full_name: Polynomial.coeff
code: /-- `coeff p n` (often denoted `p.coeff n`) is the coefficient of `X^n` in `p`. -/
-- @[simp] -- Porting note: The original generated theorem is same to `coeff_ofFinsupp` and
           --               the new generated theorem is different, so this attribute should be
           --               removed.
def coeff : R[X] → ℕ → R
  
goal: R[X] → ℕ → R

full_name: Polynomial.coeff_ofFinsupp
code: @[simp]
theorem coeff_ofFinsupp (p) : coeff (⟨p⟩ : R[X]) = p 
goal: { toFinsupp := p }.coeff = ⇑p

full_name: Polynomial.coeff_injective
code: theorem coeff_injective : Injective (coeff : R[X] → ℕ → R) 
goal: Function.Injective Polynomial.coeff

full_name: Polynomial.coeff_inj
code: @[simp]
theorem coeff_inj : p.coeff = q.coeff ↔ p = q 
goal: p.coeff = q.coeff ↔ p = q

full_name: Polynomial.toFinsupp_apply
code: theorem toFinsupp_apply (f : R[X]) (i) : f.toFinsupp i = f.coeff i 
goal: f.toFinsupp i = f.coeff i

full_name: Polynomial.coeff_monomial
code: theorem coeff_monomial : coeff (monomial n a) m = if n = m then a else 0 
goal: ((Polynomial.monomial n) a).coeff m = if n = m then a else 0

full_name: Polynomial.coeff_zero
code: @[simp]
theorem coeff_zero (n : ℕ) : coeff (0 : R[X]) n = 0 
goal: Polynomial.coeff 0 n = 0

full_name: Polynomial.coeff_one
code: theorem coeff_one {n : ℕ} : coeff (1 : R[X]) n = if n = 0 then 1 else 0 
goal: Polynomial.coeff 1 n = if n = 0 then 1 else 0

full_name: Polynomial.coeff_one_zero
code: @[simp]
theorem coeff_one_zero : coeff (1 : R[X]) 0 = 1 
goal: Polynomial.coeff 1 0 = 1

full_name: Polynomial.coeff_X_one
code: @[simp]
theorem coeff_X_one : coeff (X : R[X]) 1 = 1 
goal: Polynomial.X.coeff 1 = 1

full_name: Polynomial.coeff_X_zero
code: @[simp]
theorem coeff_X_zero : coeff (X : R[X]) 0 = 0 
goal: Polynomial.X.coeff 0 = 0

full_name: Polynomial.coeff_monomial_succ
code: @[simp]
theorem coeff_monomial_succ : coeff (monomial (n + 1) a) 0 = 0 
goal: ((Polynomial.monomial (n + 1)) a).coeff 0 = 0

full_name: Polynomial.coeff_X
code: theorem coeff_X : coeff (X : R[X]) n = if 1 = n then 1 else 0 
goal: Polynomial.X.coeff n = if 1 = n then 1 else 0

full_name: Polynomial.coeff_X_of_ne_one
code: theorem coeff_X_of_ne_one {n : ℕ} (hn : n ≠ 1) : coeff (X : R[X]) n = 0 
goal: Polynomial.X.coeff n = 0

full_name: Polynomial.mem_support_iff
code: @[simp]
theorem mem_support_iff : n ∈ p.support ↔ p.coeff n ≠ 0 
goal: n ∈ p.support ↔ p.coeff n ≠ 0

full_name: Polynomial.not_mem_support_iff
code: theorem not_mem_support_iff : n ∉ p.support ↔ p.coeff n = 0 
goal: n ∉ p.support ↔ p.coeff n = 0

full_name: Polynomial.coeff_C
code: theorem coeff_C : coeff (C a) n = ite (n = 0) a 0 
goal: (Polynomial.C a).coeff n = if n = 0 then a else 0

full_name: Polynomial.coeff_C_zero
code: @[simp]
theorem coeff_C_zero : coeff (C a) 0 = a 
goal: (Polynomial.C a).coeff 0 = a

full_name: Polynomial.coeff_C_ne_zero
code: theorem coeff_C_ne_zero (h : n ≠ 0) : (C a).coeff n = 0 
goal: (Polynomial.C a).coeff n = 0

full_name: Polynomial.coeff_C_succ
code: @[simp]
lemma coeff_C_succ {r : R} {n : ℕ} : coeff (C r) (n + 1) = 0 
goal: (Polynomial.C r).coeff (n + 1) = 0

full_name: Polynomial.coeff_natCast_ite
code: @[simp]
theorem coeff_natCast_ite : (Nat.cast m : R[X]).coeff n = ite (n = 0) m 0 
goal: (↑m).coeff n = ↑(if n = 0 then m else 0)

full_name: Polynomial.coeff_ofNat_zero
code: @[simp]
theorem coeff_ofNat_zero (a : ℕ) [a.AtLeastTwo] :
    coeff (no_index (OfNat.ofNat a : R[X])) 0 = OfNat.ofNat a 
goal: (OfNat.ofNat a).coeff 0 = OfNat.ofNat a

full_name: Polynomial.coeff_ofNat_succ
code: @[simp]
theorem coeff_ofNat_succ (a n : ℕ) [h : a.AtLeastTwo] :
    coeff (no_index (OfNat.ofNat a : R[X])) (n + 1) = 0 
goal: (OfNat.ofNat a).coeff (n + 1) = 0

full_name: Polynomial.C_mul_X_pow_eq_monomial
code: theorem C_mul_X_pow_eq_monomial : ∀ {n : ℕ}, C a * X ^ n = monomial n a
  
goal: Polynomial.C a * Polynomial.X ^ n = (Polynomial.monomial n) a

full_name: Polynomial.toFinsupp_C_mul_X_pow
code: @[simp high]
theorem toFinsupp_C_mul_X_pow (a : R) (n : ℕ) :
    Polynomial.toFinsupp (C a * X ^ n) = Finsupp.single n a 
goal: (Polynomial.C a * Polynomial.X ^ n).toFinsupp = Finsupp.single n a

full_name: Polynomial.C_mul_X_eq_monomial
code: theorem C_mul_X_eq_monomial : C a * X = monomial 1 a 
goal: Polynomial.C a * Polynomial.X = (Polynomial.monomial 1) a

full_name: Polynomial.toFinsupp_C_mul_X
code: @[simp high]
theorem toFinsupp_C_mul_X (a : R) : Polynomial.toFinsupp (C a * X) = Finsupp.single 1 a 
goal: (Polynomial.C a * Polynomial.X).toFinsupp = Finsupp.single 1 a

full_name: Polynomial.C_injective
code: theorem C_injective : Injective (C : R → R[X]) 
goal: Function.Injective ⇑Polynomial.C

full_name: Polynomial.C_inj
code: @[simp]
theorem C_inj : C a = C b ↔ a = b 
goal: Polynomial.C a = Polynomial.C b ↔ a = b

full_name: Polynomial.C_eq_zero
code: @[simp]
theorem C_eq_zero : C a = 0 ↔ a = 0 
goal: Polynomial.C a = 0 ↔ a = 0

full_name: Polynomial.C_ne_zero
code: theorem C_ne_zero : C a ≠ 0 ↔ a ≠ 0 
goal: Polynomial.C a ≠ 0 ↔ a ≠ 0

full_name: Polynomial.subsingleton_iff_subsingleton
code: theorem subsingleton_iff_subsingleton : Subsingleton R[X] ↔ Subsingleton R 
goal: Subsingleton R[X] ↔ Subsingleton R

full_name: Polynomial.Nontrivial.of_polynomial_ne
code: theorem Nontrivial.of_polynomial_ne (h : p ≠ q) : Nontrivial R 
goal: Nontrivial R

full_name: Polynomial.forall_eq_iff_forall_eq
code: theorem forall_eq_iff_forall_eq : (∀ f g : R[X], f = g) ↔ ∀ a b : R, a = b 
goal: (∀ (f g : R[X]), f = g) ↔ ∀ (a b : R), a = b

full_name: Polynomial.ext_iff
code: theorem ext_iff {p q : R[X]} : p = q ↔ ∀ n, coeff p n = coeff q n 
goal: p = q ↔ ∀ (n : ℕ), p.coeff n = q.coeff n

full_name: Polynomial.ext
code: @[ext]
theorem ext {p q : R[X]} : (∀ n, coeff p n = coeff q n) → p = q 
goal: (∀ (n : ℕ), p.coeff n = q.coeff n) → p = q

full_name: Polynomial.addSubmonoid_closure_setOf_eq_monomial
code: /-- Monomials generate the additive monoid of polynomials. -/
theorem addSubmonoid_closure_setOf_eq_monomial :
    AddSubmonoid.closure { p : R[X] | ∃ n a, p = monomial n a } = ⊤ 
goal: AddSubmonoid.closure {p | ∃ n a, p = (Polynomial.monomial n) a} = ⊤

full_name: Polynomial.addHom_ext
code: theorem addHom_ext {M : Type*} [AddMonoid M] {f g : R[X] →+ M}
    (h : ∀ n a, f (monomial n a) = g (monomial n a)) : f = g 
goal: f = g

full_name: Polynomial.addHom_ext'
code: @[ext high]
theorem addHom_ext' {M : Type*} [AddMonoid M] {f g : R[X] →+ M}
    (h : ∀ n, f.comp (monomial n).toAddMonoidHom = g.comp (monomial n).toAddMonoidHom) : f = g 
goal: f = g

full_name: Polynomial.lhom_ext'
code: @[ext high]
theorem lhom_ext' {M : Type*} [AddCommMonoid M] [Module R M] {f g : R[X] →ₗ[R] M}
    (h : ∀ n, f.comp (monomial n) = g.comp (monomial n)) : f = g 
goal: f = g

full_name: Polynomial.eq_zero_of_eq_zero
code: theorem eq_zero_of_eq_zero (h : (0 : R) = (1 : R)) (p : R[X]) : p = 0 
goal: p = 0

full_name: Polynomial.support_monomial
code: theorem support_monomial (n) {a : R} (H : a ≠ 0) : (monomial n a).support = singleton n 
goal: ((Polynomial.monomial n) a).support = {n}

full_name: Polynomial.support_monomial'
code: theorem support_monomial' (n) (a : R) : (monomial n a).support ⊆ singleton n 
goal: ((Polynomial.monomial n) a).support ⊆ {n}

full_name: Polynomial.support_C_mul_X
code: theorem support_C_mul_X {c : R} (h : c ≠ 0) : Polynomial.support (C c * X) = singleton 1 
goal: (Polynomial.C c * Polynomial.X).support = {1}

full_name: Polynomial.support_C_mul_X'
code: theorem support_C_mul_X' (c : R) : Polynomial.support (C c * X) ⊆ singleton 1 
goal: (Polynomial.C c * Polynomial.X).support ⊆ {1}

full_name: Polynomial.support_C_mul_X_pow
code: theorem support_C_mul_X_pow (n : ℕ) {c : R} (h : c ≠ 0) :
    Polynomial.support (C c * X ^ n) = singleton n 
goal: (Polynomial.C c * Polynomial.X ^ n).support = {n}

full_name: Polynomial.support_C_mul_X_pow'
code: theorem support_C_mul_X_pow' (n : ℕ) (c : R) : Polynomial.support (C c * X ^ n) ⊆ singleton n 
goal: (Polynomial.C c * Polynomial.X ^ n).support ⊆ {n}

full_name: Polynomial.support_binomial'
code: theorem support_binomial' (k m : ℕ) (x y : R) :
    Polynomial.support (C x * X ^ k + C y * X ^ m) ⊆ {k, m} 
goal: (Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m).support ⊆ {k, m}

full_name: Polynomial.support_trinomial'
code: theorem support_trinomial' (k m n : ℕ) (x y z : R) :
    Polynomial.support (C x * X ^ k + C y * X ^ m + C z * X ^ n) ⊆ {k, m, n} 
goal: (Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m + Polynomial.C z * Polynomial.X ^ n).support ⊆
  {k, m, n}

full_name: Polynomial.X_pow_eq_monomial
code: theorem X_pow_eq_monomial (n) : X ^ n = monomial n (1 : R) 
goal: Polynomial.X ^ n = (Polynomial.monomial n) 1

full_name: Polynomial.toFinsupp_X_pow
code: @[simp high]
theorem toFinsupp_X_pow (n : ℕ) : (X ^ n).toFinsupp = Finsupp.single n (1 : R) 
goal: (Polynomial.X ^ n).toFinsupp = Finsupp.single n 1

full_name: Polynomial.smul_X_eq_monomial
code: theorem smul_X_eq_monomial {n} : a • X ^ n = monomial n (a : R) 
goal: a • Polynomial.X ^ n = (Polynomial.monomial n) a

full_name: Polynomial.support_X_pow
code: theorem support_X_pow (H : ¬(1 : R) = 0) (n : ℕ) : (X ^ n : R[X]).support = singleton n 
goal: (Polynomial.X ^ n).support = {n}

full_name: Polynomial.support_X_empty
code: theorem support_X_empty (H : (1 : R) = 0) : (X : R[X]).support = ∅ 
goal: Polynomial.X.support = ∅

full_name: Polynomial.support_X
code: theorem support_X (H : ¬(1 : R) = 0) : (X : R[X]).support = singleton 1 
goal: Polynomial.X.support = {1}

full_name: Polynomial.monomial_left_inj
code: theorem monomial_left_inj {a : R} (ha : a ≠ 0) {i j : ℕ} :
    monomial i a = monomial j a ↔ i = j 
goal: (Polynomial.monomial i) a = (Polynomial.monomial j) a ↔ i = j

full_name: Polynomial.binomial_eq_binomial
code: theorem binomial_eq_binomial {k l m n : ℕ} {u v : R} (hu : u ≠ 0) (hv : v ≠ 0) :
    C u * X ^ k + C v * X ^ l = C u * X ^ m + C v * X ^ n ↔
      k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n 
goal: Polynomial.C u * Polynomial.X ^ k + Polynomial.C v * Polynomial.X ^ l =
    Polynomial.C u * Polynomial.X ^ m + Polynomial.C v * Polynomial.X ^ n ↔
  k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n

full_name: Polynomial.natCast_mul
code: theorem natCast_mul (n : ℕ) (p : R[X]) : (n : R[X]) * p = n • p 
goal: ↑n * p = n • p

full_name: Polynomial.sum
code: /-- Summing the values of a function applied to the coefficients of a polynomial -/
def sum {S : Type*} [AddCommMonoid S] (p : R[X]) (f : ℕ → R → S) : S 
goal: S

full_name: Polynomial.sum_def
code: theorem sum_def {S : Type*} [AddCommMonoid S] (p : R[X]) (f : ℕ → R → S) :
    p.sum f = ∑ n ∈ p.support, f n (p.coeff n) 
goal: p.sum f = ∑ n ∈ p.support, f n (p.coeff n)

full_name: Polynomial.sum_eq_of_subset
code: theorem sum_eq_of_subset {S : Type*} [AddCommMonoid S] {p : R[X]} (f : ℕ → R → S)
    (hf : ∀ i, f i 0 = 0) {s : Finset ℕ} (hs : p.support ⊆ s) :
    p.sum f = ∑ n ∈ s, f n (p.coeff n) 
goal: p.sum f = ∑ n ∈ s, f n (p.coeff n)

full_name: Polynomial.mul_eq_sum_sum
code: /-- Expressing the product of two polynomials as a double sum. -/
theorem mul_eq_sum_sum :
    p * q = ∑ i ∈ p.support, q.sum fun j a => (monomial (i + j)) (p.coeff i * a) 
goal: p * q = ∑ i ∈ p.support, q.sum fun j a => (Polynomial.monomial (i + j)) (p.coeff i * a)

full_name: Polynomial.sum_zero_index
code: @[simp]
theorem sum_zero_index {S : Type*} [AddCommMonoid S] (f : ℕ → R → S) : (0 : R[X]).sum f = 0 
goal: Polynomial.sum 0 f = 0

full_name: Polynomial.sum_monomial_index
code: @[simp]
theorem sum_monomial_index {S : Type*} [AddCommMonoid S] {n : ℕ} (a : R) (f : ℕ → R → S)
    (hf : f n 0 = 0) : (monomial n a : R[X]).sum f = f n a 
goal: ((Polynomial.monomial n) a).sum f = f n a

full_name: Polynomial.sum_C_index
code: @[simp]
theorem sum_C_index {a} {β} [AddCommMonoid β] {f : ℕ → R → β} (h : f 0 0 = 0) :
    (C a).sum f = f 0 a 
goal: (Polynomial.C a).sum f = f 0 a

full_name: Polynomial.sum_X_index
code: @[simp]
theorem sum_X_index {S : Type*} [AddCommMonoid S] {f : ℕ → R → S} (hf : f 1 0 = 0) :
    (X : R[X]).sum f = f 1 1 
goal: Polynomial.X.sum f = f 1 1

full_name: Polynomial.sum_add_index
code: theorem sum_add_index {S : Type*} [AddCommMonoid S] (p q : R[X]) (f : ℕ → R → S)
    (hf : ∀ i, f i 0 = 0) (h_add : ∀ a b₁ b₂, f a (b₁ + b₂) = f a b₁ + f a b₂) :
    (p + q).sum f = p.sum f + q.sum f 
goal: (p + q).sum f = p.sum f + q.sum f

full_name: Polynomial.sum_add'
code: theorem sum_add' {S : Type*} [AddCommMonoid S] (p : R[X]) (f g : ℕ → R → S) :
    p.sum (f + g) = p.sum f + p.sum g 
goal: p.sum (f + g) = p.sum f + p.sum g

full_name: Polynomial.sum_add
code: theorem sum_add {S : Type*} [AddCommMonoid S] (p : R[X]) (f g : ℕ → R → S) :
    (p.sum fun n x => f n x + g n x) = p.sum f + p.sum g 
goal: (p.sum fun n x => f n x + g n x) = p.sum f + p.sum g

full_name: Polynomial.sum_smul_index
code: theorem sum_smul_index {S : Type*} [AddCommMonoid S] (p : R[X]) (b : R) (f : ℕ → R → S)
    (hf : ∀ i, f i 0 = 0) : (b • p).sum f = p.sum fun n a => f n (b * a) 
goal: (b • p).sum f = p.sum fun n a => f n (b * a)

full_name: Polynomial.sum_smul_index'
code: theorem sum_smul_index' {S T : Type*} [DistribSMul T R] [AddCommMonoid S] (p : R[X]) (b : T)
    (f : ℕ → R → S) (hf : ∀ i, f i 0 = 0) : (b • p).sum f = p.sum fun n a => f n (b • a) 
goal: (b • p).sum f = p.sum fun n a => f n (b • a)

full_name: Polynomial.smul_sum
code: protected theorem smul_sum {S T : Type*} [AddCommMonoid S] [DistribSMul T S] (p : R[X]) (b : T)
    (f : ℕ → R → S) : b • p.sum f = p.sum fun n a => b • f n a 
goal: b • p.sum f = p.sum fun n a => b • f n a

full_name: Polynomial.sum_monomial_eq
code: @[simp]
theorem sum_monomial_eq : ∀ p : R[X], (p.sum fun n a => monomial n a) = p
  
goal: (p.sum fun n a => (Polynomial.monomial n) a) = p

full_name: Polynomial.sum_C_mul_X_pow_eq
code: theorem sum_C_mul_X_pow_eq (p : R[X]) : (p.sum fun n a => C a * X ^ n) = p 
goal: (p.sum fun n a => Polynomial.C a * Polynomial.X ^ n) = p

full_name: Polynomial.definition._@.Mathlib.Algebra.Polynomial.Basic._hyg.12105
code: /-- `erase p n` is the polynomial `p` in which the `X^n` term has been erased. -/
irreducible_def erase (n : ℕ) : R[X] → R[X]
  
goal: R[X] → R[X]

full_name: Polynomial.wrapped._@.Mathlib.Algebra.Polynomial.Basic._hyg.12105
code: /-- `erase p n` is the polynomial `p` in which the `X^n` term has been erased. -/
irreducible_def erase (n : ℕ) : R[X] → R[X]
  
goal: Subtype (Eq @Polynomial.definition✝)

full_name: Polynomial.erase
code: /-- `erase p n` is the polynomial `p` in which the `X^n` term has been erased. -/
irreducible_def erase (n : ℕ) : R[X] → R[X]
  
goal: R[X] → R[X]

full_name: Polynomial.erase_def
code: /-- `erase p n` is the polynomial `p` in which the `X^n` term has been erased. -/
irreducible_def erase (n : ℕ) : R[X] → R[X]
  
goal: ∀ (x : R[X]),
  Polynomial.erase n x =
    match x with
    | { toFinsupp := p } => { toFinsupp := Finsupp.erase n p }

full_name: Polynomial.toFinsupp_erase
code: @[simp]
theorem toFinsupp_erase (p : R[X]) (n : ℕ) : toFinsupp (p.erase n) = p.toFinsupp.erase n 
goal: (Polynomial.erase n p).toFinsupp = Finsupp.erase n p.toFinsupp

full_name: Polynomial.ofFinsupp_erase
code: @[simp]
theorem ofFinsupp_erase (p : R[ℕ]) (n : ℕ) :
    (⟨p.erase n⟩ : R[X]) = (⟨p⟩ : R[X]).erase n 
goal: { toFinsupp := Finsupp.erase n p } = Polynomial.erase n { toFinsupp := p }

full_name: Polynomial.support_erase
code: @[simp]
theorem support_erase (p : R[X]) (n : ℕ) : support (p.erase n) = (support p).erase n 
goal: (Polynomial.erase n p).support = p.support.erase n

full_name: Polynomial.monomial_add_erase
code: theorem monomial_add_erase (p : R[X]) (n : ℕ) : monomial n (coeff p n) + p.erase n = p 
goal: (Polynomial.monomial n) (p.coeff n) + Polynomial.erase n p = p

full_name: Polynomial.coeff_erase
code: theorem coeff_erase (p : R[X]) (n i : ℕ) :
    (p.erase n).coeff i = if i = n then 0 else p.coeff i 
goal: (Polynomial.erase n p).coeff i = if i = n then 0 else p.coeff i

full_name: Polynomial.erase_zero
code: @[simp]
theorem erase_zero (n : ℕ) : (0 : R[X]).erase n = 0 
goal: Polynomial.erase n 0 = 0

full_name: Polynomial.erase_monomial
code: @[simp]
theorem erase_monomial {n : ℕ} {a : R} : erase n (monomial n a) = 0 
goal: Polynomial.erase n ((Polynomial.monomial n) a) = 0

full_name: Polynomial.erase_same
code: @[simp]
theorem erase_same (p : R[X]) (n : ℕ) : coeff (p.erase n) n = 0 
goal: (Polynomial.erase n p).coeff n = 0

full_name: Polynomial.erase_ne
code: @[simp]
theorem erase_ne (p : R[X]) (n i : ℕ) (h : i ≠ n) : coeff (p.erase n) i = coeff p i 
goal: (Polynomial.erase n p).coeff i = p.coeff i

full_name: Polynomial.update
code: /-- Replace the coefficient of a `p : R[X]` at a given degree `n : ℕ`
by a given value `a : R`. If `a = 0`, this is equal to `p.erase n`
If `p.natDegree < n` and `a ≠ 0`, this increases the degree to `n`.  -/
def update (p : R[X]) (n : ℕ) (a : R) : R[X] 
goal: R[X]

full_name: Polynomial.coeff_update
code: theorem coeff_update (p : R[X]) (n : ℕ) (a : R) :
    (p.update n a).coeff = Function.update p.coeff n a 
goal: (p.update n a).coeff = Function.update p.coeff n a

full_name: Polynomial.coeff_update_apply
code: theorem coeff_update_apply (p : R[X]) (n : ℕ) (a : R) (i : ℕ) :
    (p.update n a).coeff i = if i = n then a else p.coeff i 
goal: (p.update n a).coeff i = if i = n then a else p.coeff i

full_name: Polynomial.coeff_update_same
code: @[simp]
theorem coeff_update_same (p : R[X]) (n : ℕ) (a : R) : (p.update n a).coeff n = a 
goal: (p.update n a).coeff n = a

full_name: Polynomial.coeff_update_ne
code: theorem coeff_update_ne (p : R[X]) {n : ℕ} (a : R) {i : ℕ} (h : i ≠ n) :
    (p.update n a).coeff i = p.coeff i 
goal: (p.update n a).coeff i = p.coeff i

full_name: Polynomial.update_zero_eq_erase
code: @[simp]
theorem update_zero_eq_erase (p : R[X]) (n : ℕ) : p.update n 0 = p.erase n 
goal: p.update n 0 = Polynomial.erase n p

full_name: Polynomial.support_update
code: theorem support_update (p : R[X]) (n : ℕ) (a : R) [Decidable (a = 0)] :
    support (p.update n a) = if a = 0 then p.support.erase n else insert n p.support 
goal: (p.update n a).support = if a = 0 then p.support.erase n else insert n p.support

full_name: Polynomial.support_update_zero
code: theorem support_update_zero (p : R[X]) (n : ℕ) : support (p.update n 0) = p.support.erase n 
goal: (p.update n 0).support = p.support.erase n

full_name: Polynomial.support_update_ne_zero
code: theorem support_update_ne_zero (p : R[X]) (n : ℕ) {a : R} (ha : a ≠ 0) :
    support (p.update n a) = insert n p.support 
goal: (p.update n a).support = insert n p.support

full_name: Polynomial.commSemiring
code: instance commSemiring : CommSemiring R[X] 
goal: CommSemiring R[X]

full_name: Polynomial.instIntCast
code: instance instIntCast : IntCast R[X] 
goal: IntCast R[X]

full_name: Polynomial.ring
code: instance ring : Ring R[X] 
goal: Ring R[X]

full_name: Polynomial.coeff_neg
code: @[simp]
theorem coeff_neg (p : R[X]) (n : ℕ) : coeff (-p) n = -coeff p n 
goal: (-p).coeff n = -p.coeff n

full_name: Polynomial.coeff_sub
code: @[simp]
theorem coeff_sub (p q : R[X]) (n : ℕ) : coeff (p - q) n = coeff p n - coeff q n 
goal: (p - q).coeff n = p.coeff n - q.coeff n

full_name: Polynomial.monomial_neg
code: theorem monomial_neg (n : ℕ) (a : R) : monomial n (-a) = -monomial n a 
goal: (Polynomial.monomial n) (-a) = -(Polynomial.monomial n) a

full_name: Polynomial.monomial_sub
code: theorem monomial_sub (n : ℕ) : monomial n (a - b) = monomial n a - monomial n b 
goal: (Polynomial.monomial n) (a - b) = (Polynomial.monomial n) a - (Polynomial.monomial n) b

full_name: Polynomial.support_neg
code: @[simp]
theorem support_neg {p : R[X]} : (-p).support = p.support 
goal: (-p).support = p.support

full_name: Polynomial.C_eq_intCast
code: theorem C_eq_intCast (n : ℤ) : C (n : R) = n 
goal: Polynomial.C ↑n = ↑n

full_name: Polynomial.C_neg
code: theorem C_neg : C (-a) = -C a 
goal: Polynomial.C (-a) = -Polynomial.C a

full_name: Polynomial.C_sub
code: theorem C_sub : C (a - b) = C a - C b 
goal: Polynomial.C (a - b) = Polynomial.C a - Polynomial.C b

full_name: Polynomial.commRing
code: instance commRing [CommRing R] : CommRing R[X] 
goal: CommRing R[X]

full_name: Polynomial.nontrivial
code: instance nontrivial [Nontrivial R] : Nontrivial R[X] 
goal: Nontrivial R[X]

full_name: Polynomial.X_ne_zero
code: @[simp]
theorem X_ne_zero [Nontrivial R] : (X : R[X]) ≠ 0 
goal: Polynomial.X ≠ 0

full_name: Polynomial.nnqsmul_eq_C_mul
code: lemma nnqsmul_eq_C_mul (q : ℚ≥0) (f : R[X]) : q • f = Polynomial.C (q : R) * f 
goal: q • f = Polynomial.C ↑q * f

full_name: Polynomial.qsmul_eq_C_mul
code: theorem qsmul_eq_C_mul (a : ℚ) (f : R[X]) : a • f = Polynomial.C (a : R) * f 
goal: a • f = Polynomial.C ↑a * f

full_name: Polynomial.nontrivial_iff
code: @[simp]
theorem nontrivial_iff [Semiring R] : Nontrivial R[X] ↔ Nontrivial R 
goal: Nontrivial R[X] ↔ Nontrivial R

full_name: Polynomial.repr
code: protected instance repr [Repr R] [DecidableEq R] : Repr R[X] 
goal: Repr R[X]