Metamath Proof Explorer


Theorem fsumm1

Description: Separate out the last term in a finite sum. (Contributed by Mario Carneiro, 26-Apr-2014)

Ref Expression
Hypotheses fsumm1.1 φ N M
fsumm1.2 φ k M N A
fsumm1.3 k = N A = B
Assertion fsumm1 φ k = M N A = k = M N 1 A + B

Proof

Step Hyp Ref Expression
1 fsumm1.1 φ N M
2 fsumm1.2 φ k M N A
3 fsumm1.3 k = N A = B
4 eluzelz N M N
5 1 4 syl φ N
6 fzsn N N N = N
7 5 6 syl φ N N = N
8 7 ineq2d φ M N 1 N N = M N 1 N
9 5 zred φ N
10 9 ltm1d φ N 1 < N
11 fzdisj N 1 < N M N 1 N N =
12 10 11 syl φ M N 1 N N =
13 8 12 eqtr3d φ M N 1 N =
14 eluzel2 N M M
15 1 14 syl φ M
16 peano2zm M M 1
17 15 16 syl φ M 1
18 15 zcnd φ M
19 ax-1cn 1
20 npcan M 1 M - 1 + 1 = M
21 18 19 20 sylancl φ M - 1 + 1 = M
22 21 fveq2d φ M - 1 + 1 = M
23 1 22 eleqtrrd φ N M - 1 + 1
24 eluzp1m1 M 1 N M - 1 + 1 N 1 M 1
25 17 23 24 syl2anc φ N 1 M 1
26 fzsuc2 M N 1 M 1 M N - 1 + 1 = M N 1 N - 1 + 1
27 15 25 26 syl2anc φ M N - 1 + 1 = M N 1 N - 1 + 1
28 5 zcnd φ N
29 npcan N 1 N - 1 + 1 = N
30 28 19 29 sylancl φ N - 1 + 1 = N
31 30 oveq2d φ M N - 1 + 1 = M N
32 27 31 eqtr3d φ M N 1 N - 1 + 1 = M N
33 30 sneqd φ N - 1 + 1 = N
34 33 uneq2d φ M N 1 N - 1 + 1 = M N 1 N
35 32 34 eqtr3d φ M N = M N 1 N
36 fzfid φ M N Fin
37 13 35 36 2 fsumsplit φ k = M N A = k = M N 1 A + k N A
38 3 eleq1d k = N A B
39 2 ralrimiva φ k M N A
40 eluzfz2 N M N M N
41 1 40 syl φ N M N
42 38 39 41 rspcdva φ B
43 3 sumsn N M B k N A = B
44 1 42 43 syl2anc φ k N A = B
45 44 oveq2d φ k = M N 1 A + k N A = k = M N 1 A + B
46 37 45 eqtrd φ k = M N A = k = M N 1 A + B