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

Theorem arisum2 12645
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 10228 . 2  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
2 nnm1nn0 10266 . . . . . 6  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  NN0 )
3 nn0uz 10525 . . . . . 6  |-  NN0  =  ( ZZ>= `  0 )
42, 3syl6eleq 2528 . . . . 5  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  ( ZZ>= `  0
) )
5 elfznn0 11088 . . . . . . 7  |-  ( k  e.  ( 0 ... ( N  -  1 ) )  ->  k  e.  NN0 )
65adantl 454 . . . . . 6  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  NN0 )
76nn0cnd 10281 . . . . 5  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
8 id 21 . . . . 5  |-  ( k  =  0  ->  k  =  0 )
94, 7, 8fsum1p 12544 . . . 4  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k ) )
10 1e0p1 10415 . . . . . . . . 9  |-  1  =  ( 0  +  1 )
1110oveq1i 6094 . . . . . . . 8  |-  ( 1 ... ( N  - 
1 ) )  =  ( ( 0  +  1 ) ... ( N  -  1 ) )
1211sumeq1i 12497 . . . . . . 7  |-  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  sum_ k  e.  ( (
0  +  1 ) ... ( N  - 
1 ) ) k
1312oveq2i 6095 . . . . . 6  |-  ( 0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )
14 fzfid 11317 . . . . . . . 8  |-  ( N  e.  NN  ->  (
1 ... ( N  - 
1 ) )  e. 
Fin )
15 elfznn 11085 . . . . . . . . . 10  |-  ( k  e.  ( 1 ... ( N  -  1 ) )  ->  k  e.  NN )
1615adantl 454 . . . . . . . . 9  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  NN )
1716nncnd 10021 . . . . . . . 8  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
1814, 17fsumcl 12532 . . . . . . 7  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  e.  CC )
1918addid2d 9272 . . . . . 6  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
2013, 19syl5eqr 2484 . . . . 5  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
21 arisum 12644 . . . . . . 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 10013 . . . . . . . . . . . . . . . 16  |-  ( N  e.  NN  ->  N  e.  CC )
2423mulid1d 9110 . . . . . . . . . . . . . . 15  |-  ( N  e.  NN  ->  ( N  x.  1 )  =  N )
2524oveq2d 6100 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( 2  x.  N ) )
26232timesd 10215 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  N )  =  ( N  +  N ) )
2725, 26eqtrd 2470 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( N  +  N ) )
2827oveq2d 6100 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
2923sqcld 11526 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  ( N ^ 2 )  e.  CC )
3029, 23, 23subsub4d 9447 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  N )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
3128, 30eqtr4d 2473 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( ( N ^ 2 )  -  N )  -  N ) )
32 sq1 11481 . . . . . . . . . . . 12  |-  ( 1 ^ 2 )  =  1
3332a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
1 ^ 2 )  =  1 )
3431, 33oveq12d 6102 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  (
2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
35 ax-1cn 9053 . . . . . . . . . . 11  |-  1  e.  CC
36 binom2sub 11503 . . . . . . . . . . 11  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( ( N  - 
1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3723, 35, 36sylancl 645 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3829, 23subcld 9416 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  N )  e.  CC )
3935a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  1  e.  CC )
4038, 23, 39subsubd 9444 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
4134, 37, 403eqtr4d 2480 . . . . . . . . 9  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  N )  -  ( N  -  1
) ) )
4241oveq1d 6099 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  ( N  - 
1 ) )  +  ( N  -  1 ) ) )
43 subcl 9310 . . . . . . . . . 10  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( N  -  1 )  e.  CC )
4423, 35, 43sylancl 645 . . . . . . . . 9  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  CC )
4538, 44npcand 9420 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( ( N ^ 2 )  -  N )  -  ( N  -  1 ) )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4642, 45eqtrd 2470 . . . . . . 7  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4746oveq1d 6099 . . . . . 6  |-  ( N  e.  NN  ->  (
( ( ( N  -  1 ) ^
2 )  +  ( N  -  1 ) )  /  2 )  =  ( ( ( N ^ 2 )  -  N )  / 
2 ) )
4822, 47eqtrd 2470 . . . . 5  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
4920, 48eqtrd 2470 . . . 4  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  =  ( ( ( N ^ 2 )  -  N )  /  2
) )
509, 49eqtrd 2470 . . 3  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
51 oveq1 6091 . . . . . . . 8  |-  ( N  =  0  ->  ( N  -  1 )  =  ( 0  -  1 ) )
5251oveq2d 6100 . . . . . . 7  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  ( 0 ... (
0  -  1 ) ) )
53 0re 9096 . . . . . . . . 9  |-  0  e.  RR
54 ltm1 9855 . . . . . . . . 9  |-  ( 0  e.  RR  ->  (
0  -  1 )  <  0 )
5553, 54ax-mp 5 . . . . . . . 8  |-  ( 0  -  1 )  <  0
56 0z 10298 . . . . . . . . 9  |-  0  e.  ZZ
57 peano2zm 10325 . . . . . . . . . 10  |-  ( 0  e.  ZZ  ->  (
0  -  1 )  e.  ZZ )
5856, 57ax-mp 5 . . . . . . . . 9  |-  ( 0  -  1 )  e.  ZZ
59 fzn 11076 . . . . . . . . 9  |-  ( ( 0  e.  ZZ  /\  ( 0  -  1 )  e.  ZZ )  ->  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) ) )
6056, 58, 59mp2an 655 . . . . . . . 8  |-  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) )
6155, 60mpbi 201 . . . . . . 7  |-  ( 0 ... ( 0  -  1 ) )  =  (/)
6252, 61syl6eq 2486 . . . . . 6  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  (/) )
6362sumeq1d 12500 . . . . 5  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  sum_ k  e.  (/)  k )
64 sum0 12520 . . . . 5  |-  sum_ k  e.  (/)  k  =  0
6563, 64syl6eq 2486 . . . 4  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  0 )
66 sq0i 11479 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
67 id 21 . . . . . . . 8  |-  ( N  =  0  ->  N  =  0 )
6866, 67oveq12d 6102 . . . . . . 7  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  ( 0  -  0 ) )
69 0cn 9089 . . . . . . . 8  |-  0  e.  CC
7069subidi 9376 . . . . . . 7  |-  ( 0  -  0 )  =  0
7168, 70syl6eq 2486 . . . . . 6  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  0 )
7271oveq1d 6099 . . . . 5  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  ( 0  / 
2 ) )
73 2cn 10075 . . . . . 6  |-  2  e.  CC
74 2ne0 10088 . . . . . 6  |-  2  =/=  0
7573, 74div0i 9753 . . . . 5  |-  ( 0  /  2 )  =  0
7672, 75syl6eq 2486 . . . 4  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  0 )
7765, 76eqtr4d 2473 . . 3  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
7850, 77jaoi 370 . 2  |-  ( ( N  e.  NN  \/  N  =  0 )  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^ 2 )  -  N )  /  2 ) )
791, 78sylbi 189 1  |-  ( N  e.  NN0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 178    \/ wo 359    /\ wa 360    = wceq 1653    e. wcel 1726   (/)c0 3630   class class class wbr 4215   ` cfv 5457  (class class class)co 6084   CCcc 8993   RRcr 8994   0cc0 8995   1c1 8996    + caddc 8998    x. cmul 9000    < clt 9125    - cmin 9296    / cdiv 9682   NNcn 10005   2c2 10054   NN0cn0 10226   ZZcz 10287   ZZ>=cuz 10493   ...cfz 11048   ^cexp 11387   sum_csu 12484
This theorem is referenced by:  birthdaylem3  20797
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-rep 4323  ax-sep 4333  ax-nul 4341  ax-pow 4380  ax-pr 4406  ax-un 4704  ax-inf2 7599  ax-cnex 9051  ax-resscn 9052  ax-1cn 9053  ax-icn 9054  ax-addcl 9055  ax-addrcl 9056  ax-mulcl 9057  ax-mulrcl 9058  ax-mulcom 9059  ax-addass 9060  ax-mulass 9061  ax-distr 9062  ax-i2m1 9063  ax-1ne0 9064  ax-1rid 9065  ax-rnegex 9066  ax-rrecex 9067  ax-cnre 9068  ax-pre-lttri 9069  ax-pre-lttrn 9070  ax-pre-ltadd 9071  ax-pre-mulgt0 9072  ax-pre-sup 9073
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-int 4053  df-iun 4097  df-br 4216  df-opab 4270  df-mpt 4271  df-tr 4306  df-eprel 4497  df-id 4501  df-po 4506  df-so 4507  df-fr 4544  df-se 4545  df-we 4546  df-ord 4587  df-on 4588  df-lim 4589  df-suc 4590  df-om 4849  df-xp 4887  df-rel 4888  df-cnv 4889  df-co 4890  df-dm 4891  df-rn 4892  df-res 4893  df-ima 4894  df-iota 5421  df-fun 5459  df-fn 5460  df-f 5461  df-f1 5462  df-fo 5463  df-f1o 5464  df-fv 5465  df-isom 5466  df-ov 6087  df-oprab 6088  df-mpt2 6089  df-1st 6352  df-2nd 6353  df-riota 6552  df-recs 6636  df-rdg 6671  df-1o 6727  df-oadd 6731  df-er 6908  df-en 7113  df-dom 7114  df-sdom 7115  df-fin 7116  df-sup 7449  df-oi 7482  df-card 7831  df-pnf 9127  df-mnf 9128  df-xr 9129  df-ltxr 9130  df-le 9131  df-sub 9298  df-neg 9299  df-div 9683  df-nn 10006  df-2 10063  df-3 10064  df-n0 10227  df-z 10288  df-uz 10494  df-rp 10618  df-fz 11049  df-fzo 11141  df-seq 11329  df-exp 11388  df-fac 11572  df-bc 11599  df-hash 11624  df-cj 11909  df-re 11910  df-im 11911  df-sqr 12045  df-abs 12046  df-clim 12287  df-sum 12485
  Copyright terms: Public domain W3C validator