:: YELLOW_1 semantic presentation

registration
let c1 be Lattice;
cluster LattPOSet a1 -> with_suprema with_infima ;
coherence
( LattPOSet c1 is with_suprema & LattPOSet c1 is with_infima )
by LATTICE3:11;
end;

registration
let c1 be upper-bounded Lattice;
cluster LattPOSet a1 -> upper-bounded with_suprema with_infima ;
coherence
LattPOSet c1 is upper-bounded
proof end;
end;

registration
let c1 be lower-bounded Lattice;
cluster LattPOSet a1 -> lower-bounded with_suprema with_infima ;
coherence
LattPOSet c1 is lower-bounded
proof end;
end;

registration
let c1 be complete Lattice;
cluster LattPOSet a1 -> lower-bounded upper-bounded with_suprema with_infima complete ;
coherence
LattPOSet c1 is complete
proof end;
end;

definition
let c1 be set ;
redefine func RelIncl as RelIncl c1 -> Order of a1;
coherence
RelIncl c1 is Order of c1
proof end;
end;

definition
let c1 be set ;
func InclPoset c1 -> strict RelStr equals :: YELLOW_1:def 1
RelStr(# a1,(RelIncl a1) #);
correctness
coherence
RelStr(# c1,(RelIncl c1) #) is strict RelStr
;
;
end;

:: deftheorem Def1 defines InclPoset YELLOW_1:def 1 :
for b1 being set holds InclPoset b1 = RelStr(# b1,(RelIncl b1) #);

registration
let c1 be set ;
cluster InclPoset a1 -> strict reflexive transitive antisymmetric ;
coherence
( InclPoset c1 is reflexive & InclPoset c1 is antisymmetric & InclPoset c1 is transitive )
;
end;

registration
let c1 be non empty set ;
cluster InclPoset a1 -> non empty strict reflexive transitive antisymmetric ;
coherence
not InclPoset c1 is empty
;
end;

theorem Th1: :: YELLOW_1:1
for b1 being set holds
( the carrier of (InclPoset b1) = b1 & the InternalRel of (InclPoset b1) = RelIncl b1 ) ;

definition
let c1 be set ;
func BoolePoset c1 -> strict RelStr equals :: YELLOW_1:def 2
LattPOSet (BooleLatt a1);
correctness
coherence
LattPOSet (BooleLatt c1) is strict RelStr
;
;
end;

:: deftheorem Def2 defines BoolePoset YELLOW_1:def 2 :
for b1 being set holds BoolePoset b1 = LattPOSet (BooleLatt b1);

registration
let c1 be set ;
cluster BoolePoset a1 -> non empty strict reflexive transitive antisymmetric ;
coherence
( not BoolePoset c1 is empty & BoolePoset c1 is reflexive & BoolePoset c1 is antisymmetric & BoolePoset c1 is transitive )
;
end;

registration
let c1 be set ;
cluster BoolePoset a1 -> non empty strict reflexive transitive antisymmetric complete ;
coherence
BoolePoset c1 is complete
;
end;

theorem Th2: :: YELLOW_1:2
for b1 being set
for b2, b3 being Element of (BoolePoset b1) holds
( b2 <= b3 iff b2 c= b3 )
proof end;

theorem Th3: :: YELLOW_1:3
for b1 being non empty set
for b2, b3 being Element of (InclPoset b1) holds
( b2 <= b3 iff b2 c= b3 )
proof end;

theorem Th4: :: YELLOW_1:4
for b1 being set holds BoolePoset b1 = InclPoset (bool b1)
proof end;

theorem Th5: :: YELLOW_1:5
for b1 being set
for b2 being Subset-Family of b1 holds InclPoset b2 is full SubRelStr of BoolePoset b1
proof end;

theorem Th6: :: YELLOW_1:6
for b1 being non empty set st InclPoset b1 is with_suprema holds
for b2, b3 being Element of (InclPoset b1) holds b2 \/ b3 c= b2 "\/" b3
proof end;

theorem Th7: :: YELLOW_1:7
for b1 being non empty set st InclPoset b1 is with_infima holds
for b2, b3 being Element of (InclPoset b1) holds b2 "/\" b3 c= b2 /\ b3
proof end;

theorem Th8: :: YELLOW_1:8
for b1 being non empty set
for b2, b3 being Element of (InclPoset b1) st b2 \/ b3 in b1 holds
b2 "\/" b3 = b2 \/ b3
proof end;

theorem Th9: :: YELLOW_1:9
for b1 being non empty set
for b2, b3 being Element of (InclPoset b1) st b2 /\ b3 in b1 holds
b2 "/\" b3 = b2 /\ b3
proof end;

theorem Th10: :: YELLOW_1:10
for b1 being RelStr st ( for b2, b3 being Element of b1 holds
( b2 <= b3 iff b2 c= b3 ) ) holds
the InternalRel of b1 = RelIncl the carrier of b1
proof end;

theorem Th11: :: YELLOW_1:11
for b1 being non empty set st ( for b2, b3 being set st b2 in b1 & b3 in b1 holds
b2 \/ b3 in b1 ) holds
InclPoset b1 is with_suprema
proof end;

theorem Th12: :: YELLOW_1:12
for b1 being non empty set st ( for b2, b3 being set st b2 in b1 & b3 in b1 holds
b2 /\ b3 in b1 ) holds
InclPoset b1 is with_infima
proof end;

theorem Th13: :: YELLOW_1:13
for b1 being non empty set st {} in b1 holds
Bottom (InclPoset b1) = {}
proof end;

theorem Th14: :: YELLOW_1:14
for b1 being non empty set st union b1 in b1 holds
Top (InclPoset b1) = union b1
proof end;

theorem Th15: :: YELLOW_1:15
for b1 being non empty set st InclPoset b1 is upper-bounded holds
union b1 in b1
proof end;

theorem Th16: :: YELLOW_1:16
for b1 being non empty set st InclPoset b1 is lower-bounded holds
meet b1 in b1
proof end;

Lemma8: for b1 being set holds the carrier of (BoolePoset b1) = bool b1
by LATTICE3:def 1;

Lemma9: for b1 being set
for b2, b3 being Element of (BoolePoset b1) holds
( b2 /\ b3 in bool b1 & b2 \/ b3 in bool b1 )
proof end;

theorem Th17: :: YELLOW_1:17
for b1 being set
for b2, b3 being Element of (BoolePoset b1) holds
( b2 "\/" b3 = b2 \/ b3 & b2 "/\" b3 = b2 /\ b3 )
proof end;

theorem Th18: :: YELLOW_1:18
for b1 being set holds Bottom (BoolePoset b1) = {}
proof end;

theorem Th19: :: YELLOW_1:19
for b1 being set holds Top (BoolePoset b1) = b1
proof end;

theorem Th20: :: YELLOW_1:20
for b1 being set
for b2 being non empty Subset of (BoolePoset b1) holds inf b2 = meet b2
proof end;

theorem Th21: :: YELLOW_1:21
for b1 being set
for b2 being Subset of (BoolePoset b1) holds sup b2 = union b2
proof end;

theorem Th22: :: YELLOW_1:22
for b1 being non empty TopSpace
for b2 being Subset of (InclPoset the topology of b1) holds sup b2 = union b2
proof end;

theorem Th23: :: YELLOW_1:23
for b1 being non empty TopSpace holds Bottom (InclPoset the topology of b1) = {}
proof end;

Lemma10: for b1 being non empty TopSpace holds InclPoset the topology of b1 is lower-bounded
proof end;

theorem Th24: :: YELLOW_1:24
for b1 being non empty TopSpace holds Top (InclPoset the topology of b1) = the carrier of b1
proof end;

Lemma11: for b1 being non empty TopSpace holds InclPoset the topology of b1 is complete
proof end;

Lemma12: for b1 being non empty TopSpace holds not InclPoset the topology of b1 is trivial
proof end;

registration
let c1 be non empty TopSpace;
cluster InclPoset the topology of a1 -> non empty strict reflexive transitive antisymmetric complete non trivial ;
coherence
( InclPoset the topology of c1 is complete & not InclPoset the topology of c1 is trivial )
by Lemma11, Lemma12;
end;

theorem Th25: :: YELLOW_1:25
for b1 being TopSpace
for b2 being Subset-Family of b1 holds
( b2 is open iff b2 is Subset of (InclPoset the topology of b1) )
proof end;

definition
let c1 be Relation;
attr a1 is RelStr-yielding means :Def3: :: YELLOW_1:def 3
for b1 being set st b1 in rng a1 holds
b1 is RelStr ;
end;

:: deftheorem Def3 defines RelStr-yielding YELLOW_1:def 3 :
for b1 being Relation holds
( b1 is RelStr-yielding iff for b2 being set st b2 in rng b1 holds
b2 is RelStr );

registration
cluster RelStr-yielding -> 1-sorted-yielding set ;
coherence
for b1 being Function st b1 is RelStr-yielding holds
b1 is 1-sorted-yielding
proof end;
end;

registration
let c1 be set ;
cluster 1-sorted-yielding RelStr-yielding ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is RelStr-yielding
proof end;
end;

definition
let c1 be non empty set ;
let c2 be RelStr-yielding ManySortedSet of c1;
let c3 be Element of c1;
redefine func . as c2 . c3 -> RelStr ;
coherence
c2 . c3 is RelStr
proof end;
end;

definition
let c1 be set ;
let c2 be RelStr-yielding ManySortedSet of c1;
func product c2 -> strict RelStr means :Def4: :: YELLOW_1:def 4
( the carrier of a3 = product (Carrier a2) & ( for b1, b2 being Element of a3 st b1 in product (Carrier a2) holds
( b1 <= b2 iff ex b3, b4 being Function st
( b3 = b1 & b4 = b2 & ( for b5 being set st b5 in a1 holds
ex b6 being RelStr ex b7, b8 being Element of b6 st
( b6 = a2 . b5 & b7 = b3 . b5 & b8 = b4 . b5 & b7 <= b8 ) ) ) ) ) );
existence
ex b1 being strict RelStr st
( the carrier of b1 = product (Carrier c2) & ( for b2, b3 being Element of b1 st b2 in product (Carrier c2) holds
( b2 <= b3 iff ex b4, b5 being Function st
( b4 = b2 & b5 = b3 & ( for b6 being set st b6 in c1 holds
ex b7 being RelStr ex b8, b9 being Element of b7 st
( b7 = c2 . b6 & b8 = b4 . b6 & b9 = b5 . b6 & b8 <= b9 ) ) ) ) ) )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = product (Carrier c2) & ( for b3, b4 being Element of b1 st b3 in product (Carrier c2) holds
( b3 <= b4 iff ex b5, b6 being Function st
( b5 = b3 & b6 = b4 & ( for b7 being set st b7 in c1 holds
ex b8 being RelStr ex b9, b10 being Element of b8 st
( b8 = c2 . b7 & b9 = b5 . b7 & b10 = b6 . b7 & b9 <= b10 ) ) ) ) ) & the carrier of b2 = product (Carrier c2) & ( for b3, b4 being Element of b2 st b3 in product (Carrier c2) holds
( b3 <= b4 iff ex b5, b6 being Function st
( b5 = b3 & b6 = b4 & ( for b7 being set st b7 in c1 holds
ex b8 being RelStr ex b9, b10 being Element of b8 st
( b8 = c2 . b7 & b9 = b5 . b7 & b10 = b6 . b7 & b9 <= b10 ) ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines product YELLOW_1:def 4 :
for b1 being set
for b2 being RelStr-yielding ManySortedSet of b1
for b3 being strict RelStr holds
( b3 = product b2 iff ( the carrier of b3 = product (Carrier b2) & ( for b4, b5 being Element of b3 st b4 in product (Carrier b2) holds
( b4 <= b5 iff ex b6, b7 being Function st
( b6 = b4 & b7 = b5 & ( for b8 being set st b8 in b1 holds
ex b9 being RelStr ex b10, b11 being Element of b9 st
( b9 = b2 . b8 & b10 = b6 . b8 & b11 = b7 . b8 & b10 <= b11 ) ) ) ) ) ) );

registration
let c1 be set ;
let c2 be RelStr ;
cluster K134(a1,a2) -> 1-sorted-yielding RelStr-yielding ;
coherence
c1 --> c2 is RelStr-yielding
proof end;
end;

definition
let c1 be set ;
let c2 be RelStr ;
func c2 |^ c1 -> strict RelStr equals :: YELLOW_1:def 5
product (a1 --> a2);
correctness
coherence
product (c1 --> c2) is strict RelStr
;
;
end;

:: deftheorem Def5 defines |^ YELLOW_1:def 5 :
for b1 being set
for b2 being RelStr holds b2 |^ b1 = product (b1 --> b2);

theorem Th26: :: YELLOW_1:26
for b1 being RelStr-yielding ManySortedSet of {} holds product b1 = RelStr(# {{} },(id {{} }) #)
proof end;

theorem Th27: :: YELLOW_1:27
for b1 being RelStr holds b1 |^ {} = RelStr(# {{} },(id {{} }) #) by Th26;

theorem Th28: :: YELLOW_1:28
for b1 being set
for b2 being RelStr holds Funcs b1,the carrier of b2 = the carrier of (b2 |^ b1)
proof end;

registration
let c1 be set ;
let c2 be non empty RelStr ;
cluster a2 |^ a1 -> non empty strict ;
coherence
not c2 |^ c1 is empty
proof end;
end;

Lemma18: for b1 being set
for b2 being non empty RelStr
for b3 being Element of (b2 |^ b1) holds
( b3 in the carrier of (product (b1 --> b2)) & b3 is Function of b1,the carrier of b2 )
proof end;

registration
let c1 be set ;
let c2 be non empty reflexive RelStr ;
cluster a2 |^ a1 -> non empty strict reflexive ;
coherence
c2 |^ c1 is reflexive
proof end;
end;

registration
let c1 be non empty RelStr ;
cluster a1 |^ {} -> non empty strict trivial ;
coherence
c1 |^ {} is trivial
by Th27;
end;

registration
let c1 be non empty reflexive RelStr ;
cluster a1 |^ {} -> non empty strict reflexive antisymmetric with_suprema with_infima trivial ;
coherence
( c1 |^ {} is with_infima & c1 |^ {} is with_suprema & c1 |^ {} is antisymmetric )
;
end;

registration
let c1 be set ;
let c2 be non empty transitive RelStr ;
cluster a2 |^ a1 -> non empty strict transitive ;
coherence
c2 |^ c1 is transitive
proof end;
end;

registration
let c1 be set ;
let c2 be non empty antisymmetric RelStr ;
cluster a2 |^ a1 -> non empty strict antisymmetric ;
coherence
c2 |^ c1 is antisymmetric
proof end;
end;

registration
let c1 be non empty set ;
let c2 be non empty antisymmetric with_infima RelStr ;
cluster a2 |^ a1 -> non empty strict antisymmetric with_infima ;
coherence
c2 |^ c1 is with_infima
proof end;
end;

registration
let c1 be non empty set ;
let c2 be non empty antisymmetric with_suprema RelStr ;
cluster a2 |^ a1 -> non empty strict antisymmetric with_suprema ;
coherence
c2 |^ c1 is with_suprema
proof end;
end;

definition
let c1, c2 be RelStr ;
func MonMaps c1,c2 -> strict full SubRelStr of a2 |^ the carrier of a1 means :: YELLOW_1:def 6
for b1 being Function of a1,a2 holds
( b1 in the carrier of a3 iff ( b1 in Funcs the carrier of a1,the carrier of a2 & b1 is monotone ) );
existence
ex b1 being strict full SubRelStr of c2 |^ the carrier of c1 st
for b2 being Function of c1,c2 holds
( b2 in the carrier of b1 iff ( b2 in Funcs the carrier of c1,the carrier of c2 & b2 is monotone ) )
proof end;
uniqueness
for b1, b2 being strict full SubRelStr of c2 |^ the carrier of c1 st ( for b3 being Function of c1,c2 holds
( b3 in the carrier of b1 iff ( b3 in Funcs the carrier of c1,the carrier of c2 & b3 is monotone ) ) ) & ( for b3 being Function of c1,c2 holds
( b3 in the carrier of b2 iff ( b3 in Funcs the carrier of c1,the carrier of c2 & b3 is monotone ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines MonMaps YELLOW_1:def 6 :
for b1, b2 being RelStr
for b3 being strict full SubRelStr of b2 |^ the carrier of b1 holds
( b3 = MonMaps b1,b2 iff for b4 being Function of b1,b2 holds
( b4 in the carrier of b3 iff ( b4 in Funcs the carrier of b1,the carrier of b2 & b4 is monotone ) ) );