:: CARD_1 semantic presentation

Lemma1: for b1, b2 being Ordinal st b1 c= b2 holds
succ b1 c= succ b2
proof end;

definition
let c1 be set ;
attr a1 is cardinal means :Def1: :: CARD_1:def 1
ex b1 being Ordinal st
( a1 = b1 & ( for b2 being Ordinal st b2,b1 are_equipotent holds
b1 c= b2 ) );
end;

:: deftheorem Def1 defines cardinal CARD_1:def 1 :
for b1 being set holds
( b1 is cardinal iff ex b2 being Ordinal st
( b1 = b2 & ( for b3 being Ordinal st b3,b2 are_equipotent holds
b2 c= b3 ) ) );

registration
cluster cardinal set ;
existence
ex b1 being set st b1 is cardinal
proof end;
end;

definition
mode Cardinal is cardinal set ;
end;

registration
cluster cardinal -> ordinal set ;
coherence
for b1 being set st b1 is cardinal holds
b1 is ordinal
proof end;
end;

theorem Th1: :: CARD_1:1
canceled;

theorem Th2: :: CARD_1:2
canceled;

theorem Th3: :: CARD_1:3
canceled;

theorem Th4: :: CARD_1:4
for b1 being set ex b2 being Ordinal st b1,b2 are_equipotent
proof end;

notation
let c1, c2 be Cardinal;
synonym c1 <=` c2 for c1 c= c2;
synonym c1 <` c2 for c1 in c2;
end;

theorem Th5: :: CARD_1:5
canceled;

theorem Th6: :: CARD_1:6
canceled;

theorem Th7: :: CARD_1:7
canceled;

theorem Th8: :: CARD_1:8
for b1, b2 being Cardinal holds
( b1 = b2 iff b1,b2 are_equipotent )
proof end;

theorem Th9: :: CARD_1:9
canceled;

theorem Th10: :: CARD_1:10
canceled;

theorem Th11: :: CARD_1:11
canceled;

theorem Th12: :: CARD_1:12
canceled;

theorem Th13: :: CARD_1:13
for b1, b2 being Cardinal holds
( b1 <` b2 iff ( b1 <=` b2 & b1 <> b2 ) )
proof end;

theorem Th14: :: CARD_1:14
for b1, b2 being Cardinal holds
( b1 <` b2 iff not b2 <=` b1 ) by ORDINAL1:7, ORDINAL1:26;

definition
let c1 be set ;
canceled;
canceled;
canceled;
func Card c1 -> Cardinal means :Def5: :: CARD_1:def 5
a1,a2 are_equipotent ;
existence
ex b1 being Cardinal st c1,b1 are_equipotent
proof end;
uniqueness
for b1, b2 being Cardinal st c1,b1 are_equipotent & c1,b2 are_equipotent holds
b1 = b2
proof end;
end;

:: deftheorem Def2 CARD_1:def 2 :
canceled;

:: deftheorem Def3 CARD_1:def 3 :
canceled;

:: deftheorem Def4 CARD_1:def 4 :
canceled;

:: deftheorem Def5 defines Card CARD_1:def 5 :
for b1 being set
for b2 being Cardinal holds
( b2 = Card b1 iff b1,b2 are_equipotent );

theorem Th15: :: CARD_1:15
canceled;

theorem Th16: :: CARD_1:16
canceled;

theorem Th17: :: CARD_1:17
canceled;

theorem Th18: :: CARD_1:18
canceled;

theorem Th19: :: CARD_1:19
canceled;

theorem Th20: :: CARD_1:20
canceled;

theorem Th21: :: CARD_1:21
for b1, b2 being set holds
( b1,b2 are_equipotent iff Card b1 = Card b2 )
proof end;

theorem Th22: :: CARD_1:22
for b1 being Relation st b1 is well-ordering holds
field b1, order_type_of b1 are_equipotent
proof end;

theorem Th23: :: CARD_1:23
for b1 being set
for b2 being Cardinal st b1 c= b2 holds
Card b1 <=` b2
proof end;

theorem Th24: :: CARD_1:24
for b1 being Ordinal holds Card b1 c= b1
proof end;

theorem Th25: :: CARD_1:25
for b1 being set
for b2 being Cardinal st b1 in b2 holds
Card b1 <` b2
proof end;

theorem Th26: :: CARD_1:26
for b1, b2 being set holds
( Card b1 <=` Card b2 iff ex b3 being Function st
( b3 is one-to-one & dom b3 = b1 & rng b3 c= b2 ) )
proof end;

theorem Th27: :: CARD_1:27
for b1, b2 being set st b1 c= b2 holds
Card b1 <=` Card b2
proof end;

theorem Th28: :: CARD_1:28
for b1, b2 being set holds
( Card b1 <=` Card b2 iff ex b3 being Function st
( dom b3 = b2 & b1 c= rng b3 ) )
proof end;

theorem Th29: :: CARD_1:29
for b1 being set holds not b1, bool b1 are_equipotent
proof end;

theorem Th30: :: CARD_1:30
for b1 being set holds Card b1 <` Card (bool b1)
proof end;

definition
let c1 be set ;
func nextcard c1 -> Cardinal means :Def6: :: CARD_1:def 6
( Card a1 <` a2 & ( for b1 being Cardinal st Card a1 <` b1 holds
a2 <=` b1 ) );
existence
ex b1 being Cardinal st
( Card c1 <` b1 & ( for b2 being Cardinal st Card c1 <` b2 holds
b1 <=` b2 ) )
proof end;
uniqueness
for b1, b2 being Cardinal st Card c1 <` b1 & ( for b3 being Cardinal st Card c1 <` b3 holds
b1 <=` b3 ) & Card c1 <` b2 & ( for b3 being Cardinal st Card c1 <` b3 holds
b2 <=` b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines nextcard CARD_1:def 6 :
for b1 being set
for b2 being Cardinal holds
( b2 = nextcard b1 iff ( Card b1 <` b2 & ( for b3 being Cardinal st Card b1 <` b3 holds
b2 <=` b3 ) ) );

theorem Th31: :: CARD_1:31
canceled;

theorem Th32: :: CARD_1:32
for b1 being Cardinal holds b1 <` nextcard b1
proof end;

theorem Th33: :: CARD_1:33
for b1 being set holds Card {} <` nextcard b1
proof end;

theorem Th34: :: CARD_1:34
for b1, b2 being set st Card b1 = Card b2 holds
nextcard b1 = nextcard b2
proof end;

theorem Th35: :: CARD_1:35
for b1, b2 being set st b1,b2 are_equipotent holds
nextcard b1 = nextcard b2
proof end;

theorem Th36: :: CARD_1:36
for b1 being Ordinal holds b1 in nextcard b1
proof end;

definition
let c1 be Cardinal;
attr a1 is limit means :Def7: :: CARD_1:def 7
for b1 being Cardinal holds not a1 = nextcard b1;
end;

:: deftheorem Def7 defines limit CARD_1:def 7 :
for b1 being Cardinal holds
( b1 is limit iff for b2 being Cardinal holds not b1 = nextcard b2 );

notation
let c1 be Cardinal;
synonym c1 is_limit_cardinal for limit c1;
end;

definition
let c1 be Ordinal;
func alef c1 -> set means :Def8: :: CARD_1:def 8
ex b1 being T-Sequence st
( a2 = last b1 & dom b1 = succ a1 & b1 . {} = Card NAT & ( for b2 being Ordinal st succ b2 in succ a1 holds
b1 . (succ b2) = nextcard (union {(b1 . b2)}) ) & ( for b2 being Ordinal st b2 in succ a1 & b2 <> {} & b2 is_limit_ordinal holds
b1 . b2 = Card (sup (b1 | b2)) ) );
correctness
existence
ex b1 being set ex b2 being T-Sequence st
( b1 = last b2 & dom b2 = succ c1 & b2 . {} = Card NAT & ( for b3 being Ordinal st succ b3 in succ c1 holds
b2 . (succ b3) = nextcard (union {(b2 . b3)}) ) & ( for b3 being Ordinal st b3 in succ c1 & b3 <> {} & b3 is_limit_ordinal holds
b2 . b3 = Card (sup (b2 | b3)) ) )
;
uniqueness
for b1, b2 being set st ex b3 being T-Sequence st
( b1 = last b3 & dom b3 = succ c1 & b3 . {} = Card NAT & ( for b4 being Ordinal st succ b4 in succ c1 holds
b3 . (succ b4) = nextcard (union {(b3 . b4)}) ) & ( for b4 being Ordinal st b4 in succ c1 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = Card (sup (b3 | b4)) ) ) & ex b3 being T-Sequence st
( b2 = last b3 & dom b3 = succ c1 & b3 . {} = Card NAT & ( for b4 being Ordinal st succ b4 in succ c1 holds
b3 . (succ b4) = nextcard (union {(b3 . b4)}) ) & ( for b4 being Ordinal st b4 in succ c1 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = Card (sup (b3 | b4)) ) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def8 defines alef CARD_1:def 8 :
for b1 being Ordinal
for b2 being set holds
( b2 = alef b1 iff ex b3 being T-Sequence st
( b2 = last b3 & dom b3 = succ b1 & b3 . {} = Card NAT & ( for b4 being Ordinal st succ b4 in succ b1 holds
b3 . (succ b4) = nextcard (union {(b3 . b4)}) ) & ( for b4 being Ordinal st b4 in succ b1 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = Card (sup (b3 | b4)) ) ) );

E20: now
deffunc H1( Ordinal) -> set = alef a1;
deffunc H2( Ordinal, set ) -> Cardinal = nextcard (union {a2});
deffunc H3( Ordinal, T-Sequence) -> Cardinal = Card (sup a2);
E21: for b1 being Ordinal
for b2 being set holds
( b2 = H1(b1) iff ex b3 being T-Sequence st
( b2 = last b3 & dom b3 = succ b1 & b3 . {} = Card NAT & ( for b4 being Ordinal st succ b4 in succ b1 holds
b3 . (succ b4) = H2(b4,b3 . b4) ) & ( for b4 being Ordinal st b4 in succ b1 & b4 <> {} & b4 is_limit_ordinal holds
b3 . b4 = H3(b4,b3 | b4) ) ) ) by Def8;
H1( {} ) = Card NAT from ORDINAL2:sch 8(E21);
hence alef 0 = Card NAT ;
thus for b1 being Ordinal holds H1( succ b1) = H2(b1,H1(b1)) from ORDINAL2:sch 9(E21);
thus for b1 being Ordinal st b1 <> {} & b1 is_limit_ordinal holds
for b2 being T-Sequence st dom b2 = b1 & ( for b3 being Ordinal st b3 in b1 holds
b2 . b3 = alef b3 ) holds
alef b1 = Card (sup b2)
proof
let c1 be Ordinal;
assume E22: ( c1 <> {} & c1 is_limit_ordinal ) ;
let c2 be T-Sequence;
assume that
E23: dom c2 = c1 and
E24: for b1 being Ordinal st b1 in c1 holds
c2 . b1 = H1(b1) ;
thus H1(c1) = H3(c1,c2) from ORDINAL2:sch 10(E21, E22, E23, E24);
end;
end;

deffunc H1( Ordinal) -> set = alef a1;

registration
let c1 be Ordinal;
cluster alef a1 -> ordinal cardinal ;
coherence
alef c1 is cardinal
proof end;
end;

theorem Th37: :: CARD_1:37
canceled;

theorem Th38: :: CARD_1:38
alef 0 = Card NAT by Lemma20;

theorem Th39: :: CARD_1:39
for b1 being Ordinal holds alef (succ b1) = nextcard (alef b1)
proof end;

theorem Th40: :: CARD_1:40
for b1 being Ordinal st b1 <> {} & b1 is_limit_ordinal holds
for b2 being T-Sequence st dom b2 = b1 & ( for b3 being Ordinal st b3 in b1 holds
b2 . b3 = alef b3 ) holds
alef b1 = Card (sup b2) by Lemma20;

theorem Th41: :: CARD_1:41
for b1, b2 being Ordinal holds
( b1 in b2 iff alef b1 <` alef b2 )
proof end;

theorem Th42: :: CARD_1:42
for b1, b2 being Ordinal st alef b1 = alef b2 holds
b1 = b2
proof end;

theorem Th43: :: CARD_1:43
for b1, b2 being Ordinal holds
( b1 c= b2 iff alef b1 <=` alef b2 )
proof end;

theorem Th44: :: CARD_1:44
for b1, b2, b3 being set st b1 c= b2 & b2 c= b3 & b1,b3 are_equipotent holds
( b1,b2 are_equipotent & b2,b3 are_equipotent )
proof end;

theorem Th45: :: CARD_1:45
for b1, b2 being set st bool b1 c= b2 holds
( Card b1 <` Card b2 & not b1,b2 are_equipotent )
proof end;

theorem Th46: :: CARD_1:46
for b1 being set holds
( b1, {} are_equipotent iff b1 = {} )
proof end;

theorem Th47: :: CARD_1:47
Card {} = {}
proof end;

theorem Th48: :: CARD_1:48
for b1, b2 being set holds
( b1,{b2} are_equipotent iff ex b3 being set st b1 = {b3} )
proof end;

theorem Th49: :: CARD_1:49
for b1, b2 being set holds
( Card b1 = Card {b2} iff ex b3 being set st b1 = {b3} )
proof end;

theorem Th50: :: CARD_1:50
for b1 being set holds Card {b1} = one
proof end;

theorem Th51: :: CARD_1:51
0 = {} ;

theorem Th52: :: CARD_1:52
for b1 being Nat holds succ b1 = b1 + 1
proof end;

theorem Th53: :: CARD_1:53
canceled;

theorem Th54: :: CARD_1:54
canceled;

theorem Th55: :: CARD_1:55
canceled;

theorem Th56: :: CARD_1:56
for b1, b2 being Nat holds
( b1 <= b2 iff b1 c= b2 )
proof end;

theorem Th57: :: CARD_1:57
canceled;

theorem Th58: :: CARD_1:58
for b1, b2, b3, b4 being set st b1 misses b2 & b3 misses b4 & b1,b3 are_equipotent & b2,b4 are_equipotent holds
b1 \/ b2,b3 \/ b4 are_equipotent
proof end;

theorem Th59: :: CARD_1:59
for b1, b2, b3 being set st b1 in b2 & b3 in b2 holds
b2 \ {b1},b2 \ {b3} are_equipotent
proof end;

theorem Th60: :: CARD_1:60
for b1 being set
for b2 being Function st b1 c= dom b2 & b2 is one-to-one holds
b1,b2 .: b1 are_equipotent
proof end;

theorem Th61: :: CARD_1:61
for b1, b2, b3, b4 being set st b1,b2 are_equipotent & b3 in b1 & b4 in b2 holds
b1 \ {b3},b2 \ {b4} are_equipotent
proof end;

theorem Th62: :: CARD_1:62
canceled;

theorem Th63: :: CARD_1:63
canceled;

theorem Th64: :: CARD_1:64
for b1, b2 being Nat st b1,b2 are_equipotent holds
b1 = b2
proof end;

theorem Th65: :: CARD_1:65
for b1 being set st b1 in omega holds
b1 is cardinal
proof end;

registration
cluster -> ordinal cardinal Element of NAT ;
correctness
coherence
for b1 being Nat holds b1 is cardinal
;
by Th65;
end;

theorem Th66: :: CARD_1:66
for b1 being Nat holds b1 = Card b1 by Def5;

theorem Th67: :: CARD_1:67
canceled;

theorem Th68: :: CARD_1:68
for b1, b2 being set st b1,b2 are_equipotent & b1 is finite holds
b2 is finite
proof end;

theorem Th69: :: CARD_1:69
for b1 being Nat holds
( b1 is finite & Card b1 is finite )
proof end;

theorem Th70: :: CARD_1:70
canceled;

theorem Th71: :: CARD_1:71
for b1, b2 being Nat st Card b1 = Card b2 holds
b1 = b2
proof end;

theorem Th72: :: CARD_1:72
for b1, b2 being Nat holds
( Card b1 <=` Card b2 iff b1 <= b2 )
proof end;

theorem Th73: :: CARD_1:73
for b1, b2 being Nat holds
( Card b1 <` Card b2 iff b1 < b2 )
proof end;

theorem Th74: :: CARD_1:74
for b1 being set st b1 is finite holds
ex b2 being Nat st b1,b2 are_equipotent
proof end;

theorem Th75: :: CARD_1:75
canceled;

theorem Th76: :: CARD_1:76
for b1 being Nat holds nextcard (Card b1) = Card (b1 + 1)
proof end;

notation
let c1 be finite set ;
synonym card c1 for Card c1;
end;

definition
let c1 be finite set ;
canceled;
canceled;
redefine func Card as card c1 -> Nat means :: CARD_1:def 11
Card a2 = Card a1;
coherence
Card c1 is Nat
proof end;
compatibility
for b1 being Nat holds
( b1 = Card c1 iff Card b1 = Card c1 )
by Def5;
end;

:: deftheorem Def9 CARD_1:def 9 :
canceled;

:: deftheorem Def10 CARD_1:def 10 :
canceled;

:: deftheorem Def11 defines card CARD_1:def 11 :
for b1 being finite set
for b2 being Nat holds
( b2 = card b1 iff Card b2 = Card b1 );

theorem Th77: :: CARD_1:77
canceled;

theorem Th78: :: CARD_1:78
card {} = 0 by Def5;

theorem Th79: :: CARD_1:79
for b1 being set holds card {b1} = 1
proof end;

theorem Th80: :: CARD_1:80
for b1, b2 being finite set st b1 c= b2 holds
card b1 <= card b2
proof end;

theorem Th81: :: CARD_1:81
for b1, b2 being finite set st b1,b2 are_equipotent holds
card b1 = card b2 by Th21;

theorem Th82: :: CARD_1:82
for b1 being set st b1 is finite holds
nextcard b1 is finite
proof end;

scheme :: CARD_1:sch 1
s1{ P1[ set ] } :
for b1 being Cardinal holds P1[b1]
provided
E42: P1[ {} ] and
E43: for b1 being Cardinal st P1[b1] holds
P1[ nextcard b1] and
E44: for b1 being Cardinal st b1 <> {} & b1 is_limit_cardinal & ( for b2 being Cardinal st b2 <` b1 holds
P1[b2] ) holds
P1[b1]
proof end;

scheme :: CARD_1:sch 2
s2{ P1[ set ] } :
for b1 being Cardinal holds P1[b1]
provided
E42: for b1 being Cardinal st ( for b2 being Cardinal st b2 <` b1 holds
P1[b2] ) holds
P1[b1]
proof end;

theorem Th83: :: CARD_1:83
alef 0 = omega
proof end;

theorem Th84: :: CARD_1:84
Card omega = omega by Lemma20, Th83;

theorem Th85: :: CARD_1:85
Card omega is_limit_cardinal
proof end;

registration
cluster -> ordinal finite cardinal Element of NAT ;
coherence
for b1 being Nat holds b1 is finite
by Th69;
end;

registration
cluster ordinal finite set ;
existence
ex b1 being Cardinal st b1 is finite
proof end;
end;

theorem Th86: :: CARD_1:86
for b1 being finite Cardinal ex b2 being Nat st b1 = Card b2
proof end;

registration
let c1 be finite set ;
cluster Card a1 -> ordinal finite ;
coherence
card c1 is finite
;
end;