:: MSUALG_5 semantic presentation

theorem Th1: :: MSUALG_5:1
for b1 being set
for b2, b3, b4 being Equivalence_Relation of b1 holds (b2 "\/" b3) "\/" b4 = b2 "\/" (b3 "\/" b4)
proof end;

definition
let c1 be set ;
let c2 be Relation of c1;
func EqCl c2 -> Equivalence_Relation of a1 means :Def1: :: MSUALG_5:def 1
( a2 c= a3 & ( for b1 being Equivalence_Relation of a1 st a2 c= b1 holds
a3 c= b1 ) );
existence
ex b1 being Equivalence_Relation of c1 st
( c2 c= b1 & ( for b2 being Equivalence_Relation of c1 st c2 c= b2 holds
b1 c= b2 ) )
by EQREL_1:20;
uniqueness
for b1, b2 being Equivalence_Relation of c1 st c2 c= b1 & ( for b3 being Equivalence_Relation of c1 st c2 c= b3 holds
b1 c= b3 ) & c2 c= b2 & ( for b3 being Equivalence_Relation of c1 st c2 c= b3 holds
b2 c= b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines EqCl MSUALG_5:def 1 :
for b1 being set
for b2 being Relation of b1
for b3 being Equivalence_Relation of b1 holds
( b3 = EqCl b2 iff ( b2 c= b3 & ( for b4 being Equivalence_Relation of b1 st b2 c= b4 holds
b3 c= b4 ) ) );

theorem Th2: :: MSUALG_5:2
for b1 being set
for b2, b3 being Equivalence_Relation of b1 holds b2 "\/" b3 = EqCl (b2 \/ b3)
proof end;

theorem Th3: :: MSUALG_5:3
for b1 being set
for b2 being Equivalence_Relation of b1 holds EqCl b2 = b2
proof end;

theorem Th4: :: MSUALG_5:4
for b1 being set
for b2 being Relation of b1 holds (nabla b1) \/ b2 = nabla b1
proof end;

definition
let c1 be set ;
func EqRelLatt c1 -> strict Lattice means :: MSUALG_5:def 2
( the carrier of a2 = { b1 where B is Relation of a1,a1 : b1 is Equivalence_Relation of a1 } & ( for b1, b2 being Equivalence_Relation of a1 holds
( the L_meet of a2 . b1,b2 = b1 /\ b2 & the L_join of a2 . b1,b2 = b1 "\/" b2 ) ) );
existence
ex b1 being strict Lattice st
( the carrier of b1 = { b2 where B is Relation of c1,c1 : b2 is Equivalence_Relation of c1 } & ( for b2, b3 being Equivalence_Relation of c1 holds
( the L_meet of b1 . b2,b3 = b2 /\ b3 & the L_join of b1 . b2,b3 = b2 "\/" b3 ) ) )
proof end;
uniqueness
for b1, b2 being strict Lattice st the carrier of b1 = { b3 where B is Relation of c1,c1 : b3 is Equivalence_Relation of c1 } & ( for b3, b4 being Equivalence_Relation of c1 holds
( the L_meet of b1 . b3,b4 = b3 /\ b4 & the L_join of b1 . b3,b4 = b3 "\/" b4 ) ) & the carrier of b2 = { b3 where B is Relation of c1,c1 : b3 is Equivalence_Relation of c1 } & ( for b3, b4 being Equivalence_Relation of c1 holds
( the L_meet of b2 . b3,b4 = b3 /\ b4 & the L_join of b2 . b3,b4 = b3 "\/" b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines EqRelLatt MSUALG_5:def 2 :
for b1 being set
for b2 being strict Lattice holds
( b2 = EqRelLatt b1 iff ( the carrier of b2 = { b3 where B is Relation of b1,b1 : b3 is Equivalence_Relation of b1 } & ( for b3, b4 being Equivalence_Relation of b1 holds
( the L_meet of b2 . b3,b4 = b3 /\ b4 & the L_join of b2 . b3,b4 = b3 "\/" b4 ) ) ) );

registration
let c1 be set ;
let c2 be ManySortedSet of c1;
cluster MSEquivalence_Relation-like ManySortedRelation of a2,a2;
existence
ex b1 being ManySortedRelation of c2 st b1 is MSEquivalence_Relation-like
proof end;
end;

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
mode Equivalence_Relation of a2 is MSEquivalence_Relation-like ManySortedRelation of a2;
end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of c1;
let c3 be ManySortedRelation of c2;
func EqCl c3 -> Equivalence_Relation of a2 means :Def3: :: MSUALG_5:def 3
for b1 being Element of a1 holds a4 . b1 = EqCl (a3 . b1);
existence
ex b1 being Equivalence_Relation of c2 st
for b2 being Element of c1 holds b1 . b2 = EqCl (c3 . b2)
proof end;
uniqueness
for b1, b2 being Equivalence_Relation of c2 st ( for b3 being Element of c1 holds b1 . b3 = EqCl (c3 . b3) ) & ( for b3 being Element of c1 holds b2 . b3 = EqCl (c3 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines EqCl MSUALG_5:def 3 :
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being ManySortedRelation of b2
for b4 being Equivalence_Relation of b2 holds
( b4 = EqCl b3 iff for b5 being Element of b1 holds b4 . b5 = EqCl (b3 . b5) );

theorem Th5: :: MSUALG_5:5
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being Equivalence_Relation of b2 holds EqCl b3 = b3
proof end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of c1;
let c3, c4 be Equivalence_Relation of c2;
func c3 "\/" c4 -> Equivalence_Relation of a2 means :Def4: :: MSUALG_5:def 4
ex b1 being ManySortedRelation of a2 st
( b1 = a3 \/ a4 & a5 = EqCl b1 );
existence
ex b1 being Equivalence_Relation of c2ex b2 being ManySortedRelation of c2 st
( b2 = c3 \/ c4 & b1 = EqCl b2 )
proof end;
uniqueness
for b1, b2 being Equivalence_Relation of c2 st ex b3 being ManySortedRelation of c2 st
( b3 = c3 \/ c4 & b1 = EqCl b3 ) & ex b3 being ManySortedRelation of c2 st
( b3 = c3 \/ c4 & b2 = EqCl b3 ) holds
b1 = b2
;
commutativity
for b1, b2, b3 being Equivalence_Relation of c2 st ex b4 being ManySortedRelation of c2 st
( b4 = b2 \/ b3 & b1 = EqCl b4 ) holds
ex b4 being ManySortedRelation of c2 st
( b4 = b3 \/ b2 & b1 = EqCl b4 )
;
end;

:: deftheorem Def4 defines "\/" MSUALG_5:def 4 :
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4, b5 being Equivalence_Relation of b2 holds
( b5 = b3 "\/" b4 iff ex b6 being ManySortedRelation of b2 st
( b6 = b3 \/ b4 & b5 = EqCl b6 ) );

theorem Th6: :: MSUALG_5:6
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4 being Equivalence_Relation of b2 holds b3 \/ b4 c= b3 "\/" b4
proof end;

theorem Th7: :: MSUALG_5:7
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4, b5 being Equivalence_Relation of b2 st b3 \/ b4 c= b5 holds
b3 "\/" b4 c= b5
proof end;

theorem Th8: :: MSUALG_5:8
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4, b5 being Equivalence_Relation of b2 st b3 \/ b4 c= b5 & ( for b6 being Equivalence_Relation of b2 st b3 \/ b4 c= b6 holds
b5 c= b6 ) holds
b5 = b3 "\/" b4
proof end;

theorem Th9: :: MSUALG_5:9
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being Equivalence_Relation of b2 holds b3 "\/" b3 = b3
proof end;

theorem Th10: :: MSUALG_5:10
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4, b5 being Equivalence_Relation of b2 holds (b3 "\/" b4) "\/" b5 = b3 "\/" (b4 "\/" b5)
proof end;

theorem Th11: :: MSUALG_5:11
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4 being Equivalence_Relation of b2 holds b3 /\ (b3 "\/" b4) = b3
proof end;

theorem Th12: :: MSUALG_5:12
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4, b5 being Equivalence_Relation of b2 st b5 = b3 /\ b4 holds
b3 "\/" b5 = b3
proof end;

theorem Th13: :: MSUALG_5:13
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3, b4 being Equivalence_Relation of b2 holds b3 /\ b4 is Equivalence_Relation of b2
proof end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of c1;
func EqRelLatt c2 -> strict Lattice means :Def5: :: MSUALG_5:def 5
( ( for b1 being set holds
( b1 in the carrier of a3 iff b1 is Equivalence_Relation of a2 ) ) & ( for b1, b2 being Equivalence_Relation of a2 holds
( the L_meet of a3 . b1,b2 = b1 /\ b2 & the L_join of a3 . b1,b2 = b1 "\/" b2 ) ) );
existence
ex b1 being strict Lattice st
( ( for b2 being set holds
( b2 in the carrier of b1 iff b2 is Equivalence_Relation of c2 ) ) & ( for b2, b3 being Equivalence_Relation of c2 holds
( the L_meet of b1 . b2,b3 = b2 /\ b3 & the L_join of b1 . b2,b3 = b2 "\/" b3 ) ) )
proof end;
uniqueness
for b1, b2 being strict Lattice st ( for b3 being set holds
( b3 in the carrier of b1 iff b3 is Equivalence_Relation of c2 ) ) & ( for b3, b4 being Equivalence_Relation of c2 holds
( the L_meet of b1 . b3,b4 = b3 /\ b4 & the L_join of b1 . b3,b4 = b3 "\/" b4 ) ) & ( for b3 being set holds
( b3 in the carrier of b2 iff b3 is Equivalence_Relation of c2 ) ) & ( for b3, b4 being Equivalence_Relation of c2 holds
( the L_meet of b2 . b3,b4 = b3 /\ b4 & the L_join of b2 . b3,b4 = b3 "\/" b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines EqRelLatt MSUALG_5:def 5 :
for b1 being non empty set
for b2 being ManySortedSet of b1
for b3 being strict Lattice holds
( b3 = EqRelLatt b2 iff ( ( for b4 being set holds
( b4 in the carrier of b3 iff b4 is Equivalence_Relation of b2 ) ) & ( for b4, b5 being Equivalence_Relation of b2 holds
( the L_meet of b3 . b4,b5 = b4 /\ b5 & the L_join of b3 . b4,b5 = b4 "\/" b5 ) ) ) );

registration
let c1 be non empty ManySortedSign ;
let c2 be MSAlgebra of c1;
cluster MSEquivalence-like -> MSEquivalence_Relation-like ManySortedRelation of the Sorts of a2,the Sorts of a2;
coherence
for b1 being ManySortedRelation of c2 st b1 is MSEquivalence-like holds
b1 is MSEquivalence_Relation-like
by MSUALG_4:def 5;
end;

theorem Th14: :: MSUALG_5:14
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being OperSymbol of b1
for b4, b5 being MSCongruence of b2
for b6, b7 being set
for b8, b9 being FinSequence st [b6,b7] in (b4 . ((the_arity_of b3) /. ((len b8) + 1))) \/ (b5 . ((the_arity_of b3) /. ((len b8) + 1))) holds
for b10, b11 being Element of Args b3,b2 st b10 = (b8 ^ <*b6*>) ^ b9 & b11 = (b8 ^ <*b7*>) ^ b9 holds
[((Den b3,b2) . b10),((Den b3,b2) . b11)] in (b4 . (the_result_sort_of b3)) \/ (b5 . (the_result_sort_of b3))
proof end;

theorem Th15: :: MSUALG_5:15
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being OperSymbol of b1
for b4, b5 being MSCongruence of b2
for b6 being MSEquivalence-like ManySortedRelation of b2 st b6 = b4 "\/" b5 holds
for b7, b8 being set
for b9 being Nat
for b10, b11, b12 being FinSequence st len b10 = b9 & len b10 = len b11 & ( for b13 being Nat st b13 in dom b10 holds
[(b10 . b13),(b11 . b13)] in b6 . ((the_arity_of b3) /. b13) ) & [((Den b3,b2) . ((b10 ^ <*b7*>) ^ b12)),((Den b3,b2) . ((b11 ^ <*b7*>) ^ b12))] in b6 . (the_result_sort_of b3) & [b7,b8] in b6 . ((the_arity_of b3) /. (b9 + 1)) holds
for b13 being Element of Args b3,b2 st b13 = (b10 ^ <*b7*>) ^ b12 holds
[((Den b3,b2) . b13),((Den b3,b2) . ((b11 ^ <*b8*>) ^ b12))] in b6 . (the_result_sort_of b3)
proof end;

theorem Th16: :: MSUALG_5:16
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being OperSymbol of b1
for b4, b5 being MSCongruence of b2
for b6 being MSEquivalence-like ManySortedRelation of b2 st b6 = b4 "\/" b5 holds
for b7, b8 being Element of Args b3,b2 st ( for b9 being Nat st b9 in dom b7 holds
[(b7 . b9),(b8 . b9)] in b6 . ((the_arity_of b3) /. b9) ) holds
[((Den b3,b2) . b7),((Den b3,b2) . b8)] in b6 . (the_result_sort_of b3)
proof end;

theorem Th17: :: MSUALG_5:17
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSCongruence of b2 holds b3 "\/" b4 is MSCongruence of b2
proof end;

theorem Th18: :: MSUALG_5:18
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSCongruence of b2 holds b3 /\ b4 is MSCongruence of b2
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
func CongrLatt c2 -> strict SubLattice of EqRelLatt the Sorts of a2 means :Def6: :: MSUALG_5:def 6
for b1 being set holds
( b1 in the carrier of a3 iff b1 is MSCongruence of a2 );
existence
ex b1 being strict SubLattice of EqRelLatt the Sorts of c2 st
for b2 being set holds
( b2 in the carrier of b1 iff b2 is MSCongruence of c2 )
proof end;
uniqueness
for b1, b2 being strict SubLattice of EqRelLatt the Sorts of c2 st ( for b3 being set holds
( b3 in the carrier of b1 iff b3 is MSCongruence of c2 ) ) & ( for b3 being set holds
( b3 in the carrier of b2 iff b3 is MSCongruence of c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines CongrLatt MSUALG_5:def 6 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being strict SubLattice of EqRelLatt the Sorts of b2 holds
( b3 = CongrLatt b2 iff for b4 being set holds
( b4 in the carrier of b3 iff b4 is MSCongruence of b2 ) );

theorem Th19: :: MSUALG_5:19
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds id the Sorts of b2 is MSCongruence of b2
proof end;

theorem Th20: :: MSUALG_5:20
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds [|the Sorts of b2,the Sorts of b2|] is MSCongruence of b2
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster CongrLatt a2 -> strict bounded ;
coherence
CongrLatt c2 is bounded
proof end;
end;

theorem Th21: :: MSUALG_5:21
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds Bottom (CongrLatt b2) = id the Sorts of b2
proof end;

theorem Th22: :: MSUALG_5:22
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds Top (CongrLatt b2) = [|the Sorts of b2,the Sorts of b2|]
proof end;