:: OSALG_1 semantic presentation

registration
let c1 be set ;
let c2 be ManySortedSet of c1;
let c3 be FinSequence of c1;
cluster a3 * a2 -> FinSequence-like ;
coherence
c2 * c3 is FinSequence-like
proof end;
end;

Lemma1: for b1 being set
for b2 being ManySortedSet of b1
for b3 being FinSequence of b1 holds
( dom (b2 * b3) = dom b3 & len (b2 * b3) = len b3 )
proof end;

definition
let c1 be non empty ManySortedSign ;
mode SortSymbol of a1 is Element of a1;
end;

definition
let c1 be non empty ManySortedSign ;
mode OperSymbol of a1 is Element of the OperSymbols of a1;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be OperSymbol of c1;
redefine func the_result_sort_of as the_result_sort_of c2 -> Element of a1;
coherence
the_result_sort_of c2 is Element of c1
;
end;

definition
attr a1 is strict;
struct OverloadedMSSign -> ManySortedSign ;
aggr OverloadedMSSign(# carrier, OperSymbols, Overloading, Arity, ResultSort #) -> OverloadedMSSign ;
sel Overloading c1 -> Equivalence_Relation of the OperSymbols of a1;
end;

definition
attr a1 is strict;
struct RelSortedSign -> ManySortedSign , RelStr ;
aggr RelSortedSign(# carrier, InternalRel, OperSymbols, Arity, ResultSort #) -> RelSortedSign ;
end;

definition
attr a1 is strict;
struct OverloadedRSSign -> OverloadedMSSign , RelSortedSign ;
aggr OverloadedRSSign(# carrier, InternalRel, OperSymbols, Overloading, Arity, ResultSort #) -> OverloadedRSSign ;
end;

theorem Th1: :: OSALG_1:1
for b1, b2 being non empty set
for b3 being Order of b1
for b4 being Equivalence_Relation of b2
for b5 being Function of b2,b1 *
for b6 being Function of b2,b1 holds
( not OverloadedRSSign(# b1,b3,b2,b4,b5,b6 #) is empty & not OverloadedRSSign(# b1,b3,b2,b4,b5,b6 #) is void & OverloadedRSSign(# b1,b3,b2,b4,b5,b6 #) is reflexive & OverloadedRSSign(# b1,b3,b2,b4,b5,b6 #) is transitive & OverloadedRSSign(# b1,b3,b2,b4,b5,b6 #) is antisymmetric )
proof end;

registration
let c1 be non empty set ;
let c2 be Order of c1;
let c3 be non empty set ;
let c4 be Equivalence_Relation of c3;
let c5 be Function of c3,c1 * ;
let c6 be Function of c3,c1;
cluster OverloadedRSSign(# a1,a2,a3,a4,a5,a6 #) -> non empty reflexive transitive antisymmetric ;
coherence
( OverloadedRSSign(# c1,c2,c3,c4,c5,c6 #) is strict & not OverloadedRSSign(# c1,c2,c3,c4,c5,c6 #) is empty & OverloadedRSSign(# c1,c2,c3,c4,c5,c6 #) is reflexive & OverloadedRSSign(# c1,c2,c3,c4,c5,c6 #) is transitive & OverloadedRSSign(# c1,c2,c3,c4,c5,c6 #) is antisymmetric )
by Th1;
end;

definition
let c1 be OverloadedRSSign ;
canceled;
attr a1 is order-sorted means :Def2: :: OSALG_1:def 2
( a1 is reflexive & a1 is transitive & a1 is antisymmetric );
end;

:: deftheorem Def1 OSALG_1:def 1 :
canceled;

:: deftheorem Def2 defines order-sorted OSALG_1:def 2 :
for b1 being OverloadedRSSign holds
( b1 is order-sorted iff ( b1 is reflexive & b1 is transitive & b1 is antisymmetric ) );

registration
cluster order-sorted -> reflexive transitive antisymmetric OverloadedRSSign ;
coherence
for b1 being OverloadedRSSign st b1 is order-sorted holds
( b1 is reflexive & b1 is transitive & b1 is antisymmetric )
by Def2;
cluster non empty non void strict order-sorted OverloadedRSSign ;
existence
ex b1 being OverloadedRSSign st
( b1 is strict & not b1 is empty & not b1 is void & b1 is order-sorted )
proof end;
end;

registration
cluster non empty non void OverloadedMSSign ;
existence
ex b1 being OverloadedMSSign st
( not b1 is empty & not b1 is void )
proof end;
end;

definition
let c1 be non empty non void OverloadedMSSign ;
let c2, c3 be OperSymbol of c1;
pred c2 ~= c3 means :Def3: :: OSALG_1:def 3
[a2,a3] in the Overloading of a1;
symmetry
for b1, b2 being OperSymbol of c1 st [b1,b2] in the Overloading of c1 holds
[b2,b1] in the Overloading of c1
proof end;
reflexivity
for b1 being OperSymbol of c1 holds [b1,b1] in the Overloading of c1
proof end;
end;

:: deftheorem Def3 defines ~= OSALG_1:def 3 :
for b1 being non empty non void OverloadedMSSign
for b2, b3 being OperSymbol of b1 holds
( b2 ~= b3 iff [b2,b3] in the Overloading of b1 );

theorem Th2: :: OSALG_1:2
for b1 being non empty non void OverloadedMSSign
for b2, b3, b4 being OperSymbol of b1 st b2 ~= b3 & b3 ~= b4 holds
b2 ~= b4
proof end;

definition
let c1 be non empty non void OverloadedMSSign ;
attr a1 is discernable means :Def4: :: OSALG_1:def 4
for b1, b2 being OperSymbol of a1 st b1 ~= b2 & the_arity_of b1 = the_arity_of b2 & the_result_sort_of b1 = the_result_sort_of b2 holds
b1 = b2;
attr a1 is op-discrete means :Def5: :: OSALG_1:def 5
the Overloading of a1 = id the OperSymbols of a1;
end;

:: deftheorem Def4 defines discernable OSALG_1:def 4 :
for b1 being non empty non void OverloadedMSSign holds
( b1 is discernable iff for b2, b3 being OperSymbol of b1 st b2 ~= b3 & the_arity_of b2 = the_arity_of b3 & the_result_sort_of b2 = the_result_sort_of b3 holds
b2 = b3 );

:: deftheorem Def5 defines op-discrete OSALG_1:def 5 :
for b1 being non empty non void OverloadedMSSign holds
( b1 is op-discrete iff the Overloading of b1 = id the OperSymbols of b1 );

theorem Th3: :: OSALG_1:3
for b1 being non empty non void OverloadedMSSign holds
( b1 is op-discrete iff for b2, b3 being OperSymbol of b1 st b2 ~= b3 holds
b2 = b3 )
proof end;

theorem Th4: :: OSALG_1:4
for b1 being non empty non void OverloadedMSSign st b1 is op-discrete holds
b1 is discernable
proof end;

definition
let c1 be non empty non void ManySortedSign ;
func OSSign c1 -> non empty non void strict order-sorted OverloadedRSSign means :Def6: :: OSALG_1:def 6
( the carrier of a1 = the carrier of a2 & id the carrier of a1 = the InternalRel of a2 & the OperSymbols of a1 = the OperSymbols of a2 & id the OperSymbols of a1 = the Overloading of a2 & the Arity of a1 = the Arity of a2 & the ResultSort of a1 = the ResultSort of a2 );
existence
ex b1 being non empty non void strict order-sorted OverloadedRSSign st
( the carrier of c1 = the carrier of b1 & id the carrier of c1 = the InternalRel of b1 & the OperSymbols of c1 = the OperSymbols of b1 & id the OperSymbols of c1 = the Overloading of b1 & the Arity of c1 = the Arity of b1 & the ResultSort of c1 = the ResultSort of b1 )
proof end;
uniqueness
for b1, b2 being non empty non void strict order-sorted OverloadedRSSign st the carrier of c1 = the carrier of b1 & id the carrier of c1 = the InternalRel of b1 & the OperSymbols of c1 = the OperSymbols of b1 & id the OperSymbols of c1 = the Overloading of b1 & the Arity of c1 = the Arity of b1 & the ResultSort of c1 = the ResultSort of b1 & the carrier of c1 = the carrier of b2 & id the carrier of c1 = the InternalRel of b2 & the OperSymbols of c1 = the OperSymbols of b2 & id the OperSymbols of c1 = the Overloading of b2 & the Arity of c1 = the Arity of b2 & the ResultSort of c1 = the ResultSort of b2 holds
b1 = b2
;
end;

:: deftheorem Def6 defines OSSign OSALG_1:def 6 :
for b1 being non empty non void ManySortedSign
for b2 being non empty non void strict order-sorted OverloadedRSSign holds
( b2 = OSSign b1 iff ( the carrier of b1 = the carrier of b2 & id the carrier of b1 = the InternalRel of b2 & the OperSymbols of b1 = the OperSymbols of b2 & id the OperSymbols of b1 = the Overloading of b2 & the Arity of b1 = the Arity of b2 & the ResultSort of b1 = the ResultSort of b2 ) );

theorem Th5: :: OSALG_1:5
for b1 being non empty non void ManySortedSign holds
( OSSign b1 is discrete & OSSign b1 is op-discrete )
proof end;

registration
cluster non empty reflexive transitive antisymmetric discrete non void strict order-sorted discernable op-discrete OverloadedRSSign ;
existence
ex b1 being non empty non void strict order-sorted OverloadedRSSign st
( b1 is discrete & b1 is op-discrete & b1 is discernable )
proof end;
end;

registration
cluster non empty non void op-discrete -> non empty non void discernable OverloadedRSSign ;
coherence
for b1 being non empty non void OverloadedRSSign st b1 is op-discrete holds
b1 is discernable
by Th4;
end;

registration
let c1 be non empty non void ManySortedSign ;
cluster OSSign a1 -> non empty reflexive transitive antisymmetric discrete non void strict order-sorted discernable op-discrete ;
coherence
( OSSign c1 is discrete & OSSign c1 is op-discrete )
by Th5;
end;

definition
mode OrderSortedSign is non empty non void order-sorted discernable OverloadedRSSign ;
end;

definition
let c1 be non empty Poset;
let c2, c3 be Element of the carrier of c1 * ;
pred c2 <= c3 means :Def7: :: OSALG_1:def 7
( len a2 = len a3 & ( for b1 being set st b1 in dom a2 holds
for b2, b3 being Element of a1 st b2 = a2 . b1 & b3 = a3 . b1 holds
b2 <= b3 ) );
reflexivity
for b1 being Element of the carrier of c1 * holds
( len b1 = len b1 & ( for b2 being set st b2 in dom b1 holds
for b3, b4 being Element of c1 st b3 = b1 . b2 & b4 = b1 . b2 holds
b3 <= b4 ) )
;
end;

:: deftheorem Def7 defines <= OSALG_1:def 7 :
for b1 being non empty Poset
for b2, b3 being Element of the carrier of b1 * holds
( b2 <= b3 iff ( len b2 = len b3 & ( for b4 being set st b4 in dom b2 holds
for b5, b6 being Element of b1 st b5 = b2 . b4 & b6 = b3 . b4 holds
b5 <= b6 ) ) );

theorem Th6: :: OSALG_1:6
for b1 being non empty Poset
for b2, b3 being Element of the carrier of b1 * st b2 <= b3 & b3 <= b2 holds
b2 = b3
proof end;

theorem Th7: :: OSALG_1:7
for b1 being non empty Poset
for b2, b3 being Element of the carrier of b1 * st b1 is discrete & b2 <= b3 holds
b2 = b3
proof end;

theorem Th8: :: OSALG_1:8
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 st b1 is discrete & b2 ~= b3 & the_arity_of b2 <= the_arity_of b3 & the_result_sort_of b2 <= the_result_sort_of b3 holds
b2 = b3
proof end;

definition
let c1 be OrderSortedSign;
let c2 be OperSymbol of c1;
attr a2 is monotone means :Def8: :: OSALG_1:def 8
for b1 being OperSymbol of a1 st a2 ~= b1 & the_arity_of a2 <= the_arity_of b1 holds
the_result_sort_of a2 <= the_result_sort_of b1;
end;

:: deftheorem Def8 defines monotone OSALG_1:def 8 :
for b1 being OrderSortedSign
for b2 being OperSymbol of b1 holds
( b2 is monotone iff for b3 being OperSymbol of b1 st b2 ~= b3 & the_arity_of b2 <= the_arity_of b3 holds
the_result_sort_of b2 <= the_result_sort_of b3 );

definition
let c1 be OrderSortedSign;
attr a1 is monotone means :Def9: :: OSALG_1:def 9
for b1 being OperSymbol of a1 holds b1 is monotone;
end;

:: deftheorem Def9 defines monotone OSALG_1:def 9 :
for b1 being OrderSortedSign holds
( b1 is monotone iff for b2 being OperSymbol of b1 holds b2 is monotone );

theorem Th9: :: OSALG_1:9
for b1 being OrderSortedSign st b1 is op-discrete holds
b1 is monotone
proof end;

registration
cluster monotone OverloadedRSSign ;
existence
ex b1 being OrderSortedSign st b1 is monotone
proof end;
end;

registration
let c1 be monotone OrderSortedSign;
cluster monotone Element of the OperSymbols of a1;
existence
ex b1 being OperSymbol of c1 st b1 is monotone
proof end;
end;

registration
let c1 be monotone OrderSortedSign;
cluster -> monotone Element of the OperSymbols of a1;
coherence
for b1 being OperSymbol of c1 holds b1 is monotone
by Def9;
end;

registration
cluster op-discrete -> reflexive transitive antisymmetric monotone OverloadedRSSign ;
coherence
for b1 being OrderSortedSign st b1 is op-discrete holds
b1 is monotone
by Th9;
end;

theorem Th10: :: OSALG_1:10
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 st b1 is monotone & the_arity_of b2 = {} & b2 ~= b3 & the_arity_of b3 = {} holds
b2 = b3
proof end;

definition
let c1 be OrderSortedSign;
let c2, c3 be OperSymbol of c1;
let c4 be Element of the carrier of c1 * ;
pred c3 has_least_args_for c2,c4 means :Def10: :: OSALG_1:def 10
( a2 ~= a3 & a4 <= the_arity_of a3 & ( for b1 being OperSymbol of a1 st a2 ~= b1 & a4 <= the_arity_of b1 holds
the_arity_of a3 <= the_arity_of b1 ) );
pred c3 has_least_sort_for c2,c4 means :Def11: :: OSALG_1:def 11
( a2 ~= a3 & a4 <= the_arity_of a3 & ( for b1 being OperSymbol of a1 st a2 ~= b1 & a4 <= the_arity_of b1 holds
the_result_sort_of a3 <= the_result_sort_of b1 ) );
end;

:: deftheorem Def10 defines has_least_args_for OSALG_1:def 10 :
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being Element of the carrier of b1 * holds
( b3 has_least_args_for b2,b4 iff ( b2 ~= b3 & b4 <= the_arity_of b3 & ( for b5 being OperSymbol of b1 st b2 ~= b5 & b4 <= the_arity_of b5 holds
the_arity_of b3 <= the_arity_of b5 ) ) );

:: deftheorem Def11 defines has_least_sort_for OSALG_1:def 11 :
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being Element of the carrier of b1 * holds
( b3 has_least_sort_for b2,b4 iff ( b2 ~= b3 & b4 <= the_arity_of b3 & ( for b5 being OperSymbol of b1 st b2 ~= b5 & b4 <= the_arity_of b5 holds
the_result_sort_of b3 <= the_result_sort_of b5 ) ) );

definition
let c1 be OrderSortedSign;
let c2, c3 be OperSymbol of c1;
let c4 be Element of the carrier of c1 * ;
pred c3 has_least_rank_for c2,c4 means :Def12: :: OSALG_1:def 12
( a3 has_least_args_for a2,a4 & a3 has_least_sort_for a2,a4 );
end;

:: deftheorem Def12 defines has_least_rank_for OSALG_1:def 12 :
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being Element of the carrier of b1 * holds
( b3 has_least_rank_for b2,b4 iff ( b3 has_least_args_for b2,b4 & b3 has_least_sort_for b2,b4 ) );

definition
let c1 be OrderSortedSign;
let c2 be OperSymbol of c1;
attr a2 is regular means :Def13: :: OSALG_1:def 13
( a2 is monotone & ( for b1 being Element of the carrier of a1 * st b1 <= the_arity_of a2 holds
ex b2 being OperSymbol of a1 st b2 has_least_args_for a2,b1 ) );
end;

:: deftheorem Def13 defines regular OSALG_1:def 13 :
for b1 being OrderSortedSign
for b2 being OperSymbol of b1 holds
( b2 is regular iff ( b2 is monotone & ( for b3 being Element of the carrier of b1 * st b3 <= the_arity_of b2 holds
ex b4 being OperSymbol of b1 st b4 has_least_args_for b2,b3 ) ) );

definition
let c1 be monotone OrderSortedSign;
attr a1 is regular means :Def14: :: OSALG_1:def 14
for b1 being OperSymbol of a1 holds b1 is regular;
end;

:: deftheorem Def14 defines regular OSALG_1:def 14 :
for b1 being monotone OrderSortedSign holds
( b1 is regular iff for b2 being OperSymbol of b1 holds b2 is regular );

theorem Th11: :: OSALG_1:11
for b1 being monotone OrderSortedSign holds
( b1 is regular iff for b2 being OperSymbol of b1
for b3 being Element of the carrier of b1 * st b3 <= the_arity_of b2 holds
ex b4 being OperSymbol of b1 st b4 has_least_rank_for b2,b3 )
proof end;

theorem Th12: :: OSALG_1:12
for b1 being monotone OrderSortedSign st b1 is op-discrete holds
b1 is regular
proof end;

registration
cluster monotone regular OverloadedRSSign ;
existence
ex b1 being monotone OrderSortedSign st b1 is regular
proof end;
end;

registration
cluster op-discrete monotone -> reflexive transitive antisymmetric monotone regular OverloadedRSSign ;
coherence
for b1 being monotone OrderSortedSign st b1 is op-discrete holds
b1 is regular
by Th12;
end;

registration
let c1 be monotone regular OrderSortedSign;
cluster -> monotone regular Element of the OperSymbols of a1;
coherence
for b1 being OperSymbol of c1 holds b1 is regular
by Def14;
end;

theorem Th13: :: OSALG_1:13
for b1 being monotone regular OrderSortedSign
for b2, b3, b4 being OperSymbol of b1
for b5 being Element of the carrier of b1 * st b5 <= the_arity_of b2 & b3 has_least_args_for b2,b5 & b4 has_least_args_for b2,b5 holds
b3 = b4
proof end;

definition
let c1 be monotone regular OrderSortedSign;
let c2 be OperSymbol of c1;
let c3 be Element of the carrier of c1 * ;
assume E27: c3 <= the_arity_of c2 ;
func LBound c2,c3 -> OperSymbol of a1 means :Def15: :: OSALG_1:def 15
a4 has_least_args_for a2,a3;
existence
ex b1 being OperSymbol of c1 st b1 has_least_args_for c2,c3
by E27, Def13;
uniqueness
for b1, b2 being OperSymbol of c1 st b1 has_least_args_for c2,c3 & b2 has_least_args_for c2,c3 holds
b1 = b2
by E27, Th13;
end;

:: deftheorem Def15 defines LBound OSALG_1:def 15 :
for b1 being monotone regular OrderSortedSign
for b2 being OperSymbol of b1
for b3 being Element of the carrier of b1 * st b3 <= the_arity_of b2 holds
for b4 being OperSymbol of b1 holds
( b4 = LBound b2,b3 iff b4 has_least_args_for b2,b3 );

theorem Th14: :: OSALG_1:14
for b1 being monotone regular OrderSortedSign
for b2 being OperSymbol of b1
for b3 being Element of the carrier of b1 * st b3 <= the_arity_of b2 holds
LBound b2,b3 has_least_rank_for b2,b3
proof end;

definition
let c1 be non empty Poset;
let c2 be non empty set ;
func ConstOSSet c1,c2 -> ManySortedSet of the carrier of a1 equals :: OSALG_1:def 16
the carrier of a1 --> a2;
correctness
coherence
the carrier of c1 --> c2 is ManySortedSet of the carrier of c1
;
proof end;
end;

:: deftheorem Def16 defines ConstOSSet OSALG_1:def 16 :
for b1 being non empty Poset
for b2 being non empty set holds ConstOSSet b1,b2 = the carrier of b1 --> b2;

theorem Th15: :: OSALG_1:15
for b1 being non empty Poset
for b2 being non empty set holds
( ConstOSSet b1,b2 is non-empty & ( for b3, b4 being Element of b1 st b3 <= b4 holds
(ConstOSSet b1,b2) . b3 c= (ConstOSSet b1,b2) . b4 ) )
proof end;

definition
let c1 be non empty Poset;
let c2 be ManySortedSet of c1;
canceled;
attr a2 is order-sorted means :Def18: :: OSALG_1:def 18
for b1, b2 being Element of a1 st b1 <= b2 holds
a2 . b1 c= a2 . b2;
end;

:: deftheorem Def17 OSALG_1:def 17 :
canceled;

:: deftheorem Def18 defines order-sorted OSALG_1:def 18 :
for b1 being non empty Poset
for b2 being ManySortedSet of b1 holds
( b2 is order-sorted iff for b3, b4 being Element of b1 st b3 <= b4 holds
b2 . b3 c= b2 . b4 );

theorem Th16: :: OSALG_1:16
for b1 being non empty Poset
for b2 being non empty set holds ConstOSSet b1,b2 is order-sorted
proof end;

registration
let c1 be non empty Poset;
cluster order-sorted ManySortedSet of the carrier of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is order-sorted
proof end;
end;

definition
let c1 be non empty Poset;
let c2 be non empty set ;
redefine func ConstOSSet as ConstOSSet c1,c2 -> order-sorted ManySortedSet of a1;
coherence
ConstOSSet c1,c2 is order-sorted ManySortedSet of c1
by Th16;
end;

definition
let c1 be non empty Poset;
mode OrderSortedSet of a1 is order-sorted ManySortedSet of a1;
end;

registration
let c1 be non empty Poset;
cluster V2 ManySortedSet of the carrier of a1;
existence
ex b1 being OrderSortedSet of c1 st b1 is non-empty
proof end;
end;

definition
let c1 be OrderSortedSign;
let c2 be MSAlgebra of c1;
attr a2 is order-sorted means :Def19: :: OSALG_1:def 19
for b1, b2 being SortSymbol of a1 st b1 <= b2 holds
the Sorts of a2 . b1 c= the Sorts of a2 . b2;
end;

:: deftheorem Def19 defines order-sorted OSALG_1:def 19 :
for b1 being OrderSortedSign
for b2 being MSAlgebra of b1 holds
( b2 is order-sorted iff for b3, b4 being SortSymbol of b1 st b3 <= b4 holds
the Sorts of b2 . b3 c= the Sorts of b2 . b4 );

theorem Th17: :: OSALG_1:17
for b1 being OrderSortedSign
for b2 being MSAlgebra of b1 holds
( b2 is order-sorted iff the Sorts of b2 is OrderSortedSet of b1 )
proof end;

definition
let c1 be OrderSortedSign;
let c2 be non empty set ;
let c3 be ManySortedFunction of ((ConstOSSet c1,c2) # ) * the Arity of c1,(ConstOSSet c1,c2) * the ResultSort of c1;
func ConstOSA c1,c2,c3 -> strict non-empty MSAlgebra of a1 means :Def20: :: OSALG_1:def 20
( the Sorts of a4 = ConstOSSet a1,a2 & the Charact of a4 = a3 );
existence
ex b1 being strict non-empty MSAlgebra of c1 st
( the Sorts of b1 = ConstOSSet c1,c2 & the Charact of b1 = c3 )
proof end;
uniqueness
for b1, b2 being strict non-empty MSAlgebra of c1 st the Sorts of b1 = ConstOSSet c1,c2 & the Charact of b1 = c3 & the Sorts of b2 = ConstOSSet c1,c2 & the Charact of b2 = c3 holds
b1 = b2
;
end;

:: deftheorem Def20 defines ConstOSA OSALG_1:def 20 :
for b1 being OrderSortedSign
for b2 being non empty set
for b3 being ManySortedFunction of ((ConstOSSet b1,b2) # ) * the Arity of b1,(ConstOSSet b1,b2) * the ResultSort of b1
for b4 being strict non-empty MSAlgebra of b1 holds
( b4 = ConstOSA b1,b2,b3 iff ( the Sorts of b4 = ConstOSSet b1,b2 & the Charact of b4 = b3 ) );

theorem Th18: :: OSALG_1:18
for b1 being OrderSortedSign
for b2 being non empty set
for b3 being ManySortedFunction of ((ConstOSSet b1,b2) # ) * the Arity of b1,(ConstOSSet b1,b2) * the ResultSort of b1 holds ConstOSA b1,b2,b3 is order-sorted
proof end;

registration
let c1 be OrderSortedSign;
cluster strict non-empty order-sorted MSAlgebra of a1;
existence
ex b1 being MSAlgebra of c1 st
( b1 is strict & b1 is non-empty & b1 is order-sorted )
proof end;
end;

registration
let c1 be OrderSortedSign;
let c2 be non empty set ;
let c3 be ManySortedFunction of ((ConstOSSet c1,c2) # ) * the Arity of c1,(ConstOSSet c1,c2) * the ResultSort of c1;
cluster ConstOSA a1,a2,a3 -> strict non-empty order-sorted ;
coherence
ConstOSA c1,c2,c3 is order-sorted
by Th18;
end;

definition
let c1 be OrderSortedSign;
mode OSAlgebra of a1 is order-sorted MSAlgebra of a1;
end;

theorem Th19: :: OSALG_1:19
for b1 being discrete OrderSortedSign
for b2 being MSAlgebra of b1 holds b2 is order-sorted
proof end;

registration
let c1 be discrete OrderSortedSign;
cluster -> order-sorted MSAlgebra of a1;
coherence
for b1 being MSAlgebra of c1 holds b1 is order-sorted
by Th19;
end;

theorem Th20: :: OSALG_1:20
for b1 being OrderSortedSign
for b2, b3 being Element of the carrier of b1 *
for b4 being OSAlgebra of b1 st b2 <= b3 holds
(the Sorts of b4 # ) . b2 c= (the Sorts of b4 # ) . b3
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
func OSAlg c2 -> strict OSAlgebra of OSSign a1 means :: OSALG_1:def 21
( the Sorts of a3 = the Sorts of a2 & the Charact of a3 = the Charact of a2 );
uniqueness
for b1, b2 being strict OSAlgebra of OSSign c1 st the Sorts of b1 = the Sorts of c2 & the Charact of b1 = the Charact of c2 & the Sorts of b2 = the Sorts of c2 & the Charact of b2 = the Charact of c2 holds
b1 = b2
;
existence
ex b1 being strict OSAlgebra of OSSign c1 st
( the Sorts of b1 = the Sorts of c2 & the Charact of b1 = the Charact of c2 )
proof end;
end;

:: deftheorem Def21 defines OSAlg OSALG_1:def 21 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being strict OSAlgebra of OSSign b1 holds
( b3 = OSAlg b2 iff ( the Sorts of b3 = the Sorts of b2 & the Charact of b3 = the Charact of b2 ) );

theorem Th21: :: OSALG_1:21
for b1 being OrderSortedSign
for b2, b3, b4 being Element of the carrier of b1 * st b2 <= b3 & b3 <= b4 holds
b2 <= b4
proof end;

definition
let c1 be OrderSortedSign;
let c2, c3 be OperSymbol of c1;
pred c2 <= c3 means :Def22: :: OSALG_1:def 22
( a2 ~= a3 & the_arity_of a2 <= the_arity_of a3 & the_result_sort_of a2 <= the_result_sort_of a3 );
reflexivity
for b1 being OperSymbol of c1 holds
( b1 ~= b1 & the_arity_of b1 <= the_arity_of b1 & the_result_sort_of b1 <= the_result_sort_of b1 )
;
end;

:: deftheorem Def22 defines <= OSALG_1:def 22 :
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 holds
( b2 <= b3 iff ( b2 ~= b3 & the_arity_of b2 <= the_arity_of b3 & the_result_sort_of b2 <= the_result_sort_of b3 ) );

theorem Th22: :: OSALG_1:22
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 st b2 <= b3 & b3 <= b2 holds
b2 = b3
proof end;

theorem Th23: :: OSALG_1:23
for b1 being OrderSortedSign
for b2, b3, b4 being OperSymbol of b1 st b2 <= b3 & b3 <= b4 holds
b2 <= b4
proof end;

theorem Th24: :: OSALG_1:24
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being OSAlgebra of b1 st the_result_sort_of b2 <= the_result_sort_of b3 holds
Result b2,b4 c= Result b3,b4
proof end;

theorem Th25: :: OSALG_1:25
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being OSAlgebra of b1 st the_arity_of b2 <= the_arity_of b3 holds
Args b2,b4 c= Args b3,b4
proof end;

theorem Th26: :: OSALG_1:26
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being OSAlgebra of b1 st b2 <= b3 holds
( Args b2,b4 c= Args b3,b4 & Result b2,b4 c= Result b3,b4 )
proof end;

definition
let c1 be OrderSortedSign;
let c2 be OSAlgebra of c1;
attr a2 is monotone means :Def23: :: OSALG_1:def 23
for b1, b2 being OperSymbol of a1 st b1 <= b2 holds
(Den b2,a2) | (Args b1,a2) = Den b1,a2;
end;

:: deftheorem Def23 defines monotone OSALG_1:def 23 :
for b1 being OrderSortedSign
for b2 being OSAlgebra of b1 holds
( b2 is monotone iff for b3, b4 being OperSymbol of b1 st b3 <= b4 holds
(Den b4,b2) | (Args b3,b2) = Den b3,b2 );

theorem Th27: :: OSALG_1:27
for b1 being OrderSortedSign
for b2 being non-empty OSAlgebra of b1 holds
( b2 is monotone iff for b3, b4 being OperSymbol of b1 st b3 <= b4 holds
Den b3,b2 c= Den b4,b2 )
proof end;

theorem Th28: :: OSALG_1:28
for b1 being OrderSortedSign
for b2 being OSAlgebra of b1 st ( b1 is discrete or b1 is op-discrete ) holds
b2 is monotone
proof end;

definition
let c1 be OrderSortedSign;
let c2 be non empty set ;
let c3 be Element of c2;
func TrivialOSA c1,c2,c3 -> strict OSAlgebra of a1 means :Def24: :: OSALG_1:def 24
( the Sorts of a4 = ConstOSSet a1,a2 & ( for b1 being OperSymbol of a1 holds Den b1,a4 = (Args b1,a4) --> a3 ) );
existence
ex b1 being strict OSAlgebra of c1 st
( the Sorts of b1 = ConstOSSet c1,c2 & ( for b2 being OperSymbol of c1 holds Den b2,b1 = (Args b2,b1) --> c3 ) )
proof end;
uniqueness
for b1, b2 being strict OSAlgebra of c1 st the Sorts of b1 = ConstOSSet c1,c2 & ( for b3 being OperSymbol of c1 holds Den b3,b1 = (Args b3,b1) --> c3 ) & the Sorts of b2 = ConstOSSet c1,c2 & ( for b3 being OperSymbol of c1 holds Den b3,b2 = (Args b3,b2) --> c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def24 defines TrivialOSA OSALG_1:def 24 :
for b1 being OrderSortedSign
for b2 being non empty set
for b3 being Element of b2
for b4 being strict OSAlgebra of b1 holds
( b4 = TrivialOSA b1,b2,b3 iff ( the Sorts of b4 = ConstOSSet b1,b2 & ( for b5 being OperSymbol of b1 holds Den b5,b4 = (Args b5,b4) --> b3 ) ) );

theorem Th29: :: OSALG_1:29
for b1 being OrderSortedSign
for b2 being non empty set
for b3 being Element of b2 holds
( TrivialOSA b1,b2,b3 is non-empty & TrivialOSA b1,b2,b3 is monotone )
proof end;

registration
let c1 be OrderSortedSign;
cluster strict non-empty monotone MSAlgebra of a1;
existence
ex b1 being OSAlgebra of c1 st
( b1 is monotone & b1 is strict & b1 is non-empty )
proof end;
end;

registration
let c1 be OrderSortedSign;
let c2 be non empty set ;
let c3 be Element of c2;
cluster TrivialOSA a1,a2,a3 -> strict non-empty monotone ;
coherence
( TrivialOSA c1,c2,c3 is monotone & TrivialOSA c1,c2,c3 is non-empty )
by Th29;
end;

definition
let c1 be OrderSortedSign;
func OperNames c1 -> non empty Subset-Family of the OperSymbols of a1 equals :: OSALG_1:def 25
Class the Overloading of a1;
coherence
Class the Overloading of c1 is non empty Subset-Family of the OperSymbols of c1
;
end;

:: deftheorem Def25 defines OperNames OSALG_1:def 25 :
for b1 being OrderSortedSign holds OperNames b1 = Class the Overloading of b1;

registration
let c1 be OrderSortedSign;
cluster -> non empty Element of OperNames a1;
coherence
for b1 being Element of OperNames c1 holds not b1 is empty
proof end;
end;

definition
let c1 be OrderSortedSign;
mode OperName of a1 is Element of OperNames a1;
end;

definition
let c1 be OrderSortedSign;
let c2 be OperSymbol of c1;
func Name c2 -> OperName of a1 equals :: OSALG_1:def 26
Class the Overloading of a1,a2;
coherence
Class the Overloading of c1,c2 is OperName of c1
by EQREL_1:def 5;
end;

:: deftheorem Def26 defines Name OSALG_1:def 26 :
for b1 being OrderSortedSign
for b2 being OperSymbol of b1 holds Name b2 = Class the Overloading of b1,b2;

theorem Th30: :: OSALG_1:30
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 holds
( b2 ~= b3 iff b3 in Class the Overloading of b1,b2 )
proof end;

theorem Th31: :: OSALG_1:31
for b1 being OrderSortedSign
for b2, b3 being OperSymbol of b1 holds
( b2 ~= b3 iff Name b2 = Name b3 )
proof end;

theorem Th32: :: OSALG_1:32
for b1 being OrderSortedSign
for b2 being set holds
( b2 is OperName of b1 iff ex b3 being OperSymbol of b1 st b2 = Name b3 )
proof end;

definition
let c1 be OrderSortedSign;
let c2 be OperName of c1;
redefine mode Element as Element of c2 -> OperSymbol of a1;
coherence
for b1 being Element of c2 holds b1 is OperSymbol of c1
proof end;
end;

theorem Th33: :: OSALG_1:33
for b1 being OrderSortedSign
for b2 being OperName of b1
for b3 being OperSymbol of b1 holds
( b3 is Element of b2 iff Name b3 = b2 )
proof end;

theorem Th34: :: OSALG_1:34
for b1 being monotone regular OrderSortedSign
for b2, b3 being OperSymbol of b1
for b4 being Element of the carrier of b1 * st b2 ~= b3 & len (the_arity_of b2) = len (the_arity_of b3) & b4 <= the_arity_of b2 & b4 <= the_arity_of b3 holds
LBound b2,b4 = LBound b3,b4
proof end;

definition
let c1 be monotone regular OrderSortedSign;
let c2 be OperName of c1;
let c3 be Element of the carrier of c1 * ;
assume E50: ex b1 being Element of c2 st c3 <= the_arity_of b1 ;
func LBound c2,c3 -> Element of a2 means :: OSALG_1:def 27
for b1 being Element of a2 st a3 <= the_arity_of b1 holds
a4 = LBound b1,a3;
existence
ex b1 being Element of c2 st
for b2 being Element of c2 st c3 <= the_arity_of b2 holds
b1 = LBound b2,c3
proof end;
uniqueness
for b1, b2 being Element of c2 st ( for b3 being Element of c2 st c3 <= the_arity_of b3 holds
b1 = LBound b3,c3 ) & ( for b3 being Element of c2 st c3 <= the_arity_of b3 holds
b2 = LBound b3,c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def27 defines LBound OSALG_1:def 27 :
for b1 being monotone regular OrderSortedSign
for b2 being OperName of b1
for b3 being Element of the carrier of b1 * st ex b4 being Element of b2 st b3 <= the_arity_of b4 holds
for b4 being Element of b2 holds
( b4 = LBound b2,b3 iff for b5 being Element of b2 st b3 <= the_arity_of b5 holds
b4 = LBound b5,b3 );

theorem Th35: :: OSALG_1:35
for b1 being monotone regular OrderSortedSign
for b2 being OperSymbol of b1
for b3 being Element of the carrier of b1 * st b3 <= the_arity_of b2 holds
LBound b2,b3 <= b2
proof end;