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

Theorem arisum2 12567
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 10155 . 2  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
2 nnm1nn0 10193 . . . . . 6  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  NN0 )
3 nn0uz 10452 . . . . . 6  |-  NN0  =  ( ZZ>= `  0 )
42, 3syl6eleq 2477 . . . . 5  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  ( ZZ>= `  0
) )
5 elfznn0 11015 . . . . . . 7  |-  ( k  e.  ( 0 ... ( N  -  1 ) )  ->  k  e.  NN0 )
65adantl 453 . . . . . 6  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  NN0 )
76nn0cnd 10208 . . . . 5  |-  ( ( N  e.  NN  /\  k  e.  ( 0 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
8 id 20 . . . . 5  |-  ( k  =  0  ->  k  =  0 )
94, 7, 8fsum1p 12466 . . . 4  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k ) )
10 1e0p1 10342 . . . . . . . . 9  |-  1  =  ( 0  +  1 )
1110oveq1i 6030 . . . . . . . 8  |-  ( 1 ... ( N  - 
1 ) )  =  ( ( 0  +  1 ) ... ( N  -  1 ) )
1211sumeq1i 12419 . . . . . . 7  |-  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  sum_ k  e.  ( (
0  +  1 ) ... ( N  - 
1 ) ) k
1312oveq2i 6031 . . . . . 6  |-  ( 0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  =  ( 0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )
14 fzfid 11239 . . . . . . . 8  |-  ( N  e.  NN  ->  (
1 ... ( N  - 
1 ) )  e. 
Fin )
15 elfznn 11012 . . . . . . . . . 10  |-  ( k  e.  ( 1 ... ( N  -  1 ) )  ->  k  e.  NN )
1615adantl 453 . . . . . . . . 9  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  NN )
1716nncnd 9948 . . . . . . . 8  |-  ( ( N  e.  NN  /\  k  e.  ( 1 ... ( N  - 
1 ) ) )  ->  k  e.  CC )
1814, 17fsumcl 12454 . . . . . . 7  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  e.  CC )
1918addid2d 9199 . . . . . 6  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
2013, 19syl5eqr 2433 . . . . 5  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  = 
sum_ k  e.  ( 1 ... ( N  -  1 ) ) k )
21 arisum 12566 . . . . . . 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 9940 . . . . . . . . . . . . . . . 16  |-  ( N  e.  NN  ->  N  e.  CC )
2423mulid1d 9038 . . . . . . . . . . . . . . 15  |-  ( N  e.  NN  ->  ( N  x.  1 )  =  N )
2524oveq2d 6036 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( 2  x.  N ) )
26232timesd 10142 . . . . . . . . . . . . . 14  |-  ( N  e.  NN  ->  (
2  x.  N )  =  ( N  +  N ) )
2725, 26eqtrd 2419 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  (
2  x.  ( N  x.  1 ) )  =  ( N  +  N ) )
2827oveq2d 6036 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
2923sqcld 11448 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  ( N ^ 2 )  e.  CC )
3029, 23, 23subsub4d 9374 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  N )  =  ( ( N ^ 2 )  -  ( N  +  N
) ) )
3128, 30eqtr4d 2422 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  =  ( ( ( N ^ 2 )  -  N )  -  N ) )
32 sq1 11403 . . . . . . . . . . . 12  |-  ( 1 ^ 2 )  =  1
3332a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
1 ^ 2 )  =  1 )
3431, 33oveq12d 6038 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  (
2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
35 ax-1cn 8981 . . . . . . . . . . 11  |-  1  e.  CC
36 binom2sub 11425 . . . . . . . . . . 11  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( ( N  - 
1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3723, 35, 36sylancl 644 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  ( 2  x.  ( N  x.  1 ) ) )  +  ( 1 ^ 2 ) ) )
3829, 23subcld 9343 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  (
( N ^ 2 )  -  N )  e.  CC )
3935a1i 11 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  1  e.  CC )
4038, 23, 39subsubd 9371 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
( ( N ^
2 )  -  N
)  -  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  N )  +  1 ) )
4134, 37, 403eqtr4d 2429 . . . . . . . . 9  |-  ( N  e.  NN  ->  (
( N  -  1 ) ^ 2 )  =  ( ( ( N ^ 2 )  -  N )  -  ( N  -  1
) ) )
4241oveq1d 6035 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( ( ( N ^ 2 )  -  N )  -  ( N  - 
1 ) )  +  ( N  -  1 ) ) )
43 subcl 9237 . . . . . . . . . 10  |-  ( ( N  e.  CC  /\  1  e.  CC )  ->  ( N  -  1 )  e.  CC )
4423, 35, 43sylancl 644 . . . . . . . . 9  |-  ( N  e.  NN  ->  ( N  -  1 )  e.  CC )
4538, 44npcand 9347 . . . . . . . 8  |-  ( N  e.  NN  ->  (
( ( ( N ^ 2 )  -  N )  -  ( N  -  1 ) )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4642, 45eqtrd 2419 . . . . . . 7  |-  ( N  e.  NN  ->  (
( ( N  - 
1 ) ^ 2 )  +  ( N  -  1 ) )  =  ( ( N ^ 2 )  -  N ) )
4746oveq1d 6035 . . . . . 6  |-  ( N  e.  NN  ->  (
( ( ( N  -  1 ) ^
2 )  +  ( N  -  1 ) )  /  2 )  =  ( ( ( N ^ 2 )  -  N )  / 
2 ) )
4822, 47eqtrd 2419 . . . . 5  |-  ( N  e.  NN  ->  sum_ k  e.  ( 1 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
4920, 48eqtrd 2419 . . . 4  |-  ( N  e.  NN  ->  (
0  +  sum_ k  e.  ( ( 0  +  1 ) ... ( N  -  1 ) ) k )  =  ( ( ( N ^ 2 )  -  N )  /  2
) )
509, 49eqtrd 2419 . . 3  |-  ( N  e.  NN  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
51 oveq1 6027 . . . . . . . 8  |-  ( N  =  0  ->  ( N  -  1 )  =  ( 0  -  1 ) )
5251oveq2d 6036 . . . . . . 7  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  ( 0 ... (
0  -  1 ) ) )
53 0re 9024 . . . . . . . . 9  |-  0  e.  RR
54 ltm1 9782 . . . . . . . . 9  |-  ( 0  e.  RR  ->  (
0  -  1 )  <  0 )
5553, 54ax-mp 8 . . . . . . . 8  |-  ( 0  -  1 )  <  0
56 0z 10225 . . . . . . . . 9  |-  0  e.  ZZ
57 peano2zm 10252 . . . . . . . . . 10  |-  ( 0  e.  ZZ  ->  (
0  -  1 )  e.  ZZ )
5856, 57ax-mp 8 . . . . . . . . 9  |-  ( 0  -  1 )  e.  ZZ
59 fzn 11003 . . . . . . . . 9  |-  ( ( 0  e.  ZZ  /\  ( 0  -  1 )  e.  ZZ )  ->  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) ) )
6056, 58, 59mp2an 654 . . . . . . . 8  |-  ( ( 0  -  1 )  <  0  <->  ( 0 ... ( 0  -  1 ) )  =  (/) )
6155, 60mpbi 200 . . . . . . 7  |-  ( 0 ... ( 0  -  1 ) )  =  (/)
6252, 61syl6eq 2435 . . . . . 6  |-  ( N  =  0  ->  (
0 ... ( N  - 
1 ) )  =  (/) )
6362sumeq1d 12422 . . . . 5  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  sum_ k  e.  (/)  k )
64 sum0 12442 . . . . 5  |-  sum_ k  e.  (/)  k  =  0
6563, 64syl6eq 2435 . . . 4  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  0 )
66 sq0i 11401 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
67 id 20 . . . . . . . 8  |-  ( N  =  0  ->  N  =  0 )
6866, 67oveq12d 6038 . . . . . . 7  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  ( 0  -  0 ) )
69 0cn 9017 . . . . . . . 8  |-  0  e.  CC
7069subidi 9303 . . . . . . 7  |-  ( 0  -  0 )  =  0
7168, 70syl6eq 2435 . . . . . 6  |-  ( N  =  0  ->  (
( N ^ 2 )  -  N )  =  0 )
7271oveq1d 6035 . . . . 5  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  ( 0  / 
2 ) )
73 2cn 10002 . . . . . 6  |-  2  e.  CC
74 2ne0 10015 . . . . . 6  |-  2  =/=  0
7573, 74div0i 9680 . . . . 5  |-  ( 0  /  2 )  =  0
7672, 75syl6eq 2435 . . . 4  |-  ( N  =  0  ->  (
( ( N ^
2 )  -  N
)  /  2 )  =  0 )
7765, 76eqtr4d 2422 . . 3  |-  ( N  =  0  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^
2 )  -  N
)  /  2 ) )
7850, 77jaoi 369 . 2  |-  ( ( N  e.  NN  \/  N  =  0 )  ->  sum_ k  e.  ( 0 ... ( N  -  1 ) ) k  =  ( ( ( N ^ 2 )  -  N )  /  2 ) )
791, 78sylbi 188 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 177    \/ wo 358    /\ wa 359    = wceq 1649    e. wcel 1717   (/)c0 3571   class class class wbr 4153   ` cfv 5394  (class class class)co 6020   CCcc 8921   RRcr 8922   0cc0 8923   1c1 8924    + caddc 8926    x. cmul 8928    < clt 9053    - cmin 9223    / cdiv 9609   NNcn 9932   2c2 9981   NN0cn0 10153   ZZcz 10214   ZZ>=cuz 10420   ...cfz 10975   ^cexp 11309   sum_csu 12406
This theorem is referenced by:  birthdaylem3  20659
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2368  ax-rep 4261  ax-sep 4271  ax-nul 4279  ax-pow 4318  ax-pr 4344  ax-un 4641  ax-inf2 7529  ax-cnex 8979  ax-resscn 8980  ax-1cn 8981  ax-icn 8982  ax-addcl 8983  ax-addrcl 8984  ax-mulcl 8985  ax-mulrcl 8986  ax-mulcom 8987  ax-addass 8988  ax-mulass 8989  ax-distr 8990  ax-i2m1 8991  ax-1ne0 8992  ax-1rid 8993  ax-rnegex 8994  ax-rrecex 8995  ax-cnre 8996  ax-pre-lttri 8997  ax-pre-lttrn 8998  ax-pre-ltadd 8999  ax-pre-mulgt0 9000  ax-pre-sup 9001
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2242  df-mo 2243  df-clab 2374  df-cleq 2380  df-clel 2383  df-nfc 2512  df-ne 2552  df-nel 2553  df-ral 2654  df-rex 2655  df-reu 2656  df-rmo 2657  df-rab 2658  df-v 2901  df-sbc 3105  df-csb 3195  df-dif 3266  df-un 3268  df-in 3270  df-ss 3277  df-pss 3279  df-nul 3572  df-if 3683  df-pw 3744  df-sn 3763  df-pr 3764  df-tp 3765  df-op 3766  df-uni 3958  df-int 3993  df-iun 4037  df-br 4154  df-opab 4208  df-mpt 4209  df-tr 4244  df-eprel 4435  df-id 4439  df-po 4444  df-so 4445  df-fr 4482  df-se 4483  df-we 4484  df-ord 4525  df-on 4526  df-lim 4527  df-suc 4528  df-om 4786  df-xp 4824  df-rel 4825  df-cnv 4826  df-co 4827  df-dm 4828  df-rn 4829  df-res 4830  df-ima 4831  df-iota 5358  df-fun 5396  df-fn 5397  df-f 5398  df-f1 5399  df-fo 5400  df-f1o 5401  df-fv 5402  df-isom 5403  df-ov 6023  df-oprab 6024  df-mpt2 6025  df-1st 6288  df-2nd 6289  df-riota 6485  df-recs 6569  df-rdg 6604  df-1o 6660  df-oadd 6664  df-er 6841  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-oi 7412  df-card 7759  df-pnf 9055  df-mnf 9056  df-xr 9057  df-ltxr 9058  df-le 9059  df-sub 9225  df-neg 9226  df-div 9610  df-nn 9933  df-2 9990  df-3 9991  df-n0 10154  df-z 10215  df-uz 10421  df-rp 10545  df-fz 10976  df-fzo 11066  df-seq 11251  df-exp 11310  df-fac 11494  df-bc 11521  df-hash 11546  df-cj 11831  df-re 11832  df-im 11833  df-sqr 11967  df-abs 11968  df-clim 12209  df-sum 12407
  Copyright terms: Public domain W3C validator