Metamath Proof Explorer


Theorem coeeq2

Description: Compute the coefficient function given a sum expression for the polynomial. (Contributed by Mario Carneiro, 24-Jul-2014)

Ref Expression
Hypotheses dgrle.1 φFPolyS
dgrle.2 φN0
dgrle.3 φk0NA
dgrle.4 φF=zk=0NAzk
Assertion coeeq2 φcoeffF=k0ifkNA0

Proof

Step Hyp Ref Expression
1 dgrle.1 φFPolyS
2 dgrle.2 φN0
3 dgrle.3 φk0NA
4 dgrle.4 φF=zk=0NAzk
5 simpll φk0kNφ
6 simpr φk0kNkN
7 simplr φk0kNk0
8 nn0uz 0=0
9 7 8 eleqtrdi φk0kNk0
10 2 nn0zd φN
11 10 ad2antrr φk0kNN
12 elfz5 k0Nk0NkN
13 9 11 12 syl2anc φk0kNk0NkN
14 6 13 mpbird φk0kNk0N
15 5 14 3 syl2anc φk0kNA
16 0cnd φk0¬kN0
17 15 16 ifclda φk0ifkNA0
18 17 fmpttd φk0ifkNA0:0
19 simpr φk0k0
20 eqid k0ifkNA0=k0ifkNA0
21 20 fvmpt2 k0ifkNA0k0ifkNA0k=ifkNA0
22 19 17 21 syl2anc φk0k0ifkNA0k=ifkNA0
23 22 neeq1d φk0k0ifkNA0k0ifkNA00
24 iffalse ¬kNifkNA0=0
25 24 necon1ai ifkNA00kN
26 23 25 syl6bi φk0k0ifkNA0k0kN
27 26 ralrimiva φk0k0ifkNA0k0kN
28 nfv mk0ifkNA0k0kN
29 nffvmpt1 _kk0ifkNA0m
30 nfcv _k0
31 29 30 nfne kk0ifkNA0m0
32 nfv kmN
33 31 32 nfim kk0ifkNA0m0mN
34 fveq2 k=mk0ifkNA0k=k0ifkNA0m
35 34 neeq1d k=mk0ifkNA0k0k0ifkNA0m0
36 breq1 k=mkNmN
37 35 36 imbi12d k=mk0ifkNA0k0kNk0ifkNA0m0mN
38 28 33 37 cbvralw k0k0ifkNA0k0kNm0k0ifkNA0m0mN
39 27 38 sylib φm0k0ifkNA0m0mN
40 plyco0 N0k0ifkNA0:0k0ifkNA0N+1=0m0k0ifkNA0m0mN
41 2 18 40 syl2anc φk0ifkNA0N+1=0m0k0ifkNA0m0mN
42 39 41 mpbird φk0ifkNA0N+1=0
43 nfcv _mk0ifkNA0kzk
44 nfcv _k×
45 nfcv _kzm
46 29 44 45 nfov _kk0ifkNA0mzm
47 oveq2 k=mzk=zm
48 34 47 oveq12d k=mk0ifkNA0kzk=k0ifkNA0mzm
49 43 46 48 cbvsumi k=0Nk0ifkNA0kzk=m=0Nk0ifkNA0mzm
50 elfznn0 k0Nk0
51 50 adantl φzk0Nk0
52 elfzle2 k0NkN
53 52 adantl φzk0NkN
54 53 iftrued φzk0NifkNA0=A
55 3 adantlr φzk0NA
56 54 55 eqeltrd φzk0NifkNA0
57 51 56 21 syl2anc φzk0Nk0ifkNA0k=ifkNA0
58 57 54 eqtrd φzk0Nk0ifkNA0k=A
59 58 oveq1d φzk0Nk0ifkNA0kzk=Azk
60 59 sumeq2dv φzk=0Nk0ifkNA0kzk=k=0NAzk
61 49 60 eqtr3id φzm=0Nk0ifkNA0mzm=k=0NAzk
62 61 mpteq2dva φzm=0Nk0ifkNA0mzm=zk=0NAzk
63 4 62 eqtr4d φF=zm=0Nk0ifkNA0mzm
64 1 2 18 42 63 coeeq φcoeffF=k0ifkNA0