Metamath Proof Explorer


Theorem eulerpartlemsv2

Description: Lemma for eulerpart . Value of the sum of a finite partition A (Contributed by Thierry Arnoux, 19-Aug-2018)

Ref Expression
Hypotheses eulerpartlems.r R = f | f -1 Fin
eulerpartlems.s S = f 0 R k f k k
Assertion eulerpartlemsv2 A 0 R S A = k A -1 A k k

Proof

Step Hyp Ref Expression
1 eulerpartlems.r R = f | f -1 Fin
2 eulerpartlems.s S = f 0 R k f k k
3 1 2 eulerpartlemsv1 A 0 R S A = k A k k
4 cnvimass A -1 dom A
5 1 2 eulerpartlemelr A 0 R A : 0 A -1 Fin
6 5 simpld A 0 R A : 0
7 4 6 fssdm A 0 R A -1
8 6 adantr A 0 R k A -1 A : 0
9 7 sselda A 0 R k A -1 k
10 8 9 ffvelrnd A 0 R k A -1 A k 0
11 9 nnnn0d A 0 R k A -1 k 0
12 10 11 nn0mulcld A 0 R k A -1 A k k 0
13 12 nn0cnd A 0 R k A -1 A k k
14 simpr A 0 R k A -1 k A -1
15 14 eldifad A 0 R k A -1 k
16 14 eldifbd A 0 R k A -1 ¬ k A -1
17 6 adantr A 0 R k A -1 A : 0
18 ffn A : 0 A Fn
19 elpreima A Fn k A -1 k A k
20 17 18 19 3syl A 0 R k A -1 k A -1 k A k
21 16 20 mtbid A 0 R k A -1 ¬ k A k
22 imnan k ¬ A k ¬ k A k
23 21 22 sylibr A 0 R k A -1 k ¬ A k
24 15 23 mpd A 0 R k A -1 ¬ A k
25 17 15 ffvelrnd A 0 R k A -1 A k 0
26 elnn0 A k 0 A k A k = 0
27 25 26 sylib A 0 R k A -1 A k A k = 0
28 orel1 ¬ A k A k A k = 0 A k = 0
29 24 27 28 sylc A 0 R k A -1 A k = 0
30 29 oveq1d A 0 R k A -1 A k k = 0 k
31 15 nncnd A 0 R k A -1 k
32 31 mul02d A 0 R k A -1 0 k = 0
33 30 32 eqtrd A 0 R k A -1 A k k = 0
34 nnuz = 1
35 34 eqimssi 1
36 35 a1i A 0 R 1
37 7 13 33 36 sumss A 0 R k A -1 A k k = k A k k
38 3 37 eqtr4d A 0 R S A = k A -1 A k k