MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  arisum2 Structured version   Unicode version

Theorem arisum2 13305
Description: Arithmetic series sum of the first  N nonnegative integers. (Contributed by Mario Carneiro, 17-Apr-2015.)
Assertion
Ref Expression
arisum2  |-  ( N  e.  NN0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
Distinct variable group:    k, N

Proof of Theorem arisum2
StepHypRef Expression
1 elnn0 10568 . 2  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
2 nnm1nn0 10608 . . . . . 6  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  NN0 )
3 nn0uz 10882 . . . . . 6  |-  NN0  =  ( ZZ>= `  0 )
42, 3syl6eleq 2523 . . . . 5  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  ( ZZ>= `  0
) )
5 elfznn0 11467 . . . . . . 7  |-  ( k  e.  ( 0 ... ( N  -  1 ) )  ->  k  e.  NN0 )
65adantl 463 . . . . . 6  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  NN0 )
76nn0cnd 10625 . . . . 5  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
8 id 22 . . . . 5  |-  ( k  =  0  ->  k  =  0 )
94, 7, 8fsum1p 13205 . . . 4  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k ) )
10 1e0p1 10770 . . . . . . . . 9  |-  1  =  ( 0  +  1 )
1110oveq1i 6090 . . . . . . . 8  |-  ( 1 ... ( N  - 
1 ) )  =  ( ( 0  +  1 ) ... ( N  -  1 ) )
1211sumeq1i 13158 . . . . . . 7  |-  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  sum_ k  e.  ( (
0  +  1 ) ... ( N  - 
1 ) ) k
1312oveq2i 6091 . . . . . 6  |-  ( 0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )
14 fzfid 11778 . . . . . . . 8  |-  ( N  e.  NN  ->  (
1 ... ( N  - 
1 ) )  e. 
Fin )
15 elfznn 11464 . . . . . . . . . 10  |-  ( k  e.  ( 1 ... ( N  -  1 ) )  ->  k  e.  NN )
1615adantl 463 . . . . . . . . 9  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  NN )
1716nncnd 10325 . . . . . . . 8  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
1814, 17fsumcl 13193 . . . . . . 7  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  e.  CC )
1918addid2d 9557 . . . . . 6  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
2013, 19syl5eqr 2479 . . . . 5  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
21 arisum 13304 . . . . . . 7  |-  ( ( N  -  1 )  e.  NN0  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  ( ( ( ( N  -  1 ) ^
2 )  +  ( N  -  1 ) )  /  2 ) )
222, 21syl 16 . . . . . 6  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  ( ( ( ( N  -  1 ) ^
2 )  +  ( N  -  1 ) )  /  2 ) )
23 nncn 10317 . . . . . . . . . . . . . . . 16  |-  ( N  e.  NN  ->  N  e.  CC )
2423mulid1d 9390 . . . . . . . . . . . . . . 15  |-  ( N  e.  NN  ->  ( N  x.  1 )  =  N )
2524oveq2d 6096 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( 2  x.  N ) )
26232timesd 10554 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  N )  =  ( N  +  N ) )
2725, 26eqtrd 2465 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( N  +  N ) )
2827oveq2d 6096 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
2923sqcld 11989 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  ( N ^ 2 )  e.  CC )
3029, 23, 23subsub4d 9737 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  N )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
3128, 30eqtr4d 2468 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( ( N ^ 2 )  -  N )  -  N ) )
32 sq1 11943 . . . . . . . . . . . 12  |-  ( 1 ^ 2 )  =  1
3332a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
1 ^ 2 )  =  1 )
3431, 33oveq12d 6098 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  (
2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
35 ax-1cn 9327 . . . . . . . . . . 11  |-  1  e.  CC
36 binom2sub 11966 . . . . . . . . . . 11  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( ( N  - 
1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3723, 35, 36sylancl 655 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3829, 23subcld 9706 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  N )  e.  CC )
3935a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  1  e.  CC )
4038, 23, 39subsubd 9734 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
4134, 37, 403eqtr4d 2475 . . . . . . . . 9  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  N )  -  ( N  -  1
) ) )
4241oveq1d 6095 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  ( N  - 
1 ) )  +  ( N  -  1 ) ) )
43 subcl 9596 . . . . . . . . . 10  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( N  -  1 )  e.  CC )
4423, 35, 43sylancl 655 . . . . . . . . 9  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  CC )
4538, 44npcand 9710 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( ( N ^ 2 )  -  N )  -  ( N  -  1 ) )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4642, 45eqtrd 2465 . . . . . . 7  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4746oveq1d 6095 . . . . . 6  |-  ( N  e.  NN  ->  (
( ( ( N  -  1 ) ^
2 )  +  ( N  -  1 ) )  /  2 )  =  ( ( ( N ^ 2 )  -  N )  / 
2 ) )
4822, 47eqtrd 2465 . . . . 5  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
4920, 48eqtrd 2465 . . . 4  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  =  ( ( ( N ^ 2 )  -  N )  /  2
) )
509, 49eqtrd 2465 . . 3  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
51 oveq1 6087 . . . . . . . 8  |-  ( N  =  0  ->  ( N  -  1 )  =  ( 0  -  1 ) )
5251oveq2d 6096 . . . . . . 7  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  ( 0 ... (
0  -  1 ) ) )
53 0re 9373 . . . . . . . . 9  |-  0  e.  RR
54 ltm1 10156 . . . . . . . . 9  |-  ( 0  e.  RR  ->  (
0  -  1 )  <  0 )
5553, 54ax-mp 5 . . . . . . . 8  |-  ( 0  -  1 )  <  0
56 0z 10644 . . . . . . . . 9  |-  0  e.  ZZ
57 peano2zm 10675 . . . . . . . . . 10  |-  ( 0  e.  ZZ  ->  (
0  -  1 )  e.  ZZ )
5856, 57ax-mp 5 . . . . . . . . 9  |-  ( 0  -  1 )  e.  ZZ
59 fzn 11452 . . . . . . . . 9  |-  ( ( 0  e.  ZZ  /\  ( 0  -  1 )  e.  ZZ )  ->  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) ) )
6056, 58, 59mp2an 665 . . . . . . . 8  |-  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) )
6155, 60mpbi 208 . . . . . . 7  |-  ( 0 ... ( 0  -  1 ) )  =  (/)
6252, 61syl6eq 2481 . . . . . 6  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  (/) )
6362sumeq1d 13161 . . . . 5  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  sum_ k  e.  (/)  k )
64 sum0 13181 . . . . 5  |-  sum_ k  e.  (/)  k  =  0
6563, 64syl6eq 2481 . . . 4  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  0 )
66 sq0i 11941 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
67 id 22 . . . . . . . 8  |-  ( N  =  0  ->  N  =  0 )
6866, 67oveq12d 6098 . . . . . . 7  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  ( 0  -  0 ) )
69 0m0e0 10418 . . . . . . 7  |-  ( 0  -  0 )  =  0
7068, 69syl6eq 2481 . . . . . 6  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  0 )
7170oveq1d 6095 . . . . 5  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  ( 0  / 
2 ) )
72 2cn 10379 . . . . . 6  |-  2  e.  CC
73 2ne0 10401 . . . . . 6  |-  2  =/=  0
7472, 73div0i 10052 . . . . 5  |-  ( 0  /  2 )  =  0
7571, 74syl6eq 2481 . . . 4  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  0 )
7665, 75eqtr4d 2468 . . 3  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
7750, 76jaoi 379 . 2  |-  ( ( N  e.  NN  \/  N  =  0 )  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^ 2 )  -  N )  /  2 ) )
781, 77sylbi 195 1  |-  ( N  e.  NN0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    \/ wo 368    /\ wa 369    = wceq 1362    e. wcel 1755   (/)c0 3625   class class class wbr 4280   ` cfv 5406  (class class class)co 6080   CCcc 9267   RRcr 9268   0cc0 9269   1c1 9270    + caddc 9272    x. cmul 9274    < clt 9405    - cmin 9582    / cdiv 9980   NNcn 10309   2c2 10358   NN0cn0 10566   ZZcz 10633   ZZ>=cuz 10848   ...cfz 11423   ^cexp 11848   sum_csu 13146
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1594  ax-4 1605  ax-5 1669  ax-6 1707  ax-7 1727  ax-8 1757  ax-9 1759  ax-10 1774  ax-11 1779  ax-12 1791  ax-13 1942  ax-ext 2414  ax-rep 4391  ax-sep 4401  ax-nul 4409  ax-pow 4458  ax-pr 4519  ax-un 6361  ax-inf2 7835  ax-cnex 9325  ax-resscn 9326  ax-1cn 9327  ax-icn 9328  ax-addcl 9329  ax-addrcl 9330  ax-mulcl 9331  ax-mulrcl 9332  ax-mulcom 9333  ax-addass 9334  ax-mulass 9335  ax-distr 9336  ax-i2m1 9337  ax-1ne0 9338  ax-1rid 9339  ax-rnegex 9340  ax-rrecex 9341  ax-cnre 9342  ax-pre-lttri 9343  ax-pre-lttrn 9344  ax-pre-ltadd 9345  ax-pre-mulgt0 9346  ax-pre-sup 9347
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 959  df-3an 960  df-tru 1365  df-fal 1368  df-ex 1590  df-nf 1593  df-sb 1700  df-eu 2258  df-mo 2259  df-clab 2420  df-cleq 2426  df-clel 2429  df-nfc 2558  df-ne 2598  df-nel 2599  df-ral 2710  df-rex 2711  df-reu 2712  df-rmo 2713  df-rab 2714  df-v 2964  df-sbc 3176  df-csb 3277  df-dif 3319  df-un 3321  df-in 3323  df-ss 3330  df-pss 3332  df-nul 3626  df-if 3780  df-pw 3850  df-sn 3866  df-pr 3868  df-tp 3870  df-op 3872  df-uni 4080  df-int 4117  df-iun 4161  df-br 4281  df-opab 4339  df-mpt 4340  df-tr 4374  df-eprel 4619  df-id 4623  df-po 4628  df-so 4629  df-fr 4666  df-se 4667  df-we 4668  df-ord 4709  df-on 4710  df-lim 4711  df-suc 4712  df-xp 4833  df-rel 4834  df-cnv 4835  df-co 4836  df-dm 4837  df-rn 4838  df-res 4839  df-ima 4840  df-iota 5369  df-fun 5408  df-fn 5409  df-f 5410  df-f1 5411  df-fo 5412  df-f1o 5413  df-fv 5414  df-isom 5415  df-riota 6039  df-ov 6083  df-oprab 6084  df-mpt2 6085  df-om 6466  df-1st 6566  df-2nd 6567  df-recs 6818  df-rdg 6852  df-1o 6908  df-oadd 6912  df-er 7089  df-en 7299  df-dom 7300  df-sdom 7301  df-fin 7302  df-sup 7679  df-oi 7712  df-card 8097  df-pnf 9407  df-mnf 9408  df-xr 9409  df-ltxr 9410  df-le 9411  df-sub 9584  df-neg 9585  df-div 9981  df-nn 10310  df-2 10367  df-3 10368  df-n0 10567  df-z 10634  df-uz 10849  df-rp 10979  df-fz 11424  df-fzo 11532  df-seq 11790  df-exp 11849  df-fac 12035  df-bc 12062  df-hash 12087  df-cj 12571  df-re 12572  df-im 12573  df-sqr 12707  df-abs 12708  df-clim 12949  df-sum 13147
This theorem is referenced by:  birthdaylem3  22231
  Copyright terms: Public domain W3C validator