:: RELSET_2 semantic presentation

notation
let c1 be set ;
synonym {_{c1}_} for SmallestPartition c1;
end;

theorem Th1: :: RELSET_2:1
for b1, b2 being set holds
( b1 in {_{b2}_} iff ex b3 being set st
( b1 = {b3} & b3 in b2 ) )
proof end;

theorem Th2: :: RELSET_2:2
for b1 being set holds
( b1 = {} iff {_{b1}_} = {} )
proof end;

theorem Th3: :: RELSET_2:3
for b1, b2 being set holds {_{(b1 \/ b2)}_} = {_{b1}_} \/ {_{b2}_}
proof end;

theorem Th4: :: RELSET_2:4
for b1, b2 being set holds {_{(b1 /\ b2)}_} = {_{b1}_} /\ {_{b2}_}
proof end;

theorem Th5: :: RELSET_2:5
for b1, b2 being set holds {_{(b1 \ b2)}_} = {_{b1}_} \ {_{b2}_}
proof end;

theorem Th6: :: RELSET_2:6
for b1, b2 being set holds
( b1 c= b2 iff {_{b1}_} c= {_{b2}_} )
proof end;

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

theorem Th7: :: RELSET_2:7
for b1 being set
for b2, b3 being Subset-Family of b1 holds (Intersect b2) /\ (Intersect b3) c= Intersect (b2 /\ b3)
proof end;

theorem Th8: :: RELSET_2:8
for b1, b2, b3 being Relation holds (b1 /\ b2) * b3 c= (b1 * b3) /\ (b2 * b3)
proof end;

definition
let c1, c2 be set ;
let c3 be Relation of c1,c2;
let c4 be Element of c1;
func c3 .: c4 -> Subset of a2 equals :: RELSET_2:def 1
a3 .: {a4};
correctness
coherence
c3 .: {c4} is Subset of c2
;
;
end;

:: deftheorem Def1 defines .: RELSET_2:def 1 :
for b1, b2 being set
for b3 being Relation of b1,b2
for b4 being Element of b1 holds b3 .: b4 = b3 .: {b4};

theorem Th9: :: RELSET_2:9
for b1, b2 being set
for b3 being Relation holds
( b1 in b3 .: {b2} iff [b2,b1] in b3 )
proof end;

theorem Th10: :: RELSET_2:10
for b1 being set
for b2, b3 being Relation holds (b2 \/ b3) .: {b1} = (b2 .: {b1}) \/ (b3 .: {b1})
proof end;

theorem Th11: :: RELSET_2:11
for b1 being set
for b2, b3 being Relation holds (b2 /\ b3) .: {b1} = (b2 .: {b1}) /\ (b3 .: {b1})
proof end;

theorem Th12: :: RELSET_2:12
for b1 being set
for b2, b3 being Relation holds (b2 \ b3) .: {b1} = (b2 .: {b1}) \ (b3 .: {b1})
proof end;

theorem Th13: :: RELSET_2:13
for b1 being set
for b2, b3 being Relation holds (b2 /\ b3) .: {_{b1}_} c= (b2 .: {_{b1}_}) /\ (b3 .: {_{b1}_})
proof end;

definition
let c1, c2 be set ;
let c3 be Relation of c1,c2;
let c4 be Element of c1;
func c3 " c4 -> Subset of a1 equals :: RELSET_2:def 2
a3 " {a4};
correctness
coherence
c3 " {c4} is Subset of c1
;
;
end;

:: deftheorem Def2 defines " RELSET_2:def 2 :
for b1, b2 being set
for b3 being Relation of b1,b2
for b4 being Element of b1 holds b3 " b4 = b3 " {b4};

theorem Th14: :: RELSET_2:14
for b1 being set
for b2 being Subset-Family of b1
for b3 being Relation holds b3 .: (union b2) = union { (b3 .: b4) where B is Subset of b1 : b4 in b2 }
proof end;

theorem Th15: :: RELSET_2:15
for b1 being non empty set
for b2 being Subset of b1 holds b2 = union { {b3} where B is Element of b1 : b3 in b2 }
proof end;

theorem Th16: :: RELSET_2:16
for b1 being non empty set
for b2 being Subset of b1 holds { {b3} where B is Element of b1 : b3 in b2 } is Subset-Family of b1
proof end;

theorem Th17: :: RELSET_2:17
for b1 being non empty set
for b2 being set
for b3 being Subset of b1
for b4 being Relation of b1,b2 holds b4 .: b3 = union { (b4 .: b5) where B is Element of b1 : b5 in b3 }
proof end;

theorem Th18: :: RELSET_2:18
for b1 being non empty set
for b2 being set
for b3 being Subset of b1
for b4 being Relation of b1,b2 holds { (b4 .: b5) where B is Element of b1 : b5 in b3 } is Subset-Family of b2
proof end;

definition
let c1, c2 be set ;
let c3 be Subset of [:c1,(bool c2):];
let c4 be set ;
redefine func .: as c3 .: c4 -> Subset-Family of a2;
coherence
c3 .: c4 is Subset-Family of c2
proof end;
end;

definition
let c1 be set ;
let c2 be Relation;
func .: c2,c1 -> Function means :Def3: :: RELSET_2:def 3
( dom a3 = bool a1 & ( for b1 being set st b1 c= a1 holds
a3 . b1 = a2 .: b1 ) );
existence
ex b1 being Function st
( dom b1 = bool c1 & ( for b2 being set st b2 c= c1 holds
b1 . b2 = c2 .: b2 ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = bool c1 & ( for b3 being set st b3 c= c1 holds
b1 . b3 = c2 .: b3 ) & dom b2 = bool c1 & ( for b3 being set st b3 c= c1 holds
b2 . b3 = c2 .: b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines .: RELSET_2:def 3 :
for b1 being set
for b2 being Relation
for b3 being Function holds
( b3 = .: b2,b1 iff ( dom b3 = bool b1 & ( for b4 being set st b4 c= b1 holds
b3 . b4 = b2 .: b4 ) ) );

notation
let c1, c2 be set ;
let c3 be Subset of [:c2,c1:];
synonym .: c3 for .: c2,c1;
end;

theorem Th19: :: RELSET_2:19
for b1, b2, b3 being set
for b4 being Subset of [:b2,b3:] st b1 in dom (.: ) holds
(.: ) . b1 = b4 .: b1
proof end;

theorem Th20: :: RELSET_2:20
for b1, b2 being set
for b3 being Subset of [:b1,b2:] holds rng (.: ) c= bool (rng b3)
proof end;

theorem Th21: :: RELSET_2:21
for b1, b2 being set
for b3 being Subset of [:b1,b2:] holds .: is Function of bool b1, bool (rng b3)
proof end;

definition
let c1, c2 be set ;
let c3 be Subset of [:c2,c1:];
redefine func .: as .: c3 -> Function of bool a2, bool a1;
correctness
coherence
.: c3,c2 is Function of bool c2, bool c1
;
proof end;
end;

theorem Th22: :: RELSET_2:22
for b1, b2 being set
for b3 being Subset of [:b1,b2:] holds union ((.: b3) .: b1) c= b3 .: (union b1)
proof end;

definition
let c1, c2 be set ;
let c3 be Subset of c1;
let c4 be Subset of [:c1,c2:];
func c4 .:^ c3 -> set equals :: RELSET_2:def 4
Intersect ((.: a4) .: {_{a3}_});
correctness
coherence
Intersect ((.: c4) .: {_{c3}_}) is set
;
;
end;

:: deftheorem Def4 defines .:^ RELSET_2:def 4 :
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] holds b4 .:^ b3 = Intersect ((.: b4) .: {_{b3}_});

definition
let c1, c2 be set ;
let c3 be Subset of c1;
let c4 be Subset of [:c1,c2:];
redefine func .:^ as c4 .:^ c3 -> Subset of a2;
coherence
c4 .:^ c3 is Subset of c2
;
end;

theorem Th23: :: RELSET_2:23
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] holds
( (.: b4) .: {_{b3}_} = {} iff b3 = {} )
proof end;

theorem Th24: :: RELSET_2:24
for b1, b2, b3 being set
for b4 being Subset of b1
for b5 being Subset of [:b1,b2:] st b3 in b5 .:^ b4 holds
for b6 being set st b6 in b4 holds
b3 in b5 .: {b6}
proof end;

theorem Th25: :: RELSET_2:25
for b1 being non empty set
for b2 being set
for b3 being Subset of b2
for b4 being Element of b1
for b5 being Subset of [:b2,b1:] holds
( b4 in b5 .:^ b3 iff for b6 being set st b6 in b3 holds
b4 in b5 .: {b6} )
proof end;

theorem Th26: :: RELSET_2:26
for b1, b2 being set
for b3, b4 being Subset of b1
for b5 being Subset of [:b1,b2:] st (.: b5) .: {_{b3}_} = {} holds
b5 .:^ (b3 \/ b4) = b5 .:^ b4
proof end;

theorem Th27: :: RELSET_2:27
for b1, b2 being set
for b3, b4 being Subset of b1
for b5 being Subset of [:b1,b2:] holds b5 .:^ (b3 \/ b4) = (b5 .:^ b3) /\ (b5 .:^ b4)
proof end;

theorem Th28: :: RELSET_2:28
for b1 being non empty set
for b2 being set
for b3 being Subset-Family of b1
for b4 being Relation of b1,b2 holds { (b4 .:^ b5) where B is Subset of b1 : b5 in b3 } is Subset-Family of b2
proof end;

theorem Th29: :: RELSET_2:29
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] st b3 = {} holds
b4 .:^ b3 = b2
proof end;

theorem Th30: :: RELSET_2:30
for b1 being set
for b2 being Subset-Family of b1 holds
( union b2 = {} iff for b3 being set st b3 in b2 holds
b3 = {} )
proof end;

theorem Th31: :: RELSET_2:31
for b1 being set
for b2 being non empty set
for b3 being Relation of b1,b2
for b4 being Subset-Family of b1
for b5 being Subset-Family of b2 st b5 = { (b3 .:^ b6) where B is Subset of b1 : b6 in b4 } holds
b3 .:^ (union b4) = Intersect b5
proof end;

theorem Th32: :: RELSET_2:32
for b1, b2 being set
for b3, b4 being Subset of b1
for b5 being Subset of [:b1,b2:] st b3 c= b4 holds
b5 .:^ b4 c= b5 .:^ b3
proof end;

theorem Th33: :: RELSET_2:33
for b1, b2 being set
for b3, b4 being Subset of b1
for b5 being Subset of [:b1,b2:] holds (b5 .:^ b3) \/ (b5 .:^ b4) c= b5 .:^ (b3 /\ b4)
proof end;

theorem Th34: :: RELSET_2:34
for b1, b2 being set
for b3 being Subset of b1
for b4, b5 being Subset of [:b1,b2:] holds (b4 /\ b5) .:^ b3 = (b4 .:^ b3) /\ (b5 .:^ b3)
proof end;

theorem Th35: :: RELSET_2:35
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset-Family of [:b1,b2:] holds (union b4) .: b3 = union { (b5 .: b3) where B is Subset of [:b1,b2:] : b5 in b4 }
proof end;

theorem Th36: :: RELSET_2:36
for b1, b2 being set
for b3 being Subset-Family of [:b1,b2:]
for b4, b5 being set
for b6 being Subset of b4 holds { (b7 .:^ b6) where B is Subset of [:b4,b5:] : b7 in b3 } is Subset-Family of b5
proof end;

theorem Th37: :: RELSET_2:37
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] st b4 = {} & b3 <> {} holds
b4 .:^ b3 = {}
proof end;

theorem Th38: :: RELSET_2:38
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] st b4 = [:b1,b2:] holds
b4 .:^ b3 = b2
proof end;

theorem Th39: :: RELSET_2:39
for b1, b2 being set
for b3 being Subset of b2
for b4 being Subset-Family of [:b2,b1:]
for b5 being Subset-Family of b1 st b5 = { (b6 .:^ b3) where B is Subset of [:b2,b1:] : b6 in b4 } holds
(Intersect b4) .:^ b3 = Intersect b5
proof end;

theorem Th40: :: RELSET_2:40
for b1, b2 being set
for b3 being Subset of b1
for b4, b5 being Subset of [:b1,b2:] st b4 c= b5 holds
b4 .:^ b3 c= b5 .:^ b3
proof end;

theorem Th41: :: RELSET_2:41
for b1, b2 being set
for b3 being Subset of b1
for b4, b5 being Subset of [:b1,b2:] holds (b4 .:^ b3) \/ (b5 .:^ b3) c= (b4 \/ b5) .:^ b3
proof end;

theorem Th42: :: RELSET_2:42
for b1, b2, b3, b4 being set
for b5 being Subset of [:b3,b4:] holds
( b1 in (b5 ` ) .: {b2} iff ( not [b2,b1] in b5 & b2 in b3 & b1 in b4 ) )
proof end;

theorem Th43: :: RELSET_2:43
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] st b3 <> {} holds
b4 .:^ b3 c= b4 .: b3
proof end;

theorem Th44: :: RELSET_2:44
for b1, b2 being set
for b3 being Subset of [:b1,b2:]
for b4, b5 being set holds
( b4 meets (b3 ~ ) .: b5 iff ex b6, b7 being set st
( b6 in b4 & b7 in b5 & b6 in (b3 ~ ) .: {b7} ) )
proof end;

theorem Th45: :: RELSET_2:45
for b1, b2 being set
for b3 being Subset of [:b1,b2:]
for b4, b5 being set holds
( ex b6, b7 being set st
( b6 in b4 & b7 in b5 & b6 in (b3 ~ ) .: {b7} ) iff b5 meets b3 .: b4 )
proof end;

theorem Th46: :: RELSET_2:46
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of b2
for b5 being Subset of [:b1,b2:] holds
( b3 misses (b5 ~ ) .: b4 iff b4 misses b5 .: b3 )
proof end;

theorem Th47: :: RELSET_2:47
for b1, b2 being set
for b3 being Subset of [:b1,b2:]
for b4 being set holds b3 .: b4 = b3 .: (b4 /\ (proj1 b3))
proof end;

theorem Th48: :: RELSET_2:48
for b1, b2 being set
for b3 being Subset of [:b1,b2:]
for b4 being set holds (b3 ~ ) .: b4 = (b3 ~ ) .: (b4 /\ (proj2 b3))
proof end;

theorem Th49: :: RELSET_2:49
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of [:b1,b2:] holds (b4 .:^ b3) ` = (b4 ` ) .: b3
proof end;

definition
let c1, c2, c3 be set ;
let c4 be Subset of [:c1,c2:];
let c5 be Subset of [:c2,c3:];
redefine func * as c4 * c5 -> Relation of a1,a3;
coherence
c4 * c5 is Relation of c1,c3
proof end;
end;

theorem Th50: :: RELSET_2:50
for b1, b2 being set
for b3 being Subset of b1
for b4 being Relation of b1,b2 holds (b4 .: b3) ` = (b4 ` ) .:^ b3
proof end;

theorem Th51: :: RELSET_2:51
for b1, b2 being set
for b3 being Relation of b2,b1 holds
( proj1 b3 = (b3 ~ ) .: b1 & proj2 b3 = b3 .: b2 )
proof end;

theorem Th52: :: RELSET_2:52
for b1, b2, b3 being set
for b4 being Relation of b1,b2
for b5 being Relation of b2,b3 holds
( proj1 (b4 * b5) = (b4 ~ ) .: (proj1 b5) & proj1 (b4 * b5) c= proj1 b4 )
proof end;

theorem Th53: :: RELSET_2:53
for b1, b2, b3 being set
for b4 being Relation of b1,b2
for b5 being Relation of b2,b3 holds
( proj2 (b4 * b5) = b5 .: (proj2 b4) & proj2 (b4 * b5) c= proj2 b5 )
proof end;

theorem Th54: :: RELSET_2:54
for b1, b2 being set
for b3 being Subset of b1
for b4 being Relation of b1,b2 holds
( b3 c= proj1 b4 iff b3 c= (b4 * (b4 ~ )) .: b3 )
proof end;

theorem Th55: :: RELSET_2:55
for b1, b2 being set
for b3 being Subset of b2
for b4 being Relation of b1,b2 holds
( b3 c= proj2 b4 iff b3 c= ((b4 ~ ) * b4) .: b3 )
proof end;

theorem Th56: :: RELSET_2:56
for b1, b2 being set
for b3 being Relation of b2,b1 holds
( proj1 b3 = (b3 ~ ) .: b1 & (b3 ~ ) .: (b3 .: b2) = (b3 ~ ) .: (proj2 b3) ) by Th51;

theorem Th57: :: RELSET_2:57
for b1, b2 being set
for b3 being Relation of b2,b1 holds (b3 ~ ) .: b1 = (b3 * (b3 ~ )) .: b2
proof end;

theorem Th58: :: RELSET_2:58
for b1, b2 being set
for b3 being Relation of b1,b2 holds b3 .: b1 = ((b3 ~ ) * b3) .: b2
proof end;

theorem Th59: :: RELSET_2:59
for b1, b2, b3 being set
for b4 being Subset of b1
for b5 being Relation of b1,b2
for b6 being Relation of b2,b3 holds b6 .:^ (b5 .: b4) = ((b5 * (b6 ` )) ` ) .:^ b4
proof end;

theorem Th60: :: RELSET_2:60
for b1, b2 being set
for b3 being Relation of b1,b2 holds (b3 ` ) ~ = (b3 ~ ) `
proof end;

theorem Th61: :: RELSET_2:61
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of b2
for b5 being Relation of b1,b2 holds
( b3 c= (b5 ~ ) .:^ b4 iff b4 c= b5 .:^ b3 )
proof end;

theorem Th62: :: RELSET_2:62
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of b2
for b5 being Relation of b1,b2 holds
( b5 .: (b3 ` ) c= b4 ` iff (b5 ~ ) .: b4 c= b3 )
proof end;

theorem Th63: :: RELSET_2:63
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of b2
for b5 being Relation of b1,b2 holds
( b3 c= (b5 ~ ) .:^ (b5 .:^ b3) & b4 c= b5 .:^ ((b5 ~ ) .:^ b4) ) by Th61;

theorem Th64: :: RELSET_2:64
for b1, b2 being set
for b3 being Subset of b1
for b4 being Subset of b2
for b5 being Relation of b1,b2 holds
( b5 .:^ b3 = b5 .:^ ((b5 ~ ) .:^ (b5 .:^ b3)) & (b5 ~ ) .:^ b4 = (b5 ~ ) .:^ (b5 .:^ ((b5 ~ ) .:^ b4)) )
proof end;

theorem Th65: :: RELSET_2:65
for b1, b2 being set
for b3 being Relation of b1,b2 holds (id b1) * b3 = b3 * (id b2)
proof end;