reserve S for non void non empty ManySortedSign,
  U1,U2 for MSAlgebra over S,
  o for OperSymbol of S,
  n for Nat;

theorem Th8:
  for U1,U2,U3 being non-empty MSAlgebra over S
  for H1 be ManySortedFunction of U1,U2,
      H2 be ManySortedFunction of U2,U3,
      x be Element of Args(o,U1) holds (H2**H1)#x = H2#(H1#x)
proof
  let U1,U2,U3 be non-empty MSAlgebra over S;
  let H1 be ManySortedFunction of U1,U2,H2 be ManySortedFunction of U2,U3;
  let x be Element of Args(o,U1);
A1: dom x = dom the_arity_of o by Th6;
A2: dom (H1#x) = dom the_arity_of o by Th6;
A3: for y be object st y in dom (the_arity_of o)
holds ((H2**H1)#x).y = ((H2#(H1#x))).y
  proof
    rng (the_arity_of o) c= the carrier of S by FINSEQ_1:def 4;
    then rng the_arity_of o c= dom (the Sorts of U1) by PARTFUN1:def 2;
    then
A4: dom ((the Sorts of U1)*(the_arity_of o)) = dom the_arity_of o by
RELAT_1:27;
    let y be object;
    assume
A5: y in dom the_arity_of o;
    then reconsider n = y as Nat;
    set F = H2**H1, p = (the_arity_of o)/.n;
A6: (F#x).n = (F.p).(x.n) by A1,A5,Def6;
    p = (the_arity_of o).n by A5,PARTFUN1:def 6; then
A7: ((the Sorts of U1) * (the_arity_of o)).n =(the Sorts of U1).p
      by A5,A4,FUNCT_1:12;
A8: F.p = (H2.p)*(H1.p) by Th2;
A9: dom (H1.p) = (the Sorts of U1).p by FUNCT_2:def 1;
    then dom ((H2.p)*(H1.p)) = dom (H1.p) by FUNCT_2:def 1;
    hence (F#x).y = (H2.p).((H1.p).(x.n)) by A5,A6,A4,A9,A7,A8,Th6,FUNCT_1:12
      .= (H2.p).((H1#x).n) by A1,A5,Def6
      .= (H2#(H1#x)).y by A2,A5,Def6;
  end;
  dom ((H2**H1)#x) = dom the_arity_of o & dom (H2#(H1#x)) = dom (
  the_arity_of o) by Th6;
  hence thesis by A3,FUNCT_1:2;
end;
