:: ORDERS_3 semantic presentation

definition
let c1 be RelStr ;
attr a1 is discrete means :Def1: :: ORDERS_3:def 1
the InternalRel of a1 = id the carrier of a1;
end;

:: deftheorem Def1 defines discrete ORDERS_3:def 1 :
for b1 being RelStr holds
( b1 is discrete iff the InternalRel of b1 = id the carrier of b1 );

registration
cluster non empty strict discrete RelStr ;
existence
ex b1 being Poset st
( b1 is strict & b1 is discrete & not b1 is empty )
proof end;
cluster empty strict discrete RelStr ;
existence
ex b1 being Poset st
( b1 is strict & b1 is discrete & b1 is empty )
proof end;
end;

Lemma2: for b1 being empty RelStr holds the InternalRel of b1 = {}
proof end;

registration
cluster RelStr(# {} ,(id {} ) #) -> empty ;
coherence
RelStr(# {} ,(id {} ) #) is empty
by STRUCT_0:def 1;
let c1 be empty RelStr ;
cluster the InternalRel of a1 -> empty ;
coherence
the InternalRel of c1 is empty
by Lemma2;
end;

Lemma3: for b1 being RelStr st b1 is empty holds
b1 is discrete
proof end;

registration
cluster empty -> discrete RelStr ;
coherence
for b1 being RelStr st b1 is empty holds
b1 is discrete
by Lemma3;
end;

definition
let c1 be RelStr ;
let c2 be Subset of c1;
attr a2 is disconnected means :Def2: :: ORDERS_3:def 2
ex b1, b2 being Subset of a1 st
( b1 <> {} & b2 <> {} & a2 = b1 \/ b2 & b1 misses b2 & the InternalRel of a1 = (the InternalRel of a1 |_2 b1) \/ (the InternalRel of a1 |_2 b2) );
end;

:: deftheorem Def2 defines disconnected ORDERS_3:def 2 :
for b1 being RelStr
for b2 being Subset of b1 holds
( b2 is disconnected iff ex b3, b4 being Subset of b1 st
( b3 <> {} & b4 <> {} & b2 = b3 \/ b4 & b3 misses b4 & the InternalRel of b1 = (the InternalRel of b1 |_2 b3) \/ (the InternalRel of b1 |_2 b4) ) );

notation
let c1 be RelStr ;
let c2 be Subset of c1;
antonym connected c2 for disconnected c2;
end;

definition
let c1 be RelStr ;
attr a1 is disconnected means :Def3: :: ORDERS_3:def 3
[#] a1 is disconnected;
end;

:: deftheorem Def3 defines disconnected ORDERS_3:def 3 :
for b1 being RelStr holds
( b1 is disconnected iff [#] b1 is disconnected );

notation
let c1 be RelStr ;
antonym connected c1 for disconnected c1;
end;

theorem Th1: :: ORDERS_3:1
for b1 being non empty discrete RelStr
for b2, b3 being Element of b1 holds
( b2 <= b3 iff b2 = b3 )
proof end;

theorem Th2: :: ORDERS_3:2
for b1 being Relation
for b2 being set st b1 is Order of {b2} holds
b1 = id {b2}
proof end;

theorem Th3: :: ORDERS_3:3
for b1 being non empty RelStr
for b2 being Element of b1 st b1 is reflexive & [#] b1 = {b2} holds
b1 is discrete
proof end;

theorem Th4: :: ORDERS_3:4
for b1 being non empty RelStr
for b2 being set st [#] b1 = {b2} holds
not b1 is disconnected
proof end;

theorem Th5: :: ORDERS_3:5
for b1 being non empty discrete Poset st ex b2, b3 being Element of b1 st b2 <> b3 holds
b1 is disconnected
proof end;

registration
cluster non empty strict connected RelStr ;
existence
ex b1 being non empty Poset st
( b1 is strict & not b1 is disconnected )
proof end;
cluster non empty strict discrete disconnected RelStr ;
existence
ex b1 being non empty Poset st
( b1 is strict & b1 is disconnected & b1 is discrete )
proof end;
end;

definition
let c1 be set ;
attr a1 is POSet_set-like means :Def4: :: ORDERS_3:def 4
for b1 being set st b1 in a1 holds
b1 is non empty Poset;
end;

:: deftheorem Def4 defines POSet_set-like ORDERS_3:def 4 :
for b1 being set holds
( b1 is POSet_set-like iff for b2 being set st b2 in b1 holds
b2 is non empty Poset );

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

definition
mode POSet_set is POSet_set-like set ;
end;

definition
let c1 be non empty POSet_set;
redefine mode Element as Element of c1 -> non empty Poset;
coherence
for b1 being Element of c1 holds b1 is non empty Poset
by Def4;
end;

definition
let c1, c2 be RelStr ;
let c3 be Function of c1,c2;
attr a3 is monotone means :Def5: :: ORDERS_3:def 5
for b1, b2 being Element of a1 st b1 <= b2 holds
for b3, b4 being Element of a2 st b3 = a3 . b1 & b4 = a3 . b2 holds
b3 <= b4;
end;

:: deftheorem Def5 defines monotone ORDERS_3:def 5 :
for b1, b2 being RelStr
for b3 being Function of b1,b2 holds
( b3 is monotone iff for b4, b5 being Element of b1 st b4 <= b5 holds
for b6, b7 being Element of b2 st b6 = b3 . b4 & b7 = b3 . b5 holds
b6 <= b7 );

Lemma10: 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
ex b6 being Function of b1,b3 st
( b6 = b5 * b4 & b6 is monotone )
proof end;

Lemma11: for b1 being non empty RelStr holds id b1 is monotone
proof end;

definition
let c1, c2 be RelStr ;
func MonFuncs c1,c2 -> set means :Def6: :: ORDERS_3:def 6
for b1 being set holds
( b1 in a3 iff ex b2 being Function of a1,a2 st
( b1 = b2 & b2 in Funcs the carrier of a1,the carrier of a2 & b2 is monotone ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being Function of c1,c2 st
( b2 = b3 & b3 in Funcs the carrier of c1,the carrier of c2 & b3 is monotone ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being Function of c1,c2 st
( b3 = b4 & b4 in Funcs the carrier of c1,the carrier of c2 & b4 is monotone ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being Function of c1,c2 st
( b3 = b4 & b4 in Funcs the carrier of c1,the carrier of c2 & b4 is monotone ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines MonFuncs ORDERS_3:def 6 :
for b1, b2 being RelStr
for b3 being set holds
( b3 = MonFuncs b1,b2 iff for b4 being set holds
( b4 in b3 iff ex b5 being Function of b1,b2 st
( b4 = b5 & b5 in Funcs the carrier of b1,the carrier of b2 & b5 is monotone ) ) );

theorem Th6: :: ORDERS_3:6
for b1, b2, b3 being non empty RelStr
for b4, b5 being Function st b4 in MonFuncs b1,b2 & b5 in MonFuncs b2,b3 holds
b5 * b4 in MonFuncs b1,b3
proof end;

theorem Th7: :: ORDERS_3:7
for b1 being non empty RelStr holds id the carrier of b1 in MonFuncs b1,b1
proof end;

registration
let c1 be non empty RelStr ;
cluster MonFuncs a1,a1 -> non empty ;
coherence
not MonFuncs c1,c1 is empty
by Th7;
end;

definition
let c1 be set ;
func Carr c1 -> set means :Def7: :: ORDERS_3:def 7
for b1 being set holds
( b1 in a2 iff ex b2 being 1-sorted st
( b2 in a1 & b1 = the carrier of b2 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being 1-sorted st
( b3 in c1 & b2 = the carrier of b3 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being 1-sorted st
( b4 in c1 & b3 = the carrier of b4 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being 1-sorted st
( b4 in c1 & b3 = the carrier of b4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines Carr ORDERS_3:def 7 :
for b1, b2 being set holds
( b2 = Carr b1 iff for b3 being set holds
( b3 in b2 iff ex b4 being 1-sorted st
( b4 in b1 & b3 = the carrier of b4 ) ) );

Lemma16: for b1 being non empty POSet_set
for b2 being Element of b1 holds the carrier of b2 in Carr b1
by Def7;

registration
let c1 be non empty POSet_set;
cluster Carr a1 -> non empty ;
coherence
not Carr c1 is empty
by Lemma16;
end;

theorem Th8: :: ORDERS_3:8
for b1 being 1-sorted holds Carr {b1} = {the carrier of b1}
proof end;

theorem Th9: :: ORDERS_3:9
for b1, b2 being 1-sorted holds Carr {b1,b2} = {the carrier of b1,the carrier of b2}
proof end;

theorem Th10: :: ORDERS_3:10
for b1 being non empty POSet_set
for b2, b3 being Element of b1 holds MonFuncs b2,b3 c= Funcs (Carr b1)
proof end;

theorem Th11: :: ORDERS_3:11
for b1, b2 being RelStr holds MonFuncs b1,b2 c= Funcs the carrier of b1,the carrier of b2
proof end;

registration
let c1, c2 be non empty Poset;
cluster MonFuncs a1,a2 -> functional ;
coherence
MonFuncs c1,c2 is functional
proof end;
end;

definition
let c1 be non empty POSet_set;
func POSCat c1 -> strict with_triple-like_morphisms Category means :: ORDERS_3:def 8
( the Objects of a2 = a1 & ( for b1, b2 being Element of a1
for b3 being Element of Funcs (Carr a1) st b3 in MonFuncs b1,b2 holds
[[b1,b2],b3] is Morphism of a2 ) & ( for b1 being Morphism of a2 ex b2, b3 being Element of a1ex b4 being Element of Funcs (Carr a1) st
( b1 = [[b2,b3],b4] & b4 in MonFuncs b2,b3 ) ) & ( for b1, b2 being Morphism of a2
for b3, b4, b5 being Element of a1
for b6, b7 being Element of Funcs (Carr a1) st b1 = [[b3,b4],b6] & b2 = [[b4,b5],b7] holds
b2 * b1 = [[b3,b5],(b7 * b6)] ) );
existence
ex b1 being strict with_triple-like_morphisms Category st
( the Objects of b1 = c1 & ( for b2, b3 being Element of c1
for b4 being Element of Funcs (Carr c1) st b4 in MonFuncs b2,b3 holds
[[b2,b3],b4] is Morphism of b1 ) & ( for b2 being Morphism of b1 ex b3, b4 being Element of c1ex b5 being Element of Funcs (Carr c1) st
( b2 = [[b3,b4],b5] & b5 in MonFuncs b3,b4 ) ) & ( for b2, b3 being Morphism of b1
for b4, b5, b6 being Element of c1
for b7, b8 being Element of Funcs (Carr c1) st b2 = [[b4,b5],b7] & b3 = [[b5,b6],b8] holds
b3 * b2 = [[b4,b6],(b8 * b7)] ) )
proof end;
uniqueness
for b1, b2 being strict with_triple-like_morphisms Category st the Objects of b1 = c1 & ( for b3, b4 being Element of c1
for b5 being Element of Funcs (Carr c1) st b5 in MonFuncs b3,b4 holds
[[b3,b4],b5] is Morphism of b1 ) & ( for b3 being Morphism of b1 ex b4, b5 being Element of c1ex b6 being Element of Funcs (Carr c1) st
( b3 = [[b4,b5],b6] & b6 in MonFuncs b4,b5 ) ) & ( for b3, b4 being Morphism of b1
for b5, b6, b7 being Element of c1
for b8, b9 being Element of Funcs (Carr c1) st b3 = [[b5,b6],b8] & b4 = [[b6,b7],b9] holds
b4 * b3 = [[b5,b7],(b9 * b8)] ) & the Objects of b2 = c1 & ( for b3, b4 being Element of c1
for b5 being Element of Funcs (Carr c1) st b5 in MonFuncs b3,b4 holds
[[b3,b4],b5] is Morphism of b2 ) & ( for b3 being Morphism of b2 ex b4, b5 being Element of c1ex b6 being Element of Funcs (Carr c1) st
( b3 = [[b4,b5],b6] & b6 in MonFuncs b4,b5 ) ) & ( for b3, b4 being Morphism of b2
for b5, b6, b7 being Element of c1
for b8, b9 being Element of Funcs (Carr c1) st b3 = [[b5,b6],b8] & b4 = [[b6,b7],b9] holds
b4 * b3 = [[b5,b7],(b9 * b8)] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def8 defines POSCat ORDERS_3:def 8 :
for b1 being non empty POSet_set
for b2 being strict with_triple-like_morphisms Category holds
( b2 = POSCat b1 iff ( the Objects of b2 = b1 & ( for b3, b4 being Element of b1
for b5 being Element of Funcs (Carr b1) st b5 in MonFuncs b3,b4 holds
[[b3,b4],b5] is Morphism of b2 ) & ( for b3 being Morphism of b2 ex b4, b5 being Element of b1ex b6 being Element of Funcs (Carr b1) st
( b3 = [[b4,b5],b6] & b6 in MonFuncs b4,b5 ) ) & ( for b3, b4 being Morphism of b2
for b5, b6, b7 being Element of b1
for b8, b9 being Element of Funcs (Carr b1) st b3 = [[b5,b6],b8] & b4 = [[b6,b7],b9] holds
b4 * b3 = [[b5,b7],(b9 * b8)] ) ) );

scheme :: ORDERS_3:sch 1
s1{ F1() -> non empty set , F2( set , set ) -> functional set } :
ex b1 being strict AltCatStr st
( the carrier of b1 = F1() & ( for b2, b3 being Element of F1() holds
( the Arrows of b1 . b2,b3 = F2(b2,b3) & ( for b4, b5, b6 being Element of F1() holds the Comp of b1 . b4,b5,b6 = FuncComp F2(b4,b5),F2(b5,b6) ) ) ) )
provided
E19: for b1, b2, b3 being Element of F1()
for b4, b5 being Function st b4 in F2(b1,b2) & b5 in F2(b2,b3) holds
b5 * b4 in F2(b1,b3)
proof end;

scheme :: ORDERS_3:sch 2
s2{ F1() -> non empty set , F2( set , set ) -> functional set } :
for b1, b2 being strict AltCatStr st the carrier of b1 = F1() & ( for b3, b4 being Element of F1() holds
( the Arrows of b1 . b3,b4 = F2(b3,b4) & ( for b5, b6, b7 being Element of F1() holds the Comp of b1 . b5,b6,b7 = FuncComp F2(b5,b6),F2(b6,b7) ) ) ) & the carrier of b2 = F1() & ( for b3, b4 being Element of F1() holds
( the Arrows of b2 . b3,b4 = F2(b3,b4) & ( for b5, b6, b7 being Element of F1() holds the Comp of b2 . b5,b6,b7 = FuncComp F2(b5,b6),F2(b6,b7) ) ) ) holds
b1 = b2
proof end;

definition
let c1 be non empty POSet_set;
func POSAltCat c1 -> strict AltCatStr means :Def9: :: ORDERS_3:def 9
( the carrier of a2 = a1 & ( for b1, b2 being Element of a1 holds
( the Arrows of a2 . b1,b2 = MonFuncs b1,b2 & ( for b3, b4, b5 being Element of a1 holds the Comp of a2 . b3,b4,b5 = FuncComp (MonFuncs b3,b4),(MonFuncs b4,b5) ) ) ) );
existence
ex b1 being strict AltCatStr st
( the carrier of b1 = c1 & ( for b2, b3 being Element of c1 holds
( the Arrows of b1 . b2,b3 = MonFuncs b2,b3 & ( for b4, b5, b6 being Element of c1 holds the Comp of b1 . b4,b5,b6 = FuncComp (MonFuncs b4,b5),(MonFuncs b5,b6) ) ) ) )
proof end;
uniqueness
for b1, b2 being strict AltCatStr st the carrier of b1 = c1 & ( for b3, b4 being Element of c1 holds
( the Arrows of b1 . b3,b4 = MonFuncs b3,b4 & ( for b5, b6, b7 being Element of c1 holds the Comp of b1 . b5,b6,b7 = FuncComp (MonFuncs b5,b6),(MonFuncs b6,b7) ) ) ) & the carrier of b2 = c1 & ( for b3, b4 being Element of c1 holds
( the Arrows of b2 . b3,b4 = MonFuncs b3,b4 & ( for b5, b6, b7 being Element of c1 holds the Comp of b2 . b5,b6,b7 = FuncComp (MonFuncs b5,b6),(MonFuncs b6,b7) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def9 defines POSAltCat ORDERS_3:def 9 :
for b1 being non empty POSet_set
for b2 being strict AltCatStr holds
( b2 = POSAltCat b1 iff ( the carrier of b2 = b1 & ( for b3, b4 being Element of b1 holds
( the Arrows of b2 . b3,b4 = MonFuncs b3,b4 & ( for b5, b6, b7 being Element of b1 holds the Comp of b2 . b5,b6,b7 = FuncComp (MonFuncs b5,b6),(MonFuncs b6,b7) ) ) ) ) );

registration
let c1 be non empty POSet_set;
cluster POSAltCat a1 -> non empty transitive strict ;
coherence
( POSAltCat c1 is transitive & not POSAltCat c1 is empty )
proof end;
end;

registration
let c1 be non empty POSet_set;
cluster POSAltCat a1 -> non empty transitive strict associative with_units ;
coherence
( POSAltCat c1 is associative & POSAltCat c1 is with_units )
proof end;
end;

theorem Th12: :: ORDERS_3:12
for b1 being non empty POSet_set
for b2, b3 being object of (POSAltCat b1)
for b4, b5 being Element of b1 st b2 = b4 & b3 = b5 holds
<^b2,b3^> c= Funcs the carrier of b4,the carrier of b5
proof end;