Metamath Proof Explorer


Theorem fsumdvds

Description: If every term in a sum is divisible by N , then so is the sum. (Contributed by Mario Carneiro, 17-Jan-2015)

Ref Expression
Hypotheses fsumdvds.1 φ A Fin
fsumdvds.2 φ N
fsumdvds.3 φ k A B
fsumdvds.4 φ k A N B
Assertion fsumdvds φ N k A B

Proof

Step Hyp Ref Expression
1 fsumdvds.1 φ A Fin
2 fsumdvds.2 φ N
3 fsumdvds.3 φ k A B
4 fsumdvds.4 φ k A N B
5 0z 0
6 dvds0 0 0 0
7 5 6 mp1i φ N = 0 0 0
8 simpr φ N = 0 N = 0
9 simplr φ N = 0 k A N = 0
10 4 adantlr φ N = 0 k A N B
11 9 10 eqbrtrrd φ N = 0 k A 0 B
12 3 adantlr φ N = 0 k A B
13 0dvds B 0 B B = 0
14 12 13 syl φ N = 0 k A 0 B B = 0
15 11 14 mpbid φ N = 0 k A B = 0
16 15 sumeq2dv φ N = 0 k A B = k A 0
17 1 adantr φ N = 0 A Fin
18 17 olcd φ N = 0 A 0 A Fin
19 sumz A 0 A Fin k A 0 = 0
20 18 19 syl φ N = 0 k A 0 = 0
21 16 20 eqtrd φ N = 0 k A B = 0
22 7 8 21 3brtr4d φ N = 0 N k A B
23 1 adantr φ N 0 A Fin
24 2 adantr φ N 0 N
25 24 zcnd φ N 0 N
26 3 adantlr φ N 0 k A B
27 26 zcnd φ N 0 k A B
28 simpr φ N 0 N 0
29 23 25 27 28 fsumdivc φ N 0 k A B N = k A B N
30 4 adantlr φ N 0 k A N B
31 24 adantr φ N 0 k A N
32 simplr φ N 0 k A N 0
33 dvdsval2 N N 0 B N B B N
34 31 32 26 33 syl3anc φ N 0 k A N B B N
35 30 34 mpbid φ N 0 k A B N
36 23 35 fsumzcl φ N 0 k A B N
37 29 36 eqeltrd φ N 0 k A B N
38 1 3 fsumzcl φ k A B
39 38 adantr φ N 0 k A B
40 dvdsval2 N N 0 k A B N k A B k A B N
41 24 28 39 40 syl3anc φ N 0 N k A B k A B N
42 37 41 mpbird φ N 0 N k A B
43 22 42 pm2.61dane φ N k A B