:: PRALG_2 semantic presentation

definition
let c1 be set ;
attr a1 is with_common_domain means :Def1: :: PRALG_2:def 1
for b1, b2 being Function st b1 in a1 & b2 in a1 holds
dom b1 = dom b2;
end;

:: deftheorem Def1 defines with_common_domain PRALG_2:def 1 :
for b1 being set holds
( b1 is with_common_domain iff for b2, b3 being Function st b2 in b1 & b3 in b1 holds
dom b2 = dom b3 );

registration
cluster non empty functional with_common_domain set ;
existence
ex b1 being set st
( b1 is with_common_domain & b1 is functional & not b1 is empty )
proof end;
end;

theorem Th1: :: PRALG_2:1
{{} } is functional with_common_domain set
proof end;

definition
let c1 be functional with_common_domain set ;
func DOM c1 -> set means :Def2: :: PRALG_2:def 2
for b1 being Function st b1 in a1 holds
a2 = dom b1 if a1 <> {}
otherwise a2 = {} ;
existence
( ( c1 <> {} implies ex b1 being set st
for b2 being Function st b2 in c1 holds
b1 = dom b2 ) & ( not c1 <> {} implies ex b1 being set st b1 = {} ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( c1 <> {} & ( for b3 being Function st b3 in c1 holds
b1 = dom b3 ) & ( for b3 being Function st b3 in c1 holds
b2 = dom b3 ) implies b1 = b2 ) & ( not c1 <> {} & b1 = {} & b2 = {} implies b1 = b2 ) )
proof end;
consistency
for b1 being set holds verum
;
end;

:: deftheorem Def2 defines DOM PRALG_2:def 2 :
for b1 being functional with_common_domain set
for b2 being set holds
( ( b1 <> {} implies ( b2 = DOM b1 iff for b3 being Function st b3 in b1 holds
b2 = dom b3 ) ) & ( not b1 <> {} implies ( b2 = DOM b1 iff b2 = {} ) ) );

definition
let c1 be non empty functional with_common_domain set ;
redefine mode Element as Element of c1 -> ManySortedSet of DOM a1;
coherence
for b1 being Element of c1 holds b1 is ManySortedSet of DOM c1
proof end;
end;

theorem Th2: :: PRALG_2:2
for b1 being functional with_common_domain set st b1 = {{} } holds
DOM b1 = {}
proof end;

registration
let c1 be set ;
let c2 be V3 ManySortedSet of c1;
cluster product a2 -> non empty functional with_common_domain ;
coherence
( product c2 is with_common_domain & product c2 is functional & not product c2 is empty )
proof end;
end;

definition
let c1 be Function;
canceled;
canceled;
canceled;
func Commute c1 -> Function means :Def6: :: PRALG_2:def 6
( ( for b1 being set holds
( b1 in dom a2 iff ex b2 being Function st
( b2 in dom a1 & b1 = commute b2 ) ) ) & ( for b1 being Function st b1 in dom a2 holds
a2 . b1 = a1 . (commute b1) ) );
existence
ex b1 being Function st
( ( for b2 being set holds
( b2 in dom b1 iff ex b3 being Function st
( b3 in dom c1 & b2 = commute b3 ) ) ) & ( for b2 being Function st b2 in dom b1 holds
b1 . b2 = c1 . (commute b2) ) )
proof end;
uniqueness
for b1, b2 being Function st ( for b3 being set holds
( b3 in dom b1 iff ex b4 being Function st
( b4 in dom c1 & b3 = commute b4 ) ) ) & ( for b3 being Function st b3 in dom b1 holds
b1 . b3 = c1 . (commute b3) ) & ( for b3 being set holds
( b3 in dom b2 iff ex b4 being Function st
( b4 in dom c1 & b3 = commute b4 ) ) ) & ( for b3 being Function st b3 in dom b2 holds
b2 . b3 = c1 . (commute b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 PRALG_2:def 3 :
canceled;

:: deftheorem Def4 PRALG_2:def 4 :
canceled;

:: deftheorem Def5 PRALG_2:def 5 :
canceled;

:: deftheorem Def6 defines Commute PRALG_2:def 6 :
for b1, b2 being Function holds
( b2 = Commute b1 iff ( ( for b3 being set holds
( b3 in dom b2 iff ex b4 being Function st
( b4 in dom b1 & b3 = commute b4 ) ) ) & ( for b3 being Function st b3 in dom b2 holds
b2 . b3 = b1 . (commute b3) ) ) );

theorem Th3: :: PRALG_2:3
canceled;

theorem Th4: :: PRALG_2:4
canceled;

theorem Th5: :: PRALG_2:5
canceled;

theorem Th6: :: PRALG_2:6
canceled;

theorem Th7: :: PRALG_2:7
canceled;

theorem Th8: :: PRALG_2:8
for b1 being Function st dom b1 = {{} } holds
Commute b1 = b1
proof end;

definition
let c1 be Function-yielding Function;
canceled;
redefine func Frege as Frege c1 -> ManySortedFunction of product (doms a1) means :Def8: :: PRALG_2:def 8
for b1 being Function st b1 in product (doms a1) holds
a2 . b1 = a1 .. b1;
coherence
Frege c1 is ManySortedFunction of product (doms c1)
proof end;
compatibility
for b1 being ManySortedFunction of product (doms c1) holds
( b1 = Frege c1 iff for b2 being Function st b2 in product (doms c1) holds
b1 . b2 = c1 .. b2 )
proof end;
end;

:: deftheorem Def7 PRALG_2:def 7 :
canceled;

:: deftheorem Def8 defines Frege PRALG_2:def 8 :
for b1 being Function-yielding Function
for b2 being ManySortedFunction of product (doms b1) holds
( b2 = Frege b1 iff for b3 being Function st b3 in product (doms b1) holds
b2 . b3 = b1 .. b3 );

registration
let c1 be set ;
let c2, c3 be V3 ManySortedSet of c1;
cluster [|a2,a3|] -> V3 ;
coherence
[|c2,c3|] is non-empty
proof end;
end;

theorem Th9: :: PRALG_2:9
for b1 being non empty set
for b2 being set
for b3, b4 being ManySortedSet of b1
for b5 being Function of b2,b1 holds [|b3,b4|] * b5 = [|(b3 * b5),(b4 * b5)|]
proof end;

definition
let c1 be non empty set ;
let c2 be set ;
let c3, c4 be V3 ManySortedSet of c1;
let c5 be Function of c2,c1 * ;
let c6 be Function of c2,c1;
let c7 be set ;
let c8 be Function of ((c3 # ) * c5) . c7,(c3 * c6) . c7;
let c9 be Function of ((c4 # ) * c5) . c7,(c4 * c6) . c7;
assume E6: c7 in c2 ;
canceled;
func [[:c8,c9:]] -> Function of (([|a3,a4|] # ) * a5) . a7,([|a3,a4|] * a6) . a7 means :: PRALG_2:def 10
for b1 being Function st b1 in (([|a3,a4|] # ) * a5) . a7 holds
a10 . b1 = [(a8 . (pr1 b1)),(a9 . (pr2 b1))];
existence
ex b1 being Function of (([|c3,c4|] # ) * c5) . c7,([|c3,c4|] * c6) . c7 st
for b2 being Function st b2 in (([|c3,c4|] # ) * c5) . c7 holds
b1 . b2 = [(c8 . (pr1 b2)),(c9 . (pr2 b2))]
proof end;
uniqueness
for b1, b2 being Function of (([|c3,c4|] # ) * c5) . c7,([|c3,c4|] * c6) . c7 st ( for b3 being Function st b3 in (([|c3,c4|] # ) * c5) . c7 holds
b1 . b3 = [(c8 . (pr1 b3)),(c9 . (pr2 b3))] ) & ( for b3 being Function st b3 in (([|c3,c4|] # ) * c5) . c7 holds
b2 . b3 = [(c8 . (pr1 b3)),(c9 . (pr2 b3))] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def9 PRALG_2:def 9 :
canceled;

:: deftheorem Def10 defines [[: PRALG_2:def 10 :
for b1 being non empty set
for b2 being set
for b3, b4 being V3 ManySortedSet of b1
for b5 being Function of b2,b1 *
for b6 being Function of b2,b1
for b7 being set
for b8 being Function of ((b3 # ) * b5) . b7,(b3 * b6) . b7
for b9 being Function of ((b4 # ) * b5) . b7,(b4 * b6) . b7 st b7 in b2 holds
for b10 being Function of (([|b3,b4|] # ) * b5) . b7,([|b3,b4|] * b6) . b7 holds
( b10 = [[:b8,b9:]] iff for b11 being Function st b11 in (([|b3,b4|] # ) * b5) . b7 holds
b10 . b11 = [(b8 . (pr1 b11)),(b9 . (pr2 b11))] );

definition
let c1 be non empty set ;
let c2 be set ;
let c3, c4 be V3 ManySortedSet of c1;
let c5 be Function of c2,c1 * ;
let c6 be Function of c2,c1;
let c7 be ManySortedFunction of (c3 # ) * c5,c3 * c6;
let c8 be ManySortedFunction of (c4 # ) * c5,c4 * c6;
func [[:c7,c8:]] -> ManySortedFunction of ([|a3,a4|] # ) * a5,[|a3,a4|] * a6 means :: PRALG_2:def 11
for b1 being set st b1 in a2 holds
for b2 being Function of ((a3 # ) * a5) . b1,(a3 * a6) . b1
for b3 being Function of ((a4 # ) * a5) . b1,(a4 * a6) . b1 st b2 = a7 . b1 & b3 = a8 . b1 holds
a9 . b1 = [[:b2,b3:]];
existence
ex b1 being ManySortedFunction of ([|c3,c4|] # ) * c5,[|c3,c4|] * c6 st
for b2 being set st b2 in c2 holds
for b3 being Function of ((c3 # ) * c5) . b2,(c3 * c6) . b2
for b4 being Function of ((c4 # ) * c5) . b2,(c4 * c6) . b2 st b3 = c7 . b2 & b4 = c8 . b2 holds
b1 . b2 = [[:b3,b4:]]
proof end;
uniqueness
for b1, b2 being ManySortedFunction of ([|c3,c4|] # ) * c5,[|c3,c4|] * c6 st ( for b3 being set st b3 in c2 holds
for b4 being Function of ((c3 # ) * c5) . b3,(c3 * c6) . b3
for b5 being Function of ((c4 # ) * c5) . b3,(c4 * c6) . b3 st b4 = c7 . b3 & b5 = c8 . b3 holds
b1 . b3 = [[:b4,b5:]] ) & ( for b3 being set st b3 in c2 holds
for b4 being Function of ((c3 # ) * c5) . b3,(c3 * c6) . b3
for b5 being Function of ((c4 # ) * c5) . b3,(c4 * c6) . b3 st b4 = c7 . b3 & b5 = c8 . b3 holds
b2 . b3 = [[:b4,b5:]] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines [[: PRALG_2:def 11 :
for b1 being non empty set
for b2 being set
for b3, b4 being V3 ManySortedSet of b1
for b5 being Function of b2,b1 *
for b6 being Function of b2,b1
for b7 being ManySortedFunction of (b3 # ) * b5,b3 * b6
for b8 being ManySortedFunction of (b4 # ) * b5,b4 * b6
for b9 being ManySortedFunction of ([|b3,b4|] # ) * b5,[|b3,b4|] * b6 holds
( b9 = [[:b7,b8:]] iff for b10 being set st b10 in b2 holds
for b11 being Function of ((b3 # ) * b5) . b10,(b3 * b6) . b10
for b12 being Function of ((b4 # ) * b5) . b10,(b4 * b6) . b10 st b11 = b7 . b10 & b12 = b8 . b10 holds
b9 . b10 = [[:b11,b12:]] );

definition
let c1 be set ;
let c2 be non empty ManySortedSign ;
mode MSAlgebra-Family of c1,c2 -> ManySortedSet of a1 means :Def12: :: PRALG_2:def 12
for b1 being set st b1 in a1 holds
a3 . b1 is non-empty MSAlgebra of a2;
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
b1 . b2 is non-empty MSAlgebra of c2
proof end;
end;

:: deftheorem Def12 defines MSAlgebra-Family PRALG_2:def 12 :
for b1 being set
for b2 being non empty ManySortedSign
for b3 being ManySortedSet of b1 holds
( b3 is MSAlgebra-Family of b1,b2 iff for b4 being set st b4 in b1 holds
b3 . b4 is non-empty MSAlgebra of b2 );

definition
let c1 be non empty set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
let c4 be Element of c1;
redefine func . as c3 . c4 -> non-empty MSAlgebra of a2;
coherence
c3 . c4 is non-empty MSAlgebra of c2
by Def12;
end;

definition
let c1 be non empty ManySortedSign ;
let c2 be MSAlgebra of c1;
func |.c2.| -> set equals :: PRALG_2:def 13
union (rng the Sorts of a2);
coherence
union (rng the Sorts of c2) is set
;
end;

:: deftheorem Def13 defines |. PRALG_2:def 13 :
for b1 being non empty ManySortedSign
for b2 being MSAlgebra of b1 holds |.b2.| = union (rng the Sorts of b2);

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

definition
let c1 be non empty set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
func |.c3.| -> set equals :: PRALG_2:def 14
union { |.(a3 . b1).| where B is Element of a1 : verum } ;
coherence
union { |.(c3 . b1).| where B is Element of c1 : verum } is set
;
end;

:: deftheorem Def14 defines |. PRALG_2:def 14 :
for b1 being non empty set
for b2 being non empty ManySortedSign
for b3 being MSAlgebra-Family of b1,b2 holds |.b3.| = union { |.(b3 . b4).| where B is Element of b1 : verum } ;

registration
let c1 be non empty set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
cluster |.a3.| -> non empty ;
coherence
not |.c3.| is empty
proof end;
end;

theorem Th10: :: PRALG_2:10
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being OperSymbol of b1 holds
( Args b3,b2 = product (the Sorts of b2 * (the_arity_of b3)) & dom (the Sorts of b2 * (the_arity_of b3)) = dom (the_arity_of b3) & Result b3,b2 = the Sorts of b2 . (the_result_sort_of b3) )
proof end;

theorem Th11: :: PRALG_2:11
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being OperSymbol of b1 st the_arity_of b3 = {} holds
Args b3,b2 = {{} }
proof end;

definition
let c1 be non empty ManySortedSign ;
let c2, c3 be non-empty MSAlgebra of c1;
func [:c2,c3:] -> MSAlgebra of a1 equals :: PRALG_2:def 15
MSAlgebra(# [|the Sorts of a2,the Sorts of a3|],[[:the Charact of a2,the Charact of a3:]] #);
coherence
MSAlgebra(# [|the Sorts of c2,the Sorts of c3|],[[:the Charact of c2,the Charact of c3:]] #) is MSAlgebra of c1
;
end;

:: deftheorem Def15 defines [: PRALG_2:def 15 :
for b1 being non empty ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1 holds [:b2,b3:] = MSAlgebra(# [|the Sorts of b2,the Sorts of b3|],[[:the Charact of b2,the Charact of b3:]] #);

registration
let c1 be non empty ManySortedSign ;
let c2, c3 be non-empty MSAlgebra of c1;
cluster [:a2,a3:] -> strict ;
coherence
[:c2,c3:] is strict
;
end;

definition
let c1 be set ;
let c2 be non empty ManySortedSign ;
let c3 be SortSymbol of c2;
let c4 be MSAlgebra-Family of c1,c2;
func Carrier c4,c3 -> ManySortedSet of a1 means :Def16: :: PRALG_2:def 16
for b1 being set st b1 in a1 holds
ex b2 being MSAlgebra of a2 st
( b2 = a4 . b1 & a5 . b1 = the Sorts of b2 . a3 ) if a1 <> {}
otherwise a5 = {} ;
existence
( ( c1 <> {} implies ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
ex b3 being MSAlgebra of c2 st
( b3 = c4 . b2 & b1 . b2 = the Sorts of b3 . c3 ) ) & ( not c1 <> {} implies ex b1 being ManySortedSet of c1 st b1 = {} ) )
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 holds
( ( c1 <> {} & ( for b3 being set st b3 in c1 holds
ex b4 being MSAlgebra of c2 st
( b4 = c4 . b3 & b1 . b3 = the Sorts of b4 . c3 ) ) & ( for b3 being set st b3 in c1 holds
ex b4 being MSAlgebra of c2 st
( b4 = c4 . b3 & b2 . b3 = the Sorts of b4 . c3 ) ) implies b1 = b2 ) & ( not c1 <> {} & b1 = {} & b2 = {} implies b1 = b2 ) )
proof end;
correctness
consistency
for b1 being ManySortedSet of c1 holds verum
;
;
end;

:: deftheorem Def16 defines Carrier PRALG_2:def 16 :
for b1 being set
for b2 being non empty ManySortedSign
for b3 being SortSymbol of b2
for b4 being MSAlgebra-Family of b1,b2
for b5 being ManySortedSet of b1 holds
( ( b1 <> {} implies ( b5 = Carrier b4,b3 iff for b6 being set st b6 in b1 holds
ex b7 being MSAlgebra of b2 st
( b7 = b4 . b6 & b5 . b6 = the Sorts of b7 . b3 ) ) ) & ( not b1 <> {} implies ( b5 = Carrier b4,b3 iff b5 = {} ) ) );

registration
let c1 be set ;
let c2 be non empty ManySortedSign ;
let c3 be SortSymbol of c2;
let c4 be MSAlgebra-Family of c1,c2;
cluster Carrier a4,a3 -> V3 ;
coherence
Carrier c4,c3 is non-empty
proof end;
end;

definition
let c1 be set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
func SORTS c3 -> ManySortedSet of the carrier of a2 means :Def17: :: PRALG_2:def 17
for b1 being SortSymbol of a2 holds a4 . b1 = product (Carrier a3,b1);
existence
ex b1 being ManySortedSet of the carrier of c2 st
for b2 being SortSymbol of c2 holds b1 . b2 = product (Carrier c3,b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of the carrier of c2 st ( for b3 being SortSymbol of c2 holds b1 . b3 = product (Carrier c3,b3) ) & ( for b3 being SortSymbol of c2 holds b2 . b3 = product (Carrier c3,b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def17 defines SORTS PRALG_2:def 17 :
for b1 being set
for b2 being non empty ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being ManySortedSet of the carrier of b2 holds
( b4 = SORTS b3 iff for b5 being SortSymbol of b2 holds b4 . b5 = product (Carrier b3,b5) );

registration
let c1 be set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
cluster SORTS a3 -> V3 ;
coherence
SORTS c3 is non-empty
proof end;
end;

definition
let c1 be set ;
let c2 be non empty ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
func OPER c3 -> ManySortedFunction of a1 means :Def18: :: PRALG_2:def 18
for b1 being set st b1 in a1 holds
ex b2 being MSAlgebra of a2 st
( b2 = a3 . b1 & a4 . b1 = the Charact of b2 ) if a1 <> {}
otherwise a4 = {} ;
existence
( ( c1 <> {} implies ex b1 being ManySortedFunction of c1 st
for b2 being set st b2 in c1 holds
ex b3 being MSAlgebra of c2 st
( b3 = c3 . b2 & b1 . b2 = the Charact of b3 ) ) & ( not c1 <> {} implies ex b1 being ManySortedFunction of c1 st b1 = {} ) )
proof end;
uniqueness
for b1, b2 being ManySortedFunction of c1 holds
( ( c1 <> {} & ( for b3 being set st b3 in c1 holds
ex b4 being MSAlgebra of c2 st
( b4 = c3 . b3 & b1 . b3 = the Charact of b4 ) ) & ( for b3 being set st b3 in c1 holds
ex b4 being MSAlgebra of c2 st
( b4 = c3 . b3 & b2 . b3 = the Charact of b4 ) ) implies b1 = b2 ) & ( not c1 <> {} & b1 = {} & b2 = {} implies b1 = b2 ) )
proof end;
correctness
consistency
for b1 being ManySortedFunction of c1 holds verum
;
;
end;

:: deftheorem Def18 defines OPER PRALG_2:def 18 :
for b1 being set
for b2 being non empty ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being ManySortedFunction of b1 holds
( ( b1 <> {} implies ( b4 = OPER b3 iff for b5 being set st b5 in b1 holds
ex b6 being MSAlgebra of b2 st
( b6 = b3 . b5 & b4 . b5 = the Charact of b6 ) ) ) & ( not b1 <> {} implies ( b4 = OPER b3 iff b4 = {} ) ) );

theorem Th12: :: PRALG_2:12
for b1 being set
for b2 being non empty ManySortedSign
for b3 being MSAlgebra-Family of b1,b2 holds dom (uncurry (OPER b3)) = [:b1,the OperSymbols of b2:]
proof end;

theorem Th13: :: PRALG_2:13
for b1 being non empty set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2 holds commute (OPER b3) in Funcs the OperSymbols of b2,(Funcs b1,(rng (uncurry (OPER b3))))
proof end;

definition
let c1 be set ;
let c2 be non empty non void ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
let c4 be OperSymbol of c2;
func c3 ?. c4 -> ManySortedFunction of a1 equals :: PRALG_2:def 19
(commute (OPER a3)) . a4;
coherence
(commute (OPER c3)) . c4 is ManySortedFunction of c1
proof end;
end;

:: deftheorem Def19 defines ?. PRALG_2:def 19 :
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2 holds b3 ?. b4 = (commute (OPER b3)) . b4;

theorem Th14: :: PRALG_2:14
for b1 being non empty set
for b2 being Element of b1
for b3 being non empty non void ManySortedSign
for b4 being MSAlgebra-Family of b1,b3
for b5 being OperSymbol of b3 holds (b4 ?. b5) . b2 = Den b5,(b4 . b2)
proof end;

theorem Th15: :: PRALG_2:15
for b1 being non empty set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2
for b5 being set st b5 in rng (Frege (b3 ?. b4)) holds
b5 is Function
proof end;

theorem Th16: :: PRALG_2:16
for b1 being non empty set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2
for b5 being Function st b5 in rng (Frege (b3 ?. b4)) holds
( dom b5 = b1 & ( for b6 being Element of b1 holds b5 . b6 in Result b4,(b3 . b6) ) )
proof end;

theorem Th17: :: PRALG_2:17
for b1 being non empty set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2
for b5 being Function st b5 in dom (Frege (b3 ?. b4)) holds
( dom b5 = b1 & ( for b6 being Element of b1 holds b5 . b6 in Args b4,(b3 . b6) ) & rng b5 c= Funcs (dom (the_arity_of b4)),|.b3.| )
proof end;

theorem Th18: :: PRALG_2:18
for b1 being non empty set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being OperSymbol of b2 holds
( dom (doms (b3 ?. b4)) = b1 & ( for b5 being Element of b1 holds (doms (b3 ?. b4)) . b5 = Args b4,(b3 . b5) ) )
proof end;

definition
let c1 be set ;
let c2 be non empty non void ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
func OPS c3 -> ManySortedFunction of ((SORTS a3) # ) * the Arity of a2,(SORTS a3) * the ResultSort of a2 means :: PRALG_2:def 20
for b1 being OperSymbol of a2 holds a4 . b1 = IFEQ (the_arity_of b1),{} ,(commute (a3 ?. b1)),(Commute (Frege (a3 ?. b1))) if a1 <> {}
otherwise verum;
existence
( ( c1 <> {} implies ex b1 being ManySortedFunction of ((SORTS c3) # ) * the Arity of c2,(SORTS c3) * the ResultSort of c2 st
for b2 being OperSymbol of c2 holds b1 . b2 = IFEQ (the_arity_of b2),{} ,(commute (c3 ?. b2)),(Commute (Frege (c3 ?. b2))) ) & ( not c1 <> {} implies ex b1 being ManySortedFunction of ((SORTS c3) # ) * the Arity of c2,(SORTS c3) * the ResultSort of c2 st verum ) )
proof end;
uniqueness
for b1, b2 being ManySortedFunction of ((SORTS c3) # ) * the Arity of c2,(SORTS c3) * the ResultSort of c2 holds
( ( c1 <> {} & ( for b3 being OperSymbol of c2 holds b1 . b3 = IFEQ (the_arity_of b3),{} ,(commute (c3 ?. b3)),(Commute (Frege (c3 ?. b3))) ) & ( for b3 being OperSymbol of c2 holds b2 . b3 = IFEQ (the_arity_of b3),{} ,(commute (c3 ?. b3)),(Commute (Frege (c3 ?. b3))) ) implies b1 = b2 ) & ( not c1 <> {} implies b1 = b2 ) )
proof end;
correctness
consistency
for b1 being ManySortedFunction of ((SORTS c3) # ) * the Arity of c2,(SORTS c3) * the ResultSort of c2 holds verum
;
;
end;

:: deftheorem Def20 defines OPS PRALG_2:def 20 :
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being ManySortedFunction of ((SORTS b3) # ) * the Arity of b2,(SORTS b3) * the ResultSort of b2 holds
( ( b1 <> {} implies ( b4 = OPS b3 iff for b5 being OperSymbol of b2 holds b4 . b5 = IFEQ (the_arity_of b5),{} ,(commute (b3 ?. b5)),(Commute (Frege (b3 ?. b5))) ) ) & ( not b1 <> {} implies ( b4 = OPS b3 iff verum ) ) );

definition
let c1 be set ;
let c2 be non empty non void ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
func product c3 -> MSAlgebra of a2 equals :: PRALG_2:def 21
MSAlgebra(# (SORTS a3),(OPS a3) #);
coherence
MSAlgebra(# (SORTS c3),(OPS c3) #) is MSAlgebra of c2
;
end;

:: deftheorem Def21 defines product PRALG_2:def 21 :
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2 holds product b3 = MSAlgebra(# (SORTS b3),(OPS b3) #);

registration
let c1 be set ;
let c2 be non empty non void ManySortedSign ;
let c3 be MSAlgebra-Family of c1,c2;
cluster product a3 -> strict ;
coherence
product c3 is strict
;
end;

theorem Th19: :: PRALG_2:19
canceled;

theorem Th20: :: PRALG_2:20
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2 holds
( the Sorts of (product b3) = SORTS b3 & the Charact of (product b3) = OPS b3 ) ;