reserve S for non void non empty ManySortedSign,
  U1 for MSAlgebra over S,
  o for OperSymbol of S,
  s for SortSymbol of S;

theorem Th4:
  for U1,U2 be non-empty MSAlgebra over S, F be ManySortedFunction
  of U1,U2 st F is_homomorphism U1,U2 holds MSHomQuot(F) is_monomorphism
  QuotMSAlg (U1,MSCng F),U2
proof
  let U1,U2 be non-empty MSAlgebra over S, F be ManySortedFunction of U1,U2;
  set mc = MSCng(F), qa = QuotMSAlg (U1,mc), qh = MSHomQuot(F), S1 = the Sorts
  of U1;
  assume
A1: F is_homomorphism U1,U2;
  for o be OperSymbol of S st Args (o,qa) <> {} for x be Element of Args(o
  ,qa) holds (qh.(the_result_sort_of o)).(Den(o,qa).x) = Den(o,U2).(qh#x)
  proof
    let o be OperSymbol of S such that
    Args (o,qa) <> {};
    let x be Element of Args(o,qa);
    set ro = the_result_sort_of o, ar = the_arity_of o;
A2: dom x = dom ar by MSUALG_3:6;
    Args(o,qa) = ((Class mc)# * (the Arity of S)).o by MSUALG_1:def 4;
    then consider a be Element of Args(o,U1) such that
A3: x = mc # a by Th2;
A4: dom a = dom ar by MSUALG_3:6;
A5: now
      let y be object;
      assume
A6:   y in dom ar;
      then reconsider n = y as Nat by ORDINAL1:def 12;
      ar.n in rng ar by A6,FUNCT_1:def 3;
      then reconsider s = ar.n as SortSymbol of S;
A7:   ar/.n = ar.n by A6,PARTFUN1:def 6;
      then x.n = Class(mc.s,a.n) by A3,A6,Def7;
      then
A8:   x.n = Class(MSCng(F,s),a.n) by A1,Def18;
A9:   n in dom (S1 * ar) by A6,PARTFUN1:def 2;
      then a.n in (S1 * ar).n by MSUALG_3:6;
      then reconsider an = a.n as Element of S1.s by A9,FUNCT_1:12;
      (qh # x).n = (qh.s).(x.n) by A2,A6,A7,MSUALG_3:def 6
        .= MSHomQuot(F,s).(x.n) by Def20
        .= (F.s).an by A1,A8,Def19
        .= (F # a).n by A4,A6,A7,MSUALG_3:def 6;
      hence (qh # x).y = (F # a).y;
    end;
    o in the carrier' of S;
    then o in dom (S1 * the ResultSort of S) by PARTFUN1:def 2;
    then
A10: ((the Sorts of U1) * the ResultSort of S).o = (the Sorts of U1).((the
    ResultSort of S).o) by FUNCT_1:12
      .= (the Sorts of U1).ro by MSUALG_1:def 2;
    then rng Den(o,U1) c= Result(o,U1) & Result(o,U1) = S1.ro by MSUALG_1:def 5
;
    then rng Den(o,U1) c= dom QuotRes(mc,o) by A10,FUNCT_2:def 1;
    then
A11: dom Den(o,U1) = Args(o,U1) & dom ((QuotRes(mc,o)) * Den(o,U1)) = dom
    Den(o, U1) by FUNCT_2:def 1,RELAT_1:27;
    ar = (the Arity of S).o by MSUALG_1:def 1;
    then
A12: product((Class mc) * ar) = ((Class mc)# * the Arity of S).o by MSAFREE:1;
    reconsider da = (Den(o,U1)).a as Element of S1.ro by A10,MSUALG_1:def 5;
A13: qh.ro = MSHomQuot(F,ro) by Def20;
    Den(o,qa) = (QuotCharact mc).o by MSUALG_1:def 6
      .= QuotCharact(mc,o) by Def13;
    then Den(o,qa).x = (QuotRes(mc,o) * Den(o,U1)).a by A3,A12,Def12
      .= (QuotRes(mc,o)) . da by A11,FUNCT_1:12
      .= Class (mc, da) by Def8
      .= Class (MSCng(F,ro),da) by A1,Def18;
    then
A14: (qh.ro).(Den(o,qa).x) = (F.ro).((Den(o,U1)).a) by A1,A13,Def19
      .= Den(o,U2).(F#a) by A1;
    dom (qh # x) = dom ar & dom (F # a) = dom ar by MSUALG_3:6;
    hence thesis by A5,A14,FUNCT_1:2;
  end;
  hence qh is_homomorphism qa,U2;
  for i be set st i in the carrier of S holds (qh.i) is one-to-one
  proof
    let i be set;
    set f = qh.i;
    assume i in the carrier of S;
    then reconsider s = i as SortSymbol of S;
A15: f = MSHomQuot(F,s) by Def20;
    for x1,x2 be object st x1 in dom f & x2 in dom f & f.x1 = f.x2
holds x1 = x2
    proof
      let x1,x2 be object;
      assume that
A16:  x1 in dom f and
A17:  x2 in dom f and
A18:  f.x1 = f.x2;
      x1 in (Class mc).s by A15,A16,FUNCT_2:def 1;
      then x1 in Class (mc.s) by Def6;
      then consider a1 be object such that
A19:  a1 in S1.s and
A20:  x1 = Class(mc.s,a1) by EQREL_1:def 3;
      x2 in (Class mc).s by A15,A17,FUNCT_2:def 1;
      then x2 in Class (mc.s) by Def6;
      then consider a2 be object such that
A21:  a2 in S1.s and
A22:  x2 = Class(mc.s,a2) by EQREL_1:def 3;
      reconsider a2 as Element of S1.s by A21;
A23:  mc.s = MSCng(F,s) by A1,Def18;
      then
A24:  f.x2 = (F.s).a2 by A1,A15,A22,Def19;
      reconsider a1 as Element of S1.s by A19;
      f.x1 = (F.s).a1 by A1,A15,A23,A20,Def19;
      then [a1,a2] in MSCng(F,s) by A18,A24,Def17;
      hence thesis by A23,A20,A22,EQREL_1:35;
    end;
    hence thesis by FUNCT_1:def 4;
  end;
  hence thesis by MSUALG_3:1;
end;
