:: PRALG_1 semantic presentation

theorem Th1: :: PRALG_1:1
for b1, b2 being non empty set
for b3, b4 being Nat st b3 -tuples_on b1 = b4 -tuples_on b2 holds
b3 = b4
proof end;

definition
let c1, c2 be non empty set ;
let c3 be FinSequence of [:c1,c2:];
redefine func pr1 as pr1 c3 -> FinSequence of a1 means :Def1: :: PRALG_1:def 1
( len a4 = len a3 & ( for b1 being Nat st b1 in dom a4 holds
a4 . b1 = (a3 . b1) `1 ) );
compatibility
for b1 being FinSequence of c1 holds
( b1 = pr1 c3 iff ( len b1 = len c3 & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = (c3 . b2) `1 ) ) )
proof end;
coherence
pr1 c3 is FinSequence of c1
proof end;
redefine func pr2 as pr2 c3 -> FinSequence of a2 means :Def2: :: PRALG_1:def 2
( len a4 = len a3 & ( for b1 being Nat st b1 in dom a4 holds
a4 . b1 = (a3 . b1) `2 ) );
compatibility
for b1 being FinSequence of c2 holds
( b1 = pr2 c3 iff ( len b1 = len c3 & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = (c3 . b2) `2 ) ) )
proof end;
coherence
pr2 c3 is FinSequence of c2
proof end;
end;

:: deftheorem Def1 defines pr1 PRALG_1:def 1 :
for b1, b2 being non empty set
for b3 being FinSequence of [:b1,b2:]
for b4 being FinSequence of b1 holds
( b4 = pr1 b3 iff ( len b4 = len b3 & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = (b3 . b5) `1 ) ) );

:: deftheorem Def2 defines pr2 PRALG_1:def 2 :
for b1, b2 being non empty set
for b3 being FinSequence of [:b1,b2:]
for b4 being FinSequence of b2 holds
( b4 = pr2 b3 iff ( len b4 = len b3 & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = (b3 . b5) `2 ) ) );

definition
let c1, c2 be non empty set ;
let c3 be non empty homogeneous quasi_total PartFunc of c1 * ,c1;
let c4 be non empty homogeneous quasi_total PartFunc of c2 * ,c2;
assume E4: arity c3 = arity c4 ;
func [[:c3,c4:]] -> non empty homogeneous quasi_total PartFunc of [:a1,a2:] * ,[:a1,a2:] means :Def3: :: PRALG_1:def 3
( dom a5 = (arity a3) -tuples_on [:a1,a2:] & ( for b1 being FinSequence of [:a1,a2:] st b1 in dom a5 holds
a5 . b1 = [(a3 . (pr1 b1)),(a4 . (pr2 b1))] ) );
existence
ex b1 being non empty homogeneous quasi_total PartFunc of [:c1,c2:] * ,[:c1,c2:] st
( dom b1 = (arity c3) -tuples_on [:c1,c2:] & ( for b2 being FinSequence of [:c1,c2:] st b2 in dom b1 holds
b1 . b2 = [(c3 . (pr1 b2)),(c4 . (pr2 b2))] ) )
proof end;
uniqueness
for b1, b2 being non empty homogeneous quasi_total PartFunc of [:c1,c2:] * ,[:c1,c2:] st dom b1 = (arity c3) -tuples_on [:c1,c2:] & ( for b3 being FinSequence of [:c1,c2:] st b3 in dom b1 holds
b1 . b3 = [(c3 . (pr1 b3)),(c4 . (pr2 b3))] ) & dom b2 = (arity c3) -tuples_on [:c1,c2:] & ( for b3 being FinSequence of [:c1,c2:] st b3 in dom b2 holds
b2 . b3 = [(c3 . (pr1 b3)),(c4 . (pr2 b3))] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines [[: PRALG_1:def 3 :
for b1, b2 being non empty set
for b3 being non empty homogeneous quasi_total PartFunc of b1 * ,b1
for b4 being non empty homogeneous quasi_total PartFunc of b2 * ,b2 st arity b3 = arity b4 holds
for b5 being non empty homogeneous quasi_total PartFunc of [:b1,b2:] * ,[:b1,b2:] holds
( b5 = [[:b3,b4:]] iff ( dom b5 = (arity b3) -tuples_on [:b1,b2:] & ( for b6 being FinSequence of [:b1,b2:] st b6 in dom b5 holds
b5 . b6 = [(b3 . (pr1 b6)),(b4 . (pr2 b6))] ) ) );

definition
let c1, c2 be Universal_Algebra;
assume E5: c1,c2 are_similar ;
func Opers c1,c2 -> PFuncFinSequence of [:the carrier of a1,the carrier of a2:] means :Def4: :: PRALG_1:def 4
( len a3 = len the charact of a1 & ( for b1 being Nat st b1 in dom a3 holds
for b2 being non empty homogeneous quasi_total PartFunc of the carrier of a1 * ,the carrier of a1
for b3 being non empty homogeneous quasi_total PartFunc of the carrier of a2 * ,the carrier of a2 st b2 = the charact of a1 . b1 & b3 = the charact of a2 . b1 holds
a3 . b1 = [[:b2,b3:]] ) );
existence
ex b1 being PFuncFinSequence of [:the carrier of c1,the carrier of c2:] st
( len b1 = len the charact of c1 & ( for b2 being Nat st b2 in dom b1 holds
for b3 being non empty homogeneous quasi_total PartFunc of the carrier of c1 * ,the carrier of c1
for b4 being non empty homogeneous quasi_total PartFunc of the carrier of c2 * ,the carrier of c2 st b3 = the charact of c1 . b2 & b4 = the charact of c2 . b2 holds
b1 . b2 = [[:b3,b4:]] ) )
proof end;
uniqueness
for b1, b2 being PFuncFinSequence of [:the carrier of c1,the carrier of c2:] st len b1 = len the charact of c1 & ( for b3 being Nat st b3 in dom b1 holds
for b4 being non empty homogeneous quasi_total PartFunc of the carrier of c1 * ,the carrier of c1
for b5 being non empty homogeneous quasi_total PartFunc of the carrier of c2 * ,the carrier of c2 st b4 = the charact of c1 . b3 & b5 = the charact of c2 . b3 holds
b1 . b3 = [[:b4,b5:]] ) & len b2 = len the charact of c1 & ( for b3 being Nat st b3 in dom b2 holds
for b4 being non empty homogeneous quasi_total PartFunc of the carrier of c1 * ,the carrier of c1
for b5 being non empty homogeneous quasi_total PartFunc of the carrier of c2 * ,the carrier of c2 st b4 = the charact of c1 . b3 & b5 = the charact of c2 . b3 holds
b2 . b3 = [[:b4,b5:]] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines Opers PRALG_1:def 4 :
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
for b3 being PFuncFinSequence of [:the carrier of b1,the carrier of b2:] holds
( b3 = Opers b1,b2 iff ( len b3 = len the charact of b1 & ( for b4 being Nat st b4 in dom b3 holds
for b5 being non empty homogeneous quasi_total PartFunc of the carrier of b1 * ,the carrier of b1
for b6 being non empty homogeneous quasi_total PartFunc of the carrier of b2 * ,the carrier of b2 st b5 = the charact of b1 . b4 & b6 = the charact of b2 . b4 holds
b3 . b4 = [[:b5,b6:]] ) ) );

theorem Th2: :: PRALG_1:2
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
UAStr(# [:the carrier of b1,the carrier of b2:],(Opers b1,b2) #) is strict Universal_Algebra
proof end;

definition
let c1, c2 be Universal_Algebra;
assume E7: c1,c2 are_similar ;
func [:c1,c2:] -> strict Universal_Algebra equals :Def5: :: PRALG_1:def 5
UAStr(# [:the carrier of a1,the carrier of a2:],(Opers a1,a2) #);
coherence
UAStr(# [:the carrier of c1,the carrier of c2:],(Opers c1,c2) #) is strict Universal_Algebra
by E7, Th2;
end;

:: deftheorem Def5 defines [: PRALG_1:def 5 :
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
[:b1,b2:] = UAStr(# [:the carrier of b1,the carrier of b2:],(Opers b1,b2) #);

definition
let c1, c2 be non empty set ;
func Inv c1,c2 -> Function of [:a1,a2:],[:a2,a1:] means :Def6: :: PRALG_1:def 6
for b1 being Element of [:a1,a2:] holds a3 . b1 = [(b1 `2 ),(b1 `1 )];
existence
ex b1 being Function of [:c1,c2:],[:c2,c1:] st
for b2 being Element of [:c1,c2:] holds b1 . b2 = [(b2 `2 ),(b2 `1 )]
proof end;
uniqueness
for b1, b2 being Function of [:c1,c2:],[:c2,c1:] st ( for b3 being Element of [:c1,c2:] holds b1 . b3 = [(b3 `2 ),(b3 `1 )] ) & ( for b3 being Element of [:c1,c2:] holds b2 . b3 = [(b3 `2 ),(b3 `1 )] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines Inv PRALG_1:def 6 :
for b1, b2 being non empty set
for b3 being Function of [:b1,b2:],[:b2,b1:] holds
( b3 = Inv b1,b2 iff for b4 being Element of [:b1,b2:] holds b3 . b4 = [(b4 `2 ),(b4 `1 )] );

theorem Th3: :: PRALG_1:3
for b1, b2 being non empty set holds rng (Inv b1,b2) = [:b2,b1:]
proof end;

theorem Th4: :: PRALG_1:4
for b1, b2 being non empty set holds Inv b1,b2 is one-to-one
proof end;

theorem Th5: :: PRALG_1:5
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
Inv the carrier of b1,the carrier of b2 is Function of the carrier of [:b1,b2:],the carrier of [:b2,b1:]
proof end;

theorem Th6: :: PRALG_1:6
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
for b3 being operation of b1
for b4 being operation of b2
for b5 being operation of [:b1,b2:]
for b6 being Nat st b3 = the charact of b1 . b6 & b4 = the charact of b2 . b6 & b5 = the charact of [:b1,b2:] . b6 & b6 in dom the charact of b1 holds
( arity b5 = arity b3 & arity b5 = arity b4 & b5 = [[:b3,b4:]] )
proof end;

theorem Th7: :: PRALG_1:7
for b1, b2 being Universal_Algebra st b1,b2 are_similar holds
[:b1,b2:],b1 are_similar
proof end;

theorem Th8: :: PRALG_1:8
for b1, b2, b3, b4 being Universal_Algebra st b1 is SubAlgebra of b2 & b3 is SubAlgebra of b4 & b2,b4 are_similar holds
[:b1,b3:] is SubAlgebra of [:b2,b4:]
proof end;

definition
let c1 be natural number ;
func TrivialOp c1 -> PartFunc of {{} } * ,{{} } means :Def7: :: PRALG_1:def 7
( dom a2 = {(a1 |-> {} )} & rng a2 = {{} } );
existence
ex b1 being PartFunc of {{} } * ,{{} } st
( dom b1 = {(c1 |-> {} )} & rng b1 = {{} } )
proof end;
uniqueness
for b1, b2 being PartFunc of {{} } * ,{{} } st dom b1 = {(c1 |-> {} )} & rng b1 = {{} } & dom b2 = {(c1 |-> {} )} & rng b2 = {{} } holds
b1 = b2
by FUNCT_1:17;
end;

:: deftheorem Def7 defines TrivialOp PRALG_1:def 7 :
for b1 being natural number
for b2 being PartFunc of {{} } * ,{{} } holds
( b2 = TrivialOp b1 iff ( dom b2 = {(b1 |-> {} )} & rng b2 = {{} } ) );

registration
let c1 be natural number ;
cluster TrivialOp a1 -> non empty homogeneous quasi_total ;
coherence
( TrivialOp c1 is homogeneous & TrivialOp c1 is quasi_total & not TrivialOp c1 is empty )
proof end;
end;

theorem Th9: :: PRALG_1:9
for b1 being natural number holds arity (TrivialOp b1) = b1
proof end;

definition
let c1 be FinSequence of NAT ;
func TrivialOps c1 -> PFuncFinSequence of {{} } means :Def8: :: PRALG_1:def 8
( len a2 = len a1 & ( for b1 being Nat st b1 in dom a2 holds
for b2 being Nat st b2 = a1 . b1 holds
a2 . b1 = TrivialOp b2 ) );
existence
ex b1 being PFuncFinSequence of {{} } st
( len b1 = len c1 & ( for b2 being Nat st b2 in dom b1 holds
for b3 being Nat st b3 = c1 . b2 holds
b1 . b2 = TrivialOp b3 ) )
proof end;
uniqueness
for b1, b2 being PFuncFinSequence of {{} } st len b1 = len c1 & ( for b3 being Nat st b3 in dom b1 holds
for b4 being Nat st b4 = c1 . b3 holds
b1 . b3 = TrivialOp b4 ) & len b2 = len c1 & ( for b3 being Nat st b3 in dom b2 holds
for b4 being Nat st b4 = c1 . b3 holds
b2 . b3 = TrivialOp b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def8 defines TrivialOps PRALG_1:def 8 :
for b1 being FinSequence of NAT
for b2 being PFuncFinSequence of {{} } holds
( b2 = TrivialOps b1 iff ( len b2 = len b1 & ( for b3 being Nat st b3 in dom b2 holds
for b4 being Nat st b4 = b1 . b3 holds
b2 . b3 = TrivialOp b4 ) ) );

theorem Th10: :: PRALG_1:10
for b1 being FinSequence of NAT holds
( TrivialOps b1 is homogeneous & TrivialOps b1 is quasi_total & TrivialOps b1 is non-empty )
proof end;

theorem Th11: :: PRALG_1:11
for b1 being FinSequence of NAT st b1 <> {} holds
UAStr(# {{} },(TrivialOps b1) #) is strict Universal_Algebra
proof end;

registration
let c1 be non empty set ;
cluster non empty FinSequence of a1;
existence
not for b1 being FinSequence of c1 holds b1 is empty
proof end;
cluster non empty Element of a1 * ;
existence
not for b1 being Element of c1 * holds b1 is empty
proof end;
end;

definition
let c1 be non empty FinSequence of NAT ;
func Trivial_Algebra c1 -> strict Universal_Algebra equals :: PRALG_1:def 9
UAStr(# {{} },(TrivialOps a1) #);
coherence
UAStr(# {{} },(TrivialOps c1) #) is strict Universal_Algebra
by Th11;
end;

:: deftheorem Def9 defines Trivial_Algebra PRALG_1:def 9 :
for b1 being non empty FinSequence of NAT holds Trivial_Algebra b1 = UAStr(# {{} },(TrivialOps b1) #);

definition
let c1 be Function;
attr a1 is Univ_Alg-yielding means :Def10: :: PRALG_1:def 10
for b1 being set st b1 in dom a1 holds
a1 . b1 is Universal_Algebra;
end;

:: deftheorem Def10 defines Univ_Alg-yielding PRALG_1:def 10 :
for b1 being Function holds
( b1 is Univ_Alg-yielding iff for b2 being set st b2 in dom b1 holds
b1 . b2 is Universal_Algebra );

definition
let c1 be Function;
attr a1 is 1-sorted-yielding means :Def11: :: PRALG_1:def 11
for b1 being set st b1 in dom a1 holds
a1 . b1 is 1-sorted ;
end;

:: deftheorem Def11 defines 1-sorted-yielding PRALG_1:def 11 :
for b1 being Function holds
( b1 is 1-sorted-yielding iff for b2 being set st b2 in dom b1 holds
b1 . b2 is 1-sorted );

registration
cluster Univ_Alg-yielding set ;
existence
ex b1 being Function st b1 is Univ_Alg-yielding
proof end;
end;

registration
cluster Univ_Alg-yielding -> 1-sorted-yielding set ;
coherence
for b1 being Function st b1 is Univ_Alg-yielding holds
b1 is 1-sorted-yielding
proof end;
end;

registration
let c1 be set ;
cluster 1-sorted-yielding ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st b1 is 1-sorted-yielding
proof end;
end;

definition
let c1 be Function;
attr a1 is equal-signature means :Def12: :: PRALG_1:def 12
for b1, b2 being set st b1 in dom a1 & b2 in dom a1 holds
for b3, b4 being Universal_Algebra st b3 = a1 . b1 & b4 = a1 . b2 holds
signature b3 = signature b4;
end;

:: deftheorem Def12 defines equal-signature PRALG_1:def 12 :
for b1 being Function holds
( b1 is equal-signature iff for b2, b3 being set st b2 in dom b1 & b3 in dom b1 holds
for b4, b5 being Universal_Algebra st b4 = b1 . b2 & b5 = b1 . b3 holds
signature b4 = signature b5 );

registration
let c1 be non empty set ;
cluster Univ_Alg-yielding 1-sorted-yielding equal-signature ManySortedSet of a1;
existence
ex b1 being ManySortedSet of c1 st
( b1 is equal-signature & b1 is Univ_Alg-yielding )
proof end;
end;

definition
let c1 be non empty set ;
let c2 be 1-sorted-yielding ManySortedSet of c1;
let c3 be Element of c1;
redefine func . as c2 . c3 -> 1-sorted ;
coherence
c2 . c3 is 1-sorted
proof end;
end;

definition
let c1 be non empty set ;
let c2 be Univ_Alg-yielding ManySortedSet of c1;
let c3 be Element of c1;
redefine func . as c2 . c3 -> Universal_Algebra;
coherence
c2 . c3 is Universal_Algebra
proof end;
end;

definition
let c1 be set ;
let c2 be 1-sorted-yielding ManySortedSet of c1;
func Carrier c2 -> ManySortedSet of a1 means :Def13: :: PRALG_1:def 13
for b1 being set st b1 in a1 holds
ex b2 being 1-sorted st
( b2 = a2 . b1 & a3 . b1 = the carrier of b2 );
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
ex b3 being 1-sorted st
( b3 = c2 . b2 & b1 . b2 = the carrier of b3 )
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set st b3 in c1 holds
ex b4 being 1-sorted st
( b4 = c2 . b3 & b1 . b3 = the carrier of b4 ) ) & ( for b3 being set st b3 in c1 holds
ex b4 being 1-sorted st
( b4 = c2 . b3 & b2 . b3 = the carrier of b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines Carrier PRALG_1:def 13 :
for b1 being set
for b2 being 1-sorted-yielding ManySortedSet of b1
for b3 being ManySortedSet of b1 holds
( b3 = Carrier b2 iff for b4 being set st b4 in b1 holds
ex b5 being 1-sorted st
( b5 = b2 . b4 & b3 . b4 = the carrier of b5 ) );

registration
let c1 be non empty set ;
let c2 be Univ_Alg-yielding ManySortedSet of c1;
cluster Carrier a2 -> V3 ;
coherence
Carrier c2 is non-empty
proof end;
end;

definition
let c1 be non empty set ;
let c2 be Univ_Alg-yielding equal-signature ManySortedSet of c1;
func ComSign c2 -> FinSequence of NAT means :Def14: :: PRALG_1:def 14
for b1 being Element of a1 holds a3 = signature (a2 . b1);
existence
ex b1 being FinSequence of NAT st
for b2 being Element of c1 holds b1 = signature (c2 . b2)
proof end;
uniqueness
for b1, b2 being FinSequence of NAT st ( for b3 being Element of c1 holds b1 = signature (c2 . b3) ) & ( for b3 being Element of c1 holds b2 = signature (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines ComSign PRALG_1:def 14 :
for b1 being non empty set
for b2 being Univ_Alg-yielding equal-signature ManySortedSet of b1
for b3 being FinSequence of NAT holds
( b3 = ComSign b2 iff for b4 being Element of b1 holds b3 = signature (b2 . b4) );

registration
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
cluster product a2 -> non empty ;
coherence
not product c2 is empty
;
end;

definition
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
mode ManySortedOperation of c2 -> ManySortedFunction of a1 means :Def15: :: PRALG_1:def 15
for b1 being Element of a1 holds a3 . b1 is non empty homogeneous quasi_total PartFunc of (a2 . b1) * ,a2 . b1;
existence
ex b1 being ManySortedFunction of c1 st
for b2 being Element of c1 holds b1 . b2 is non empty homogeneous quasi_total PartFunc of (c2 . b2) * ,c2 . b2
proof end;
end;

:: deftheorem Def15 defines ManySortedOperation PRALG_1:def 15 :
for b1 being non empty set
for b2 being V3 ManySortedSet of b1
for b3 being ManySortedFunction of b1 holds
( b3 is ManySortedOperation of b2 iff for b4 being Element of b1 holds b3 . b4 is non empty homogeneous quasi_total PartFunc of (b2 . b4) * ,b2 . b4 );

definition
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
let c3 be ManySortedOperation of c2;
let c4 be Element of c1;
redefine func . as c3 . c4 -> non empty homogeneous quasi_total PartFunc of (a2 . a4) * ,a2 . a4;
coherence
c3 . c4 is non empty homogeneous quasi_total PartFunc of (c2 . c4) * ,c2 . c4
by Def15;
end;

definition
let c1 be Function;
attr a1 is equal-arity means :Def16: :: PRALG_1:def 16
for b1, b2 being set st b1 in dom a1 & b2 in dom a1 holds
for b3, b4 being Function st a1 . b1 = b3 & a1 . b2 = b4 holds
for b5, b6 being Nat
for b7, b8 being non empty set st dom b3 = b5 -tuples_on b7 & dom b4 = b6 -tuples_on b8 holds
for b9 being non empty homogeneous quasi_total PartFunc of b7 * ,b7
for b10 being non empty homogeneous quasi_total PartFunc of b8 * ,b8 st b3 = b9 & b4 = b10 holds
arity b9 = arity b10;
end;

:: deftheorem Def16 defines equal-arity PRALG_1:def 16 :
for b1 being Function holds
( b1 is equal-arity iff for b2, b3 being set st b2 in dom b1 & b3 in dom b1 holds
for b4, b5 being Function st b1 . b2 = b4 & b1 . b3 = b5 holds
for b6, b7 being Nat
for b8, b9 being non empty set st dom b4 = b6 -tuples_on b8 & dom b5 = b7 -tuples_on b9 holds
for b10 being non empty homogeneous quasi_total PartFunc of b8 * ,b8
for b11 being non empty homogeneous quasi_total PartFunc of b9 * ,b9 st b4 = b10 & b5 = b11 holds
arity b10 = arity b11 );

registration
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
cluster equal-arity ManySortedOperation of a2;
existence
ex b1 being ManySortedOperation of c2 st b1 is equal-arity
proof end;
end;

theorem Th12: :: PRALG_1:12
for b1 being non empty set
for b2 being V3 ManySortedSet of b1
for b3 being ManySortedOperation of b2 holds
( b3 is equal-arity iff for b4, b5 being Element of b1 holds arity (b3 . b4) = arity (b3 . b5) )
proof end;

definition
let c1 be Function-yielding Function;
let c2 be Function;
func c1 .. c2 -> Function means :Def17: :: PRALG_1:def 17
( dom a3 = dom a1 & ( for b1 being set st b1 in dom a1 holds
a3 . b1 = (a1 . b1) . (a2 . b1) ) );
existence
ex b1 being Function st
( dom b1 = dom c1 & ( for b2 being set st b2 in dom c1 holds
b1 . b2 = (c1 . b2) . (c2 . b2) ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b1 . b3 = (c1 . b3) . (c2 . b3) ) & dom b2 = dom c1 & ( for b3 being set st b3 in dom c1 holds
b2 . b3 = (c1 . b3) . (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def17 defines .. PRALG_1:def 17 :
for b1 being Function-yielding Function
for b2, b3 being Function holds
( b3 = b1 .. b2 iff ( dom b3 = dom b1 & ( for b4 being set st b4 in dom b1 holds
b3 . b4 = (b1 . b4) . (b2 . b4) ) ) );

definition
let c1 be set ;
let c2 be ManySortedFunction of c1;
let c3 be ManySortedSet of c1;
redefine func .. as c2 .. c3 -> ManySortedSet of a1 means :Def18: :: PRALG_1:def 18
for b1 being set st b1 in a1 holds
for b2 being Function st b2 = a2 . b1 holds
a4 . b1 = b2 . (a3 . b1);
coherence
c2 .. c3 is ManySortedSet of c1
proof end;
compatibility
for b1 being ManySortedSet of c1 holds
( b1 = c2 .. c3 iff for b2 being set st b2 in c1 holds
for b3 being Function st b3 = c2 . b2 holds
b1 . b2 = b3 . (c3 . b2) )
proof end;
end;

:: deftheorem Def18 defines .. PRALG_1:def 18 :
for b1 being set
for b2 being ManySortedFunction of b1
for b3, b4 being ManySortedSet of b1 holds
( b4 = b2 .. b3 iff for b5 being set st b5 in b1 holds
for b6 being Function st b6 = b2 . b5 holds
b4 . b5 = b6 . (b3 . b5) );

definition
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
let c3 be FinSequence of product c2;
redefine func uncurry as uncurry c3 -> ManySortedSet of [:(dom a3),a1:];
coherence
uncurry c3 is ManySortedSet of [:(dom c3),c1:]
proof end;
end;

definition
let c1, c2 be set ;
let c3 be ManySortedSet of [:c1,c2:];
redefine func ~ as ~ c3 -> ManySortedSet of [:a2,a1:];
coherence
~ c3 is ManySortedSet of [:c2,c1:]
proof end;
end;

definition
let c1 be set ;
let c2 be non empty set ;
let c3 be ManySortedSet of [:c1,c2:];
redefine func curry as curry c3 -> ManySortedSet of a1;
coherence
curry c3 is ManySortedSet of c1
proof end;
end;

definition
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
let c3 be equal-arity ManySortedOperation of c2;
func ComAr c3 -> Nat means :Def19: :: PRALG_1:def 19
for b1 being Element of a1 holds a4 = arity (a3 . b1);
existence
ex b1 being Nat st
for b2 being Element of c1 holds b1 = arity (c3 . b2)
proof end;
uniqueness
for b1, b2 being Nat st ( for b3 being Element of c1 holds b1 = arity (c3 . b3) ) & ( for b3 being Element of c1 holds b2 = arity (c3 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def19 defines ComAr PRALG_1:def 19 :
for b1 being non empty set
for b2 being V3 ManySortedSet of b1
for b3 being equal-arity ManySortedOperation of b2
for b4 being Nat holds
( b4 = ComAr b3 iff for b5 being Element of b1 holds b4 = arity (b3 . b5) );

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
func EmptySeq c2 -> ManySortedSet of a1 means :Def20: :: PRALG_1:def 20
for b1 being set st b1 in a1 holds
a3 . b1 = {} (a2 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
b1 . b2 = {} (c2 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set st b3 in c1 holds
b1 . b3 = {} (c2 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = {} (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines EmptySeq PRALG_1:def 20 :
for b1 being set
for b2, b3 being ManySortedSet of b1 holds
( b3 = EmptySeq b2 iff for b4 being set st b4 in b1 holds
b3 . b4 = {} (b2 . b4) );

definition
let c1 be non empty set ;
let c2 be V3 ManySortedSet of c1;
let c3 be equal-arity ManySortedOperation of c2;
func [[:c3:]] -> non empty homogeneous quasi_total PartFunc of (product a2) * , product a2 means :: PRALG_1:def 21
( dom a4 = (ComAr a3) -tuples_on (product a2) & ( for b1 being Element of (product a2) * st b1 in dom a4 holds
( ( dom b1 = {} implies a4 . b1 = a3 .. (EmptySeq a2) ) & ( dom b1 <> {} implies for b2 being non empty set
for b3 being ManySortedSet of [:a1,b2:] st b2 = dom b1 & b3 = ~ (uncurry b1) holds
a4 . b1 = a3 .. (curry b3) ) ) ) );
existence
ex b1 being non empty homogeneous quasi_total PartFunc of (product c2) * , product c2 st
( dom b1 = (ComAr c3) -tuples_on (product c2) & ( for b2 being Element of (product c2) * st b2 in dom b1 holds
( ( dom b2 = {} implies b1 . b2 = c3 .. (EmptySeq c2) ) & ( dom b2 <> {} implies for b3 being non empty set
for b4 being ManySortedSet of [:c1,b3:] st b3 = dom b2 & b4 = ~ (uncurry b2) holds
b1 . b2 = c3 .. (curry b4) ) ) ) )
proof end;
uniqueness
for b1, b2 being non empty homogeneous quasi_total PartFunc of (product c2) * , product c2 st dom b1 = (ComAr c3) -tuples_on (product c2) & ( for b3 being Element of (product c2) * st b3 in dom b1 holds
( ( dom b3 = {} implies b1 . b3 = c3 .. (EmptySeq c2) ) & ( dom b3 <> {} implies for b4 being non empty set
for b5 being ManySortedSet of [:c1,b4:] st b4 = dom b3 & b5 = ~ (uncurry b3) holds
b1 . b3 = c3 .. (curry b5) ) ) ) & dom b2 = (ComAr c3) -tuples_on (product c2) & ( for b3 being Element of (product c2) * st b3 in dom b2 holds
( ( dom b3 = {} implies b2 . b3 = c3 .. (EmptySeq c2) ) & ( dom b3 <> {} implies for b4 being non empty set
for b5 being ManySortedSet of [:c1,b4:] st b4 = dom b3 & b5 = ~ (uncurry b3) holds
b2 . b3 = c3 .. (curry b5) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def21 defines [[: PRALG_1:def 21 :
for b1 being non empty set
for b2 being V3 ManySortedSet of b1
for b3 being equal-arity ManySortedOperation of b2
for b4 being non empty homogeneous quasi_total PartFunc of (product b2) * , product b2 holds
( b4 = [[:b3:]] iff ( dom b4 = (ComAr b3) -tuples_on (product b2) & ( for b5 being Element of (product b2) * st b5 in dom b4 holds
( ( dom b5 = {} implies b4 . b5 = b3 .. (EmptySeq b2) ) & ( dom b5 <> {} implies for b6 being non empty set
for b7 being ManySortedSet of [:b1,b6:] st b6 = dom b5 & b7 = ~ (uncurry b5) holds
b4 . b5 = b3 .. (curry b7) ) ) ) ) );

definition
let c1 be non empty set ;
let c2 be Univ_Alg-yielding equal-signature ManySortedSet of c1;
let c3 be natural number ;
assume E26: c3 in dom (ComSign c2) ;
func ProdOp c2,c3 -> equal-arity ManySortedOperation of Carrier a2 means :: PRALG_1:def 22
for b1 being Element of a1
for b2 being operation of (a2 . b1) st the charact of (a2 . b1) . a3 = b2 holds
a4 . b1 = b2;
existence
ex b1 being equal-arity ManySortedOperation of Carrier c2 st
for b2 being Element of c1
for b3 being operation of (c2 . b2) st the charact of (c2 . b2) . c3 = b3 holds
b1 . b2 = b3
proof end;
uniqueness
for b1, b2 being equal-arity ManySortedOperation of Carrier c2 st ( for b3 being Element of c1
for b4 being operation of (c2 . b3) st the charact of (c2 . b3) . c3 = b4 holds
b1 . b3 = b4 ) & ( for b3 being Element of c1
for b4 being operation of (c2 . b3) st the charact of (c2 . b3) . c3 = b4 holds
b2 . b3 = b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def22 defines ProdOp PRALG_1:def 22 :
for b1 being non empty set
for b2 being Univ_Alg-yielding equal-signature ManySortedSet of b1
for b3 being natural number st b3 in dom (ComSign b2) holds
for b4 being equal-arity ManySortedOperation of Carrier b2 holds
( b4 = ProdOp b2,b3 iff for b5 being Element of b1
for b6 being operation of (b2 . b5) st the charact of (b2 . b5) . b3 = b6 holds
b4 . b5 = b6 );

definition
let c1 be non empty set ;
let c2 be Univ_Alg-yielding equal-signature ManySortedSet of c1;
func ProdOpSeq c2 -> PFuncFinSequence of (product (Carrier a2)) means :Def23: :: PRALG_1:def 23
( len a3 = len (ComSign a2) & ( for b1 being Nat st b1 in dom a3 holds
a3 . b1 = [[:(ProdOp a2,b1):]] ) );
existence
ex b1 being PFuncFinSequence of (product (Carrier c2)) st
( len b1 = len (ComSign c2) & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = [[:(ProdOp c2,b2):]] ) )
proof end;
uniqueness
for b1, b2 being PFuncFinSequence of (product (Carrier c2)) st len b1 = len (ComSign c2) & ( for b3 being Nat st b3 in dom b1 holds
b1 . b3 = [[:(ProdOp c2,b3):]] ) & len b2 = len (ComSign c2) & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 = [[:(ProdOp c2,b3):]] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def23 defines ProdOpSeq PRALG_1:def 23 :
for b1 being non empty set
for b2 being Univ_Alg-yielding equal-signature ManySortedSet of b1
for b3 being PFuncFinSequence of (product (Carrier b2)) holds
( b3 = ProdOpSeq b2 iff ( len b3 = len (ComSign b2) & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = [[:(ProdOp b2,b4):]] ) ) );

definition
let c1 be non empty set ;
let c2 be Univ_Alg-yielding equal-signature ManySortedSet of c1;
func ProdUnivAlg c2 -> strict Universal_Algebra equals :: PRALG_1:def 24
UAStr(# (product (Carrier a2)),(ProdOpSeq a2) #);
coherence
UAStr(# (product (Carrier c2)),(ProdOpSeq c2) #) is strict Universal_Algebra
proof end;
end;

:: deftheorem Def24 defines ProdUnivAlg PRALG_1:def 24 :
for b1 being non empty set
for b2 being Univ_Alg-yielding equal-signature ManySortedSet of b1 holds ProdUnivAlg b2 = UAStr(# (product (Carrier b2)),(ProdOpSeq b2) #);