:: SETFAM_1 semantic presentation

definition
let c1 be set ;
func meet c1 -> set means :Def1: :: SETFAM_1:def 1
for b1 being set holds
( b1 in a2 iff for b2 being set st b2 in a1 holds
b1 in b2 ) if a1 <> {}
otherwise a2 = {} ;
existence
( ( c1 <> {} implies ex b1 being set st
for b2 being set holds
( b2 in b1 iff for b3 being set st b3 in c1 holds
b2 in b3 ) ) & ( not c1 <> {} implies ex b1 being set st b1 = {} ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( c1 <> {} & ( for b3 being set holds
( b3 in b1 iff for b4 being set st b4 in c1 holds
b3 in b4 ) ) & ( for b3 being set holds
( b3 in b2 iff for b4 being set st b4 in c1 holds
b3 in b4 ) ) implies b1 = b2 ) & ( not c1 <> {} & b1 = {} & b2 = {} implies b1 = b2 ) )
proof end;
consistency
for b1 being set holds verum
;
end;

:: deftheorem Def1 defines meet SETFAM_1:def 1 :
for b1 being set
for b2 being set holds
( ( b1 <> {} implies ( b2 = meet b1 iff for b3 being set holds
( b3 in b2 iff for b4 being set st b4 in b1 holds
b3 in b4 ) ) ) & ( not b1 <> {} implies ( b2 = meet b1 iff b2 = {} ) ) );

theorem Th1: :: SETFAM_1:1
canceled;

theorem Th2: :: SETFAM_1:2
meet {} = {} by Def1;

theorem Th3: :: SETFAM_1:3
for b1 being set holds meet b1 c= union b1
proof end;

theorem Th4: :: SETFAM_1:4
for b1, b2 being set st b1 in b2 holds
meet b2 c= b1
proof end;

theorem Th5: :: SETFAM_1:5
for b1 being set st {} in b1 holds
meet b1 = {}
proof end;

theorem Th6: :: SETFAM_1:6
for b1, b2 being set st b1 <> {} & ( for b3 being set st b3 in b1 holds
b2 c= b3 ) holds
b2 c= meet b1
proof end;

theorem Th7: :: SETFAM_1:7
for b1, b2 being set st b1 <> {} & b1 c= b2 holds
meet b2 c= meet b1
proof end;

theorem Th8: :: SETFAM_1:8
for b1, b2, b3 being set st b1 in b2 & b1 c= b3 holds
meet b2 c= b3
proof end;

theorem Th9: :: SETFAM_1:9
for b1, b2, b3 being set st b1 in b2 & b1 misses b3 holds
meet b2 misses b3
proof end;

theorem Th10: :: SETFAM_1:10
for b1, b2 being set st b1 <> {} & b2 <> {} holds
meet (b1 \/ b2) = (meet b1) /\ (meet b2)
proof end;

theorem Th11: :: SETFAM_1:11
for b1 being set holds meet {b1} = b1
proof end;

theorem Th12: :: SETFAM_1:12
for b1, b2 being set holds meet {b1,b2} = b1 /\ b2
proof end;

definition
let c1, c2 be set ;
pred c1 is_finer_than c2 means :: SETFAM_1:def 2
for b1 being set st b1 in a1 holds
ex b2 being set st
( b2 in a2 & b1 c= b2 );
reflexivity
for b1, b2 being set st b2 in b1 holds
ex b3 being set st
( b3 in b1 & b2 c= b3 )
;
pred c2 is_coarser_than c1 means :: SETFAM_1:def 3
for b1 being set st b1 in a2 holds
ex b2 being set st
( b2 in a1 & b2 c= b1 );
reflexivity
for b1, b2 being set st b2 in b1 holds
ex b3 being set st
( b3 in b1 & b3 c= b2 )
;
end;

:: deftheorem Def2 defines is_finer_than SETFAM_1:def 2 :
for b1, b2 being set holds
( b1 is_finer_than b2 iff for b3 being set st b3 in b1 holds
ex b4 being set st
( b4 in b2 & b3 c= b4 ) );

:: deftheorem Def3 defines is_coarser_than SETFAM_1:def 3 :
for b1, b2 being set holds
( b2 is_coarser_than b1 iff for b3 being set st b3 in b2 holds
ex b4 being set st
( b4 in b1 & b4 c= b3 ) );

theorem Th13: :: SETFAM_1:13
canceled;

theorem Th14: :: SETFAM_1:14
canceled;

theorem Th15: :: SETFAM_1:15
canceled;

theorem Th16: :: SETFAM_1:16
canceled;

theorem Th17: :: SETFAM_1:17
for b1, b2 being set st b1 c= b2 holds
b1 is_finer_than b2
proof end;

theorem Th18: :: SETFAM_1:18
for b1, b2 being set st b1 is_finer_than b2 holds
union b1 c= union b2
proof end;

theorem Th19: :: SETFAM_1:19
for b1, b2 being set st b1 <> {} & b1 is_coarser_than b2 holds
meet b2 c= meet b1
proof end;

theorem Th20: :: SETFAM_1:20
for b1 being set holds {} is_finer_than b1
proof end;

theorem Th21: :: SETFAM_1:21
for b1 being set st b1 is_finer_than {} holds
b1 = {}
proof end;

theorem Th22: :: SETFAM_1:22
canceled;

theorem Th23: :: SETFAM_1:23
for b1, b2, b3 being set st b1 is_finer_than b2 & b2 is_finer_than b3 holds
b1 is_finer_than b3
proof end;

theorem Th24: :: SETFAM_1:24
for b1, b2 being set st b2 is_finer_than {b1} holds
for b3 being set st b3 in b2 holds
b3 c= b1
proof end;

theorem Th25: :: SETFAM_1:25
for b1, b2, b3 being set st b3 is_finer_than {b1,b2} holds
for b4 being set holds
( not b4 in b3 or b4 c= b1 or b4 c= b2 )
proof end;

definition
let c1, c2 be set ;
func UNION c1,c2 -> set means :Def4: :: SETFAM_1:def 4
for b1 being set holds
( b1 in a3 iff ex b2, b3 being set st
( b2 in a1 & b3 in a2 & b1 = b2 \/ b3 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3, b4 being set st
( b3 in c1 & b4 in c2 & b2 = b3 \/ b4 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 \/ b5 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 \/ b5 ) ) ) holds
b1 = b2
proof end;
commutativity
for b1 being set
for b2, b3 being set st ( for b4 being set holds
( b4 in b1 iff ex b5, b6 being set st
( b5 in b2 & b6 in b3 & b4 = b5 \/ b6 ) ) ) holds
for b4 being set holds
( b4 in b1 iff ex b5, b6 being set st
( b5 in b3 & b6 in b2 & b4 = b5 \/ b6 ) )
proof end;
func INTERSECTION c1,c2 -> set means :Def5: :: SETFAM_1:def 5
for b1 being set holds
( b1 in a3 iff ex b2, b3 being set st
( b2 in a1 & b3 in a2 & b1 = b2 /\ b3 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3, b4 being set st
( b3 in c1 & b4 in c2 & b2 = b3 /\ b4 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 /\ b5 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 /\ b5 ) ) ) holds
b1 = b2
proof end;
commutativity
for b1 being set
for b2, b3 being set st ( for b4 being set holds
( b4 in b1 iff ex b5, b6 being set st
( b5 in b2 & b6 in b3 & b4 = b5 /\ b6 ) ) ) holds
for b4 being set holds
( b4 in b1 iff ex b5, b6 being set st
( b5 in b3 & b6 in b2 & b4 = b5 /\ b6 ) )
proof end;
func DIFFERENCE c1,c2 -> set means :Def6: :: SETFAM_1:def 6
for b1 being set holds
( b1 in a3 iff ex b2, b3 being set st
( b2 in a1 & b3 in a2 & b1 = b2 \ b3 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3, b4 being set st
( b3 in c1 & b4 in c2 & b2 = b3 \ b4 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 \ b5 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4, b5 being set st
( b4 in c1 & b5 in c2 & b3 = b4 \ b5 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines UNION SETFAM_1:def 4 :
for b1, b2 being set
for b3 being set holds
( b3 = UNION b1,b2 iff for b4 being set holds
( b4 in b3 iff ex b5, b6 being set st
( b5 in b1 & b6 in b2 & b4 = b5 \/ b6 ) ) );

:: deftheorem Def5 defines INTERSECTION SETFAM_1:def 5 :
for b1, b2 being set
for b3 being set holds
( b3 = INTERSECTION b1,b2 iff for b4 being set holds
( b4 in b3 iff ex b5, b6 being set st
( b5 in b1 & b6 in b2 & b4 = b5 /\ b6 ) ) );

:: deftheorem Def6 defines DIFFERENCE SETFAM_1:def 6 :
for b1, b2 being set
for b3 being set holds
( b3 = DIFFERENCE b1,b2 iff for b4 being set holds
( b4 in b3 iff ex b5, b6 being set st
( b5 in b1 & b6 in b2 & b4 = b5 \ b6 ) ) );

theorem Th26: :: SETFAM_1:26
canceled;

theorem Th27: :: SETFAM_1:27
canceled;

theorem Th28: :: SETFAM_1:28
canceled;

theorem Th29: :: SETFAM_1:29
for b1 being set holds b1 is_finer_than UNION b1,b1
proof end;

theorem Th30: :: SETFAM_1:30
for b1 being set holds INTERSECTION b1,b1 is_finer_than b1
proof end;

theorem Th31: :: SETFAM_1:31
for b1 being set holds DIFFERENCE b1,b1 is_finer_than b1
proof end;

theorem Th32: :: SETFAM_1:32
canceled;

theorem Th33: :: SETFAM_1:33
canceled;

theorem Th34: :: SETFAM_1:34
for b1, b2 being set st b1 meets b2 holds
(meet b1) /\ (meet b2) = meet (INTERSECTION b1,b2)
proof end;

theorem Th35: :: SETFAM_1:35
for b1, b2 being set st b2 <> {} holds
b1 \/ (meet b2) = meet (UNION {b1},b2)
proof end;

theorem Th36: :: SETFAM_1:36
for b1, b2 being set holds b1 /\ (union b2) = union (INTERSECTION {b1},b2)
proof end;

theorem Th37: :: SETFAM_1:37
for b1, b2 being set st b2 <> {} holds
b1 \ (union b2) = meet (DIFFERENCE {b1},b2)
proof end;

theorem Th38: :: SETFAM_1:38
for b1, b2 being set st b2 <> {} holds
b1 \ (meet b2) = union (DIFFERENCE {b1},b2)
proof end;

theorem Th39: :: SETFAM_1:39
for b1, b2 being set holds union (INTERSECTION b1,b2) = (union b1) /\ (union b2)
proof end;

theorem Th40: :: SETFAM_1:40
for b1, b2 being set st b1 <> {} & b2 <> {} holds
(meet b1) \/ (meet b2) c= meet (UNION b1,b2)
proof end;

theorem Th41: :: SETFAM_1:41
for b1, b2 being set holds meet (DIFFERENCE b1,b2) c= (meet b1) \ (meet b2)
proof end;

definition
let c1 be set ;
mode Subset-Family of a1 is Subset of (bool a1);
end;

definition
let c1 be set ;
let c2 be Subset-Family of c1;
redefine func union as union c2 -> Subset of a1;
coherence
union c2 is Subset of c1
proof end;
end;

definition
let c1 be set ;
let c2 be Subset-Family of c1;
redefine func meet as meet c2 -> Subset of a1;
coherence
meet c2 is Subset of c1
proof end;
end;

theorem Th42: :: SETFAM_1:42
canceled;

theorem Th43: :: SETFAM_1:43
canceled;

theorem Th44: :: SETFAM_1:44
for b1 being set
for b2, b3 being Subset-Family of b1 st ( for b4 being Subset of b1 holds
( b4 in b2 iff b4 in b3 ) ) holds
b2 = b3
proof end;

definition
let c1 be set ;
let c2 be Subset-Family of c1;
canceled;
func COMPLEMENT c2 -> Subset-Family of a1 means :Def8: :: SETFAM_1:def 8
for b1 being Subset of a1 holds
( b1 in a3 iff b1 ` in a2 );
existence
ex b1 being Subset-Family of c1 st
for b2 being Subset of c1 holds
( b2 in b1 iff b2 ` in c2 )
proof end;
uniqueness
for b1, b2 being Subset-Family of c1 st ( for b3 being Subset of c1 holds
( b3 in b1 iff b3 ` in c2 ) ) & ( for b3 being Subset of c1 holds
( b3 in b2 iff b3 ` in c2 ) ) holds
b1 = b2
proof end;
involutiveness
for b1, b2 being Subset-Family of c1 st ( for b3 being Subset of c1 holds
( b3 in b1 iff b3 ` in b2 ) ) holds
for b3 being Subset of c1 holds
( b3 in b2 iff b3 ` in b1 )
proof end;
end;

:: deftheorem Def7 SETFAM_1:def 7 :
canceled;

:: deftheorem Def8 defines COMPLEMENT SETFAM_1:def 8 :
for b1 being set
for b2, b3 being Subset-Family of b1 holds
( b3 = COMPLEMENT b2 iff for b4 being Subset of b1 holds
( b4 in b3 iff b4 ` in b2 ) );

theorem Th45: :: SETFAM_1:45
canceled;

theorem Th46: :: SETFAM_1:46
for b1 being set
for b2 being Subset-Family of b1 st b2 <> {} holds
COMPLEMENT b2 <> {}
proof end;

theorem Th47: :: SETFAM_1:47
for b1 being set
for b2 being Subset-Family of b1 st b2 <> {} holds
([#] b1) \ (union b2) = meet (COMPLEMENT b2)
proof end;

theorem Th48: :: SETFAM_1:48
for b1 being set
for b2 being Subset-Family of b1 st b2 <> {} holds
union (COMPLEMENT b2) = ([#] b1) \ (meet b2)
proof end;

theorem Th49: :: SETFAM_1:49
for b1 being set
for b2 being Subset-Family of b1
for b3 being Subset of b1 holds
( b3 ` in COMPLEMENT b2 iff b3 in b2 )
proof end;

theorem Th50: :: SETFAM_1:50
canceled;

theorem Th51: :: SETFAM_1:51
for b1 being set
for b2, b3 being Subset-Family of b1 st COMPLEMENT b2 c= COMPLEMENT b3 holds
b2 c= b3
proof end;

theorem Th52: :: SETFAM_1:52
for b1 being set
for b2, b3 being Subset-Family of b1 holds
( COMPLEMENT b2 c= b3 iff b2 c= COMPLEMENT b3 )
proof end;

theorem Th53: :: SETFAM_1:53
for b1 being set
for b2, b3 being Subset-Family of b1 st COMPLEMENT b2 = COMPLEMENT b3 holds
b2 = b3
proof end;

theorem Th54: :: SETFAM_1:54
for b1 being set
for b2, b3 being Subset-Family of b1 holds COMPLEMENT (b2 \/ b3) = (COMPLEMENT b2) \/ (COMPLEMENT b3)
proof end;

theorem Th55: :: SETFAM_1:55
for b1 being set
for b2 being Subset-Family of b1 st b2 = {b1} holds
COMPLEMENT b2 = {{} }
proof end;

registration
let c1 be set ;
let c2 be empty Subset-Family of c1;
cluster COMPLEMENT a2 -> empty ;
coherence
COMPLEMENT c2 is empty
proof end;
end;

definition
let c1 be set ;
attr a1 is with_non-empty_elements means :Def9: :: SETFAM_1:def 9
not {} in a1;
end;

:: deftheorem Def9 defines with_non-empty_elements SETFAM_1:def 9 :
for b1 being set holds
( b1 is with_non-empty_elements iff not {} in b1 );

registration
cluster non empty with_non-empty_elements set ;
existence
ex b1 being set st
( not b1 is empty & b1 is with_non-empty_elements )
proof end;
end;

registration
let c1 be non empty set ;
cluster {a1} -> with_non-empty_elements ;
coherence
{c1} is with_non-empty_elements
proof end;
let c2 be non empty set ;
cluster {a1,a2} -> with_non-empty_elements ;
coherence
{c1,c2} is with_non-empty_elements
proof end;
end;

registration
let c1, c2 be with_non-empty_elements set ;
cluster a1 \/ a2 -> with_non-empty_elements ;
coherence
c1 \/ c2 is with_non-empty_elements
proof end;
end;

theorem Th56: :: SETFAM_1:56
for b1, b2, b3 being set st union b1 c= b2 & b3 in b1 holds
b3 c= b2
proof end;

theorem Th57: :: SETFAM_1:57
for b1, b2, b3 being set st b3 c= union (b1 \/ b2) & ( for b4 being set st b4 in b2 holds
b4 misses b3 ) holds
b3 c= union b1
proof end;

definition
let c1 be set ;
let c2 be Subset-Family of c1;
func Intersect c2 -> Subset of a1 equals :Def10: :: SETFAM_1:def 10
meet a2 if a2 <> {}
otherwise a1;
coherence
( ( c2 <> {} implies meet c2 is Subset of c1 ) & ( not c2 <> {} implies c1 is Subset of c1 ) )
proof end;
consistency
for b1 being Subset of c1 holds verum
;
end;

:: deftheorem Def10 defines Intersect SETFAM_1:def 10 :
for b1 being set
for b2 being Subset-Family of b1 holds
( ( b2 <> {} implies Intersect b2 = meet b2 ) & ( not b2 <> {} implies Intersect b2 = b1 ) );

theorem Th58: :: SETFAM_1:58
for b1, b2 being set
for b3 being Subset-Family of b1 st b2 in b1 holds
( b2 in Intersect b3 iff for b4 being set st b4 in b3 holds
b2 in b4 )
proof end;

theorem Th59: :: SETFAM_1:59
for b1 being set
for b2, b3 being Subset-Family of b1 st b2 c= b3 holds
Intersect b3 c= Intersect b2
proof end;

registration
let c1 be non empty with_non-empty_elements set ;
cluster -> non empty Element of a1;
coherence
for b1 being Element of c1 holds not b1 is empty
by Def9;
end;

definition
let c1 be set ;
attr a1 is empty-membered means :Def11: :: SETFAM_1:def 11
for b1 being non empty set holds not b1 in a1;
end;

:: deftheorem Def11 defines empty-membered SETFAM_1:def 11 :
for b1 being set holds
( b1 is empty-membered iff for b2 being non empty set holds not b2 in b1 );

notation
let c1 be set ;
antonym with_non-empty_element c1 for empty-membered c1;
end;

registration
cluster with_non-empty_element set ;
existence
not for b1 being set holds b1 is empty-membered
proof end;
end;

registration
cluster with_non-empty_element -> non empty set ;
coherence
for b1 being set st not b1 is empty-membered holds
not b1 is empty
proof end;
end;

registration
let c1 be with_non-empty_element set ;
cluster non empty Element of a1;
existence
not for b1 being Element of c1 holds b1 is empty
proof end;
end;