defpred S1[ set , set ] means ( ( $1 `1 = 1 & ex a being Element of F1() st
( $1 = idsym a & ex F being Function of {{}},F3(a,a) st
( F = $2 & F . {} = F5(a) ) ) ) or ( $1 `1 = 2 & ex a, b, c being Element of F1() st
( $1 = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = $2 & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) ) ) );
set CS = CatSign F1();
A4: for o being set st o in the carrier' of (CatSign F1()) holds
ex u being set st S1[o,u]
proof
let o be set ; :: thesis: ( o in the carrier' of (CatSign F1()) implies ex u being set st S1[o,u] )
assume A5: o in the carrier' of (CatSign F1()) ; :: thesis: ex u being set st S1[o,u]
A6: now
assume o `1 = 1 ; :: thesis: ex u being set ex a being Element of F1() st
( o = idsym a & ex F being Function of {{}},F3(a,a) st
( F = u & F . {} = F5(a) ) )

then consider a being Element of F1() such that
A7: o = idsym a by A5, Th26;
set F = {} :-> F5(a);
reconsider u = {} :-> F5(a) as set ;
take u = u; :: thesis: ex a being Element of F1() st
( o = idsym a & ex F being Function of {{}},F3(a,a) st
( F = u & F . {} = F5(a) ) )

take a = a; :: thesis: ( o = idsym a & ex F being Function of {{}},F3(a,a) st
( F = u & F . {} = F5(a) ) )

thus o = idsym a by A7; :: thesis: ex F being Function of {{}},F3(a,a) st
( F = u & F . {} = F5(a) )

F5(a) in F3(a,a) by A2;
then {F5(a)} c= F3(a,a) by ZFMISC_1:37;
then ( dom ({} :-> F5(a)) = {{}} & rng ({} :-> F5(a)) c= F3(a,a) ) by FUNCOP_1:19, XBOOLE_1:1;
then reconsider F = {} :-> F5(a) as Function of {{}},F3(a,a) by FUNCT_2:4;
take F = F; :: thesis: ( F = u & F . {} = F5(a) )
{} in {{}} by TARSKI:def 1;
hence ( F = u & F . {} = F5(a) ) by FUNCOP_1:13; :: thesis: verum
end;
A8: now
assume o `1 = 2 ; :: thesis: ex u being set ex a, b, c being Element of F1() st
( o = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) )

then consider a, b, c being Element of F1() such that
A9: o = compsym (a,b,c) by A5, Th27;
defpred S2[ set , set ] means ex f, g being set st
( f in F3(a,b) & g in F3(b,c) & $1 = <*g,f*> & $2 = F4(a,b,c,g,f) );
A10: now
let x be set ; :: thesis: ( x in product <*F3(b,c),F3(a,b)*> implies ex u being set st
( u in F3(a,c) & S2[x,u] ) )

assume x in product <*F3(b,c),F3(a,b)*> ; :: thesis: ex u being set st
( u in F3(a,c) & S2[x,u] )

then consider g, f being set such that
A11: ( g in F3(b,c) & f in F3(a,b) ) and
A12: x = <*g,f*> by FUNCT_6:2;
take u = F4(a,b,c,g,f); :: thesis: ( u in F3(a,c) & S2[x,u] )
( F3(a,b) c= F2() & F3(b,c) c= F2() ) by A1;
hence u in F3(a,c) by A3, A11; :: thesis: S2[x,u]
thus S2[x,u] by A11, A12; :: thesis: verum
end;
consider F being Function such that
A13: ( dom F = product <*F3(b,c),F3(a,b)*> & rng F c= F3(a,c) ) and
A14: for x being set st x in product <*F3(b,c),F3(a,b)*> holds
S2[x,F . x] from WELLORD2:sch 1(A10);
reconsider u = F as set ;
take u = u; :: thesis: ex a, b, c being Element of F1() st
( o = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) )

take a = a; :: thesis: ex b, c being Element of F1() st
( o = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) )

take b = b; :: thesis: ex c being Element of F1() st
( o = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) )

take c = c; :: thesis: ( o = compsym (a,b,c) & ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) )

thus o = compsym (a,b,c) by A9; :: thesis: ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) )

reconsider F = F as Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) by A13, FUNCT_2:4;
take F = F; :: thesis: ( F = u & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) )

thus F = u ; :: thesis: for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f)

let f, g be set ; :: thesis: ( f in F3(a,b) & g in F3(b,c) implies F . <*g,f*> = F4(a,b,c,g,f) )
assume ( f in F3(a,b) & g in F3(b,c) ) ; :: thesis: F . <*g,f*> = F4(a,b,c,g,f)
then <*g,f*> in product <*F3(b,c),F3(a,b)*> by FUNCT_6:2;
then consider f9, g9 being set such that
f9 in F3(a,b) and
g9 in F3(b,c) and
A15: <*g,f*> = <*g9,f9*> and
A16: F . <*g,f*> = F4(a,b,c,g9,f9) by A14;
A17: ( <*g,f*> . 1 = g & <*g,f*> . 2 = f ) by FINSEQ_1:61;
<*g,f*> . 1 = g9 by A15, FINSEQ_1:61;
hence F . <*g,f*> = F4(a,b,c,g,f) by A15, A16, A17, FINSEQ_1:61; :: thesis: verum
end;
( o `1 = 1 or o `1 = 2 ) by A5, Th25;
hence ex u being set st S1[o,u] by A6, A8; :: thesis: verum
end;
consider O being Function such that
A18: dom O = the carrier' of (CatSign F1()) and
A19: for o being set st o in the carrier' of (CatSign F1()) holds
S1[o,O . o] from CLASSES1:sch 1(A4);
reconsider O = O as ManySortedSet of the carrier' of (CatSign F1()) by A18, PARTFUN1:def 4, RELAT_1:def 18;
defpred S2[ set , set ] means ex a, b being Element of F1() st
( $1 = homsym (a,b) & $2 = F3(a,b) );
A20: now
let s be set ; :: thesis: ( s in the carrier of (CatSign F1()) implies ex u being set st S2[s,u] )
assume s in the carrier of (CatSign F1()) ; :: thesis: ex u being set st S2[s,u]
then consider a, b being Element of F1() such that
A21: s = homsym (a,b) by Th24;
take u = F3(a,b); :: thesis: S2[s,u]
thus S2[s,u] by A21; :: thesis: verum
end;
consider S being Function such that
A22: dom S = the carrier of (CatSign F1()) and
A23: for s being set st s in the carrier of (CatSign F1()) holds
S2[s,S . s] from CLASSES1:sch 1(A20);
reconsider S = S as ManySortedSet of the carrier of (CatSign F1()) by A22, PARTFUN1:def 4, RELAT_1:def 18;
O is ManySortedFunction of (S #) * the Arity of (CatSign F1()),S * the ResultSort of (CatSign F1())
proof
let o be set ; :: according to PBOOLE:def 18 :: thesis: ( not o in the carrier' of (CatSign F1()) or O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):] )
assume o in the carrier' of (CatSign F1()) ; :: thesis: O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):]
then reconsider o = o as OperSymbol of (CatSign F1()) ;
A24: ((S #) * the Arity of (CatSign F1())) . o = (S #) . (the_arity_of o) by FUNCT_2:21
.= product (S * (the_arity_of o)) by PBOOLE:def 19 ;
A25: (S * the ResultSort of (CatSign F1())) . o = S . (the_result_sort_of o) by FUNCT_2:21;
per cases ( ( o `1 = 1 & 1 <> 2 ) or ( o `1 = 2 & 1 <> 2 ) ) by Th25;
suppose ( o `1 = 1 & 1 <> 2 ) ; :: thesis: O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):]
then consider a being Element of F1() such that
A26: ( o = idsym a & ex F being Function of {{}},F3(a,a) st
( F = O . o & F . {} = F5(a) ) ) by A19;
A27: ( the_arity_of (idsym a) = {} & {} = S * {} ) by Def5;
A28: the_result_sort_of (idsym a) = homsym (a,a) by Def5;
consider c, b being Element of F1() such that
A29: homsym (a,a) = homsym (c,b) and
A30: S . (homsym (a,a)) = F3(c,b) by A23;
( a = b & a = c ) by A29, Th22;
hence O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):] by A24, A25, A26, A30, A27, A28, CARD_3:19; :: thesis: verum
end;
suppose ( o `1 = 2 & 1 <> 2 ) ; :: thesis: O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):]
then consider a, b, c being Element of F1() such that
A31: o = compsym (a,b,c) and
A32: ex F being Function of (product <*F3(b,c),F3(a,b)*>),F3(a,c) st
( F = O . o & ( for f, g being set st f in F3(a,b) & g in F3(b,c) holds
F . <*g,f*> = F4(a,b,c,g,f) ) ) by A19;
A33: the_result_sort_of (compsym (a,b,c)) = homsym (a,c) by Def5;
consider ax, cx being Element of F1() such that
A34: homsym (a,c) = homsym (ax,cx) and
A35: S . (homsym (a,c)) = F3(ax,cx) by A23;
( ax = a & cx = c ) by A34, Th22;
then A36: (S * the ResultSort of (CatSign F1())) . o = F3(a,c) by A31, A35, A33, FUNCT_2:21;
A37: the_arity_of (compsym (a,b,c)) = <*(homsym (b,c)),(homsym (a,b))*> by Def5;
consider a9, b9 being Element of F1() such that
A38: homsym (a,b) = homsym (a9,b9) and
A39: S . (homsym (a,b)) = F3(a9,b9) by A23;
consider b99, c9 being Element of F1() such that
A40: homsym (b,c) = homsym (b99,c9) and
A41: S . (homsym (b,c)) = F3(b99,c9) by A23;
A42: ( b99 = b & c9 = c ) by A40, Th22;
( a9 = a & b9 = b ) by A38, Th22;
then ((S #) * the Arity of (CatSign F1())) . o = product <*F3(b,c),F3(a,b)*> by A22, A24, A31, A39, A41, A42, A37, FINSEQ_2:145;
hence O . o is Element of bool [:(((S #) * the Arity of (CatSign F1())) . o),((S * the ResultSort of (CatSign F1())) . o):] by A32, A36; :: thesis: verum
end;
end;
end;
then reconsider O = O as ManySortedFunction of (S #) * the Arity of (CatSign F1()),S * the ResultSort of (CatSign F1()) ;
take A = MSAlgebra(# S,O #); :: thesis: ( ( for a, b being Element of F1() holds the Sorts of A . (homsym (a,b)) = F3(a,b) ) & ( for a being Element of F1() holds (Den ((idsym a),A)) . {} = F5(a) ) & ( for a, b, c being Element of F1()
for f, g being Element of F2() st f in F3(a,b) & g in F3(b,c) holds
(Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f) ) )

hereby :: thesis: ( ( for a being Element of F1() holds (Den ((idsym a),A)) . {} = F5(a) ) & ( for a, b, c being Element of F1()
for f, g being Element of F2() st f in F3(a,b) & g in F3(b,c) holds
(Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f) ) )
let a, b be Element of F1(); :: thesis: the Sorts of A . (homsym (a,b)) = F3(a,b)
consider a9, b9 being Element of F1() such that
A43: homsym (a,b) = homsym (a9,b9) and
A44: S . (homsym (a,b)) = F3(a9,b9) by A23;
a = a9 by A43, Th22;
hence the Sorts of A . (homsym (a,b)) = F3(a,b) by A43, A44, Th22; :: thesis: verum
end;
hereby :: thesis: for a, b, c being Element of F1()
for f, g being Element of F2() st f in F3(a,b) & g in F3(b,c) holds
(Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f)
let a be Element of F1(); :: thesis: (Den ((idsym a),A)) . {} = F5(a)
(idsym a) `1 = 1 by MCART_1:7;
then ex b being Element of F1() st
( idsym a = idsym b & ex F being Function of {{}},F3(b,b) st
( F = O . (idsym a) & F . {} = F5(b) ) ) by A19;
hence (Den ((idsym a),A)) . {} = F5(a) by Th21; :: thesis: verum
end;
let a, b, c be Element of F1(); :: thesis: for f, g being Element of F2() st f in F3(a,b) & g in F3(b,c) holds
(Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f)

set o = compsym (a,b,c);
(compsym (a,b,c)) `1 = 2 by MCART_1:7;
then consider a9, b9, c9 being Element of F1() such that
A45: compsym (a,b,c) = compsym (a9,b9,c9) and
A46: ex F being Function of (product <*F3(b9,c9),F3(a9,b9)*>),F3(a9,c9) st
( F = O . (compsym (a,b,c)) & ( for f, g being set st f in F3(a9,b9) & g in F3(b9,c9) holds
F . <*g,f*> = F4(a9,b9,c9,g,f) ) ) by A19;
A47: c = c9 by A45, Th23;
let f, g be Element of F2(); :: thesis: ( f in F3(a,b) & g in F3(b,c) implies (Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f) )
assume A48: ( f in F3(a,b) & g in F3(b,c) ) ; :: thesis: (Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f)
( a = a9 & b = b9 ) by A45, Th23;
hence (Den ((compsym (a,b,c)),A)) . <*g,f*> = F4(a,b,c,g,f) by A46, A47, A48; :: thesis: verum