reserve S for non void non empty ManySortedSign,
  U1, U2, U3 for non-empty MSAlgebra over S,
  I for set,
  A for ManySortedSet of I,
  B, C for non-empty ManySortedSet of I;

theorem
  for U1 being non-empty MSAlgebra over S for U2 being non-empty
  MSAlgebra over S for Gen being GeneratorSet of U1 for h1, h2 being
ManySortedFunction of U1, U2 st h1 is_homomorphism U1, U2 & h2 is_homomorphism
  U1, U2 & h1 || Gen = h2 || Gen holds h1 = h2
proof
  let U1 be non-empty MSAlgebra over S, U2 be non-empty MSAlgebra over
S, Gen be GeneratorSet of U1, h1, h2 be ManySortedFunction of U1, U2 such that
A1: h1 is_homomorphism U1, U2 and
A2: h2 is_homomorphism U1, U2 and
A3: h1 || Gen = h2 || Gen;
  defpred P[object,object] means
   ex s being SortSymbol of S st $1 = s & h1.s.$2 = h2.s.$2;
  set I = the carrier of S;
  consider A being ManySortedSet of I such that
A4: for i being object st i in I
  for e being object holds e in A.i iff e in (
  the Sorts of U1).i & P[i,e] from PBOOLE:sch 2;
  A is ManySortedSubset of the Sorts of U1
  proof
    let i be object such that
A5: i in I;
    let e be object;
    assume e in A.i;
    hence thesis by A4,A5;
  end;
  then reconsider A as MSSubset of U1;
  A is opers_closed
  proof
    let o be OperSymbol of S;
    let y be object;
    set r = the_result_sort_of o;
    set ar = the_arity_of o;
    assume y in rng ((Den(o,U1))|((A# * the Arity of S).o));
    then consider x being object such that
A6: x in dom ((Den(o,U1))|((A# * the Arity of S).o)) and
A7: ((Den(o,U1))|((A# * the Arity of S).o)).x = y by FUNCT_1:def 3;
A8: x in (A# * the Arity of S).o by A6,RELAT_1:57;
    then x in A#.((the Arity of S).o) by FUNCT_2:15;
    then x in A#.ar by MSUALG_1:def 1;
    then
A9: x in product(A*ar) by FINSEQ_2:def 5;
    reconsider x as Element of Args(o,U1) by A6;
A10: y = Den(o,U1).x by A7,A8,FUNCT_1:49;
A11: dom (h1#x) = dom ar by MSUALG_3:6;
A12: for n being object st n in dom (h1#x) holds (h1#x).n = (h2#x).n
    proof
      let n be object;
A13:  dom x = dom ar by MSUALG_3:6;
      assume
A14:  n in dom (h1#x);
      then reconsider n9 = n as Nat by A11,ORDINAL1:def 12;
      dom x = dom (A*ar) by A9,CARD_3:9;
      then x.n in (A*ar).n by A9,A11,A14,A13,CARD_3:9;
      then x.n in A.(ar.n) by A11,A14,FUNCT_1:13;
      then x.n in A.(ar/.n) by A11,A14,PARTFUN1:def 6;
      then ex s being SortSymbol of S st s = ar/.n & h1.s.(x.n) = h2.s.(x.n)
      by A4;
      hence (h1#x).n = h2.(ar/.n).(x.n9) by A11,A14,A13,MSUALG_3:def 6
        .= (h2#x).n by A11,A14,A13,MSUALG_3:def 6;
    end;
    Den(o,U1).x is Element of ((the Sorts of U1)*the ResultSort of S).o
    by MSUALG_1:def 5;
    then
    Den(o,U1).x is Element of (the Sorts of U1).((the ResultSort of S). o
    ) by FUNCT_2:15;
    then
A15: Den(o,U1).x is Element of (the Sorts of U1).r by MSUALG_1:def 2;
A16: dom (h2#x) = dom ar by MSUALG_3:6;
    h1.r.y = h1.r.(Den(o,U1).x) by A7,A8,FUNCT_1:49
      .= Den(o,U2).(h1#x) by A1
      .= Den(o,U2).(h2#x) by A16,A12,FUNCT_1:2,MSUALG_3:6
      .= h2.r.(Den(o,U1).x) by A2
      .= h2.r.y by A7,A8,FUNCT_1:49;
    then y in A.r by A4,A10,A15;
    then y in A.((the ResultSort of S).o) by MSUALG_1:def 2;
    hence thesis by FUNCT_2:15;
  end;
  then
A17: U1|A = MSAlgebra (#A, Opers(U1,A)#) by MSUALG_2:def 15;
  Gen is ManySortedSubset of the Sorts of U1|A
  proof
    let i be object such that
A18: i in I;
    reconsider s = i as SortSymbol of S by A18;
    Gen c= the Sorts of U1 by PBOOLE:def 18;
    then
A19: Gen.i c= (the Sorts of U1).i by A18;
    let x be object such that
A20: x in Gen.i;
    h1.s.x = ((h1.s) | (Gen.s)).x by A20,FUNCT_1:49
      .= (h1 || Gen).s.x by MSAFREE:def 1
      .= ((h2.s) | (Gen.s)).x by A3,MSAFREE:def 1
      .= h2.s.x by A20,FUNCT_1:49;
    hence thesis by A4,A17,A20,A19;
  end;
  then
A21: GenMSAlg Gen is MSSubAlgebra of U1|A by MSUALG_2:def 17;
  the Sorts of GenMSAlg Gen = the Sorts of U1 by MSAFREE:def 4;
  then the Sorts of U1 is ManySortedSubset of A by A17,A21,MSUALG_2:def 9;
  then
A22: the Sorts of U1 c= A by PBOOLE:def 18;
  now
    let i be object;
    assume
A23: i in I;
    then reconsider s = i as SortSymbol of S;
A24: dom (h1.s) = (the Sorts of U1).i by FUNCT_2:def 1;
A25: now
A26:  (the Sorts of U1).i c= A.i by A22,A23;
      let x be object;
      assume x in dom (h1.s);
      then
      ex t being SortSymbol of S st t = s & h1.t.x = h2.t.x by A4,A24,A26;
      hence h1.s.x = h2.s.x;
    end;
    dom (h2.s) = (the Sorts of U1).i by FUNCT_2:def 1;
    hence h1.i = h2.i by A24,A25,FUNCT_1:2;
  end;
  hence thesis;
end;
