reserve i, j, k, c, m, n for Nat,
  a, x, y, z, X, Y for set,
  D, E for non empty set,
  R for Relation,
  f, g for Function,
  p, q for FinSequence;
reserve f1, f2 for non empty homogeneous to-naturals NAT*-defined Function,
  e1, e2 for homogeneous to-naturals NAT*-defined Function,
  p for Element of (arity f1+1)-tuples_on NAT;

theorem Th53:
  f1 is len-total & f2 is len-total & arity f1 +2 = arity f2 &
  1 <= i & i <= 1+arity f1 implies p in dom primrec(f1,f2,i,p)
proof
  assume that
A1: f1 is len-total and
A2: f2 is len-total and
A3: arity f1 +2 = arity f2 and
A4: 1 <= i and
A5: i <= 1+arity f1;
A6: len p = 1+arity f1 by CARD_1:def 7;
  then
A7: i in dom p by A4,A5,FINSEQ_3:25;
  then
A8: p/.i = p.i by PARTFUN1:def 6;
  consider F being sequence of  HFuncs NAT such that
A9: primrec(f1,f2,i,p) = F.(p/.i) and
A10: i in dom p & Del(p,i) in dom f1 implies F.0 = p+*(i,0) .--> (f1.Del
  (p,i)) and
  not i in dom p or not Del(p,i) in dom f1 implies F.0 = {} and
A11: for m being Nat holds (i in dom p & p+*(i,m) in dom (F.m
) & (p+*(i,m))^<*(F.m).(p+*(i,m))*> in dom f2 implies F.(m+1) = (F.m)+*(p+*(i,m
+1).--> f2.((p+*(i,m))^<*(F.m).(p+*(i,m))*>))) & (not i in dom p or not p+*(i,m
) in dom (F.m) or not (p+*(i,m))^<*(F.m).(p+*(i,m))*> in dom f2 implies F.(m+1)
  = F.m) by Def10;
  defpred p[Nat] means (p+*(i,$1)) in dom (F.$1);
A12: (p+*(i,p.i)) = p by FUNCT_7:35;
A13: now
    let m be Nat such that
A14: p[m];
    reconsider aa = (F.m).(p+*(i,m)) as Element of NAT;
    reconsider mm=m as Element of NAT by ORDINAL1:def 12;
    set pc = (p+*(i,m))^<*(F.m).(p+*(i,m))*>;
    reconsider p2 = <*aa*> as FinSequence of NAT;
    reconsider p1 = (p+*(i,mm))^p2 as FinSequence of NAT;
A15: len p2 = 1 by CARD_1:def 7;
    len (p+*(i,mm))=1+arity f1 by CARD_1:def 7;
    then len p1 = arity f1+1+1 by A15,FINSEQ_1:22
      .= arity f2 by A3;
    then
A16: p1 is Element of (arity f2)-tuples_on NAT by FINSEQ_2:92;
    p+*(i,m+1) in {p+*(i,m+1)} by TARSKI:def 1;
    then
A17: p+*(i,m+1) in dom ({p+*(i,m+1)}--> f2.(pc));
    dom f2 = (arity f2)-tuples_on NAT by A2,Th22;
    then F.(m+1) = (F.m)+*(p+*(i,m+1).--> f2.(pc)) by A7,A11,A14,A16;
    then dom(F.(m+1))=dom (F.m) \/ dom ({p+*(i,m+1)}--> f2.(pc))
    by FUNCT_4:def 1;
    hence p[m+1] by A17,XBOOLE_0:def 3;
  end;
A18: now
    reconsider Dpi = Del(p,i) as FinSequence of NAT by FINSEQ_3:105;
    reconsider Dpi9 = Dpi as Element of (len Dpi)-tuples_on NAT by FINSEQ_2:92;
A19: dom f1 = (arity f1)-tuples_on NAT by A1,Th22;
    len Del(p,i) = arity f1 by A6,A7,FINSEQ_3:109;
    then Dpi9 in dom f1 by A19;
    then dom (F.0) = {p+*(i,0)} by A4,A5,A6,A10,FINSEQ_3:25;
    hence p[0] by TARSKI:def 1;
  end;
  for m being Nat holds p[m] from NAT_1:sch 2(A18, A13);
  hence thesis by A8,A9,A12;
end;
