Metamath Proof Explorer


Theorem nnfoctbdjlem

Description: There exists a mapping from NN onto any (nonempty) countable set of disjoint sets, such that elements in the range of the map are disjoint. (Contributed by Glauco Siliprandi, 17-Aug-2020)

Ref Expression
Hypotheses nnfoctbdjlem.a φ A
nnfoctbdjlem.g φ G : A 1-1 onto X
nnfoctbdjlem.dj φ Disj y X y
nnfoctbdjlem.f F = n if n = 1 ¬ n 1 A G n 1
Assertion nnfoctbdjlem φ f f : onto X Disj n f n

Proof

Step Hyp Ref Expression
1 nnfoctbdjlem.a φ A
2 nnfoctbdjlem.g φ G : A 1-1 onto X
3 nnfoctbdjlem.dj φ Disj y X y
4 nnfoctbdjlem.f F = n if n = 1 ¬ n 1 A G n 1
5 iftrue n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 =
6 5 adantl n n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 =
7 0ex V
8 7 snid
9 elun2 X
10 8 9 ax-mp X
11 6 10 eqeltrdi n n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 X
12 11 adantll φ n n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 X
13 iffalse ¬ n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 = G n 1
14 13 adantl φ n ¬ n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 = G n 1
15 f1of G : A 1-1 onto X G : A X
16 2 15 syl φ G : A X
17 16 adantr φ ¬ n = 1 ¬ n 1 A G : A X
18 pm2.46 ¬ n = 1 ¬ n 1 A ¬ ¬ n 1 A
19 18 notnotrd ¬ n = 1 ¬ n 1 A n 1 A
20 19 adantl φ ¬ n = 1 ¬ n 1 A n 1 A
21 17 20 ffvelrnd φ ¬ n = 1 ¬ n 1 A G n 1 X
22 21 adantlr φ n ¬ n = 1 ¬ n 1 A G n 1 X
23 elun1 G n 1 X G n 1 X
24 22 23 syl φ n ¬ n = 1 ¬ n 1 A G n 1 X
25 14 24 eqeltrd φ n ¬ n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 X
26 12 25 pm2.61dan φ n if n = 1 ¬ n 1 A G n 1 X
27 26 4 fmptd φ F : X
28 simpr φ y X y X
29 f1ofo G : A 1-1 onto X G : A onto X
30 forn G : A onto X ran G = X
31 2 29 30 3syl φ ran G = X
32 31 eqcomd φ X = ran G
33 32 adantr φ y X X = ran G
34 28 33 eleqtrd φ y X y ran G
35 16 ffnd φ G Fn A
36 fvelrnb G Fn A y ran G k A G k = y
37 35 36 syl φ y ran G k A G k = y
38 37 adantr φ y X y ran G k A G k = y
39 34 38 mpbid φ y X k A G k = y
40 1 sselda φ k A k
41 40 peano2nnd φ k A k + 1
42 41 3adant3 φ k A G k = y k + 1
43 4 a1i φ k A F = n if n = 1 ¬ n 1 A G n 1
44 1red φ k A n = k + 1 1
45 1red φ k A 1
46 40 nnrpd φ k A k +
47 45 46 ltaddrp2d φ k A 1 < k + 1
48 47 adantr φ k A n = k + 1 1 < k + 1
49 id n = k + 1 n = k + 1
50 49 eqcomd n = k + 1 k + 1 = n
51 50 adantl φ k A n = k + 1 k + 1 = n
52 48 51 breqtrd φ k A n = k + 1 1 < n
53 44 52 gtned φ k A n = k + 1 n 1
54 53 neneqd φ k A n = k + 1 ¬ n = 1
55 oveq1 n = k + 1 n 1 = k + 1 - 1
56 40 nncnd φ k A k
57 1cnd φ k A 1
58 56 57 pncand φ k A k + 1 - 1 = k
59 55 58 sylan9eqr φ k A n = k + 1 n 1 = k
60 simplr φ k A n = k + 1 k A
61 59 60 eqeltrd φ k A n = k + 1 n 1 A
62 61 notnotd φ k A n = k + 1 ¬ ¬ n 1 A
63 ioran ¬ n = 1 ¬ n 1 A ¬ n = 1 ¬ ¬ n 1 A
64 54 62 63 sylanbrc φ k A n = k + 1 ¬ n = 1 ¬ n 1 A
65 64 iffalsed φ k A n = k + 1 if n = 1 ¬ n 1 A G n 1 = G n 1
66 59 fveq2d φ k A n = k + 1 G n 1 = G k
67 65 66 eqtrd φ k A n = k + 1 if n = 1 ¬ n 1 A G n 1 = G k
68 16 ffvelrnda φ k A G k X
69 43 67 41 68 fvmptd φ k A F k + 1 = G k
70 69 3adant3 φ k A G k = y F k + 1 = G k
71 simp3 φ k A G k = y G k = y
72 70 71 eqtrd φ k A G k = y F k + 1 = y
73 fveq2 m = k + 1 F m = F k + 1
74 73 eqeq1d m = k + 1 F m = y F k + 1 = y
75 74 rspcev k + 1 F k + 1 = y m F m = y
76 42 72 75 syl2anc φ k A G k = y m F m = y
77 76 3exp φ k A G k = y m F m = y
78 77 adantr φ y X k A G k = y m F m = y
79 78 rexlimdv φ y X k A G k = y m F m = y
80 39 79 mpd φ y X m F m = y
81 id F m = y F m = y
82 81 eqcomd F m = y y = F m
83 82 a1i φ y X m F m = y y = F m
84 83 reximdva φ y X m F m = y m y = F m
85 80 84 mpd φ y X m y = F m
86 85 adantlr φ y X y X m y = F m
87 simpll φ y X ¬ y X φ
88 elunnel1 y X ¬ y X y
89 elsni y y =
90 88 89 syl y X ¬ y X y =
91 90 adantll φ y X ¬ y X y =
92 1nn 1
93 92 a1i φ y = 1
94 5 orcs n = 1 if n = 1 ¬ n 1 A G n 1 =
95 92 a1i φ 1
96 7 a1i φ V
97 4 94 95 96 fvmptd3 φ F 1 =
98 97 adantr φ y = F 1 =
99 id y = y =
100 99 eqcomd y = = y
101 100 adantl φ y = = y
102 98 101 eqtr2d φ y = y = F 1
103 fveq2 m = 1 F m = F 1
104 103 rspceeqv 1 y = F 1 m y = F m
105 93 102 104 syl2anc φ y = m y = F m
106 87 91 105 syl2anc φ y X ¬ y X m y = F m
107 86 106 pm2.61dan φ y X m y = F m
108 107 ralrimiva φ y X m y = F m
109 dffo3 F : onto X F : X y X m y = F m
110 27 108 109 sylanbrc φ F : onto X
111 animorrl φ n m n = m n = m F n F m =
112 6 7 eqeltrdi n n = 1 ¬ n 1 A if n = 1 ¬ n 1 A G n 1 V
113 4 fvmpt2 n if n = 1 ¬ n 1 A G n 1 V F n = if n = 1 ¬ n 1 A G n 1
114 112 113 syldan n n = 1 ¬ n 1 A F n = if n = 1 ¬ n 1 A G n 1
115 114 6 eqtrd n n = 1 ¬ n 1 A F n =
116 115 ineq1d n n = 1 ¬ n 1 A F n F m = F m
117 0in F m =
118 116 117 eqtrdi n n = 1 ¬ n 1 A F n F m =
119 118 adantlr n m n = 1 ¬ n 1 A F n F m =
120 119 ad4ant24 φ n m n m n = 1 ¬ n 1 A F n F m =
121 eqeq1 n = m n = 1 m = 1
122 oveq1 n = m n 1 = m 1
123 122 eleq1d n = m n 1 A m 1 A
124 123 notbid n = m ¬ n 1 A ¬ m 1 A
125 121 124 orbi12d n = m n = 1 ¬ n 1 A m = 1 ¬ m 1 A
126 122 fveq2d n = m G n 1 = G m 1
127 125 126 ifbieq2d n = m if n = 1 ¬ n 1 A G n 1 = if m = 1 ¬ m 1 A G m 1
128 simpl m m = 1 ¬ m 1 A m
129 iftrue m = 1 ¬ m 1 A if m = 1 ¬ m 1 A G m 1 =
130 129 7 eqeltrdi m = 1 ¬ m 1 A if m = 1 ¬ m 1 A G m 1 V
131 130 adantl m m = 1 ¬ m 1 A if m = 1 ¬ m 1 A G m 1 V
132 4 127 128 131 fvmptd3 m m = 1 ¬ m 1 A F m = if m = 1 ¬ m 1 A G m 1
133 129 adantl m m = 1 ¬ m 1 A if m = 1 ¬ m 1 A G m 1 =
134 132 133 eqtrd m m = 1 ¬ m 1 A F m =
135 134 ineq2d m m = 1 ¬ m 1 A F n F m = F n
136 in0 F n =
137 135 136 eqtrdi m m = 1 ¬ m 1 A F n F m =
138 137 adantll n m m = 1 ¬ m 1 A F n F m =
139 138 ad5ant25 φ n m n m ¬ n = 1 ¬ n 1 A m = 1 ¬ m 1 A F n F m =
140 fvex G n 1 V
141 7 140 ifex if n = 1 ¬ n 1 A G n 1 V
142 141 113 mpan2 n F n = if n = 1 ¬ n 1 A G n 1
143 142 13 sylan9eq n ¬ n = 1 ¬ n 1 A F n = G n 1
144 143 adantlr n m ¬ n = 1 ¬ n 1 A F n = G n 1
145 144 3adant3 n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A F n = G n 1
146 4 a1i m ¬ m = 1 ¬ m 1 A F = n if n = 1 ¬ n 1 A G n 1
147 127 adantl m ¬ m = 1 ¬ m 1 A n = m if n = 1 ¬ n 1 A G n 1 = if m = 1 ¬ m 1 A G m 1
148 iffalse ¬ m = 1 ¬ m 1 A if m = 1 ¬ m 1 A G m 1 = G m 1
149 148 ad2antlr m ¬ m = 1 ¬ m 1 A n = m if m = 1 ¬ m 1 A G m 1 = G m 1
150 147 149 eqtrd m ¬ m = 1 ¬ m 1 A n = m if n = 1 ¬ n 1 A G n 1 = G m 1
151 simpl m ¬ m = 1 ¬ m 1 A m
152 fvexd m ¬ m = 1 ¬ m 1 A G m 1 V
153 146 150 151 152 fvmptd m ¬ m = 1 ¬ m 1 A F m = G m 1
154 153 adantll n m ¬ m = 1 ¬ m 1 A F m = G m 1
155 154 3adant2 n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A F m = G m 1
156 145 155 ineq12d n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A F n F m = G n 1 G m 1
157 156 ad5ant245 φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A F n F m = G n 1 G m 1
158 19 ad2antlr φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A n 1 A
159 pm2.46 ¬ m = 1 ¬ m 1 A ¬ ¬ m 1 A
160 159 notnotrd ¬ m = 1 ¬ m 1 A m 1 A
161 160 adantl φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A m 1 A
162 f1of1 G : A 1-1 onto X G : A 1-1 X
163 2 162 syl φ G : A 1-1 X
164 dff14a G : A 1-1 X G : A X x A y A x y G x G y
165 163 164 sylib φ G : A X x A y A x y G x G y
166 165 simprd φ x A y A x y G x G y
167 166 adantr φ n m x A y A x y G x G y
168 167 ad3antrrr φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A x A y A x y G x G y
169 158 161 168 jca31 φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A n 1 A m 1 A x A y A x y G x G y
170 nncn n n
171 170 adantr n m n
172 171 ad2antlr φ n m n m n
173 nncn m m
174 173 adantl n m m
175 174 ad2antlr φ n m n m m
176 1cnd φ n m n m 1
177 simpr φ n m n m n m
178 172 175 176 177 subneintr2d φ n m n m n 1 m 1
179 178 ad2antrr φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A n 1 m 1
180 neeq1 x = n 1 x y n 1 y
181 fveq2 x = n 1 G x = G n 1
182 181 neeq1d x = n 1 G x G y G n 1 G y
183 180 182 imbi12d x = n 1 x y G x G y n 1 y G n 1 G y
184 neeq2 y = m 1 n 1 y n 1 m 1
185 fveq2 y = m 1 G y = G m 1
186 185 neeq2d y = m 1 G n 1 G y G n 1 G m 1
187 184 186 imbi12d y = m 1 n 1 y G n 1 G y n 1 m 1 G n 1 G m 1
188 183 187 rspc2va n 1 A m 1 A x A y A x y G x G y n 1 m 1 G n 1 G m 1
189 169 179 188 sylc φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G n 1 G m 1
190 189 neneqd φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A ¬ G n 1 = G m 1
191 21 ad4ant13 φ n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G n 1 X
192 16 ffvelrnda φ m 1 A G m 1 X
193 160 192 sylan2 φ ¬ m = 1 ¬ m 1 A G m 1 X
194 193 ad4ant14 φ n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G m 1 X
195 id y = z y = z
196 195 disjor Disj y X y y X z X y = z y z =
197 3 196 sylib φ y X z X y = z y z =
198 197 ad3antrrr φ n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A y X z X y = z y z =
199 eqeq1 y = G n 1 y = z G n 1 = z
200 ineq1 y = G n 1 y z = G n 1 z
201 200 eqeq1d y = G n 1 y z = G n 1 z =
202 199 201 orbi12d y = G n 1 y = z y z = G n 1 = z G n 1 z =
203 eqeq2 z = G m 1 G n 1 = z G n 1 = G m 1
204 ineq2 z = G m 1 G n 1 z = G n 1 G m 1
205 204 eqeq1d z = G m 1 G n 1 z = G n 1 G m 1 =
206 203 205 orbi12d z = G m 1 G n 1 = z G n 1 z = G n 1 = G m 1 G n 1 G m 1 =
207 202 206 rspc2va G n 1 X G m 1 X y X z X y = z y z = G n 1 = G m 1 G n 1 G m 1 =
208 191 194 198 207 syl21anc φ n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G n 1 = G m 1 G n 1 G m 1 =
209 208 adantllr φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G n 1 = G m 1 G n 1 G m 1 =
210 orel1 ¬ G n 1 = G m 1 G n 1 = G m 1 G n 1 G m 1 = G n 1 G m 1 =
211 190 209 210 sylc φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A G n 1 G m 1 =
212 157 211 eqtrd φ n m n m ¬ n = 1 ¬ n 1 A ¬ m = 1 ¬ m 1 A F n F m =
213 139 212 pm2.61dan φ n m n m ¬ n = 1 ¬ n 1 A F n F m =
214 120 213 pm2.61dan φ n m n m F n F m =
215 214 olcd φ n m n m n = m F n F m =
216 111 215 pm2.61dane φ n m n = m F n F m =
217 216 ralrimivva φ n m n = m F n F m =
218 fveq2 n = m F n = F m
219 218 disjor Disj n F n n m n = m F n F m =
220 217 219 sylibr φ Disj n F n
221 nnex V
222 221 mptex n if n = 1 ¬ n 1 A G n 1 V
223 4 222 eqeltri F V
224 foeq1 f = F f : onto X F : onto X
225 simpl f = F n f = F
226 225 fveq1d f = F n f n = F n
227 226 disjeq2dv f = F Disj n f n Disj n F n
228 224 227 anbi12d f = F f : onto X Disj n f n F : onto X Disj n F n
229 223 228 spcev F : onto X Disj n F n f f : onto X Disj n f n
230 110 220 229 syl2anc φ f f : onto X Disj n f n