:: MBOOLEAN semantic presentation

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
func bool c2 -> ManySortedSet of a1 means :Def1: :: MBOOLEAN:def 1
for b1 being set st b1 in a1 holds
a3 . b1 = bool (a2 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
b1 . b2 = bool (c2 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set st b3 in c1 holds
b1 . b3 = bool (c2 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = bool (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines bool MBOOLEAN:def 1 :
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b3 = bool b2 iff for b4 being set st b4 in b1 holds
b3 . b4 = bool (b2 . b4) );

registration
let c1 be set ;
let c2 be ManySortedSet of c1;
cluster bool a2 -> V3 ;
coherence
bool c2 is non-empty
proof end;
end;

Lemma2: for b1, b2, b3 being set
for b4 being ManySortedSet of b2 st b1 in b2 holds
dom (b4 +* (b1 .--> b3)) = b2
proof end;

Lemma3: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(bool (b2 \/ b3)) . b4 = bool ((b2 . b4) \/ (b3 . b4))
proof end;

Lemma4: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(bool (b2 /\ b3)) . b4 = bool ((b2 . b4) /\ (b3 . b4))
proof end;

Lemma5: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(bool (b2 \ b3)) . b4 = bool ((b2 . b4) \ (b3 . b4))
proof end;

Lemma6: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(bool (b2 \+\ b3)) . b4 = bool ((b2 . b4) \+\ (b3 . b4))
proof end;

theorem Th1: :: MBOOLEAN:1
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b2 = bool b3 iff for b4 being ManySortedSet of b1 holds
( b4 in b2 iff b4 c= b3 ) )
proof end;

theorem Th2: :: MBOOLEAN:2
for b1 being set holds bool ([0] b1) = b1 --> {{} }
proof end;

theorem Th3: :: MBOOLEAN:3
for b1, b2 being set holds bool (b1 --> b2) = b1 --> (bool b2)
proof end;

theorem Th4: :: MBOOLEAN:4
for b1, b2 being set holds bool (b1 --> {b2}) = b1 --> {{} ,{b2}}
proof end;

theorem Th5: :: MBOOLEAN:5
for b1 being set
for b2 being ManySortedSet of b1 holds [0] b1 c= b2
proof end;

theorem Th6: :: MBOOLEAN:6
for b1 being set
for b2, b3 being ManySortedSet of b1 st b2 c= b3 holds
bool b2 c= bool b3
proof end;

theorem Th7: :: MBOOLEAN:7
for b1 being set
for b2, b3 being ManySortedSet of b1 holds (bool b2) \/ (bool b3) c= bool (b2 \/ b3)
proof end;

theorem Th8: :: MBOOLEAN:8
for b1 being set
for b2, b3 being ManySortedSet of b1 st (bool b2) \/ (bool b3) = bool (b2 \/ b3) holds
for b4 being set st b4 in b1 holds
b2 . b4,b3 . b4 are_c=-comparable
proof end;

theorem Th9: :: MBOOLEAN:9
for b1 being set
for b2, b3 being ManySortedSet of b1 holds bool (b2 /\ b3) = (bool b2) /\ (bool b3)
proof end;

theorem Th10: :: MBOOLEAN:10
for b1 being set
for b2, b3 being ManySortedSet of b1 holds bool (b2 \ b3) c= (b1 --> {{} }) \/ ((bool b2) \ (bool b3))
proof end;

theorem Th11: :: MBOOLEAN:11
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 holds
( b2 c= b3 \ b4 iff ( b2 c= b3 & b2 misses b4 ) )
proof end;

theorem Th12: :: MBOOLEAN:12
for b1 being set
for b2, b3 being ManySortedSet of b1 holds (bool (b2 \ b3)) \/ (bool (b3 \ b2)) c= bool (b2 \+\ b3)
proof end;

theorem Th13: :: MBOOLEAN:13
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 holds
( b2 c= b3 \+\ b4 iff ( b2 c= b3 \/ b4 & b2 misses b3 /\ b4 ) )
proof end;

theorem Th14: :: MBOOLEAN:14
canceled;

theorem Th15: :: MBOOLEAN:15
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 st ( b2 c= b3 or b4 c= b3 ) holds
b2 /\ b4 c= b3
proof end;

theorem Th16: :: MBOOLEAN:16
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 st b2 c= b3 holds
b2 \ b4 c= b3
proof end;

theorem Th17: :: MBOOLEAN:17
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 st b2 c= b3 & b4 c= b3 holds
b2 \+\ b4 c= b3
proof end;

theorem Th18: :: MBOOLEAN:18
for b1 being set
for b2, b3 being ManySortedSet of b1 holds [|b2,b3|] c= bool (bool (b2 \/ b3))
proof end;

theorem Th19: :: MBOOLEAN:19
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b2 c= b3 iff b2 in bool b3 )
proof end;

theorem Th20: :: MBOOLEAN:20
for b1 being set
for b2, b3 being ManySortedSet of b1 holds MSFuncs b2,b3 c= bool [|b2,b3|]
proof end;

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
func union c2 -> ManySortedSet of a1 means :Def2: :: MBOOLEAN:def 2
for b1 being set st b1 in a1 holds
a3 . b1 = union (a2 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
b1 . b2 = union (c2 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set st b3 in c1 holds
b1 . b3 = union (c2 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = union (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines union MBOOLEAN:def 2 :
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b3 = union b2 iff for b4 being set st b4 in b1 holds
b3 . b4 = union (b2 . b4) );

registration
let c1 be set ;
cluster union ([0] a1) -> V4 ;
coherence
union ([0] c1) is empty-yielding
proof end;
end;

Lemma9: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(union (b2 \/ b3)) . b4 = union ((b2 . b4) \/ (b3 . b4))
proof end;

Lemma10: for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being set st b4 in b1 holds
(union (b2 /\ b3)) . b4 = union ((b2 . b4) /\ (b3 . b4))
proof end;

theorem Th21: :: MBOOLEAN:21
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b2 in union b3 iff ex b4 being ManySortedSet of b1 st
( b2 in b4 & b4 in b3 ) )
proof end;

theorem Th22: :: MBOOLEAN:22
for b1 being set holds union ([0] b1) = [0] b1
proof end;

theorem Th23: :: MBOOLEAN:23
for b1, b2 being set holds union (b1 --> b2) = b1 --> (union b2)
proof end;

theorem Th24: :: MBOOLEAN:24
for b1, b2 being set holds union (b1 --> {b2}) = b1 --> b2
proof end;

theorem Th25: :: MBOOLEAN:25
for b1, b2, b3 being set holds union (b1 --> {{b2},{b3}}) = b1 --> {b2,b3}
proof end;

theorem Th26: :: MBOOLEAN:26
for b1 being set
for b2, b3 being ManySortedSet of b1 st b2 in b3 holds
b2 c= union b3
proof end;

theorem Th27: :: MBOOLEAN:27
for b1 being set
for b2, b3 being ManySortedSet of b1 st b2 c= b3 holds
union b2 c= union b3
proof end;

theorem Th28: :: MBOOLEAN:28
for b1 being set
for b2, b3 being ManySortedSet of b1 holds union (b2 \/ b3) = (union b2) \/ (union b3)
proof end;

theorem Th29: :: MBOOLEAN:29
for b1 being set
for b2, b3 being ManySortedSet of b1 holds union (b2 /\ b3) c= (union b2) /\ (union b3)
proof end;

theorem Th30: :: MBOOLEAN:30
for b1 being set
for b2 being ManySortedSet of b1 holds union (bool b2) = b2
proof end;

theorem Th31: :: MBOOLEAN:31
for b1 being set
for b2 being ManySortedSet of b1 holds b2 c= bool (union b2)
proof end;

theorem Th32: :: MBOOLEAN:32
for b1 being set
for b2, b3, b4 being ManySortedSet of b1 st union b2 c= b3 & b4 in b2 holds
b4 c= b3
proof end;

theorem Th33: :: MBOOLEAN:33
for b1 being set
for b2 being ManySortedSet of b1
for b3 being V3 ManySortedSet of b1 st ( for b4 being ManySortedSet of b1 st b4 in b3 holds
b4 c= b2 ) holds
union b3 c= b2
proof end;

theorem Th34: :: MBOOLEAN:34
for b1 being set
for b2 being ManySortedSet of b1
for b3 being V3 ManySortedSet of b1 st ( for b4 being ManySortedSet of b1 st b4 in b3 holds
b4 /\ b2 = [0] b1 ) holds
(union b3) /\ b2 = [0] b1
proof end;

theorem Th35: :: MBOOLEAN:35
for b1 being set
for b2, b3 being ManySortedSet of b1 st b2 \/ b3 is non-empty & ( for b4, b5 being ManySortedSet of b1 st b4 <> b5 & b4 in b2 \/ b3 & b5 in b2 \/ b3 holds
b4 /\ b5 = [0] b1 ) holds
union (b2 /\ b3) = (union b2) /\ (union b3)
proof end;

theorem Th36: :: MBOOLEAN:36
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being V3 ManySortedSet of b1 st b3 c= union (b2 \/ b4) & ( for b5 being ManySortedSet of b1 st b5 in b4 holds
b5 /\ b3 = [0] b1 ) holds
b3 c= union b2
proof end;

theorem Th37: :: MBOOLEAN:37
for b1 being set
for b2 being V3 locally-finite ManySortedSet of b1 st ( for b3, b4 being ManySortedSet of b1 st b3 in b2 & b4 in b2 & not b3 c= b4 holds
b4 c= b3 ) holds
union b2 in b2
proof end;