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 Th17:
  for U1,E holds Nat_Hom(U1,E) is_homomorphism
proof
  let U1,E;
  set f = Nat_Hom(U1,E), u1 = the carrier of U1, qu = the carrier of
  QuotUnivAlg(U1,E);
A1: len (signature U1) = len the charact of(U1) by UNIALG_1:def 4;
A2: dom (signature U1) = Seg len(signature U1) by FINSEQ_1:def 3;
A3: len QuotOpSeq(U1,E) = len the charact of(U1) by Def9;
A4: len (signature QuotUnivAlg(U1,E)) = len the charact of(QuotUnivAlg(U1,E)
  ) by UNIALG_1:def 4;
  now
    let n be Nat;
    assume
A5: n in dom (signature U1);
    then n in dom the charact of(U1) by A1,A2,FINSEQ_1:def 3;
    then reconsider o1 = (the charact of U1).n as operation of U1 by
FUNCT_1:def 3;
    n in dom QuotOpSeq(U1,E) by A3,A1,A2,A5,FINSEQ_1:def 3;
    then
A6: QuotOpSeq(U1,E).n = QuotOp(o1,E) by Def9;
    reconsider cl = QuotOp(o1,E) as homogeneous quasi_total non empty PartFunc
    of qu*,qu;
    consider b be object such that
A7: b in dom cl by XBOOLE_0:def 1;
    reconsider b as Element of qu* by A7;
    dom QuotOp(o1,E) = (arity o1)-tuples_on Class(E) by Def8;
    then b in {w where w is Element of (Class(E))*: len w = arity o1} by A7,
FINSEQ_2:def 4;
    then ex w be Element of (Class(E))* st w = b & len w = arity o1;
    then
A8: arity cl = arity o1 by A7,MARGREL1:def 25;
    n in dom (signature QuotUnivAlg(U1,E)) & (signature U1).n = arity o1
    by A3,A4,A2,A5,FINSEQ_1:def 3,UNIALG_1:def 4;
    hence (signature U1).n = (signature QuotUnivAlg(U1,E)).n by A6,A8,
UNIALG_1:def 4;
  end;
  hence signature U1 = signature QuotUnivAlg(U1,E) by A3,A4,A1,FINSEQ_2:9;
  let n;
  assume n in dom the charact of(U1);
  then n in Seg len the charact of(U1) by FINSEQ_1:def 3;
  then
A9: n in dom QuotOpSeq(U1,E) by A3,FINSEQ_1:def 3;
  let o1 be operation of U1, o2 be operation of QuotUnivAlg(U1,E);
  assume
  (the charact of U1).n = o1 & o2 = (the charact of QuotUnivAlg(U1,E) ).n;
  then
A10: o2 = QuotOp(o1,E) by A9,Def9;
  let x be FinSequence of U1;
  reconsider x1 = x as Element of u1* by FINSEQ_1:def 11;
  reconsider fx = f*x as FinSequence of Class(E);
  reconsider fx as Element of (Class(E))* by FINSEQ_1:def 11;
A11: len (f*x) = len x by FINSEQ_3:120;
  now
    let m;
    assume
A12: m in dom x;
    then
A13: m in dom(f*x) by FINSEQ_3:120;
    x.m in rng x by A12,FUNCT_1:def 3;
    then reconsider xm = x.m as Element of u1;
    thus Class(E,x.m) = f.xm by Def11
      .= fx.m by A13,FINSEQ_3:120;
  end;
  then
A14: x is_representatives_FS fx by A11,FINSEQ_3:def 4;
  assume
A15: x in dom o1;
  then o1.x in rng o1 by FUNCT_1:def 3;
  then reconsider ox = o1.x as Element of u1;
  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;
  then
A16: ex p be Element of u1* st p = x1 & len p = arity o1 by A15;
A17: f.(o1.x) = Class(E,ox) by Def11
    .= Class(E,o1.x);
  dom QuotOp(o1,E) = (arity o1)-tuples_on Class(E) by Def8
    .= {q where q is Element of (Class(E))*: len q = arity o1} by
FINSEQ_2:def 4;
  then fx in dom QuotOp(o1,E) by A16,A11;
  hence thesis by A17,A10,A14,Def8;
end;
