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

theorem
  for U1 being non-empty MSAlgebra over S, U2 being non-empty
  MSAlgebra over S, F be ManySortedFunction of U1,U2 st F is_homomorphism U1,U2
  holds F is_epimorphism U1,U2 iff Image F = the MSAlgebra of U2
proof
  let U1 be non-empty MSAlgebra over S;
  let U2 be non-empty MSAlgebra over S, F be ManySortedFunction of U1,
  U2;
  set FF = F.:.:(the Sorts of U1);
  assume
A1: F is_homomorphism U1,U2;
  thus F is_epimorphism U1,U2 implies Image F = the MSAlgebra of U2
  proof
    assume F is_epimorphism U1,U2;
    then
A2: F is "onto";
    now
      let i be object;
      assume
A3:   i in the carrier of S;
      then reconsider
      f = F.i as Function of (the Sorts of U1).i,(the Sorts of U2).
      i by PBOOLE:def 15;
A4:   rng f = (the Sorts of U2).i by A2,A3;
      reconsider f as Function;
      FF.i = f.:((the Sorts of U1).i) & dom f = (the Sorts of U1).i by A3,
FUNCT_2:def 1,PBOOLE:def 20;
      hence FF.i = (the Sorts of U2).i by A4,RELAT_1:113;
    end;
    then
A5: FF = the Sorts of U2 by PBOOLE:3;
    the MSAlgebra of U2 is strict MSSubAlgebra of U2 by MSUALG_2:5;
    hence thesis by A1,A5,Def12;
  end;
  assume Image F = the MSAlgebra of U2;
  then
A6: FF = the Sorts of U2 by A1,Def12;
  for i be set st i in the carrier of S holds rng(F.i) = (the Sorts of U2 ) . i
  proof
    let i be set;
    assume i in the carrier of S;
    then reconsider i as Element of S;
    reconsider f = F.i as Function of (the Sorts of U1).i,(the Sorts of U2).i;
    f.:((the Sorts of U1).i) = (the Sorts of U2).i & dom f = (the Sorts
    of U1).i by A6,FUNCT_2:def 1,PBOOLE:def 20;
    hence thesis by RELAT_1:113;
  end;
  then F is "onto";
  hence thesis by A1;
end;
