defpred S1[ object , object ] means ex f being Function of ((FreeGen F3()) . \$1),( the Sorts of F2() . \$1) st
( \$2 = f & ( for x being Element of F3() . \$1 holds f . (root-tree [x,\$1]) = F4(x,\$1) ) );
A2: for a being object st a in the carrier of F1() holds
ex y being object st S1[a,y]
proof
let a be object ; :: thesis: ( a in the carrier of F1() implies ex y being object st S1[a,y] )
assume a in the carrier of F1() ; :: thesis: ex y being object st S1[a,y]
then reconsider s = a as SortSymbol of F1() ;
defpred S2[ object , object ] means ex x being Element of F3() . s st
( \$1 = root-tree [x,s] & \$2 = F4(x,s) );
A3: (FreeGen F3()) . s = FreeGen (s,F3()) by MSAFREE:def 16;
A4: for y being object st y in (FreeGen F3()) . s holds
ex z being object st
( z in the Sorts of F2() . s & S2[y,z] )
proof
let y be object ; :: thesis: ( y in (FreeGen F3()) . s implies ex z being object st
( z in the Sorts of F2() . s & S2[y,z] ) )

assume y in (FreeGen F3()) . s ; :: thesis: ex z being object st
( z in the Sorts of F2() . s & S2[y,z] )

then consider a being set such that
A5: a in F3() . s and
A6: y = root-tree [a,s] by ;
reconsider a = a as Element of F3() . s by A5;
take z = F4(a,s); :: thesis: ( z in the Sorts of F2() . s & S2[y,z] )
thus z in the Sorts of F2() . s by A1; :: thesis: S2[y,z]
take a ; :: thesis: ( y = root-tree [a,s] & z = F4(a,s) )
thus ( y = root-tree [a,s] & z = F4(a,s) ) by A6; :: thesis: verum
end;
consider f being Function such that
A7: ( dom f = (FreeGen F3()) . s & rng f c= the Sorts of F2() . s ) and
A8: for y being object st y in (FreeGen F3()) . s holds
S2[y,f . y] from reconsider f = f as Function of ((FreeGen F3()) . a),( the Sorts of F2() . a) by ;
take y = f; :: thesis: S1[a,y]
take f ; :: thesis: ( y = f & ( for x being Element of F3() . a holds f . (root-tree [x,a]) = F4(x,a) ) )
thus y = f ; :: thesis: for x being Element of F3() . a holds f . (root-tree [x,a]) = F4(x,a)
let x be Element of F3() . a; :: thesis: f . (root-tree [x,a]) = F4(x,a)
root-tree [x,s] in (FreeGen F3()) . s by ;
then consider z being Element of F3() . s such that
A9: root-tree [x,s] = root-tree [z,s] and
A10: f . (root-tree [x,s]) = F4(z,s) by A8;
[x,s] = [z,s] by ;
hence f . (root-tree [x,a]) = F4(x,a) by ; :: thesis: verum
end;
consider h being Function such that
A11: dom h = the carrier of F1() and
A12: for a being object st a in the carrier of F1() holds
S1[a,h . a] from reconsider h = h as ManySortedSet of the carrier of F1() by ;
h is ManySortedFunction of FreeGen F3(), the Sorts of F2()
proof
let a be object ; :: according to PBOOLE:def 15 :: thesis: ( not a in the carrier of F1() or h . a is Element of bool [:((FreeGen F3()) . a),( the Sorts of F2() . a):] )
assume a in the carrier of F1() ; :: thesis: h . a is Element of bool [:((FreeGen F3()) . a),( the Sorts of F2() . a):]
then ex f being Function of ((FreeGen F3()) . a),( the Sorts of F2() . a) st
( h . a = f & ( for x being Element of F3() . a holds f . (root-tree [x,a]) = F4(x,a) ) ) by A12;
hence h . a is Element of bool [:((FreeGen F3()) . a),( the Sorts of F2() . a):] ; :: thesis: verum
end;
then reconsider h = h as ManySortedFunction of FreeGen F3(), the Sorts of F2() ;
consider H being ManySortedFunction of (FreeMSA F3()),F2() such that
A13: H is_homomorphism FreeMSA F3(),F2() and
A14: H || (FreeGen F3()) = h by MSAFREE:def 5;
take H ; :: thesis: ( H is_homomorphism FreeMSA F3(),F2() & ( for s being SortSymbol of F1()
for x being Element of F3() . s holds (H . s) . (root-tree [x,s]) = F4(x,s) ) )

thus H is_homomorphism FreeMSA F3(),F2() by A13; :: thesis: for s being SortSymbol of F1()
for x being Element of F3() . s holds (H . s) . (root-tree [x,s]) = F4(x,s)

let s be SortSymbol of F1(); :: thesis: for x being Element of F3() . s holds (H . s) . (root-tree [x,s]) = F4(x,s)
let x be Element of F3() . s; :: thesis: (H . s) . (root-tree [x,s]) = F4(x,s)
A15: ex f being Function of ((FreeGen F3()) . s),( the Sorts of F2() . s) st
( h . s = f & ( for x being Element of F3() . s holds f . (root-tree [x,s]) = F4(x,s) ) ) by A12;
reconsider t = root-tree [x,s] as Term of F1(),F3() by MSATERM:4;
(FreeGen F3()) . s = FreeGen (s,F3()) by MSAFREE:def 16;
then A16: t in (FreeGen F3()) . s by MSAFREE:def 15;
h . s = (H . s) | ((FreeGen F3()) . s) by ;
then (H . s) . (root-tree [x,s]) = (h . s) . (root-tree [x,s]) by ;
hence (H . s) . (root-tree [x,s]) = F4(x,s) by A15; :: thesis: verum