Main derivation
S01 · definition
Before
p\in\mathbb{Q}[x]After
p=\sum_k a_k x^k,\quad p=q\iff a_k=b_k\ \text{for all}\ k,\quad \deg p=\max\{k\mid a_k\neq 0\}\ (p\neq 0)Conditions: \text{finitely many}\ a_k\neq 0
Rule: mko_polynomial · Uses: G1
Leaf basis: mko_polynomial + poly_eq_coeff + def_intro
By the MKO, a polynomial is its coefficient data: equality compares coefficients power by power, the degree is the largest index with a nonzero coefficient, and the zero polynomial (all coefficients 0) has undefined degree in this entry. Since only finitely many coefficients are nonzero, the maximum exists. Every later decision is made from the coefficients, not from which terms happen to be written.
S02 · equivalent
Before
4x^3+3x^2-x+2-4x^3+x
After
(4x^3-4x^3)+3x^2+(-x+x)+2
Conditions: none
Rule: add_comm · Uses: G2, add_comm, add_assoc
Leaf basis: add_comm + add_assoc
By commutativity and associativity of addition, rearrange the terms of p into groups by power of x: the x³ terms together and the x terms together. This step only rearranges; nothing is combined yet.
S03 · equivalent
Before
(4x^3-4x^3)+3x^2+(-x+x)+2
After
0\cdot x^3+3x^2+0\cdot x+2
Conditions: none
Rule: like_terms · Uses: S02, like_terms
Leaf basis: like_terms + distributive + numeric_evaluation
Combine like terms: 4x³−4x³=(4−4)x³=0·x³ and −x+x=(−1+1)x=0·x. This is the MKO's requirement that coefficients of the same power be added first.
S04 · equivalent
Before
0\cdot x^3+3x^2+0\cdot x+2
After
[2,0,3,0]=[2,0,3],\quad p=3x^2+2
Conditions: none
Rule: poly_eq_coeff · Uses: S03, poly_eq_coeff
Leaf basis: poly_eq_coeff + def_unfold
Read the coefficients from low to high: a_0=2, a_1=0, a_2=3, a_3=0, and every coefficient with k≥4 is 0. The vectors [2,0,3,0] and [2,0,3] have the same coefficient at every power (the coefficient at index 3 is 0 in both), so they represent the same polynomial p=3x²+2.
S05 · implies
Before
a_2=3\neq 0,\ a_k=0\ (k\geq 3)
After
\deg p=2
Conditions: p\neq 0
Rule: mko_polynomial · Uses: S01, S04
Leaf basis: mko_polynomial + def_unfold
p is not the zero polynomial (a_2=3≠0), so its degree is defined. The indices with nonzero coefficients are 0 and 2, the largest being 2, so deg p=2. The original expression shows x³ literally, but its combined coefficient is 0 and does not affect the degree.
S06 · implies
Before
q\leftrightarrow[-1,1,0,0]
After
q=x-1,\quad \deg q=1
Conditions: none
Rule: mko_polynomial · Uses: G1, G2, S01
Leaf basis: mko_polynomial + poly_eq_coeff
The vector [−1,1,0,0] means b_0=−1, b_1=1 and b_2=b_3=0, so q=−1+x=x−1, the same polynomial as [−1,1]. The largest index with a nonzero coefficient is 1, so deg q=1; the vector length 4 does not mean degree 3.
S07 · implies
Before
x^2-x^2+3
After
(1-1)x^2+3=3,\quad [3],\quad \deg r=0
Conditions: none
Rule: like_terms · Uses: G2, like_terms, S01
Leaf basis: like_terms + mko_polynomial + numeric_evaluation
Combine the x² terms: x²−x²=(1−1)x²=0. So r=3, with coefficient vector [3]. r is a nonzero constant polynomial (a_0=3≠0), and the largest index with a nonzero coefficient is 0, so deg r=0. This is the example in MKO para0.
S08 · implies
Before
5x-5x
After
(5-5)x=0,\quad z=0\ \text{(zero polynomial)},\quad z\neq rConditions: none
Rule: poly_eq_coeff · Uses: G2, like_terms, S01, S07
Leaf basis: poly_eq_coeff + like_terms + numeric_evaluation
5x−5x=(5−5)x=0·x, so every coefficient of z is 0: z is the zero polynomial, and by this entry its degree is undefined. z differs from r: their constant coefficients are 0 and 3, and 0≠3, so z≠r by the definition of equality. The zero polynomial must not be confused with a nonzero constant polynomial.
S09 · equivalent
Before
p+q=[2,0,3]+[-1,1]
After
[2+(-1),\,0+1,\,3+0]=[1,1,3],\quad p+q=3x^2+x+1
Conditions: none
Rule: mko_poly_ops · Uses: S04, S06, mko_poly_ops
Leaf basis: mko_poly_ops + poly_eq_coeff + numeric_evaluation
Addition adds coefficients power by power; the x² coefficient of q is 0 (beyond [−1,1]). So the coefficients of p+q are 2+(−1)=1, 0+1=1 and 3+0=3, that is 3x²+x+1, of degree 2.
S10 · equivalent
Before
p\cdot q,\quad a=[2,0,3],\ b=[-1,1]
After
c=[-2,2,-3,3],\quad pq=3x^3-3x^2+2x-2
Conditions: none
Rule: mko_poly_ops · Uses: S04, S06, mko_poly_ops
Leaf basis: mko_poly_ops + finite_sum_rules + poly_eq_coeff
The coefficients of the product are the finite convolution c_k=Σ_{i+j=k} a_i b_j, where every a_i or b_j beyond its vector is 0. Sub-step S10.1 computes c_0 and c_1, and S10.2 computes c_2 and c_3 and shows c_k=0 for k≥4.
S11 · implies
Before
pq=3x^3-3x^2+2x-2
After
\deg(pq)=3=\deg p+\deg q
Conditions: c_3=3\neq 0
Rule: mko_polynomial · Uses: S10, S10.2, S01
Leaf basis: mko_polynomial + numeric_evaluation
c_3=3≠0 and c_k=0 for k≥4, so deg(pq)=3. In this example it equals deg p+deg q=2+1; the leading coefficient 3 is the product 3·1 of the leading coefficients of p and q. The general degree rule for products is not proved in this guide.
S12 · implies
Before
p(2),\ q(2),\ (pq)(2)
After
p(2)=14,\ q(2)=1,\ (pq)(2)=24-12+4-2=14=p(2)\,q(2)
Conditions: none
Rule: eval_hom · Uses: S04, S06, S10, eval_hom
Leaf basis: eval_hom + numeric_evaluation
Substitute x=2: p(2)=3·4+2=14, q(2)=2−1=1, and (pq)(2)=3·8−3·4+2·2−2=14. By eval_hom one must have (pq)(2)=p(2)q(2)=14, and it agrees. This is only a consistency check on S10; the product itself is determined by the coefficient convolution, and agreement at one point cannot prove the coefficients right.
S13 · implies
Before
p(1)=5=t(1)
After
p\neq t\quad([2,0,3]\neq[0,5])
Conditions: none
Rule: poly_eq_coeff · Uses: S04, G2, poly_eq_coeff, mko_poly_ops
Leaf basis: poly_eq_coeff + numeric_evaluation
p(1)=3+2=5 and t(1)=5·1=5, so the values at x=1 agree. But the constant coefficient of p is 2 and that of t is 0, and 2≠0, so p≠t by the definition of equality; at x=0 this shows as p(0)=2≠0=t(0). The MKO notes that equality of one substituted value does not establish a polynomial identity.
S14 · implies
Before
p,q,r,z,p+q,pq,t
After
\deg p=2,\ \deg q=1,\ \deg r=0,\ z=0\ (\deg\ \text{undefined}),\ \deg(p+q)=2,\ \deg(pq)=3,\ p\neq tConditions: none
Rule: and_intro_elim · Uses: S05, S06, S07, S08, S09, S11, S13
Leaf basis: and_intro_elim
Summary: p=3x²+2 has degree 2, q=x−1 degree 1, r=3 degree 0, z is the zero polynomial (degree undefined) with z≠r, p+q=3x²+x+1 has degree 2, pq=3x³−3x²+2x−2 degree 3, and p≠t although p(1)=t(1). Every conclusion comes from the coefficient data.
Error controls and negative controls
Combine like terms before reading the degree
One error named in the MKO is taking the highest literal exponent before combining like terms. p shows 4x³ and −4x³ literally, but the combined x³ coefficient is 0 and deg p=2 (S03 to S05). Likewise r=x²−x²+3 is the constant 3 (S07).
Vector length and trailing zeros do not decide the degree
The other error named in the MKO is deciding the degree from the vector length or trailing zeros. [−1,1,0,0] has length 4 but is x−1, of degree 1 (S06); [2,0,3,0] and [2,0,3] are the same polynomial (S04).
The zero polynomial is not of degree zero
Every coefficient of z=5x−5x is 0, and this entry calls its degree undefined; r=3 is a nonzero constant of degree 0. Their constant coefficients 0 and 3 differ, so z≠r (S08). Mathlib's degree gives the zero polynomial ⊥ and natDegree gives 0; the two must not be mixed when matching.
Equal at one point is not an identity
p(1)=t(1)=5, but p and t have different coefficients, and p(0)=2≠0=t(0) (S13). The agreement at x=2 in S12 is likewise only a consistency check; the product is determined by the coefficient convolution.
- p=4x³+3x²−x+2−4x³+x has degree 3 because 4x³ appears in it →
reject — After combining, the x³ coefficient is 4−4=0, so p=3x²+2 of degree 2. - The coefficient vector [−1,1,0,0] has length 4, so q has degree 3 →
reject — The largest index with a nonzero coefficient is 1, so q=x−1 of degree 1. - z=5x−5x is a polynomial of degree 0, just like the constant 3 →
reject — z is the zero polynomial, whose degree is undefined in this entry; moreover its constant coefficient 0≠3, so z≠3. - Since p(1)=t(1)=5, p=t →
reject — p(0)=2≠0=t(0), so the constant coefficients differ; equality at one point does not establish an identity.