reserve U1,U2,U3 for Universal_Algebra,
  n,m for Nat,
  o1 for operation of U1,
  o2 for operation of U2,
  o3 for operation of U3,
  x,y for set;
reserve a for FinSequence of U1,
  f for Function of U1,U2;
reserve E for Congruence of U1;

theorem Th19:
  f is_homomorphism implies HomQuot(f) is_homomorphism
& HomQuot(f) is_monomorphism
proof
  set qa = QuotUnivAlg(U1,Cng(f)), cqa = the carrier of qa, u1 = the carrier
  of U1, F = HomQuot(f);
  assume
A1: f is_homomorphism;
  thus
A2: F is_homomorphism
  proof
    Nat_Hom(U1,Cng f) is_homomorphism by Th17;
    then U1,qa are_similar;
    then
A3: signature U1 = signature qa;
    U1,U2 are_similar by A1;
    then signature U2 = signature qa by A3;
    hence qa,U2 are_similar;
    let n;
    assume
A4: n in dom the charact of(qa);
A5: len (signature U1) = len the charact of(U1) & len (signature qa) =
    len the charact of(qa) by UNIALG_1:def 4;
A6: dom the charact of(qa) = Seg len (the charact of qa) & dom the
    charact of(U1 ) = Seg len (the charact of U1) by FINSEQ_1:def 3;
    then reconsider o1 = (the charact of U1).n as operation of U1 by A3,A4,A5,
FUNCT_1:def 3;
A7: dom o1 = (arity o1)-tuples_on u1 by MARGREL1:22
      .= {p where p is Element of u1* : len p = arity o1} by FINSEQ_2:def 4;
    let oq be operation of qa, o2 be operation of U2;
    assume that
A8: oq = (the charact of qa).n and
A9: o2 = (the charact of U2).n;
    let x be FinSequence of qa;
    assume
A10: x in dom oq;
    reconsider x1 = x as FinSequence of Class(Cng f);
    reconsider x1 as Element of (Class(Cng f))* by FINSEQ_1:def 11;
    consider y be FinSequence of U1 such that
A11: y is_representatives_FS x1 by FINSEQ_3:122;
    reconsider y as Element of u1* by FINSEQ_1:def 11;
A12: len x1 = len y by A11,FINSEQ_3:def 4;
    then
A13: len (F*x) = len y by FINSEQ_3:120;
A14: len y = len (f*y) by FINSEQ_3:120;
A15: now
      let m be Nat;
      assume
A16:  m in Seg len y;
      then
A17:  m in dom (F*x) by A13,FINSEQ_1:def 3;
A18:  m in dom(f*y) by A14,A16,FINSEQ_1:def 3;
A19:  m in dom y by A16,FINSEQ_1:def 3;
      then reconsider ym = y.m as Element of u1 by FINSEQ_2:11;
      x1.m = Class(Cng f,y.m) by A11,A19,FINSEQ_3:def 4;
      hence (F*x).m = F.(Class(Cng f,ym)) by A17,FINSEQ_3:120
        .= f.(y.m) by A1,Def13
        .= (f*y).m by A18,FINSEQ_3:120;
    end;
    dom(F*x) = Seg len y by A13,FINSEQ_1:def 3;
    then
A20: o2.(F*x) = o2.(f*y) by A13,A14,A15,FINSEQ_2:9;
A21: oq = QuotOp(o1,Cng f) by A4,A8,Def9;
    then dom oq = (arity o1)-tuples_on Class(Cng f) by Def8
      .= {w where w is Element of (Class(Cng f))*: len w = arity o1} by
FINSEQ_2:def 4;
    then ex w be Element of (Class(Cng f))* st w = x1 & len w = arity o1 by A10
;
    then
A22: y in dom o1 by A12,A7;
    then o1.y in rng o1 by FUNCT_1:def 3;
    then reconsider o1y = o1.y as Element of u1;
    F.(oq.x) = F.(Class(Cng f,o1y)) by A10,A11,A21,Def8
      .= f.(o1.y) by A1,Def13;
    hence thesis by A1,A3,A4,A9,A6,A5,A22,A20;
  end;
A23: dom F = cqa by FUNCT_2:def 1;
  F is one-to-one
  proof
    let x,y be object;
    assume that
A24: x in dom F and
A25: y in dom F and
A26: F.x = F.y;
    reconsider x1 = x, y1 = y as Subset of u1 by A23,A24,A25;
    consider a be object such that
A27: a in u1 and
A28: x1 = Class(Cng f,a) by A24,EQREL_1:def 3;
    reconsider a as Element of u1 by A27;
    consider b be object such that
A29: b in u1 and
A30: y1 = Class(Cng f,b) by A25,EQREL_1:def 3;
    reconsider b as Element of u1 by A29;
A31: F.y1 = f.b by A1,A30,Def13;
    F.x1 = f.a by A1,A28,Def13;
    then [a,b] in Cng(f) by A1,A26,A31,Def12;
    hence thesis by A28,A30,EQREL_1:35;
  end;
  hence thesis by A2;
end;
