:: CARD_3 semantic presentation

definition
let c1 be Function;
attr a1 is Cardinal-yielding means :Def1: :: CARD_3:def 1
for b1 being set st b1 in dom a1 holds
a1 . b1 is Cardinal;
end;

:: deftheorem Def1 defines Cardinal-yielding CARD_3:def 1 :
for b1 being Function holds
( b1 is Cardinal-yielding iff for b2 being set st b2 in dom b1 holds
b1 . b2 is Cardinal );

registration
cluster Cardinal-yielding set ;
existence
ex b1 being Function st b1 is Cardinal-yielding
proof end;
end;

definition
mode Cardinal-Function is Cardinal-yielding Function;
end;

registration
let c1 be Cardinal-Function;
let c2 be set ;
cluster a1 | a2 -> Cardinal-yielding ;
coherence
c1 | c2 is Cardinal-yielding
proof end;
end;

registration
let c1 be set ;
let c2 be Cardinal;
cluster a1 --> a2 -> Cardinal-yielding ;
coherence
c1 --> c2 is Cardinal-yielding
proof end;
end;

theorem Th1: :: CARD_3:1
canceled;

theorem Th2: :: CARD_3:2
canceled;

theorem Th3: :: CARD_3:3
{} is Cardinal-Function
proof end;

scheme :: CARD_3:sch 1
s1{ F1() -> set , F2( set ) -> Cardinal } :
ex b1 being Cardinal-Function st
( dom b1 = F1() & ( for b2 being set st b2 in F1() holds
b1 . b2 = F2(b2) ) )
proof end;

definition
let c1 be Function;
func Card c1 -> Cardinal-Function means :Def2: :: CARD_3:def 2
( dom a2 = dom a1 & ( for b1 being set st b1 in dom a1 holds
a2 . b1 = Card (a1 . b1) ) );
existence
ex b1 being Cardinal-Function st
( dom b1 = dom c1 & ( for b2 being set st b2 in dom c1 holds
b1 . b2 = Card (c1 . b2) ) )
proof end;
uniqueness
for b1, b2 being Cardinal-Function st dom b1 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b1 . b3 = Card (c1 . b3) ) & dom b2 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b2 . b3 = Card (c1 . b3) ) holds
b1 = b2
proof end;
func disjoin c1 -> Function means :Def3: :: CARD_3:def 3
( dom a2 = dom a1 & ( for b1 being set st b1 in dom a1 holds
a2 . b1 = [:(a1 . b1),{b1}:] ) );
existence
ex b1 being Function st
( dom b1 = dom c1 & ( for b2 being set st b2 in dom c1 holds
b1 . b2 = [:(c1 . b2),{b2}:] ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b1 . b3 = [:(c1 . b3),{b3}:] ) & dom b2 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b2 . b3 = [:(c1 . b3),{b3}:] ) holds
b1 = b2
proof end;
func Union c1 -> set equals :: CARD_3:def 4
union (rng a1);
correctness
coherence
union (rng c1) is set
;
;
defpred S1[ set ] means ex b1 being Function st
( a1 = b1 & dom b1 = dom c1 & ( for b2 being set st b2 in dom c1 holds
b1 . b2 in c1 . b2 ) );
func product c1 -> set means :Def5: :: CARD_3:def 5
for b1 being set holds
( b1 in a2 iff ex b2 being Function st
( b1 = b2 & dom b2 = dom a1 & ( for b3 being set st b3 in dom a1 holds
b2 . b3 in a1 . b3 ) ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being Function st
( b2 = b3 & dom b3 = dom c1 & ( for b4 being set st b4 in dom c1 holds
b3 . b4 in c1 . b4 ) ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being Function st
( b3 = b4 & dom b4 = dom c1 & ( for b5 being set st b5 in dom c1 holds
b4 . b5 in c1 . b5 ) ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being Function st
( b3 = b4 & dom b4 = dom c1 & ( for b5 being set st b5 in dom c1 holds
b4 . b5 in c1 . b5 ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines Card CARD_3:def 2 :
for b1 being Function
for b2 being Cardinal-Function holds
( b2 = Card b1 iff ( dom b2 = dom b1 & ( for b3 being set st b3 in dom b1 holds
b2 . b3 = Card (b1 . b3) ) ) );

:: deftheorem Def3 defines disjoin CARD_3:def 3 :
for b1, b2 being Function holds
( b2 = disjoin b1 iff ( dom b2 = dom b1 & ( for b3 being set st b3 in dom b1 holds
b2 . b3 = [:(b1 . b3),{b3}:] ) ) );

:: deftheorem Def4 defines Union CARD_3:def 4 :
for b1 being Function holds Union b1 = union (rng b1);

:: deftheorem Def5 defines product CARD_3:def 5 :
for b1 being Function
for b2 being set holds
( b2 = product b1 iff for b3 being set holds
( b3 in b2 iff ex b4 being Function st
( b3 = b4 & dom b4 = dom b1 & ( for b5 being set st b5 in dom b1 holds
b4 . b5 in b1 . b5 ) ) ) );

theorem Th4: :: CARD_3:4
canceled;

theorem Th5: :: CARD_3:5
canceled;

theorem Th6: :: CARD_3:6
canceled;

theorem Th7: :: CARD_3:7
canceled;

theorem Th8: :: CARD_3:8
for b1 being Cardinal-Function holds Card b1 = b1
proof end;

theorem Th9: :: CARD_3:9
Card {} = {}
proof end;

theorem Th10: :: CARD_3:10
for b1, b2 being set holds Card (b1 --> b2) = b1 --> (Card b2)
proof end;

theorem Th11: :: CARD_3:11
disjoin {} = {}
proof end;

theorem Th12: :: CARD_3:12
for b1, b2 being set holds disjoin ({b1} --> b2) = {b1} --> [:b2,{b1}:]
proof end;

theorem Th13: :: CARD_3:13
for b1, b2 being set
for b3 being Function st b1 in dom b3 & b2 in dom b3 & b1 <> b2 holds
(disjoin b3) . b1 misses (disjoin b3) . b2
proof end;

theorem Th14: :: CARD_3:14
Union {} = {} by ZFMISC_1:2;

theorem Th15: :: CARD_3:15
for b1, b2 being set holds Union (b1 --> b2) c= b2
proof end;

theorem Th16: :: CARD_3:16
for b1, b2 being set st b1 <> {} holds
Union (b1 --> b2) = b2
proof end;

theorem Th17: :: CARD_3:17
for b1, b2 being set holds Union ({b1} --> b2) = b2 by Th16;

theorem Th18: :: CARD_3:18
for b1, b2 being Function holds
( b1 in product b2 iff ( dom b1 = dom b2 & ( for b3 being set st b3 in dom b2 holds
b1 . b3 in b2 . b3 ) ) )
proof end;

theorem Th19: :: CARD_3:19
product {} = {{} }
proof end;

theorem Th20: :: CARD_3:20
for b1, b2 being set holds Funcs b1,b2 = product (b1 --> b2)
proof end;

defpred S1[ set ] means a1 is Function;

definition
let c1, c2 be set ;
defpred S2[ set , set ] means ex b1 being Function st
( a1 = b1 & a2 = b1 . c1 );
func pi c2,c1 -> set means :Def6: :: CARD_3:def 6
for b1 being set holds
( b1 in a3 iff ex b2 being Function st
( b2 in a2 & b1 = b2 . a1 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being Function st
( b3 in c2 & b2 = b3 . c1 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being Function st
( b4 in c2 & b3 = b4 . c1 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being Function st
( b4 in c2 & b3 = b4 . c1 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines pi CARD_3:def 6 :
for b1, b2, b3 being set holds
( b3 = pi b2,b1 iff for b4 being set holds
( b4 in b3 iff ex b5 being Function st
( b5 in b2 & b4 = b5 . b1 ) ) );

theorem Th21: :: CARD_3:21
canceled;

theorem Th22: :: CARD_3:22
for b1 being set
for b2 being Function st b1 in dom b2 & product b2 <> {} holds
pi (product b2),b1 = b2 . b1
proof end;

theorem Th23: :: CARD_3:23
canceled;

theorem Th24: :: CARD_3:24
for b1 being set holds pi {} ,b1 = {}
proof end;

theorem Th25: :: CARD_3:25
for b1 being set
for b2 being Function holds pi {b2},b1 = {(b2 . b1)}
proof end;

theorem Th26: :: CARD_3:26
for b1 being set
for b2, b3 being Function holds pi {b2,b3},b1 = {(b2 . b1),(b3 . b1)}
proof end;

theorem Th27: :: CARD_3:27
for b1, b2, b3 being set holds pi (b1 \/ b2),b3 = (pi b1,b3) \/ (pi b2,b3)
proof end;

theorem Th28: :: CARD_3:28
for b1, b2, b3 being set holds pi (b1 /\ b2),b3 c= (pi b1,b3) /\ (pi b2,b3)
proof end;

theorem Th29: :: CARD_3:29
for b1, b2, b3 being set holds (pi b1,b2) \ (pi b3,b2) c= pi (b1 \ b3),b2
proof end;

theorem Th30: :: CARD_3:30
for b1, b2, b3 being set holds (pi b1,b2) \+\ (pi b3,b2) c= pi (b1 \+\ b3),b2
proof end;

theorem Th31: :: CARD_3:31
for b1, b2 being set holds Card (pi b1,b2) <=` Card b1
proof end;

theorem Th32: :: CARD_3:32
for b1 being set
for b2 being Function st b1 in Union (disjoin b2) holds
ex b3, b4 being set st b1 = [b3,b4]
proof end;

theorem Th33: :: CARD_3:33
for b1 being set
for b2 being Function holds
( b1 in Union (disjoin b2) iff ( b1 `2 in dom b2 & b1 `1 in b2 . (b1 `2 ) & b1 = [(b1 `1 ),(b1 `2 )] ) )
proof end;

theorem Th34: :: CARD_3:34
for b1, b2 being Function st b1 <= b2 holds
disjoin b1 <= disjoin b2
proof end;

theorem Th35: :: CARD_3:35
for b1, b2 being Function st b1 <= b2 holds
Union b1 c= Union b2
proof end;

theorem Th36: :: CARD_3:36
for b1, b2 being set holds Union (disjoin (b1 --> b2)) = [:b2,b1:]
proof end;

theorem Th37: :: CARD_3:37
for b1 being Function holds
( product b1 = {} iff {} in rng b1 )
proof end;

theorem Th38: :: CARD_3:38
for b1, b2 being Function st dom b1 = dom b2 & ( for b3 being set st b3 in dom b1 holds
b1 . b3 c= b2 . b3 ) holds
product b1 c= product b2
proof end;

theorem Th39: :: CARD_3:39
for b1 being Cardinal-Function
for b2 being set st b2 in dom b1 holds
Card (b1 . b2) = b1 . b2
proof end;

theorem Th40: :: CARD_3:40
for b1 being Cardinal-Function
for b2 being set st b2 in dom b1 holds
Card ((disjoin b1) . b2) = b1 . b2
proof end;

definition
let c1 be Cardinal-Function;
func Sum c1 -> Cardinal equals :: CARD_3:def 7
Card (Union (disjoin a1));
correctness
coherence
Card (Union (disjoin c1)) is Cardinal
;
;
func Product c1 -> Cardinal equals :: CARD_3:def 8
Card (product a1);
correctness
coherence
Card (product c1) is Cardinal
;
;
end;

:: deftheorem Def7 defines Sum CARD_3:def 7 :
for b1 being Cardinal-Function holds Sum b1 = Card (Union (disjoin b1));

:: deftheorem Def8 defines Product CARD_3:def 8 :
for b1 being Cardinal-Function holds Product b1 = Card (product b1);

theorem Th41: :: CARD_3:41
canceled;

theorem Th42: :: CARD_3:42
canceled;

theorem Th43: :: CARD_3:43
for b1, b2 being Cardinal-Function st dom b1 = dom b2 & ( for b3 being set st b3 in dom b1 holds
b1 . b3 c= b2 . b3 ) holds
Sum b1 <=` Sum b2
proof end;

theorem Th44: :: CARD_3:44
for b1 being Cardinal-Function holds
( {} in rng b1 iff Product b1 = 0 )
proof end;

theorem Th45: :: CARD_3:45
for b1, b2 being Cardinal-Function st dom b1 = dom b2 & ( for b3 being set st b3 in dom b1 holds
b1 . b3 c= b2 . b3 ) holds
Product b1 <=` Product b2
proof end;

theorem Th46: :: CARD_3:46
for b1, b2 being Cardinal-Function st b1 <= b2 holds
Sum b1 <=` Sum b2
proof end;

theorem Th47: :: CARD_3:47
for b1, b2 being Cardinal-Function st b1 <= b2 & not 0 in rng b2 holds
Product b1 <=` Product b2
proof end;

theorem Th48: :: CARD_3:48
for b1 being Cardinal holds Sum ({} --> b1) = 0
proof end;

theorem Th49: :: CARD_3:49
for b1 being Cardinal holds Product ({} --> b1) = 1 by Th19, CARD_1:50, CARD_2:20;

theorem Th50: :: CARD_3:50
for b1 being Cardinal
for b2 being set holds Sum ({b2} --> b1) = b1
proof end;

theorem Th51: :: CARD_3:51
for b1 being Cardinal
for b2 being set holds Product ({b2} --> b1) = b1
proof end;

theorem Th52: :: CARD_3:52
for b1, b2 being Cardinal holds Sum (b1 --> b2) = b1 *` b2
proof end;

theorem Th53: :: CARD_3:53
for b1, b2 being Cardinal holds Product (b1 --> b2) = exp b2,b1
proof end;

theorem Th54: :: CARD_3:54
for b1 being Function holds Card (Union b1) <=` Sum (Card b1)
proof end;

theorem Th55: :: CARD_3:55
for b1 being Cardinal-Function holds Card (Union b1) <=` Sum b1
proof end;

theorem Th56: :: CARD_3:56
for b1, b2 being Cardinal-Function st dom b1 = dom b2 & ( for b3 being set st b3 in dom b1 holds
b1 . b3 in b2 . b3 ) holds
Sum b1 <` Product b2
proof end;

scheme :: CARD_3:sch 2
s2{ F1() -> finite set , P1[ set , set ] } :
ex b1 being set st
( b1 in F1() & ( for b2 being set st b2 in F1() & b2 <> b1 holds
not P1[b2,b1] ) )
provided
E25: F1() <> {} and
E26: for b1, b2 being set st P1[b1,b2] & P1[b2,b1] holds
b1 = b2 and
E27: for b1, b2, b3 being set st P1[b1,b2] & P1[b2,b3] holds
P1[b1,b3]
proof end;

scheme :: CARD_3:sch 3
s3{ F1() -> finite set , P1[ set , set ] } :
ex b1 being set st
( b1 in F1() & ( for b2 being set st b2 in F1() holds
P1[b1,b2] ) )
provided
E25: F1() <> {} and
E26: for b1, b2 being set holds
( P1[b1,b2] or P1[b2,b1] ) and
E27: for b1, b2, b3 being set st P1[b1,b2] & P1[b2,b3] holds
P1[b1,b3]
proof end;

scheme :: CARD_3:sch 4
s4{ F1() -> set , F2( set ) -> set , P1[ set , set ] } :
ex b1 being Function st
( dom b1 = F1() & ( for b2 being set st b2 in F1() holds
for b3 being set holds
( b3 in b1 . b2 iff ( b3 in F2(b2) & P1[b2,b3] ) ) ) )
proof end;

Lemma25: for b1 being Nat st Rank b1 is finite holds
Rank (b1 + 1) is finite
proof end;

theorem Th57: :: CARD_3:57
for b1 being Nat holds Rank b1 is finite
proof end;

Lemma26: for b1 being set
for b2 being Relation st b1 in field b2 holds
ex b3 being set st
( [b1,b3] in b2 or [b3,b1] in b2 )
proof end;

theorem Th58: :: CARD_3:58
for b1 being set st b1 is finite holds
Card b1 <` Card omega
proof end;

theorem Th59: :: CARD_3:59
for b1, b2 being Ordinal st Card b1 <` Card b2 holds
b1 in b2
proof end;

theorem Th60: :: CARD_3:60
for b1 being Ordinal
for b2 being Cardinal st Card b1 <` b2 holds
b1 in b2
proof end;

theorem Th61: :: CARD_3:61
for b1 being set st b1 is c=-linear holds
ex b2 being set st
( b2 c= b1 & union b2 = union b1 & ( for b3 being set st b3 c= b2 & b3 <> {} holds
ex b4 being set st
( b4 in b3 & ( for b5 being set st b5 in b3 holds
b4 c= b5 ) ) ) )
proof end;

theorem Th62: :: CARD_3:62
for b1 being Cardinal
for b2 being set st ( for b3 being set st b3 in b2 holds
Card b3 <` b1 ) & b2 is c=-linear holds
Card (union b2) <=` b1
proof end;

registration
let c1 be Function;
cluster product a1 -> functional ;
coherence
product c1 is functional
proof end;
end;

registration
let c1 be set ;
let c2 be with_non-empty_elements set ;
let c3 be Function of c1,c2;
cluster product a3 -> non empty functional ;
coherence
not product c3 is empty
proof end;
end;

registration
let c1 be non-empty Function;
cluster product a1 -> non empty functional ;
coherence
( product c1 is functional & not product c1 is empty )
proof end;
end;