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;
reserve P for primitive-recursively_closed non empty Subset of HFuncs NAT;

theorem Th67:
  for g being Element of HFuncs(NAT),
  f1, f2 being quasi_total Element of HFuncs(NAT), i being Nat st
  g is_primitive-recursively_expressed_by f1, f2, i holds g is quasi_total &
  (f1 is non empty implies g is non empty)
proof
  let g be Element of HFuncs(NAT),
  f1, f2 be quasi_total Element of HFuncs(NAT),
  i be Nat;
  assume
A1: g is_primitive-recursively_expressed_by f1, f2, i;
  then consider n being Element of NAT such that
A2: dom g c= n-tuples_on NAT and
A3: i >= 1 and
A4: i <= n and
A5: (arity f1)+1 = n and
A6: n+1 = arity f2 and
A7: for p being FinSequence of NAT st len p = n holds (p+*(i,0) in dom g
iff Del(p,i) in dom f1) & (p+*(i,0) in dom g implies g.(p+*(i,0)) = f1.Del(p,i)
) & for n being Nat holds (p+*(i,n+1) in dom g iff p+*(i,n) in dom g
& (p+*(i,n))^<*g.(p+*(i,n))*> in dom f2) & (p+*(i,n+1) in dom g implies g.(p+*(
  i,n+1)) = f2.((p+*(i,n))^<*g.(p+*(i,n))*>));
  reconsider f29 = f2 as non empty quasi_total Element of HFuncs(NAT) by A6
,Th17;
  per cases;
  suppose
    f1 is empty;
    hence thesis by A1,Th66;
  end;
  suppose
    f1 is non empty;
    then
A8: dom f1 = (arity f1)-tuples_on NAT by Th21;
A9: g is quasi_total
    proof
      let x, y be FinSequence of NAT such that
A10:  len x = len y and
A11:  x in dom g;
      defpred p[Nat] means y+*(i,$1) in dom g;
A12:  len x = n by A2,A11,CARD_1:def 7;
A13:  now
        let k be Nat such that
A14:    p[k];
A15:    dom f29 = (arity f2)-tuples_on NAT by Th21;
        reconsider kk=k as Element of NAT by ORDINAL1:def 12;
        len ((y+*(i,k))^<*g.(y+*(i,k))*>) = len (y+*(i,k)) + len <*g.(y+*
        (i,k))*> by FINSEQ_1:22
          .= n+len <*g.(y+*(i,k))*> by A10,A12,FUNCT_7:97
          .= n+1 by FINSEQ_1:39;
        then (y+*(i,kk))^<*g.(y+*(i,kk))*> is Element of dom f2 by A6,A15,
FINSEQ_2:92;
        then (y+*(i,k))^<*g.(y+*(i,k))*> in dom f29;
        hence p[k+1] by A7,A10,A12,A14;
      end;
      y is Element of (len y)-tuples_on NAT by FINSEQ_2:92;
      then Del(y,i) in (arity f1)-tuples_on NAT by A3,A4,A5,A10,A12,Th9;
      then
A16:  p[0] by A7,A8,A10,A12;
      for k being Nat holds p[k] from NAT_1:sch 2(A16, A13);
      then
A17:  y+*(i,y/.i) in dom g;
      i in dom y by A3,A4,A10,A12,FINSEQ_3:25;
      then y.i = y/.i by PARTFUN1:def 6;
      hence y in dom g by A17,FUNCT_7:35;
    end;
    consider pp being object such that
A18: pp in n-tuples_on NAT by XBOOLE_0:def 1;
    pp is Element of n-tuples_on NAT by A18;
    then reconsider p = pp as FinSequence of NAT;
A19: len p = n by A18,CARD_1:def 7;
    Del(p,i) in (arity f1)-tuples_on NAT by A3,A4,A5,A18,Th9;
    hence thesis by A7,A19,A8,A9;
  end;
end;
