:: MSUALG_2 semantic presentation

registration
let c1 be set ;
let c2 be ManySortedSet of c1;
let c3 be V6 ManySortedSet of c1;
cluster a2 \/ a3 -> V6 ;
coherence
c2 \/ c3 is non-empty
proof end;
cluster a3 \/ a2 -> V6 ;
coherence
c3 \/ c2 is non-empty
;
end;

theorem Th1: :: MSUALG_2:1
canceled;

theorem Th2: :: MSUALG_2:2
for b1 being non empty set
for b2, b3 being ManySortedSet of b1
for b4 being Element of b1 * holds product ((b2 /\ b3) * b4) = (product (b2 * b4)) /\ (product (b3 * b4))
proof end;

definition
let c1 be non empty ManySortedSign ;
let c2 be MSAlgebra of c1;
mode MSSubset of a2 is ManySortedSubset of the Sorts of a2;
end;

definition
let c1 be non empty ManySortedSign ;
let c2 be SortSymbol of c1;
canceled;
attr a2 is with_const_op means :Def2: :: MSUALG_2:def 2
ex b1 being OperSymbol of a1 st
( the Arity of a1 . b1 = {} & the ResultSort of a1 . b1 = a2 );
end;

:: deftheorem Def1 MSUALG_2:def 1 :
canceled;

:: deftheorem Def2 defines with_const_op MSUALG_2:def 2 :
for b1 being non empty ManySortedSign
for b2 being SortSymbol of b1 holds
( b2 is with_const_op iff ex b3 being OperSymbol of b1 st
( the Arity of b1 . b3 = {} & the ResultSort of b1 . b3 = b2 ) );

definition
let c1 be non empty ManySortedSign ;
attr a1 is all-with_const_op means :Def3: :: MSUALG_2:def 3
for b1 being SortSymbol of a1 holds b1 is with_const_op;
end;

:: deftheorem Def3 defines all-with_const_op MSUALG_2:def 3 :
for b1 being non empty ManySortedSign holds
( b1 is all-with_const_op iff for b2 being SortSymbol of b1 holds b2 is with_const_op );

registration
let c1 be non empty set ;
let c2 be set ;
let c3 be Function of c2,c1 * ;
let c4 be Function of c2,c1;
cluster ManySortedSign(# a1,a2,a3,a4 #) -> non empty ;
coherence
not ManySortedSign(# c1,c2,c3,c4 #) is empty
by STRUCT_0:def 1;
end;

registration
cluster non empty strict non void all-with_const_op ManySortedSign ;
existence
ex b1 being non empty ManySortedSign st
( not b1 is void & b1 is all-with_const_op & b1 is strict )
proof end;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be SortSymbol of c1;
func Constants c2,c3 -> Subset of (the Sorts of a2 . a3) means :Def4: :: MSUALG_2:def 4
ex b1 being non empty set st
( b1 = the Sorts of a2 . a3 & a4 = { b2 where B is Element of b1 : ex b1 being OperSymbol of a1 st
( the Arity of a1 . b3 = {} & the ResultSort of a1 . b3 = a3 & b2 in rng (Den b3,a2) )
}
) if the Sorts of a2 . a3 <> {}
otherwise a4 = {} ;
existence
( ( the Sorts of c2 . c3 <> {} implies ex b1 being Subset of (the Sorts of c2 . c3)ex b2 being non empty set st
( b2 = the Sorts of c2 . c3 & b1 = { b3 where B is Element of b2 : ex b1 being OperSymbol of c1 st
( the Arity of c1 . b4 = {} & the ResultSort of c1 . b4 = c3 & b3 in rng (Den b4,c2) )
}
) ) & ( not the Sorts of c2 . c3 <> {} implies ex b1 being Subset of (the Sorts of c2 . c3) st b1 = {} ) )
proof end;
correctness
consistency
for b1 being Subset of (the Sorts of c2 . c3) holds verum
;
uniqueness
for b1, b2 being Subset of (the Sorts of c2 . c3) holds
( ( the Sorts of c2 . c3 <> {} & ex b3 being non empty set st
( b3 = the Sorts of c2 . c3 & b1 = { b4 where B is Element of b3 : ex b1 being OperSymbol of c1 st
( the Arity of c1 . b5 = {} & the ResultSort of c1 . b5 = c3 & b4 in rng (Den b5,c2) )
}
) & ex b3 being non empty set st
( b3 = the Sorts of c2 . c3 & b2 = { b4 where B is Element of b3 : ex b1 being OperSymbol of c1 st
( the Arity of c1 . b5 = {} & the ResultSort of c1 . b5 = c3 & b4 in rng (Den b5,c2) )
}
) implies b1 = b2 ) & ( not the Sorts of c2 . c3 <> {} & b1 = {} & b2 = {} implies b1 = b2 ) )
;
;
end;

:: deftheorem Def4 defines Constants MSUALG_2:def 4 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being SortSymbol of b1
for b4 being Subset of (the Sorts of b2 . b3) holds
( ( the Sorts of b2 . b3 <> {} implies ( b4 = Constants b2,b3 iff ex b5 being non empty set st
( b5 = the Sorts of b2 . b3 & b4 = { b6 where B is Element of b5 : ex b1 being OperSymbol of b1 st
( the Arity of b1 . b7 = {} & the ResultSort of b1 . b7 = b3 & b6 in rng (Den b7,b2) )
}
) ) ) & ( not the Sorts of b2 . b3 <> {} implies ( b4 = Constants b2,b3 iff b4 = {} ) ) );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
func Constants c2 -> MSSubset of a2 means :Def5: :: MSUALG_2:def 5
for b1 being SortSymbol of a1 holds a3 . b1 = Constants a2,b1;
existence
ex b1 being MSSubset of c2 st
for b2 being SortSymbol of c1 holds b1 . b2 = Constants c2,b2
proof end;
uniqueness
for b1, b2 being MSSubset of c2 st ( for b3 being SortSymbol of c1 holds b1 . b3 = Constants c2,b3 ) & ( for b3 being SortSymbol of c1 holds b2 . b3 = Constants c2,b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines Constants MSUALG_2:def 5 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds
( b3 = Constants b2 iff for b4 being SortSymbol of b1 holds b3 . b4 = Constants b2,b4 );

registration
let c1 be non empty non void all-with_const_op ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be SortSymbol of c1;
cluster Constants a2,a3 -> non empty ;
coherence
not Constants c2,c3 is empty
proof end;
end;

registration
let c1 be non empty non void all-with_const_op ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster Constants a2 -> V6 ;
coherence
Constants c2 is non-empty
proof end;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be OperSymbol of c1;
let c4 be MSSubset of c2;
pred c4 is_closed_on c3 means :Def6: :: MSUALG_2:def 6
rng ((Den a3,a2) | (((a4 # ) * the Arity of a1) . a3)) c= (a4 * the ResultSort of a1) . a3;
end;

:: deftheorem Def6 defines is_closed_on MSUALG_2:def 6 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being OperSymbol of b1
for b4 being MSSubset of b2 holds
( b4 is_closed_on b3 iff rng ((Den b3,b2) | (((b4 # ) * the Arity of b1) . b3)) c= (b4 * the ResultSort of b1) . b3 );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
attr a3 is opers_closed means :Def7: :: MSUALG_2:def 7
for b1 being OperSymbol of a1 holds a3 is_closed_on b1;
end;

:: deftheorem Def7 defines opers_closed MSUALG_2:def 7 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds
( b3 is opers_closed iff for b4 being OperSymbol of b1 holds b3 is_closed_on b4 );

theorem Th3: :: MSUALG_2:3
for b1 being non empty non void ManySortedSign
for b2 being OperSymbol of b1
for b3 being MSAlgebra of b1
for b4, b5 being MSSubset of b3 st b4 c= b5 holds
((b4 # ) * the Arity of b1) . b2 c= ((b5 # ) * the Arity of b1) . b2
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be OperSymbol of c1;
let c4 be MSSubset of c2;
assume E9: c4 is_closed_on c3 ;
func c3 /. c4 -> Function of ((a4 # ) * the Arity of a1) . a3,(a4 * the ResultSort of a1) . a3 equals :Def8: :: MSUALG_2:def 8
(Den a3,a2) | (((a4 # ) * the Arity of a1) . a3);
coherence
(Den c3,c2) | (((c4 # ) * the Arity of c1) . c3) is Function of ((c4 # ) * the Arity of c1) . c3,(c4 * the ResultSort of c1) . c3
proof end;
end;

:: deftheorem Def8 defines /. MSUALG_2:def 8 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being OperSymbol of b1
for b4 being MSSubset of b2 st b4 is_closed_on b3 holds
b3 /. b4 = (Den b3,b2) | (((b4 # ) * the Arity of b1) . b3);

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
func Opers c2,c3 -> ManySortedFunction of (a3 # ) * the Arity of a1,a3 * the ResultSort of a1 means :Def9: :: MSUALG_2:def 9
for b1 being OperSymbol of a1 holds a4 . b1 = b1 /. a3;
existence
ex b1 being ManySortedFunction of (c3 # ) * the Arity of c1,c3 * the ResultSort of c1 st
for b2 being OperSymbol of c1 holds b1 . b2 = b2 /. c3
proof end;
uniqueness
for b1, b2 being ManySortedFunction of (c3 # ) * the Arity of c1,c3 * the ResultSort of c1 st ( for b3 being OperSymbol of c1 holds b1 . b3 = b3 /. c3 ) & ( for b3 being OperSymbol of c1 holds b2 . b3 = b3 /. c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def9 defines Opers MSUALG_2:def 9 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2
for b4 being ManySortedFunction of (b3 # ) * the Arity of b1,b3 * the ResultSort of b1 holds
( b4 = Opers b2,b3 iff for b5 being OperSymbol of b1 holds b4 . b5 = b5 /. b3 );

theorem Th4: :: MSUALG_2:4
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 st b3 = the Sorts of b2 holds
( b3 is opers_closed & ( for b4 being OperSymbol of b1 holds b4 /. b3 = Den b4,b2 ) )
proof end;

theorem Th5: :: MSUALG_2:5
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 st b3 = the Sorts of b2 holds
Opers b2,b3 = the Charact of b2
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
mode MSSubAlgebra of c2 -> MSAlgebra of a1 means :Def10: :: MSUALG_2:def 10
( the Sorts of a3 is MSSubset of a2 & ( for b1 being MSSubset of a2 st b1 = the Sorts of a3 holds
( b1 is opers_closed & the Charact of a3 = Opers a2,b1 ) ) );
existence
ex b1 being MSAlgebra of c1 st
( the Sorts of b1 is MSSubset of c2 & ( for b2 being MSSubset of c2 st b2 = the Sorts of b1 holds
( b2 is opers_closed & the Charact of b1 = Opers c2,b2 ) ) )
proof end;
end;

:: deftheorem Def10 defines MSSubAlgebra MSUALG_2:def 10 :
for b1 being non empty non void ManySortedSign
for b2, b3 being MSAlgebra of b1 holds
( b3 is MSSubAlgebra of b2 iff ( the Sorts of b3 is MSSubset of b2 & ( for b4 being MSSubset of b2 st b4 = the Sorts of b3 holds
( b4 is opers_closed & the Charact of b3 = Opers b2,b4 ) ) ) );

Lemma14: for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1 holds MSAlgebra(# the Sorts of b2,the Charact of b2 #) is MSSubAlgebra of b2
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
cluster strict MSSubAlgebra of a2;
existence
ex b1 being MSSubAlgebra of c2 st b1 is strict
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster MSAlgebra(# the Sorts of a2,the Charact of a2 #) -> non-empty ;
coherence
MSAlgebra(# the Sorts of c2,the Charact of c2 #) is non-empty
by MSUALG_1:def 8;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster strict non-empty MSSubAlgebra of a2;
existence
ex b1 being MSSubAlgebra of c2 st
( b1 is non-empty & b1 is strict )
proof end;
end;

theorem Th6: :: MSUALG_2:6
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1 holds b2 is MSSubAlgebra of b2
proof end;

theorem Th7: :: MSUALG_2:7
for b1 being non empty non void ManySortedSign
for b2, b3, b4 being MSAlgebra of b1 st b2 is MSSubAlgebra of b3 & b3 is MSSubAlgebra of b4 holds
b2 is MSSubAlgebra of b4
proof end;

theorem Th8: :: MSUALG_2:8
for b1 being non empty non void ManySortedSign
for b2, b3 being MSAlgebra of b1 st b2 is strict MSSubAlgebra of b3 & b3 is strict MSSubAlgebra of b2 holds
b2 = b3
proof end;

theorem Th9: :: MSUALG_2:9
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being MSSubAlgebra of b2 st the Sorts of b3 c= the Sorts of b4 holds
b3 is MSSubAlgebra of b4
proof end;

theorem Th10: :: MSUALG_2:10
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being strict MSSubAlgebra of b2 st the Sorts of b3 = the Sorts of b4 holds
b3 = b4
proof end;

theorem Th11: :: MSUALG_2:11
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubAlgebra of b2 holds Constants b2 is MSSubset of b3
proof end;

theorem Th12: :: MSUALG_2:12
for b1 being non empty non void all-with_const_op ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being non-empty MSSubAlgebra of b2 holds Constants b2 is V6 MSSubset of b3 by Th11;

theorem Th13: :: MSUALG_2:13
for b1 being non empty non void all-with_const_op ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being non-empty MSSubAlgebra of b2 holds the Sorts of b3 /\ the Sorts of b4 is non-empty
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
func SubSort c3 -> set means :Def11: :: MSUALG_2:def 11
for b1 being set holds
( b1 in a4 iff ( b1 in Funcs the carrier of a1,(bool (Union the Sorts of a2)) & b1 is MSSubset of a2 & ( for b2 being MSSubset of a2 st b2 = b1 holds
( b2 is opers_closed & Constants a2 c= b2 & a3 c= b2 ) ) ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ( b2 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b2 is MSSubset of c2 & ( for b3 being MSSubset of c2 st b3 = b2 holds
( b3 is opers_closed & Constants c2 c= b3 & c3 c= b3 ) ) ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ( b3 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b3 is MSSubset of c2 & ( for b4 being MSSubset of c2 st b4 = b3 holds
( b4 is opers_closed & Constants c2 c= b4 & c3 c= b4 ) ) ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b3 is MSSubset of c2 & ( for b4 being MSSubset of c2 st b4 = b3 holds
( b4 is opers_closed & Constants c2 c= b4 & c3 c= b4 ) ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines SubSort MSUALG_2:def 11 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2
for b4 being set holds
( b4 = SubSort b3 iff for b5 being set holds
( b5 in b4 iff ( b5 in Funcs the carrier of b1,(bool (Union the Sorts of b2)) & b5 is MSSubset of b2 & ( for b6 being MSSubset of b2 st b6 = b5 holds
( b6 is opers_closed & Constants b2 c= b6 & b3 c= b6 ) ) ) ) );

Lemma20: for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds the Sorts of b2 in SubSort b3
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
cluster SubSort a3 -> non empty ;
coherence
not SubSort c3 is empty
by Lemma20;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
func SubSort c2 -> set means :Def12: :: MSUALG_2:def 12
for b1 being set holds
( b1 in a3 iff ( b1 in Funcs the carrier of a1,(bool (Union the Sorts of a2)) & b1 is MSSubset of a2 & ( for b2 being MSSubset of a2 st b2 = b1 holds
b2 is opers_closed ) ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ( b2 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b2 is MSSubset of c2 & ( for b3 being MSSubset of c2 st b3 = b2 holds
b3 is opers_closed ) ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ( b3 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b3 is MSSubset of c2 & ( for b4 being MSSubset of c2 st b4 = b3 holds
b4 is opers_closed ) ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 in Funcs the carrier of c1,(bool (Union the Sorts of c2)) & b3 is MSSubset of c2 & ( for b4 being MSSubset of c2 st b4 = b3 holds
b4 is opers_closed ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def12 defines SubSort MSUALG_2:def 12 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being set holds
( b3 = SubSort b2 iff for b4 being set holds
( b4 in b3 iff ( b4 in Funcs the carrier of b1,(bool (Union the Sorts of b2)) & b4 is MSSubset of b2 & ( for b5 being MSSubset of b2 st b5 = b4 holds
b5 is opers_closed ) ) ) );

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

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be Element of SubSort c2;
func @ c3 -> MSSubset of a2 equals :: MSUALG_2:def 13
a3;
coherence
c3 is MSSubset of c2
by Def12;
end;

:: deftheorem Def13 defines @ MSUALG_2:def 13 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being Element of SubSort b2 holds @ b3 = b3;

theorem Th14: :: MSUALG_2:14
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being MSSubset of b2 holds
( b4 in SubSort b3 iff ( b4 is opers_closed & Constants b2 c= b4 & b3 c= b4 ) )
proof end;

theorem Th15: :: MSUALG_2:15
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds
( b3 in SubSort b2 iff b3 is opers_closed )
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
let c4 be SortSymbol of c1;
func SubSort c3,c4 -> set means :Def14: :: MSUALG_2:def 14
for b1 being set holds
( b1 in a5 iff ex b2 being MSSubset of a2 st
( b2 in SubSort a3 & b1 = b2 . a4 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being MSSubset of c2 st
( b3 in SubSort c3 & b2 = b3 . c4 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being MSSubset of c2 st
( b4 in SubSort c3 & b3 = b4 . c4 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being MSSubset of c2 st
( b4 in SubSort c3 & b3 = b4 . c4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines SubSort MSUALG_2:def 14 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2
for b4 being SortSymbol of b1
for b5 being set holds
( b5 = SubSort b3,b4 iff for b6 being set holds
( b6 in b5 iff ex b7 being MSSubset of b2 st
( b7 in SubSort b3 & b6 = b7 . b4 ) ) );

registration
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
let c4 be SortSymbol of c1;
cluster SubSort a3,a4 -> non empty ;
coherence
not SubSort c3,c4 is empty
proof end;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
func MSSubSort c3 -> MSSubset of a2 means :Def15: :: MSUALG_2:def 15
for b1 being SortSymbol of a1 holds a4 . b1 = meet (SubSort a3,b1);
existence
ex b1 being MSSubset of c2 st
for b2 being SortSymbol of c1 holds b1 . b2 = meet (SubSort c3,b2)
proof end;
uniqueness
for b1, b2 being MSSubset of c2 st ( for b3 being SortSymbol of c1 holds b1 . b3 = meet (SubSort c3,b3) ) & ( for b3 being SortSymbol of c1 holds b2 . b3 = meet (SubSort c3,b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines MSSubSort MSUALG_2:def 15 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being MSSubset of b2 holds
( b4 = MSSubSort b3 iff for b5 being SortSymbol of b1 holds b4 . b5 = meet (SubSort b3,b5) );

theorem Th16: :: MSUALG_2:16
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds (Constants b2) \/ b3 c= MSSubSort b3
proof end;

theorem Th17: :: MSUALG_2:17
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 st (Constants b2) \/ b3 is non-empty holds
MSSubSort b3 is non-empty
proof end;

theorem Th18: :: MSUALG_2:18
for b1 being non empty non void ManySortedSign
for b2 being OperSymbol of b1
for b3 being MSAlgebra of b1
for b4, b5 being MSSubset of b3 st b5 in SubSort b4 holds
(((MSSubSort b4) # ) * the Arity of b1) . b2 c= ((b5 # ) * the Arity of b1) . b2
proof end;

theorem Th19: :: MSUALG_2:19
for b1 being non empty non void ManySortedSign
for b2 being OperSymbol of b1
for b3 being MSAlgebra of b1
for b4, b5 being MSSubset of b3 st b5 in SubSort b4 holds
rng ((Den b2,b3) | ((((MSSubSort b4) # ) * the Arity of b1) . b2)) c= (b5 * the ResultSort of b1) . b2
proof end;

theorem Th20: :: MSUALG_2:20
for b1 being non empty non void ManySortedSign
for b2 being OperSymbol of b1
for b3 being MSAlgebra of b1
for b4 being MSSubset of b3 holds rng ((Den b2,b3) | ((((MSSubSort b4) # ) * the Arity of b1) . b2)) c= ((MSSubSort b4) * the ResultSort of b1) . b2
proof end;

theorem Th21: :: MSUALG_2:21
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds
( MSSubSort b3 is opers_closed & b3 c= MSSubSort b3 )
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
assume E32: c3 is opers_closed ;
func c2 | c3 -> strict MSSubAlgebra of a2 equals :Def16: :: MSUALG_2:def 16
MSAlgebra(# a3,(Opers a2,a3) #);
coherence
MSAlgebra(# c3,(Opers c2,c3) #) is strict MSSubAlgebra of c2
proof end;
end;

:: deftheorem Def16 defines | MSUALG_2:def 16 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 st b3 is opers_closed holds
b2 | b3 = MSAlgebra(# b3,(Opers b2,b3) #);

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3, c4 be MSSubAlgebra of c2;
func c3 /\ c4 -> strict MSSubAlgebra of a2 means :Def17: :: MSUALG_2:def 17
( the Sorts of a5 = the Sorts of a3 /\ the Sorts of a4 & ( for b1 being MSSubset of a2 st b1 = the Sorts of a5 holds
( b1 is opers_closed & the Charact of a5 = Opers a2,b1 ) ) );
existence
ex b1 being strict MSSubAlgebra of c2 st
( the Sorts of b1 = the Sorts of c3 /\ the Sorts of c4 & ( for b2 being MSSubset of c2 st b2 = the Sorts of b1 holds
( b2 is opers_closed & the Charact of b1 = Opers c2,b2 ) ) )
proof end;
uniqueness
for b1, b2 being strict MSSubAlgebra of c2 st the Sorts of b1 = the Sorts of c3 /\ the Sorts of c4 & ( for b3 being MSSubset of c2 st b3 = the Sorts of b1 holds
( b3 is opers_closed & the Charact of b1 = Opers c2,b3 ) ) & the Sorts of b2 = the Sorts of c3 /\ the Sorts of c4 & ( for b3 being MSSubset of c2 st b3 = the Sorts of b2 holds
( b3 is opers_closed & the Charact of b2 = Opers c2,b3 ) ) holds
b1 = b2
by Th10;
end;

:: deftheorem Def17 defines /\ MSUALG_2:def 17 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being MSSubAlgebra of b2
for b5 being strict MSSubAlgebra of b2 holds
( b5 = b3 /\ b4 iff ( the Sorts of b5 = the Sorts of b3 /\ the Sorts of b4 & ( for b6 being MSSubset of b2 st b6 = the Sorts of b5 holds
( b6 is opers_closed & the Charact of b5 = Opers b2,b6 ) ) ) );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubset of c2;
func GenMSAlg c3 -> strict MSSubAlgebra of a2 means :Def18: :: MSUALG_2:def 18
( a3 is MSSubset of a4 & ( for b1 being MSSubAlgebra of a2 st a3 is MSSubset of b1 holds
a4 is MSSubAlgebra of b1 ) );
existence
ex b1 being strict MSSubAlgebra of c2 st
( c3 is MSSubset of b1 & ( for b2 being MSSubAlgebra of c2 st c3 is MSSubset of b2 holds
b1 is MSSubAlgebra of b2 ) )
proof end;
uniqueness
for b1, b2 being strict MSSubAlgebra of c2 st c3 is MSSubset of b1 & ( for b3 being MSSubAlgebra of c2 st c3 is MSSubset of b3 holds
b1 is MSSubAlgebra of b3 ) & c3 is MSSubset of b2 & ( for b3 being MSSubAlgebra of c2 st c3 is MSSubset of b3 holds
b2 is MSSubAlgebra of b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def18 defines GenMSAlg MSUALG_2:def 18 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2
for b4 being strict MSSubAlgebra of b2 holds
( b4 = GenMSAlg b3 iff ( b3 is MSSubset of b4 & ( for b5 being MSSubAlgebra of b2 st b3 is MSSubset of b5 holds
b4 is MSSubAlgebra of b5 ) ) );

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be V6 MSSubset of c2;
cluster GenMSAlg a3 -> strict non-empty ;
coherence
GenMSAlg c3 is non-empty
proof end;
end;

theorem Th22: :: MSUALG_2:22
for b1 being non empty non void ManySortedSign
for b2 being strict MSAlgebra of b1
for b3 being MSSubset of b2 st b3 = the Sorts of b2 holds
GenMSAlg b3 = b2
proof end;

theorem Th23: :: MSUALG_2:23
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being strict MSSubAlgebra of b2
for b4 being MSSubset of b2 st b4 = the Sorts of b3 holds
GenMSAlg b4 = b3
proof end;

theorem Th24: :: MSUALG_2:24
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSSubAlgebra of b2 holds (GenMSAlg (Constants b2)) /\ b3 = GenMSAlg (Constants b2)
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3, c4 be MSSubAlgebra of c2;
func c3 "\/" c4 -> strict MSSubAlgebra of a2 means :Def19: :: MSUALG_2:def 19
for b1 being MSSubset of a2 st b1 = the Sorts of a3 \/ the Sorts of a4 holds
a5 = GenMSAlg b1;
existence
ex b1 being strict MSSubAlgebra of c2 st
for b2 being MSSubset of c2 st b2 = the Sorts of c3 \/ the Sorts of c4 holds
b1 = GenMSAlg b2
proof end;
uniqueness
for b1, b2 being strict MSSubAlgebra of c2 st ( for b3 being MSSubset of c2 st b3 = the Sorts of c3 \/ the Sorts of c4 holds
b1 = GenMSAlg b3 ) & ( for b3 being MSSubset of c2 st b3 = the Sorts of c3 \/ the Sorts of c4 holds
b2 = GenMSAlg b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def19 defines "\/" MSUALG_2:def 19 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSSubAlgebra of b2
for b5 being strict MSSubAlgebra of b2 holds
( b5 = b3 "\/" b4 iff for b6 being MSSubset of b2 st b6 = the Sorts of b3 \/ the Sorts of b4 holds
b5 = GenMSAlg b6 );

theorem Th25: :: MSUALG_2:25
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSSubAlgebra of b2
for b4, b5 being MSSubset of b2 st b5 = b4 \/ the Sorts of b3 holds
(GenMSAlg b4) "\/" b3 = GenMSAlg b5
proof end;

theorem Th26: :: MSUALG_2:26
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSSubAlgebra of b2
for b4 being MSSubset of b2 st b4 = the Sorts of b2 holds
(GenMSAlg b4) "\/" b3 = GenMSAlg b4
proof end;

theorem Th27: :: MSUALG_2:27
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSSubAlgebra of b2 holds b3 "\/" b4 = b4 "\/" b3
proof end;

theorem Th28: :: MSUALG_2:28
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being strict MSSubAlgebra of b2 holds b3 /\ (b3 "\/" b4) = b3
proof end;

theorem Th29: :: MSUALG_2:29
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being strict MSSubAlgebra of b2 holds (b3 /\ b4) "\/" b4 = b4
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
func MSSub c2 -> set means :Def20: :: MSUALG_2:def 20
for b1 being set holds
( b1 in a3 iff b1 is strict MSSubAlgebra of a2 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff b2 is strict MSSubAlgebra of c2 )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff b3 is strict MSSubAlgebra of c2 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is strict MSSubAlgebra of c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines MSSub MSUALG_2:def 20 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being set holds
( b3 = MSSub b2 iff for b4 being set holds
( b4 in b3 iff b4 is strict MSSubAlgebra of b2 ) );

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

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
func MSAlg_join c2 -> BinOp of MSSub a2 means :Def21: :: MSUALG_2:def 21
for b1, b2 being Element of MSSub a2
for b3, b4 being strict MSSubAlgebra of a2 st b1 = b3 & b2 = b4 holds
a3 . b1,b2 = b3 "\/" b4;
existence
ex b1 being BinOp of MSSub c2 st
for b2, b3 being Element of MSSub c2
for b4, b5 being strict MSSubAlgebra of c2 st b2 = b4 & b3 = b5 holds
b1 . b2,b3 = b4 "\/" b5
proof end;
uniqueness
for b1, b2 being BinOp of MSSub c2 st ( for b3, b4 being Element of MSSub c2
for b5, b6 being strict MSSubAlgebra of c2 st b3 = b5 & b4 = b6 holds
b1 . b3,b4 = b5 "\/" b6 ) & ( for b3, b4 being Element of MSSub c2
for b5, b6 being strict MSSubAlgebra of c2 st b3 = b5 & b4 = b6 holds
b2 . b3,b4 = b5 "\/" b6 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def21 defines MSAlg_join MSUALG_2:def 21 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being BinOp of MSSub b2 holds
( b3 = MSAlg_join b2 iff for b4, b5 being Element of MSSub b2
for b6, b7 being strict MSSubAlgebra of b2 st b4 = b6 & b5 = b7 holds
b3 . b4,b5 = b6 "\/" b7 );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
func MSAlg_meet c2 -> BinOp of MSSub a2 means :Def22: :: MSUALG_2:def 22
for b1, b2 being Element of MSSub a2
for b3, b4 being strict MSSubAlgebra of a2 st b1 = b3 & b2 = b4 holds
a3 . b1,b2 = b3 /\ b4;
existence
ex b1 being BinOp of MSSub c2 st
for b2, b3 being Element of MSSub c2
for b4, b5 being strict MSSubAlgebra of c2 st b2 = b4 & b3 = b5 holds
b1 . b2,b3 = b4 /\ b5
proof end;
uniqueness
for b1, b2 being BinOp of MSSub c2 st ( for b3, b4 being Element of MSSub c2
for b5, b6 being strict MSSubAlgebra of c2 st b3 = b5 & b4 = b6 holds
b1 . b3,b4 = b5 /\ b6 ) & ( for b3, b4 being Element of MSSub c2
for b5, b6 being strict MSSubAlgebra of c2 st b3 = b5 & b4 = b6 holds
b2 . b3,b4 = b5 /\ b6 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def22 defines MSAlg_meet MSUALG_2:def 22 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being BinOp of MSSub b2 holds
( b3 = MSAlg_meet b2 iff for b4, b5 being Element of MSSub b2
for b6, b7 being strict MSSubAlgebra of b2 st b4 = b6 & b5 = b7 holds
b3 . b4,b5 = b6 /\ b7 );

theorem Th30: :: MSUALG_2:30
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSAlg_join b2 is commutative
proof end;

theorem Th31: :: MSUALG_2:31
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSAlg_join b2 is associative
proof end;

theorem Th32: :: MSUALG_2:32
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSAlg_meet b2 is commutative
proof end;

theorem Th33: :: MSUALG_2:33
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSAlg_meet b2 is associative
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
func MSSubAlLattice c2 -> strict Lattice equals :: MSUALG_2:def 23
LattStr(# (MSSub a2),(MSAlg_join a2),(MSAlg_meet a2) #);
coherence
LattStr(# (MSSub c2),(MSAlg_join c2),(MSAlg_meet c2) #) is strict Lattice
proof end;
end;

:: deftheorem Def23 defines MSSubAlLattice MSUALG_2:def 23 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSSubAlLattice b2 = LattStr(# (MSSub b2),(MSAlg_join b2),(MSAlg_meet b2) #);

theorem Th34: :: MSUALG_2:34
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds MSSubAlLattice b2 is bounded
proof end;

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

theorem Th35: :: MSUALG_2:35
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds Bottom (MSSubAlLattice b2) = GenMSAlg (Constants b2)
proof end;

theorem Th36: :: MSUALG_2:36
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSSubset of b2 st b3 = the Sorts of b2 holds
Top (MSSubAlLattice b2) = GenMSAlg b3
proof end;

theorem Th37: :: MSUALG_2:37
for b1 being non empty non void ManySortedSign
for b2 being strict non-empty MSAlgebra of b1 holds Top (MSSubAlLattice b2) = b2
proof end;

theorem Th38: :: MSUALG_2:38
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1 holds MSAlgebra(# the Sorts of b2,the Charact of b2 #) is MSSubAlgebra of b2 by Lemma14;

theorem Th39: :: MSUALG_2:39
canceled;

theorem Th40: :: MSUALG_2:40
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds the Sorts of b2 in SubSort b3 by Lemma20;

theorem Th41: :: MSUALG_2:41
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubset of b2 holds SubSort b3 c= SubSort b2
proof end;