Metamath Proof Explorer


Theorem fzennn

Description: The cardinality of a finite set of sequential integers. (See om2uz0i for a description of the hypothesis.) (Contributed by Mario Carneiro, 12-Feb-2013) (Revised by Mario Carneiro, 7-Mar-2014)

Ref Expression
Hypothesis fzennn.1 G = rec x V x + 1 0 ω
Assertion fzennn N 0 1 N G -1 N

Proof

Step Hyp Ref Expression
1 fzennn.1 G = rec x V x + 1 0 ω
2 oveq2 n = 0 1 n = 1 0
3 fveq2 n = 0 G -1 n = G -1 0
4 2 3 breq12d n = 0 1 n G -1 n 1 0 G -1 0
5 oveq2 n = m 1 n = 1 m
6 fveq2 n = m G -1 n = G -1 m
7 5 6 breq12d n = m 1 n G -1 n 1 m G -1 m
8 oveq2 n = m + 1 1 n = 1 m + 1
9 fveq2 n = m + 1 G -1 n = G -1 m + 1
10 8 9 breq12d n = m + 1 1 n G -1 n 1 m + 1 G -1 m + 1
11 oveq2 n = N 1 n = 1 N
12 fveq2 n = N G -1 n = G -1 N
13 11 12 breq12d n = N 1 n G -1 n 1 N G -1 N
14 0ex V
15 14 enref
16 fz10 1 0 =
17 0z 0
18 17 1 om2uzf1oi G : ω 1-1 onto 0
19 peano1 ω
20 18 19 pm3.2i G : ω 1-1 onto 0 ω
21 17 1 om2uz0i G = 0
22 f1ocnvfv G : ω 1-1 onto 0 ω G = 0 G -1 0 =
23 20 21 22 mp2 G -1 0 =
24 15 16 23 3brtr4i 1 0 G -1 0
25 simpr m 0 1 m G -1 m 1 m G -1 m
26 ovex m + 1 V
27 fvex G -1 m V
28 en2sn m + 1 V G -1 m V m + 1 G -1 m
29 26 27 28 mp2an m + 1 G -1 m
30 29 a1i m 0 1 m G -1 m m + 1 G -1 m
31 fzp1disj 1 m m + 1 =
32 31 a1i m 0 1 m G -1 m 1 m m + 1 =
33 f1ocnvdm G : ω 1-1 onto 0 m 0 G -1 m ω
34 18 33 mpan m 0 G -1 m ω
35 nn0uz 0 = 0
36 34 35 eleq2s m 0 G -1 m ω
37 nnord G -1 m ω Ord G -1 m
38 ordirr Ord G -1 m ¬ G -1 m G -1 m
39 36 37 38 3syl m 0 ¬ G -1 m G -1 m
40 39 adantr m 0 1 m G -1 m ¬ G -1 m G -1 m
41 disjsn G -1 m G -1 m = ¬ G -1 m G -1 m
42 40 41 sylibr m 0 1 m G -1 m G -1 m G -1 m =
43 unen 1 m G -1 m m + 1 G -1 m 1 m m + 1 = G -1 m G -1 m = 1 m m + 1 G -1 m G -1 m
44 25 30 32 42 43 syl22anc m 0 1 m G -1 m 1 m m + 1 G -1 m G -1 m
45 1z 1
46 1m1e0 1 1 = 0
47 46 fveq2i 1 1 = 0
48 35 47 eqtr4i 0 = 1 1
49 48 eleq2i m 0 m 1 1
50 49 biimpi m 0 m 1 1
51 fzsuc2 1 m 1 1 1 m + 1 = 1 m m + 1
52 45 50 51 sylancr m 0 1 m + 1 = 1 m m + 1
53 52 adantr m 0 1 m G -1 m 1 m + 1 = 1 m m + 1
54 peano2 G -1 m ω suc G -1 m ω
55 36 54 syl m 0 suc G -1 m ω
56 55 18 jctil m 0 G : ω 1-1 onto 0 suc G -1 m ω
57 17 1 om2uzsuci G -1 m ω G suc G -1 m = G G -1 m + 1
58 36 57 syl m 0 G suc G -1 m = G G -1 m + 1
59 35 eleq2i m 0 m 0
60 59 biimpi m 0 m 0
61 f1ocnvfv2 G : ω 1-1 onto 0 m 0 G G -1 m = m
62 18 60 61 sylancr m 0 G G -1 m = m
63 62 oveq1d m 0 G G -1 m + 1 = m + 1
64 58 63 eqtrd m 0 G suc G -1 m = m + 1
65 f1ocnvfv G : ω 1-1 onto 0 suc G -1 m ω G suc G -1 m = m + 1 G -1 m + 1 = suc G -1 m
66 56 64 65 sylc m 0 G -1 m + 1 = suc G -1 m
67 66 adantr m 0 1 m G -1 m G -1 m + 1 = suc G -1 m
68 df-suc suc G -1 m = G -1 m G -1 m
69 67 68 eqtrdi m 0 1 m G -1 m G -1 m + 1 = G -1 m G -1 m
70 44 53 69 3brtr4d m 0 1 m G -1 m 1 m + 1 G -1 m + 1
71 70 ex m 0 1 m G -1 m 1 m + 1 G -1 m + 1
72 4 7 10 13 24 71 nn0ind N 0 1 N G -1 N