Metamath Proof Explorer


Theorem sticksstones18

Description: Extend sticks and stones to finite sets, bijective builder. (Contributed by metakunt, 23-Oct-2024)

Ref Expression
Hypotheses sticksstones18.1 φ N 0
sticksstones18.2 φ K 0
sticksstones18.3 A = g | g : 1 K 0 i = 1 K g i = N
sticksstones18.4 B = h | h : S 0 i S h i = N
sticksstones18.5 φ Z : 1 K 1-1 onto S
sticksstones18.6 F = a A x S a Z -1 x
Assertion sticksstones18 φ F : A B

Proof

Step Hyp Ref Expression
1 sticksstones18.1 φ N 0
2 sticksstones18.2 φ K 0
3 sticksstones18.3 A = g | g : 1 K 0 i = 1 K g i = N
4 sticksstones18.4 B = h | h : S 0 i S h i = N
5 sticksstones18.5 φ Z : 1 K 1-1 onto S
6 sticksstones18.6 F = a A x S a Z -1 x
7 3 eqimssi A g | g : 1 K 0 i = 1 K g i = N
8 7 a1i φ A g | g : 1 K 0 i = 1 K g i = N
9 8 sseld φ a A a g | g : 1 K 0 i = 1 K g i = N
10 9 imp φ a A a g | g : 1 K 0 i = 1 K g i = N
11 vex a V
12 feq1 g = a g : 1 K 0 a : 1 K 0
13 simpl g = a i 1 K g = a
14 13 fveq1d g = a i 1 K g i = a i
15 14 sumeq2dv g = a i = 1 K g i = i = 1 K a i
16 15 eqeq1d g = a i = 1 K g i = N i = 1 K a i = N
17 12 16 anbi12d g = a g : 1 K 0 i = 1 K g i = N a : 1 K 0 i = 1 K a i = N
18 11 17 elab a g | g : 1 K 0 i = 1 K g i = N a : 1 K 0 i = 1 K a i = N
19 10 18 sylib φ a A a : 1 K 0 i = 1 K a i = N
20 19 simpld φ a A a : 1 K 0
21 20 adantr φ a A x S a : 1 K 0
22 f1ocnv Z : 1 K 1-1 onto S Z -1 : S 1-1 onto 1 K
23 5 22 syl φ Z -1 : S 1-1 onto 1 K
24 f1of Z -1 : S 1-1 onto 1 K Z -1 : S 1 K
25 23 24 syl φ Z -1 : S 1 K
26 25 adantr φ a A Z -1 : S 1 K
27 26 ffvelrnda φ a A x S Z -1 x 1 K
28 21 27 ffvelrnd φ a A x S a Z -1 x 0
29 28 fmpttd φ a A x S a Z -1 x : S 0
30 eqidd φ a A i S x S a Z -1 x = x S a Z -1 x
31 simpr φ a A i S x = i x = i
32 31 fveq2d φ a A i S x = i Z -1 x = Z -1 i
33 32 fveq2d φ a A i S x = i a Z -1 x = a Z -1 i
34 simpr φ a A i S i S
35 fvexd φ a A i S a Z -1 i V
36 30 33 34 35 fvmptd φ a A i S x S a Z -1 x i = a Z -1 i
37 36 sumeq2dv φ a A i S x S a Z -1 x i = i S a Z -1 i
38 fveq2 n = Z -1 i a n = a Z -1 i
39 fzfid φ a A 1 K Fin
40 5 adantr φ a A Z : 1 K 1-1 onto S
41 f1oenfi 1 K Fin Z : 1 K 1-1 onto S 1 K S
42 39 40 41 syl2anc φ a A 1 K S
43 42 ensymd φ a A S 1 K
44 enfii 1 K Fin S 1 K S Fin
45 39 43 44 syl2anc φ a A S Fin
46 23 adantr φ a A Z -1 : S 1-1 onto 1 K
47 eqidd φ a A i S Z -1 i = Z -1 i
48 nn0sscn 0
49 48 a1i φ a A 0
50 fss a : 1 K 0 0 a : 1 K
51 20 49 50 syl2anc φ a A a : 1 K
52 51 ffvelrnda φ a A n 1 K a n
53 38 45 46 47 52 fsumf1o φ a A n = 1 K a n = i S a Z -1 i
54 53 eqcomd φ a A i S a Z -1 i = n = 1 K a n
55 fveq2 n = i a n = a i
56 55 cbvsumv n = 1 K a n = i = 1 K a i
57 56 a1i φ a A n = 1 K a n = i = 1 K a i
58 19 simprd φ a A i = 1 K a i = N
59 57 58 eqtrd φ a A n = 1 K a n = N
60 54 59 eqtrd φ a A i S a Z -1 i = N
61 37 60 eqtrd φ a A i S x S a Z -1 x i = N
62 29 61 jca φ a A x S a Z -1 x : S 0 i S x S a Z -1 x i = N
63 fzfid φ 1 K Fin
64 63 adantr φ a A 1 K Fin
65 63 5 41 syl2anc φ 1 K S
66 65 ensymd φ S 1 K
67 66 adantr φ a A S 1 K
68 64 67 44 syl2anc φ a A S Fin
69 68 mptexd φ a A x S a Z -1 x V
70 feq1 h = x S a Z -1 x h : S 0 x S a Z -1 x : S 0
71 simpl h = x S a Z -1 x i S h = x S a Z -1 x
72 71 fveq1d h = x S a Z -1 x i S h i = x S a Z -1 x i
73 72 sumeq2dv h = x S a Z -1 x i S h i = i S x S a Z -1 x i
74 73 eqeq1d h = x S a Z -1 x i S h i = N i S x S a Z -1 x i = N
75 70 74 anbi12d h = x S a Z -1 x h : S 0 i S h i = N x S a Z -1 x : S 0 i S x S a Z -1 x i = N
76 75 elabg x S a Z -1 x V x S a Z -1 x h | h : S 0 i S h i = N x S a Z -1 x : S 0 i S x S a Z -1 x i = N
77 69 76 syl φ a A x S a Z -1 x h | h : S 0 i S h i = N x S a Z -1 x : S 0 i S x S a Z -1 x i = N
78 62 77 mpbird φ a A x S a Z -1 x h | h : S 0 i S h i = N
79 4 a1i φ a A B = h | h : S 0 i S h i = N
80 78 79 eleqtrrd φ a A x S a Z -1 x B
81 80 6 fmptd φ F : A B