Metamath Proof Explorer


Theorem dgrle

Description: Given an explicit expression for a polynomial, the degree is at most the highest term in the sum. (Contributed by Mario Carneiro, 24-Jul-2014)

Ref Expression
Hypotheses dgrle.1 φ F Poly S
dgrle.2 φ N 0
dgrle.3 φ k 0 N A
dgrle.4 φ F = z k = 0 N A z k
Assertion dgrle φ deg F N

Proof

Step Hyp Ref Expression
1 dgrle.1 φ F Poly S
2 dgrle.2 φ N 0
3 dgrle.3 φ k 0 N A
4 dgrle.4 φ F = z k = 0 N A z k
5 1 2 3 4 coeeq2 φ coeff F = k 0 if k N A 0
6 5 ad2antrr φ m 0 ¬ m N coeff F = k 0 if k N A 0
7 6 fveq1d φ m 0 ¬ m N coeff F m = k 0 if k N A 0 m
8 nfcv _ k m
9 nfv k ¬ m N
10 nffvmpt1 _ k k 0 if k N A 0 m
11 10 nfeq1 k k 0 if k N A 0 m = 0
12 9 11 nfim k ¬ m N k 0 if k N A 0 m = 0
13 breq1 k = m k N m N
14 13 notbid k = m ¬ k N ¬ m N
15 fveqeq2 k = m k 0 if k N A 0 k = 0 k 0 if k N A 0 m = 0
16 14 15 imbi12d k = m ¬ k N k 0 if k N A 0 k = 0 ¬ m N k 0 if k N A 0 m = 0
17 iffalse ¬ k N if k N A 0 = 0
18 17 fveq2d ¬ k N I if k N A 0 = I 0
19 0cn 0
20 fvi 0 I 0 = 0
21 19 20 ax-mp I 0 = 0
22 18 21 eqtrdi ¬ k N I if k N A 0 = 0
23 eqid k 0 if k N A 0 = k 0 if k N A 0
24 23 fvmpt2i k 0 k 0 if k N A 0 k = I if k N A 0
25 24 eqeq1d k 0 k 0 if k N A 0 k = 0 I if k N A 0 = 0
26 22 25 syl5ibr k 0 ¬ k N k 0 if k N A 0 k = 0
27 8 12 16 26 vtoclgaf m 0 ¬ m N k 0 if k N A 0 m = 0
28 27 imp m 0 ¬ m N k 0 if k N A 0 m = 0
29 28 adantll φ m 0 ¬ m N k 0 if k N A 0 m = 0
30 7 29 eqtrd φ m 0 ¬ m N coeff F m = 0
31 30 ex φ m 0 ¬ m N coeff F m = 0
32 31 necon1ad φ m 0 coeff F m 0 m N
33 32 ralrimiva φ m 0 coeff F m 0 m N
34 eqid coeff F = coeff F
35 34 coef3 F Poly S coeff F : 0
36 1 35 syl φ coeff F : 0
37 plyco0 N 0 coeff F : 0 coeff F N + 1 = 0 m 0 coeff F m 0 m N
38 2 36 37 syl2anc φ coeff F N + 1 = 0 m 0 coeff F m 0 m N
39 33 38 mpbird φ coeff F N + 1 = 0
40 eqid deg F = deg F
41 34 40 dgrlb F Poly S N 0 coeff F N + 1 = 0 deg F N
42 1 2 39 41 syl3anc φ deg F N