:: HALLMAR1 semantic presentation

theorem Th1: :: HALLMAR1:1
for b1, b2 being finite set holds (card (b1 \/ b2)) + (card (b1 /\ b2)) = (card b1) + (card b2)
proof end;

scheme :: HALLMAR1:sch 1
s1{ F1() -> Nat, P1[ set ] } :
for b1 being Nat holds
( 1 <= b1 & b1 <= F1() implies P1[b1] )
provided
E2: ( P1[F1()] & F1() >= 2 ) and E3: for b1 being Nat holds
( 1 <= b1 & b1 < F1() & P1[b1 + 1] implies P1[b1] )
proof end;

scheme :: HALLMAR1:sch 2
s2{ P1[ Nat] } :
P1[1]
provided
E2: ex b1 being Nat st
( b1 > 1 & P1[b1] ) and E3: for b1 being Nat holds
( b1 >= 1 & P1[b1 + 1] implies P1[b1] )
proof end;

registration
let c1 be non empty set ;
cluster non-empty non empty FinSequence of bool a1;
existence
ex b1 being FinSequence of bool c1 st
( not b1 is empty & b1 is non-empty )
proof end;
end;

theorem Th2: :: HALLMAR1:2
for b1 being non empty set
for b2 being non-empty FinSequence of bool b1
for b3 being Nat holds
not ( b3 in dom b2 & not b2 . b3 <> {} )
proof end;

registration
let c1 be finite set ;
let c2 be FinSequence of bool c1;
let c3 be Nat;
cluster a2 . a3 -> finite ;
coherence
c2 . c3 is finite
proof end;
end;

definition
let c1 be set ;
let c2 be FinSequence of bool c1;
let c3 be set ;
func union c2,c3 -> set means :Def1: :: HALLMAR1:def 1
for b1 being set holds
( b1 in a4 iff ex b2 being set st
( b2 in a3 & b2 in dom a2 & b1 in a2 . b2 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being set st
( b3 in c3 & b3 in dom c2 & b2 in c2 . b3 ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( for b3 being set holds
( b3 in b1 iff ex b4 being set st
( b4 in c3 & b4 in dom c2 & b3 in c2 . b4 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being set st
( b4 in c3 & b4 in dom c2 & b3 in c2 . b4 ) ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def1 defines union HALLMAR1:def 1 :
for b1 being set
for b2 being FinSequence of bool b1
for b3, b4 being set holds
( b4 = union b2,b3 iff for b5 being set holds
( b5 in b4 iff ex b6 being set st
( b6 in b3 & b6 in dom b2 & b5 in b2 . b6 ) ) );

theorem Th3: :: HALLMAR1:3
for b1 being set
for b2 being FinSequence of bool b1
for b3 being set holds union b2,b3 c= b1
proof end;

theorem Th4: :: HALLMAR1:4
for b1 being finite set
for b2 being FinSequence of bool b1
for b3, b4 being set holds
( b3 c= b4 implies union b2,b3 c= union b2,b4 )
proof end;

registration
let c1 be finite set ;
let c2 be FinSequence of bool c1;
let c3 be set ;
cluster union a2,a3 -> finite ;
coherence
union c2,c3 is finite
proof end;
end;

theorem Th5: :: HALLMAR1:5
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat holds
( b3 in dom b2 implies union b2,{b3} = b2 . b3 )
proof end;

theorem Th6: :: HALLMAR1:6
for b1 being finite set
for b2 being FinSequence of bool b1
for b3, b4 being Nat holds
( b3 in dom b2 & b4 in dom b2 implies union b2,{b3,b4} = (b2 . b3) \/ (b2 . b4) )
proof end;

theorem Th7: :: HALLMAR1:7
for b1 being set
for b2 being finite set
for b3 being FinSequence of bool b2
for b4 being Nat holds
( b4 in b1 & b4 in dom b3 implies b3 . b4 c= union b3,b1 )
proof end;

theorem Th8: :: HALLMAR1:8
for b1 being set
for b2 being finite set
for b3 being Nat
for b4 being FinSequence of bool b2 holds
( b3 in b1 & b3 in dom b4 implies union b4,b1 = (union b4,(b1 \ {b3})) \/ (b4 . b3) )
proof end;

theorem Th9: :: HALLMAR1:9
for b1, b2 being set
for b3 being finite set
for b4 being Nat
for b5 being FinSequence of bool b3 holds
( b4 in dom b5 implies union b5,(({b4} \/ b1) \/ b2) = (b5 . b4) \/ (union b5,(b1 \/ b2)) )
proof end;

theorem Th10: :: HALLMAR1:10
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4, b5 being set holds
( b4 <> b5 & b4 in b2 . b3 & b5 in b2 . b3 implies ((b2 . b3) \ {b4}) \/ ((b2 . b3) \ {b5}) = b2 . b3 )
proof end;

definition
let c1 be finite set ;
let c2 be FinSequence of bool c1;
let c3 be Nat;
let c4 be set ;
func Cut c2,c3,c4 -> FinSequence of bool a1 means :Def2: :: HALLMAR1:def 2
( dom a5 = dom a2 & ( for b1 being Nat holds
( b1 in dom a5 implies ( ( a3 = b1 implies a5 . b1 = (a2 . b1) \ {a4} ) & ( a3 <> b1 implies a5 . b1 = a2 . b1 ) ) ) ) );
existence
ex b1 being FinSequence of bool c1 st
( dom b1 = dom c2 & ( for b2 being Nat holds
( b2 in dom b1 implies ( ( c3 = b2 implies b1 . b2 = (c2 . b2) \ {c4} ) & ( c3 <> b2 implies b1 . b2 = c2 . b2 ) ) ) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of bool c1 holds
( dom b1 = dom c2 & ( for b3 being Nat holds
( b3 in dom b1 implies ( ( c3 = b3 implies b1 . b3 = (c2 . b3) \ {c4} ) & ( c3 <> b3 implies b1 . b3 = c2 . b3 ) ) ) ) & dom b2 = dom c2 & ( for b3 being Nat holds
( b3 in dom b2 implies ( ( c3 = b3 implies b2 . b3 = (c2 . b3) \ {c4} ) & ( c3 <> b3 implies b2 . b3 = c2 . b3 ) ) ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def2 defines Cut HALLMAR1:def 2 :
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being set
for b5 being FinSequence of bool b1 holds
( b5 = Cut b2,b3,b4 iff ( dom b5 = dom b2 & ( for b6 being Nat holds
( b6 in dom b5 implies ( ( b3 = b6 implies b5 . b6 = (b2 . b6) \ {b4} ) & ( b3 <> b6 implies b5 . b6 = b2 . b6 ) ) ) ) ) );

theorem Th11: :: HALLMAR1:11
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being set holds
( b3 in dom b2 & b4 in b2 . b3 implies card ((Cut b2,b3,b4) . b3) = (card (b2 . b3)) - 1 )
proof end;

theorem Th12: :: HALLMAR1:12
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4, b5 being set holds union (Cut b2,b3,b4),(b5 \ {b3}) = union b2,(b5 \ {b3})
proof end;

theorem Th13: :: HALLMAR1:13
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4, b5 being set holds
( not b3 in b5 implies union b2,b5 = union (Cut b2,b3,b4),b5 )
proof end;

theorem Th14: :: HALLMAR1:14
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4, b5 being set holds
( b3 in dom (Cut b2,b3,b4) & b5 c= dom (Cut b2,b3,b4) & b3 in b5 implies union (Cut b2,b3,b4),b5 = (union b2,(b5 \ {b3})) \/ ((b2 . b3) \ {b4}) )
proof end;

definition
let c1 be finite set ;
let c2 be FinSequence of bool c1;
let c3 be set ;
pred c3 is_a_system_of_different_representatives_of c2 means :Def3: :: HALLMAR1:def 3
ex b1 being FinSequence of a1 st
( b1 = a3 & dom a2 = dom b1 & ( for b2 being Nat holds
( b2 in dom b1 implies b1 . b2 in a2 . b2 ) ) & b1 is one-to-one );
end;

:: deftheorem Def3 defines is_a_system_of_different_representatives_of HALLMAR1:def 3 :
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being set holds
( b3 is_a_system_of_different_representatives_of b2 iff ex b4 being FinSequence of b1 st
( b4 = b3 & dom b2 = dom b4 & ( for b5 being Nat holds
( b5 in dom b4 implies b4 . b5 in b2 . b5 ) ) & b4 is one-to-one ) );

definition
let c1 be finite set ;
let c2 be FinSequence of bool c1;
attr a2 is Hall means :Def4: :: HALLMAR1:def 4
for b1 being finite set holds
( b1 c= dom a2 implies card b1 <= card (union a2,b1) );
end;

:: deftheorem Def4 defines Hall HALLMAR1:def 4 :
for b1 being finite set
for b2 being FinSequence of bool b1 holds
( b2 is Hall iff for b3 being finite set holds
( b3 c= dom b2 implies card b3 <= card (union b2,b3) ) );

theorem Th15: :: HALLMAR1:15
for b1 being finite set
for b2 being non empty FinSequence of bool b1 holds
( b2 is Hall implies b2 is non-empty )
proof end;

theorem Th16: :: HALLMAR1:16
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat holds
( b3 in dom b2 & b2 is Hall implies card (b2 . b3) >= 1 )
proof end;

theorem Th17: :: HALLMAR1:17
for b1 being non empty finite set
for b2 being non empty FinSequence of bool b1 holds
not ( ( for b3 being Nat holds
( b3 in dom b2 implies card (b2 . b3) = 1 ) ) & b2 is Hall & ( for b3 being set holds
not b3 is_a_system_of_different_representatives_of b2 ) )
proof end;

theorem Th18: :: HALLMAR1:18
for b1 being finite set
for b2 being FinSequence of bool b1 holds
( ex b3 being set st b3 is_a_system_of_different_representatives_of b2 implies b2 is Hall )
proof end;

definition
let c1 be set ;
let c2 be FinSequence of bool c1;
let c3 be Nat;
mode Reduction of c2,c3 -> FinSequence of bool a1 means :Def5: :: HALLMAR1:def 5
( dom a4 = dom a2 & ( for b1 being Nat holds
( b1 in dom a2 & b1 <> a3 implies a2 . b1 = a4 . b1 ) ) & a4 . a3 c= a2 . a3 );
existence
ex b1 being FinSequence of bool c1 st
( dom b1 = dom c2 & ( for b2 being Nat holds
( b2 in dom c2 & b2 <> c3 implies c2 . b2 = b1 . b2 ) ) & b1 . c3 c= c2 . c3 )
proof end;
end;

:: deftheorem Def5 defines Reduction HALLMAR1:def 5 :
for b1 being set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being FinSequence of bool b1 holds
( b4 is Reduction of b2,b3 iff ( dom b4 = dom b2 & ( for b5 being Nat holds
( b5 in dom b2 & b5 <> b3 implies b2 . b5 = b4 . b5 ) ) & b4 . b3 c= b2 . b3 ) );

definition
let c1 be set ;
let c2 be FinSequence of bool c1;
mode Reduction of c2 -> FinSequence of bool a1 means :Def6: :: HALLMAR1:def 6
( dom a3 = dom a2 & ( for b1 being Nat holds
( b1 in dom a2 implies a3 . b1 c= a2 . b1 ) ) );
existence
ex b1 being FinSequence of bool c1 st
( dom b1 = dom c2 & ( for b2 being Nat holds
( b2 in dom c2 implies b1 . b2 c= c2 . b2 ) ) )
proof end;
end;

:: deftheorem Def6 defines Reduction HALLMAR1:def 6 :
for b1 being set
for b2, b3 being FinSequence of bool b1 holds
( b3 is Reduction of b2 iff ( dom b3 = dom b2 & ( for b4 being Nat holds
( b4 in dom b2 implies b3 . b4 c= b2 . b4 ) ) ) );

definition
let c1 be set ;
let c2 be FinSequence of bool c1;
let c3 be Nat;
assume E24: ( c3 in dom c2 & c2 . c3 <> {} ) ;
mode Singlification of c2,c3 -> Reduction of a2 means :Def7: :: HALLMAR1:def 7
Card (a4 . a3) = 1;
existence
ex b1 being Reduction of c2 st Card (b1 . c3) = 1
proof end;
end;

:: deftheorem Def7 defines Singlification HALLMAR1:def 7 :
for b1 being set
for b2 being FinSequence of bool b1
for b3 being Nat holds
( b3 in dom b2 & b2 . b3 <> {} implies for b4 being Reduction of b2 holds
( b4 is Singlification of b2,b3 iff Card (b4 . b3) = 1 ) );

theorem Th19: :: HALLMAR1:19
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being Reduction of b2,b3 holds
b4 is Reduction of b2
proof end;

theorem Th20: :: HALLMAR1:20
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being set holds
( b3 in dom b2 & b4 in b2 . b3 implies Cut b2,b3,b4 is Reduction of b2,b3 )
proof end;

theorem Th21: :: HALLMAR1:21
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat
for b4 being set holds
( b3 in dom b2 & b4 in b2 . b3 implies Cut b2,b3,b4 is Reduction of b2 )
proof end;

theorem Th22: :: HALLMAR1:22
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Reduction of b2
for b4 being Reduction of b3 holds
b4 is Reduction of b2
proof end;

theorem Th23: :: HALLMAR1:23
for b1 being non empty finite set
for b2 being non-empty FinSequence of bool b1
for b3 being Nat
for b4 being Singlification of b2,b3 holds
not ( b3 in dom b2 & not b4 . b3 <> {} )
proof end;

theorem Th24: :: HALLMAR1:24
for b1 being non empty finite set
for b2 being non-empty FinSequence of bool b1
for b3, b4 being Nat
for b5 being Singlification of b2,b3
for b6 being Singlification of b5,b4 holds
( b3 in dom b2 & b4 in dom b2 & b6 . b3 <> {} & b5 . b4 <> {} implies ( b6 is Singlification of b2,b4 & b6 is Singlification of b2,b3 ) )
proof end;

theorem Th25: :: HALLMAR1:25
for b1 being set
for b2 being FinSequence of bool b1
for b3 being Nat holds
b2 is Reduction of b2,b3
proof end;

theorem Th26: :: HALLMAR1:26
for b1 being set
for b2 being FinSequence of bool b1 holds
b2 is Reduction of b2
proof end;

definition
let c1 be non empty set ;
let c2 be FinSequence of bool c1;
assume E31: c2 is non-empty ;
mode Singlification of c2 -> Reduction of a2 means :Def8: :: HALLMAR1:def 8
for b1 being Nat holds
( b1 in dom a2 implies Card (a3 . b1) = 1 );
existence
ex b1 being Reduction of c2 st
for b2 being Nat holds
( b2 in dom c2 implies Card (b1 . b2) = 1 )
proof end;
end;

:: deftheorem Def8 defines Singlification HALLMAR1:def 8 :
for b1 being non empty set
for b2 being FinSequence of bool b1 holds
( b2 is non-empty implies for b3 being Reduction of b2 holds
( b3 is Singlification of b2 iff for b4 being Nat holds
( b4 in dom b2 implies Card (b3 . b4) = 1 ) ) );

theorem Th27: :: HALLMAR1:27
for b1 being non empty finite set
for b2 being non-empty non empty FinSequence of bool b1
for b3 being Function holds
( b3 is Singlification of b2 iff ( dom b3 = dom b2 & ( for b4 being Nat holds
( b4 in dom b2 implies b3 is Singlification of b2,b4 ) ) ) )
proof end;

registration
let c1 be non empty finite set ;
let c2 be non empty FinSequence of bool c1;
let c3 be Nat;
cluster -> non empty Singlification of a2,a3;
coherence
for b1 being Singlification of c2,c3 holds
not b1 is empty
proof end;
end;

registration
let c1 be non empty finite set ;
let c2 be non empty FinSequence of bool c1;
cluster -> non empty Singlification of a2;
coherence
for b1 being Singlification of c2 holds
not b1 is empty
proof end;
end;

theorem Th28: :: HALLMAR1:28
for b1 being non empty finite set
for b2 being non empty FinSequence of bool b1
for b3 being set
for b4 being Reduction of b2 holds
( b3 is_a_system_of_different_representatives_of b4 implies b3 is_a_system_of_different_representatives_of b2 )
proof end;

theorem Th29: :: HALLMAR1:29
for b1 being finite set
for b2 being FinSequence of bool b1 holds
( b2 is Hall implies for b3 being Nat holds
not ( card (b2 . b3) >= 2 & ( for b4 being set holds
not ( b4 in b2 . b3 & Cut b2,b3,b4 is Hall ) ) ) )
proof end;

theorem Th30: :: HALLMAR1:30
for b1 being finite set
for b2 being FinSequence of bool b1
for b3 being Nat holds
not ( b3 in dom b2 & b2 is Hall & ( for b4 being Singlification of b2,b3 holds
not b4 is Hall ) )
proof end;

theorem Th31: :: HALLMAR1:31
for b1 being non empty finite set
for b2 being non empty FinSequence of bool b1 holds
not ( b2 is Hall & ( for b3 being Singlification of b2 holds
not b3 is Hall ) )
proof end;

theorem Th32: :: HALLMAR1:32
for b1 being non empty finite set
for b2 being non empty FinSequence of bool b1 holds
( ex b3 being set st b3 is_a_system_of_different_representatives_of b2 iff b2 is Hall )
proof end;