Metamath Proof Explorer


Theorem sticksstones19

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

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

Proof

Step Hyp Ref Expression
1 sticksstones19.1 φ N 0
2 sticksstones19.2 φ K 0
3 sticksstones19.3 A = g | g : 1 K 0 i = 1 K g i = N
4 sticksstones19.4 B = h | h : S 0 i S h i = N
5 sticksstones19.5 φ Z : 1 K 1-1 onto S
6 sticksstones19.6 F = a A x S a Z -1 x
7 sticksstones19.7 G = b B y 1 K b Z y
8 1 2 3 4 5 6 sticksstones18 φ F : A B
9 1 2 3 4 5 7 sticksstones17 φ G : B A
10 7 a1i φ c A G = b B y 1 K b Z y
11 simplr φ c A b = F c y 1 K b = F c
12 11 fveq1d φ c A b = F c y 1 K b Z y = F c Z y
13 12 mpteq2dva φ c A b = F c y 1 K b Z y = y 1 K F c Z y
14 8 ffvelrnda φ c A F c B
15 fzfid φ c A 1 K Fin
16 15 mptexd φ c A y 1 K F c Z y V
17 10 13 14 16 fvmptd φ c A G F c = y 1 K F c Z y
18 6 a1i φ c A y 1 K F = a A x S a Z -1 x
19 18 fveq1d φ c A y 1 K F c = a A x S a Z -1 x c
20 19 fveq1d φ c A y 1 K F c Z y = a A x S a Z -1 x c Z y
21 20 3expa φ c A y 1 K F c Z y = a A x S a Z -1 x c Z y
22 21 mpteq2dva φ c A y 1 K F c Z y = y 1 K a A x S a Z -1 x c Z y
23 eqidd φ c A y 1 K a A x S a Z -1 x = a A x S a Z -1 x
24 simplr φ c A y 1 K a = c x S a = c
25 24 fveq1d φ c A y 1 K a = c x S a Z -1 x = c Z -1 x
26 25 mpteq2dva φ c A y 1 K a = c x S a Z -1 x = x S c Z -1 x
27 simplr φ c A y 1 K c A
28 fzfid φ 1 K Fin
29 f1oenfi 1 K Fin Z : 1 K 1-1 onto S 1 K S
30 28 5 29 syl2anc φ 1 K S
31 30 ensymd φ S 1 K
32 enfii 1 K Fin S 1 K S Fin
33 28 31 32 syl2anc φ S Fin
34 33 adantr φ c A S Fin
35 34 adantr φ c A y 1 K S Fin
36 35 mptexd φ c A y 1 K x S c Z -1 x V
37 23 26 27 36 fvmptd φ c A y 1 K a A x S a Z -1 x c = x S c Z -1 x
38 37 fveq1d φ c A y 1 K a A x S a Z -1 x c Z y = x S c Z -1 x Z y
39 38 mpteq2dva φ c A y 1 K a A x S a Z -1 x c Z y = y 1 K x S c Z -1 x Z y
40 eqidd φ c A y 1 K x S c Z -1 x = x S c Z -1 x
41 simpr φ c A y 1 K x = Z y x = Z y
42 41 fveq2d φ c A y 1 K x = Z y Z -1 x = Z -1 Z y
43 42 fveq2d φ c A y 1 K x = Z y c Z -1 x = c Z -1 Z y
44 f1of Z : 1 K 1-1 onto S Z : 1 K S
45 5 44 syl φ Z : 1 K S
46 45 adantr φ c A Z : 1 K S
47 46 ffvelrnda φ c A y 1 K Z y S
48 fvexd φ c A y 1 K c Z -1 Z y V
49 40 43 47 48 fvmptd φ c A y 1 K x S c Z -1 x Z y = c Z -1 Z y
50 49 mpteq2dva φ c A y 1 K x S c Z -1 x Z y = y 1 K c Z -1 Z y
51 5 ad2antrr φ c A y 1 K Z : 1 K 1-1 onto S
52 simpr φ c A y 1 K y 1 K
53 f1ocnvfv1 Z : 1 K 1-1 onto S y 1 K Z -1 Z y = y
54 51 52 53 syl2anc φ c A y 1 K Z -1 Z y = y
55 54 fveq2d φ c A y 1 K c Z -1 Z y = c y
56 55 mpteq2dva φ c A y 1 K c Z -1 Z y = y 1 K c y
57 simpr φ c A c A
58 3 a1i φ c A A = g | g : 1 K 0 i = 1 K g i = N
59 57 58 eleqtrd φ c A c g | g : 1 K 0 i = 1 K g i = N
60 vex c V
61 feq1 g = c g : 1 K 0 c : 1 K 0
62 simpl g = c i 1 K g = c
63 62 fveq1d g = c i 1 K g i = c i
64 63 sumeq2dv g = c i = 1 K g i = i = 1 K c i
65 64 eqeq1d g = c i = 1 K g i = N i = 1 K c i = N
66 61 65 anbi12d g = c g : 1 K 0 i = 1 K g i = N c : 1 K 0 i = 1 K c i = N
67 60 66 elab c g | g : 1 K 0 i = 1 K g i = N c : 1 K 0 i = 1 K c i = N
68 59 67 sylib φ c A c : 1 K 0 i = 1 K c i = N
69 68 simpld φ c A c : 1 K 0
70 ffn c : 1 K 0 c Fn 1 K
71 69 70 syl φ c A c Fn 1 K
72 dffn5 c Fn 1 K c = y 1 K c y
73 71 72 sylib φ c A c = y 1 K c y
74 73 eqcomd φ c A y 1 K c y = c
75 56 74 eqtrd φ c A y 1 K c Z -1 Z y = c
76 50 75 eqtrd φ c A y 1 K x S c Z -1 x Z y = c
77 39 76 eqtrd φ c A y 1 K a A x S a Z -1 x c Z y = c
78 22 77 eqtrd φ c A y 1 K F c Z y = c
79 17 78 eqtrd φ c A G F c = c
80 79 ralrimiva φ c A G F c = c
81 6 a1i φ d B F = a A x S a Z -1 x
82 simplr φ d B a = G d x S a = G d
83 82 fveq1d φ d B a = G d x S a Z -1 x = G d Z -1 x
84 83 mpteq2dva φ d B a = G d x S a Z -1 x = x S G d Z -1 x
85 9 ffvelrnda φ d B G d A
86 33 adantr φ d B S Fin
87 86 mptexd φ d B x S G d Z -1 x V
88 81 84 85 87 fvmptd φ d B F G d = x S G d Z -1 x
89 7 a1i φ d B x S G = b B y 1 K b Z y
90 simplr φ d B x S b = d y 1 K b = d
91 90 fveq1d φ d B x S b = d y 1 K b Z y = d Z y
92 91 mpteq2dva φ d B x S b = d y 1 K b Z y = y 1 K d Z y
93 simplr φ d B x S d B
94 fzfid φ d B x S 1 K Fin
95 94 mptexd φ d B x S y 1 K d Z y V
96 89 92 93 95 fvmptd φ d B x S G d = y 1 K d Z y
97 96 fveq1d φ d B x S G d Z -1 x = y 1 K d Z y Z -1 x
98 97 mpteq2dva φ d B x S G d Z -1 x = x S y 1 K d Z y Z -1 x
99 eqidd φ d B x S y 1 K d Z y = y 1 K d Z y
100 simpr φ d B x S y = Z -1 x y = Z -1 x
101 100 fveq2d φ d B x S y = Z -1 x Z y = Z Z -1 x
102 101 fveq2d φ d B x S y = Z -1 x d Z y = d Z Z -1 x
103 f1ocnv Z : 1 K 1-1 onto S Z -1 : S 1-1 onto 1 K
104 5 103 syl φ Z -1 : S 1-1 onto 1 K
105 f1of Z -1 : S 1-1 onto 1 K Z -1 : S 1 K
106 104 105 syl φ Z -1 : S 1 K
107 106 adantr φ d B Z -1 : S 1 K
108 107 ffvelrnda φ d B x S Z -1 x 1 K
109 fvexd φ d B x S d Z Z -1 x V
110 99 102 108 109 fvmptd φ d B x S y 1 K d Z y Z -1 x = d Z Z -1 x
111 110 mpteq2dva φ d B x S y 1 K d Z y Z -1 x = x S d Z Z -1 x
112 5 ad2antrr φ d B x S Z : 1 K 1-1 onto S
113 simpr φ d B x S x S
114 f1ocnvfv2 Z : 1 K 1-1 onto S x S Z Z -1 x = x
115 112 113 114 syl2anc φ d B x S Z Z -1 x = x
116 115 fveq2d φ d B x S d Z Z -1 x = d x
117 116 mpteq2dva φ d B x S d Z Z -1 x = x S d x
118 simpr φ d B d B
119 4 a1i φ d B B = h | h : S 0 i S h i = N
120 118 119 eleqtrd φ d B d h | h : S 0 i S h i = N
121 vex d V
122 feq1 h = d h : S 0 d : S 0
123 simpl h = d i S h = d
124 123 fveq1d h = d i S h i = d i
125 124 sumeq2dv h = d i S h i = i S d i
126 125 eqeq1d h = d i S h i = N i S d i = N
127 122 126 anbi12d h = d h : S 0 i S h i = N d : S 0 i S d i = N
128 121 127 elab d h | h : S 0 i S h i = N d : S 0 i S d i = N
129 120 128 sylib φ d B d : S 0 i S d i = N
130 129 simpld φ d B d : S 0
131 ffn d : S 0 d Fn S
132 130 131 syl φ d B d Fn S
133 dffn5 d Fn S d = x S d x
134 132 133 sylib φ d B d = x S d x
135 134 eqcomd φ d B x S d x = d
136 117 135 eqtrd φ d B x S d Z Z -1 x = d
137 111 136 eqtrd φ d B x S y 1 K d Z y Z -1 x = d
138 98 137 eqtrd φ d B x S G d Z -1 x = d
139 88 138 eqtrd φ d B F G d = d
140 139 ralrimiva φ d B F G d = d
141 8 9 80 140 2fvidf1od φ F : A 1-1 onto B