:: YELLOW_2 semantic presentation

theorem Th1: :: YELLOW_2:1
for b1 being non empty RelStr
for b2 being Element of b1
for b3 being Subset of b1 holds
( b3 c= downarrow b2 iff b3 is_<=_than b2 )
proof end;

theorem Th2: :: YELLOW_2:2
for b1 being non empty RelStr
for b2 being Element of b1
for b3 being Subset of b1 holds
( b3 c= uparrow b2 iff b2 is_<=_than b3 )
proof end;

theorem Th3: :: YELLOW_2:3
for b1 being transitive antisymmetric with_suprema RelStr
for b2, b3 being set st ex_sup_of b2,b1 & ex_sup_of b3,b1 holds
( ex_sup_of b2 \/ b3,b1 & "\/" (b2 \/ b3),b1 = ("\/" b2,b1) "\/" ("\/" b3,b1) )
proof end;

theorem Th4: :: YELLOW_2:4
for b1 being transitive antisymmetric with_infima RelStr
for b2, b3 being set st ex_inf_of b2,b1 & ex_inf_of b3,b1 holds
( ex_inf_of b2 \/ b3,b1 & "/\" (b2 \/ b3),b1 = ("/\" b2,b1) "/\" ("/\" b3,b1) )
proof end;

theorem Th5: :: YELLOW_2:5
for b1 being Relation
for b2, b3 being set st b2 c= b3 holds
b1 |_2 b2 c= b1 |_2 b3
proof end;

theorem Th6: :: YELLOW_2:6
for b1 being RelStr
for b2, b3 being full SubRelStr of b1 st the carrier of b2 c= the carrier of b3 holds
the InternalRel of b2 c= the InternalRel of b3
proof end;

theorem Th7: :: YELLOW_2:7
for b1 being set
for b2 being non empty RelStr
for b3 being non empty SubRelStr of b2 holds
( ( b1 is directed Subset of b3 implies b1 is directed Subset of b2 ) & ( b1 is filtered Subset of b3 implies b1 is filtered Subset of b2 ) )
proof end;

theorem Th8: :: YELLOW_2:8
for b1 being non empty RelStr
for b2, b3 being non empty full SubRelStr of b1 st the carrier of b2 c= the carrier of b3 holds
for b4 being Subset of b2 holds
( b4 is Subset of b3 & ( for b5 being Subset of b3 st b4 = b5 holds
( ( b4 is filtered implies b5 is filtered ) & ( b4 is directed implies b5 is directed ) ) ) )
proof end;

definition
let c1, c2 be 1-sorted ;
let c3 be Function of c1,c2;
redefine func rng as rng c3 -> Subset of a2;
coherence
rng c3 is Subset of c2
by RELSET_1:12;
end;

definition
let c1 be set ;
let c2 be RelStr ;
let c3, c4 be Function of c1,the carrier of c2;
pred c3 <= c4 means :Def1: :: YELLOW_2:def 1
for b1 being set st b1 in a1 holds
ex b2, b3 being Element of a2 st
( b2 = a3 . b1 & b3 = a4 . b1 & b2 <= b3 );
end;

:: deftheorem Def1 defines <= YELLOW_2:def 1 :
for b1 being set
for b2 being RelStr
for b3, b4 being Function of b1,the carrier of b2 holds
( b3 <= b4 iff for b5 being set st b5 in b1 holds
ex b6, b7 being Element of b2 st
( b6 = b3 . b5 & b7 = b4 . b5 & b6 <= b7 ) );

notation
let c1 be set ;
let c2 be RelStr ;
let c3, c4 be Function of c1,the carrier of c2;
synonym c4 >= c3 for c3 <= c4;
end;

theorem Th9: :: YELLOW_2:9
canceled;

theorem Th10: :: YELLOW_2:10
for b1, b2 being non empty RelStr
for b3, b4 being Function of b1,b2 holds
( b3 <= b4 iff for b5 being Element of b1 holds b3 . b5 <= b4 . b5 )
proof end;

definition
let c1, c2 be non empty RelStr ;
let c3 be Function of c1,c2;
func Image c3 -> strict full SubRelStr of a2 equals :: YELLOW_2:def 2
subrelstr (rng a3);
correctness
coherence
subrelstr (rng c3) is strict full SubRelStr of c2
;
;
end;

:: deftheorem Def2 defines Image YELLOW_2:def 2 :
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2 holds Image b3 = subrelstr (rng b3);

theorem Th11: :: YELLOW_2:11
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2 holds rng b3 = the carrier of (Image b3) by YELLOW_0:def 15;

theorem Th12: :: YELLOW_2:12
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2
for b4 being Element of (Image b3) ex b5 being Element of b1 st b3 . b5 = b4
proof end;

registration
let c1 be non empty RelStr ;
let c2 be non empty Subset of c1;
cluster subrelstr a2 -> non empty ;
coherence
not subrelstr c2 is empty
proof end;
end;

registration
let c1, c2 be non empty RelStr ;
let c3 be Function of c1,c2;
cluster Image a3 -> non empty strict full ;
coherence
not Image c3 is empty
proof end;
end;

theorem Th13: :: YELLOW_2:13
for b1 being non empty RelStr holds id b1 is monotone
proof end;

theorem Th14: :: YELLOW_2:14
for b1, b2, b3 being non empty RelStr
for b4 being Function of b1,b2
for b5 being Function of b2,b3 st b4 is monotone & b5 is monotone holds
b5 * b4 is monotone
proof end;

theorem Th15: :: YELLOW_2:15
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2
for b4 being Subset of b1
for b5 being Element of b1 st b3 is monotone & b5 is_<=_than b4 holds
b3 . b5 is_<=_than b3 .: b4
proof end;

theorem Th16: :: YELLOW_2:16
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2
for b4 being Subset of b1
for b5 being Element of b1 st b3 is monotone & b4 is_<=_than b5 holds
b3 .: b4 is_<=_than b3 . b5
proof end;

theorem Th17: :: YELLOW_2:17
for b1, b2 being non empty RelStr
for b3 being Function of b1,b2
for b4 being directed Subset of b1 st b3 is monotone holds
b3 .: b4 is directed
proof end;

theorem Th18: :: YELLOW_2:18
for b1 being with_suprema Poset
for b2 being Function of b1,b1 st b2 is directed-sups-preserving holds
b2 is monotone
proof end;

theorem Th19: :: YELLOW_2:19
for b1 being with_infima Poset
for b2 being Function of b1,b1 st b2 is filtered-infs-preserving holds
b2 is monotone
proof end;

theorem Th20: :: YELLOW_2:20
for b1 being non empty 1-sorted
for b2 being Function of b1,b1 st b2 is idempotent holds
for b3 being Element of b1 holds b2 . (b2 . b3) = b2 . b3
proof end;

theorem Th21: :: YELLOW_2:21
for b1 being non empty 1-sorted
for b2 being Function of b1,b1 st b2 is idempotent holds
rng b2 = { b3 where B is Element of b1 : b3 = b2 . b3 }
proof end;

theorem Th22: :: YELLOW_2:22
for b1 being set
for b2 being non empty 1-sorted
for b3 being Function of b2,b2 st b3 is idempotent & b1 c= rng b3 holds
b3 .: b1 = b1
proof end;

theorem Th23: :: YELLOW_2:23
for b1 being non empty RelStr holds id b1 is idempotent
proof end;

theorem Th24: :: YELLOW_2:24
for b1 being set
for b2 being complete LATTICE
for b3 being Element of b2 st b3 in b1 holds
( b3 <= "\/" b1,b2 & "/\" b1,b2 <= b3 )
proof end;

theorem Th25: :: YELLOW_2:25
for b1 being non empty RelStr holds
( ( for b2 being set holds ex_sup_of b2,b1 ) iff for b2 being set holds ex_inf_of b2,b1 )
proof end;

theorem Th26: :: YELLOW_2:26
for b1 being non empty RelStr st ( for b2 being set holds ex_sup_of b2,b1 ) holds
b1 is complete
proof end;

theorem Th27: :: YELLOW_2:27
for b1 being non empty RelStr st ( for b2 being set holds ex_inf_of b2,b1 ) holds
b1 is complete
proof end;

theorem Th28: :: YELLOW_2:28
for b1 being non empty RelStr st ( for b2 being Subset of b1 holds ex_inf_of b2,b1 ) holds
for b2 being set holds
( ex_inf_of b2,b1 & "/\" b2,b1 = "/\" (b2 /\ the carrier of b1),b1 )
proof end;

theorem Th29: :: YELLOW_2:29
for b1 being non empty RelStr st ( for b2 being Subset of b1 holds ex_sup_of b2,b1 ) holds
for b2 being set holds
( ex_sup_of b2,b1 & "\/" b2,b1 = "\/" (b2 /\ the carrier of b1),b1 )
proof end;

theorem Th30: :: YELLOW_2:30
for b1 being non empty RelStr st ( for b2 being Subset of b1 holds ex_inf_of b2,b1 ) holds
b1 is complete
proof end;

Lemma14: for b1 being non empty Poset st b1 is up-complete & b1 is /\-complete & b1 is upper-bounded holds
b1 is non empty complete Poset
proof end;

registration
cluster non empty upper-bounded up-complete /\-complete -> non empty complete RelStr ;
correctness
coherence
for b1 being non empty Poset st b1 is up-complete & b1 is /\-complete & b1 is upper-bounded holds
b1 is complete
;
by Lemma14;
end;

theorem Th31: :: YELLOW_2:31
for b1 being complete LATTICE
for b2 being Function of b1,b1 st b2 is monotone holds
for b3 being Subset of b1 st b3 = { b4 where B is Element of b1 : b4 = b2 . b4 } holds
subrelstr b3 is complete LATTICE
proof end;

theorem Th32: :: YELLOW_2:32
for b1 being complete LATTICE
for b2 being non empty full infs-inheriting SubRelStr of b1 holds b2 is complete LATTICE
proof end;

theorem Th33: :: YELLOW_2:33
for b1 being complete LATTICE
for b2 being non empty full sups-inheriting SubRelStr of b1 holds b2 is complete LATTICE
proof end;

theorem Th34: :: YELLOW_2:34
for b1 being complete LATTICE
for b2 being non empty RelStr
for b3 being Function of b1,b2 st b3 is sups-preserving holds
Image b3 is sups-inheriting
proof end;

theorem Th35: :: YELLOW_2:35
for b1 being complete LATTICE
for b2 being non empty RelStr
for b3 being Function of b1,b2 st b3 is infs-preserving holds
Image b3 is infs-inheriting
proof end;

theorem Th36: :: YELLOW_2:36
for b1, b2 being complete LATTICE
for b3 being Function of b1,b2 st ( b3 is sups-preserving or b3 is infs-preserving ) holds
Image b3 is complete LATTICE
proof end;

theorem Th37: :: YELLOW_2:37
for b1 being complete LATTICE
for b2 being Function of b1,b1 st b2 is idempotent & b2 is directed-sups-preserving holds
( Image b2 is directed-sups-inheriting & Image b2 is complete LATTICE )
proof end;

theorem Th38: :: YELLOW_2:38
for b1 being RelStr
for b2 being Subset-Family of b1 st ( for b3 being Subset of b1 st b3 in b2 holds
b3 is lower ) holds
meet b2 is lower Subset of b1
proof end;

theorem Th39: :: YELLOW_2:39
for b1 being RelStr
for b2 being Subset-Family of b1 st ( for b3 being Subset of b1 st b3 in b2 holds
b3 is upper ) holds
meet b2 is upper Subset of b1
proof end;

theorem Th40: :: YELLOW_2:40
for b1 being antisymmetric with_suprema RelStr
for b2 being Subset-Family of b1 st ( for b3 being Subset of b1 st b3 in b2 holds
( b3 is lower & b3 is directed ) ) holds
meet b2 is directed Subset of b1
proof end;

theorem Th41: :: YELLOW_2:41
for b1 being antisymmetric with_infima RelStr
for b2 being Subset-Family of b1 st ( for b3 being Subset of b1 st b3 in b2 holds
( b3 is upper & b3 is filtered ) ) holds
meet b2 is filtered Subset of b1
proof end;

theorem Th42: :: YELLOW_2:42
for b1 being with_infima Poset
for b2, b3 being Ideal of b1 holds b2 /\ b3 is Ideal of b1
proof end;

registration
let c1 be non empty reflexive transitive RelStr ;
cluster Ids a1 -> non empty ;
correctness
coherence
not Ids c1 is empty
;
proof end;
end;

theorem Th43: :: YELLOW_2:43
for b1 being set
for b2 being non empty reflexive transitive RelStr holds
( b1 is Element of (InclPoset (Ids b2)) iff b1 is Ideal of b2 )
proof end;

theorem Th44: :: YELLOW_2:44
for b1 being set
for b2 being non empty reflexive transitive RelStr
for b3 being Element of (InclPoset (Ids b2)) st b1 in b3 holds
b1 is Element of b2
proof end;

theorem Th45: :: YELLOW_2:45
for b1 being with_infima Poset
for b2, b3 being Element of (InclPoset (Ids b1)) holds b2 "/\" b3 = b2 /\ b3
proof end;

registration
let c1 be with_infima Poset;
cluster InclPoset (Ids a1) -> with_infima ;
correctness
coherence
InclPoset (Ids c1) is with_infima
;
proof end;
end;

theorem Th46: :: YELLOW_2:46
for b1 being with_suprema Poset
for b2, b3 being Element of (InclPoset (Ids b1)) ex b4 being Subset of b1 st
( b4 = { b5 where B is Element of b1 : ( b5 in b2 or b5 in b3 or ex b1, b2 being Element of b1 st
( b6 in b2 & b7 in b3 & b5 = b6 "\/" b7 ) )
}
& ex_sup_of {b2,b3}, InclPoset (Ids b1) & b2 "\/" b3 = downarrow b4 )
proof end;

registration
let c1 be with_suprema Poset;
cluster InclPoset (Ids a1) -> with_suprema ;
correctness
coherence
InclPoset (Ids c1) is with_suprema
;
proof end;
end;

theorem Th47: :: YELLOW_2:47
for b1 being lower-bounded sup-Semilattice
for b2 being non empty Subset of (Ids b1) holds meet b2 is Ideal of b1
proof end;

theorem Th48: :: YELLOW_2:48
for b1 being lower-bounded sup-Semilattice
for b2 being non empty Subset of (InclPoset (Ids b1)) holds
( ex_inf_of b2, InclPoset (Ids b1) & inf b2 = meet b2 )
proof end;

theorem Th49: :: YELLOW_2:49
for b1 being with_suprema Poset holds
( ex_inf_of {} , InclPoset (Ids b1) & "/\" {} ,(InclPoset (Ids b1)) = [#] b1 )
proof end;

theorem Th50: :: YELLOW_2:50
for b1 being lower-bounded sup-Semilattice holds InclPoset (Ids b1) is complete
proof end;

registration
let c1 be lower-bounded sup-Semilattice;
cluster InclPoset (Ids a1) -> with_suprema complete ;
correctness
coherence
InclPoset (Ids c1) is complete
;
by Th50;
end;

definition
let c1 be non empty Poset;
func SupMap c1 -> Function of (InclPoset (Ids a1)),a1 means :Def3: :: YELLOW_2:def 3
for b1 being Ideal of a1 holds a2 . b1 = sup b1;
existence
ex b1 being Function of (InclPoset (Ids c1)),c1 st
for b2 being Ideal of c1 holds b1 . b2 = sup b2
proof end;
uniqueness
for b1, b2 being Function of (InclPoset (Ids c1)),c1 st ( for b3 being Ideal of c1 holds b1 . b3 = sup b3 ) & ( for b3 being Ideal of c1 holds b2 . b3 = sup b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines SupMap YELLOW_2:def 3 :
for b1 being non empty Poset
for b2 being Function of (InclPoset (Ids b1)),b1 holds
( b2 = SupMap b1 iff for b3 being Ideal of b1 holds b2 . b3 = sup b3 );

theorem Th51: :: YELLOW_2:51
for b1 being non empty Poset holds
( dom (SupMap b1) = Ids b1 & rng (SupMap b1) is Subset of b1 )
proof end;

theorem Th52: :: YELLOW_2:52
for b1 being set
for b2 being non empty Poset holds
( b1 in dom (SupMap b2) iff b1 is Ideal of b2 )
proof end;

theorem Th53: :: YELLOW_2:53
for b1 being non empty up-complete Poset holds SupMap b1 is monotone
proof end;

registration
let c1 be non empty up-complete Poset;
cluster SupMap a1 -> monotone ;
correctness
coherence
SupMap c1 is monotone
;
by Th53;
end;

definition
let c1 be non empty Poset;
func IdsMap c1 -> Function of a1,(InclPoset (Ids a1)) means :Def4: :: YELLOW_2:def 4
for b1 being Element of a1 holds a2 . b1 = downarrow b1;
existence
ex b1 being Function of c1,(InclPoset (Ids c1)) st
for b2 being Element of c1 holds b1 . b2 = downarrow b2
proof end;
uniqueness
for b1, b2 being Function of c1,(InclPoset (Ids c1)) st ( for b3 being Element of c1 holds b1 . b3 = downarrow b3 ) & ( for b3 being Element of c1 holds b2 . b3 = downarrow b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines IdsMap YELLOW_2:def 4 :
for b1 being non empty Poset
for b2 being Function of b1,(InclPoset (Ids b1)) holds
( b2 = IdsMap b1 iff for b3 being Element of b1 holds b2 . b3 = downarrow b3 );

theorem Th54: :: YELLOW_2:54
for b1 being non empty Poset holds IdsMap b1 is monotone
proof end;

registration
let c1 be non empty Poset;
cluster IdsMap a1 -> monotone ;
correctness
coherence
IdsMap c1 is monotone
;
by Th54;
end;

definition
let c1 be non empty RelStr ;
let c2 be Relation;
func \\/ c2,c1 -> Element of a1 equals :: YELLOW_2:def 5
"\/" (rng a2),a1;
coherence
"\/" (rng c2),c1 is Element of c1
;
func //\ c2,c1 -> Element of a1 equals :: YELLOW_2:def 6
"/\" (rng a2),a1;
coherence
"/\" (rng c2),c1 is Element of c1
;
end;

:: deftheorem Def5 defines \\/ YELLOW_2:def 5 :
for b1 being non empty RelStr
for b2 being Relation holds \\/ b2,b1 = "\/" (rng b2),b1;

:: deftheorem Def6 defines //\ YELLOW_2:def 6 :
for b1 being non empty RelStr
for b2 being Relation holds //\ b2,b1 = "/\" (rng b2),b1;

notation
let c1 be set ;
let c2 be non empty RelStr ;
let c3 be Function of c1,the carrier of c2;
synonym Sup c3 for \\/ c2,c1;
synonym Inf c3 for //\ c2,c1;
end;

definition
let c1 be non empty set ;
let c2 be non empty 1-sorted ;
let c3 be Function of c1,the carrier of c2;
let c4 be Element of c1;
redefine func . as c3 . c4 -> Element of a2;
coherence
c3 . c4 is Element of c2
proof end;
end;

definition
let c1 be set ;
let c2 be non empty 1-sorted ;
let c3 be Function of c1,the carrier of c2;
redefine func rng as rng c3 -> Subset of a2;
coherence
rng c3 is Subset of c2
by RELSET_1:12;
end;

theorem Th55: :: YELLOW_2:55
for b1 being complete LATTICE
for b2 being non empty set
for b3 being Element of b2
for b4 being Function of b2,the carrier of b1 holds
( b4 . b3 <= Sup & Inf <= b4 . b3 )
proof end;

theorem Th56: :: YELLOW_2:56
for b1 being complete LATTICE
for b2 being Element of b1
for b3 being non empty set
for b4 being Function of b3,the carrier of b1 st ( for b5 being Element of b3 holds b4 . b5 <= b2 ) holds
Sup <= b2
proof end;

theorem Th57: :: YELLOW_2:57
for b1 being complete LATTICE
for b2 being Element of b1
for b3 being non empty set
for b4 being Function of b3,the carrier of b1 st ( for b5 being Element of b3 holds b2 <= b4 . b5 ) holds
b2 <= Inf
proof end;