:: MSUALG_8 semantic presentation

theorem Th1: :: MSUALG_8:1
for b1 being Nat
for b2 being FinSequence holds
( 1 <= b1 & b1 < len b2 iff ( b1 in dom b2 & b1 + 1 in dom b2 ) )
proof end;

scheme :: MSUALG_8:sch 1
s1{ F1() -> Nat, P1[ set , set ] } :
ex b1 being FinSequence st
( dom b1 = Seg F1() & ( for b2 being Nat st b2 in Seg F1() holds
P1[b2,b1 . b2] ) )
provided
E2: for b1 being Nat st b1 in Seg F1() holds
ex b2 being set st P1[b1,b2]
proof end;

theorem Th2: :: MSUALG_8:2
for b1 being set
for b2, b3 being Element of (EqRelLatt b1)
for b4, b5 being Equivalence_Relation of b1 st b2 = b4 & b3 = b5 holds
( b2 [= b3 iff b4 c= b5 )
proof end;

registration
let c1 be set ;
cluster EqRelLatt a1 -> bounded ;
coherence
EqRelLatt c1 is bounded
proof end;
end;

theorem Th3: :: MSUALG_8:3
for b1 being set holds Bottom (EqRelLatt b1) = id b1
proof end;

theorem Th4: :: MSUALG_8:4
for b1 being set holds Top (EqRelLatt b1) = nabla b1
proof end;

theorem Th5: :: MSUALG_8:5
for b1 being set holds EqRelLatt b1 is complete
proof end;

registration
let c1 be set ;
cluster EqRelLatt a1 -> bounded complete ;
coherence
EqRelLatt c1 is complete
by Th5;
end;

theorem Th6: :: MSUALG_8:6
for b1 being set
for b2 being Subset of (EqRelLatt b1) holds union b2 is Relation of b1
proof end;

theorem Th7: :: MSUALG_8:7
for b1 being set
for b2 being Subset of (EqRelLatt b1) holds union b2 c= "\/" b2
proof end;

theorem Th8: :: MSUALG_8:8
for b1 being set
for b2 being Subset of (EqRelLatt b1)
for b3 being Relation of b1 st b3 = union b2 holds
"\/" b2 = EqCl b3
proof end;

theorem Th9: :: MSUALG_8:9
for b1 being set
for b2 being Subset of (EqRelLatt b1)
for b3 being Relation st b3 = union b2 holds
b3 = b3 ~
proof end;

theorem Th10: :: MSUALG_8:10
for b1, b2, b3 being set
for b4 being Subset of (EqRelLatt b3) st b1 in b3 & b2 in b3 holds
( [b1,b2] in "\/" b4 iff ex b5 being FinSequence st
( 1 <= len b5 & b1 = b5 . 1 & b2 = b5 . (len b5) & ( for b6 being Nat st 1 <= b6 & b6 < len b5 holds
[(b5 . b6),(b5 . (b6 + 1))] in union b4 ) ) )
proof end;

theorem Th11: :: MSUALG_8:11
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (CongrLatt b2) holds "/\" b3,(EqRelLatt the Sorts of b2) is MSCongruence of b2
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be Element of (EqRelLatt the Sorts of c2);
func CongrCl c3 -> MSCongruence of a2 equals :: MSUALG_8:def 1
"/\" { b1 where B is Element of (EqRelLatt the Sorts of a2) : ( b1 is MSCongruence of a2 & a3 [= b1 ) } ,(EqRelLatt the Sorts of a2);
coherence
"/\" { b1 where B is Element of (EqRelLatt the Sorts of c2) : ( b1 is MSCongruence of c2 & c3 [= b1 ) } ,(EqRelLatt the Sorts of c2) is MSCongruence of c2
proof end;
end;

:: deftheorem Def1 defines CongrCl MSUALG_8:def 1 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Element of (EqRelLatt the Sorts of b2) holds CongrCl b3 = "/\" { b4 where B is Element of (EqRelLatt the Sorts of b2) : ( b4 is MSCongruence of b2 & b3 [= b4 ) } ,(EqRelLatt the Sorts of b2);

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be Subset of (EqRelLatt the Sorts of c2);
func CongrCl c3 -> MSCongruence of a2 equals :: MSUALG_8:def 2
"/\" { b1 where B is Element of (EqRelLatt the Sorts of a2) : ( b1 is MSCongruence of a2 & a3 is_less_than b1 ) } ,(EqRelLatt the Sorts of a2);
coherence
"/\" { b1 where B is Element of (EqRelLatt the Sorts of c2) : ( b1 is MSCongruence of c2 & c3 is_less_than b1 ) } ,(EqRelLatt the Sorts of c2) is MSCongruence of c2
proof end;
end;

:: deftheorem Def2 defines CongrCl MSUALG_8:def 2 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (EqRelLatt the Sorts of b2) holds CongrCl b3 = "/\" { b4 where B is Element of (EqRelLatt the Sorts of b2) : ( b4 is MSCongruence of b2 & b3 is_less_than b4 ) } ,(EqRelLatt the Sorts of b2);

theorem Th12: :: MSUALG_8:12
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Element of (EqRelLatt the Sorts of b2) st b3 is MSCongruence of b2 holds
CongrCl b3 = b3
proof end;

theorem Th13: :: MSUALG_8:13
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (EqRelLatt the Sorts of b2) holds CongrCl ("\/" b3,(EqRelLatt the Sorts of b2)) = CongrCl b3
proof end;

theorem Th14: :: MSUALG_8:14
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being Subset of (CongrLatt b2)
for b5, b6 being MSCongruence of b2 st b5 = "\/" b3,(EqRelLatt the Sorts of b2) & b6 = "\/" b4,(EqRelLatt the Sorts of b2) holds
b5 "\/" b6 = "\/" (b3 \/ b4),(EqRelLatt the Sorts of b2)
proof end;

theorem Th15: :: MSUALG_8:15
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (CongrLatt b2) holds "\/" b3,(EqRelLatt the Sorts of b2) = "\/" { ("\/" b4,(EqRelLatt the Sorts of b2)) where B is Subset of (EqRelLatt the Sorts of b2) : b4 is finite Subset of b3 } ,(EqRelLatt the Sorts of b2)
proof end;

theorem Th16: :: MSUALG_8:16
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being Element of b1
for b4 being Equivalence_Relation of b2 . b3 ex b5 being Equivalence_Relation of b2 st
( b5 . b3 = b4 & ( for b6 being Element of b1 st b6 <> b3 holds
b5 . b6 = nabla (b2 . b6) ) )
proof end;

notation
let c1 be non empty set ;
let c2 be ManySortedSet of c1;
let c3 be Element of c1;
let c4 be Subset of (EqRelLatt c2);
synonym EqRelSet c4,c3 for pi c2,c1;
end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of c1;
let c3 be Element of c1;
let c4 be Subset of (EqRelLatt c2);
redefine func EqRelSet as EqRelSet c4,c3 -> Subset of (EqRelLatt (a2 . a3)) means :Def3: :: MSUALG_8:def 3
for b1 being set holds
( b1 in a5 iff ex b2 being Equivalence_Relation of a2 st
( b1 = b2 . a3 & b2 in a4 ) );
coherence
EqRelSet , is Subset of (EqRelLatt (c2 . c3))
proof end;
compatibility
for b1 being Subset of (EqRelLatt (c2 . c3)) holds
( b1 = EqRelSet , iff for b2 being set holds
( b2 in b1 iff ex b3 being Equivalence_Relation of c2 st
( b2 = b3 . c3 & b3 in c4 ) ) )
proof end;
end;

:: deftheorem Def3 defines EqRelSet MSUALG_8:def 3 :
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being Element of b1
for b4 being Subset of (EqRelLatt b2)
for b5 being Subset of (EqRelLatt (b2 . b3)) holds
( b5 = EqRelSet b4,b3 iff for b6 being set holds
( b6 in b5 iff ex b7 being Equivalence_Relation of b2 st
( b6 = b7 . b3 & b7 in b4 ) ) );

theorem Th17: :: MSUALG_8:17
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Element of b1
for b4 being Subset of (EqRelLatt the Sorts of b2)
for b5 being Equivalence_Relation of the Sorts of b2 st b5 = "\/" b4 holds
b5 . b3 = "\/" (EqRelSet b4,b3),(EqRelLatt (the Sorts of b2 . b3))
proof end;

theorem Th18: :: MSUALG_8:18
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (CongrLatt b2) holds "\/" b3,(EqRelLatt the Sorts of b2) is MSCongruence of b2
proof end;

theorem Th19: :: MSUALG_8:19
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds CongrLatt b2 is /\-inheriting
proof end;

theorem Th20: :: MSUALG_8:20
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds CongrLatt b2 is \/-inheriting
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster CongrLatt a2 -> /\-inheriting \/-inheriting ;
coherence
( CongrLatt c2 is /\-inheriting & CongrLatt c2 is \/-inheriting )
by Th19, Th20;
end;