Metamath Proof Explorer


Theorem dvdsflsumcom

Description: A sum commutation from sum_ n <_ A , sum_ d || n , B ( n , d ) to sum_ d <_ A , sum_ m <_ A / d , B ( n , d m ) . (Contributed by Mario Carneiro, 4-May-2016)

Ref Expression
Hypotheses dvdsflsumcom.1 n = d m B = C
dvdsflsumcom.2 φ A
dvdsflsumcom.3 φ n 1 A d x | x n B
Assertion dvdsflsumcom φ n = 1 A d x | x n B = d = 1 A m = 1 A d C

Proof

Step Hyp Ref Expression
1 dvdsflsumcom.1 n = d m B = C
2 dvdsflsumcom.2 φ A
3 dvdsflsumcom.3 φ n 1 A d x | x n B
4 fzfid φ 1 A Fin
5 fzfid φ n 1 A 1 n Fin
6 elfznn n 1 A n
7 6 adantl φ n 1 A n
8 dvdsssfz1 n x | x n 1 n
9 7 8 syl φ n 1 A x | x n 1 n
10 5 9 ssfid φ n 1 A x | x n Fin
11 nnre d d
12 11 ad2antrl φ n 1 A d d n d
13 7 adantr φ n 1 A d d n n
14 13 nnred φ n 1 A d d n n
15 2 ad2antrr φ n 1 A d d n A
16 nnz d d
17 dvdsle d n d n d n
18 16 7 17 syl2anr φ n 1 A d d n d n
19 18 impr φ n 1 A d d n d n
20 fznnfl A n 1 A n n A
21 2 20 syl φ n 1 A n n A
22 21 simplbda φ n 1 A n A
23 22 adantr φ n 1 A d d n n A
24 12 14 15 19 23 letrd φ n 1 A d d n d A
25 24 ex φ n 1 A d d n d A
26 25 pm4.71rd φ n 1 A d d n d A d d n
27 ancom d A d d n d d n d A
28 an32 d d n d A d d A d n
29 27 28 bitri d A d d n d d A d n
30 26 29 bitrdi φ n 1 A d d n d d A d n
31 fznnfl A d 1 A d d A
32 2 31 syl φ d 1 A d d A
33 32 adantr φ n 1 A d 1 A d d A
34 33 anbi1d φ n 1 A d 1 A d n d d A d n
35 30 34 bitr4d φ n 1 A d d n d 1 A d n
36 35 pm5.32da φ n 1 A d d n n 1 A d 1 A d n
37 an12 n 1 A d 1 A d n d 1 A n 1 A d n
38 36 37 bitrdi φ n 1 A d d n d 1 A n 1 A d n
39 breq1 x = d x n d n
40 39 elrab d x | x n d d n
41 40 anbi2i n 1 A d x | x n n 1 A d d n
42 breq2 x = n d x d n
43 42 elrab n x 1 A | d x n 1 A d n
44 43 anbi2i d 1 A n x 1 A | d x d 1 A n 1 A d n
45 38 41 44 3bitr4g φ n 1 A d x | x n d 1 A n x 1 A | d x
46 4 4 10 45 3 fsumcom2 φ n = 1 A d x | x n B = d = 1 A n x 1 A | d x B
47 fzfid φ d 1 A 1 A d Fin
48 2 adantr φ d 1 A A
49 32 simprbda φ d 1 A d
50 eqid y 1 A d d y = y 1 A d d y
51 48 49 50 dvdsflf1o φ d 1 A y 1 A d d y : 1 A d 1-1 onto x 1 A | d x
52 oveq2 y = m d y = d m
53 ovex d m V
54 52 50 53 fvmpt m 1 A d y 1 A d d y m = d m
55 54 adantl φ d 1 A m 1 A d y 1 A d d y m = d m
56 45 biimpar φ d 1 A n x 1 A | d x n 1 A d x | x n
57 56 3 syldan φ d 1 A n x 1 A | d x B
58 57 anassrs φ d 1 A n x 1 A | d x B
59 1 47 51 55 58 fsumf1o φ d 1 A n x 1 A | d x B = m = 1 A d C
60 59 sumeq2dv φ d = 1 A n x 1 A | d x B = d = 1 A m = 1 A d C
61 46 60 eqtrd φ n = 1 A d x | x n B = d = 1 A m = 1 A d C