reserve H for ZF-formula,
  M,E for non empty set,
  e for Element of E,
  m,m0,m3, m4 for Element of M,
  v,v1,v2 for Function of VAR,M,
  f,f1 for Function of VAR,E,
  g for Function,
  u,u1,u2 for set,
  x,y for Variable,
  i,n for Element of NAT,
  X for set;
reserve W for Universe,
  w for Element of W,
  Y for Subclass of W,
  a,a1,b,c for Ordinal of W,
  L for DOMAIN-Sequence of W;

theorem Th5:
  Y is closed_wrt_A1-A7 & Y is epsilon-transitive implies Y is
  predicatively_closed
proof
  assume that
A1: Y is closed_wrt_A1-A7 and
A2: Y is epsilon-transitive;
  let H,E,f such that
A3: E in Y;
  now
    per cases;
    suppose
      not x.0 in Free H;
      then Section(H,f)={} by Def1;
      hence thesis by A1,ZF_FUND1:3;
    end;
    suppose
A4:   x.0 in Free H;
      reconsider a=E as Element of W by A3;
      reconsider n={} as Element of omega by ORDINAL1:def 11;
      set fs=(code Free H)\{n};
A5:   Diagram(H,E) in Y by A1,A3,ZF_FUND1:22;
      then reconsider b=Diagram(H,E) as Element of W;
A6:   b c= Funcs(fs \/ {n},a)
      proof
        let u be object;
        assume u in b;
        then ex f1 st u=(f1*decode)|code Free H & f1 in St(H,E) by
ZF_FUND1:def 5;
        then
A7:     u in Funcs(code Free H,a) by ZF_FUND1:31;
        x".x.0 in code Free H by A4,ZF_FUND1:33;
        then n in code Free H by ZF_FUND1:def 3;
        then {n} c= code Free H by ZFMISC_1:31;
        hence thesis by A7,XBOOLE_1:45;
      end;
      n in {n} by TARSKI:def 1;
      then
A8:   not n in fs by XBOOLE_0:def 5;
A9:   (f*decode)|fs in Funcs(fs,a) by ZF_FUND1:31;
      Funcs(fs,a) in Y by A1,A3,ZF_FUND1:9;
      then reconsider y=(f*decode)|fs as Element of W by A9,ZF_FUND1:1;
      set B={e: {[n,e]} \/ y in b};
      set A={w: w in a & {[n,w]} \/ y in b};
A10:  A=B
      proof
        thus A c= B
        proof
          let u be object;
          assume u in A;
          then ex w st u=w & w in a & {[n,w]} \/ y in b;
          hence thesis;
        end;
        let u be object;
        assume u in B;
        then consider e such that
A11:    u=e and
A12:    {[n,e]} \/ y in b;
        reconsider e as Element of W by A3,ZF_FUND1:1;
        e in A by A12;
        hence thesis by A11;
      end;
      a c= Y by A2,A3;
      then A in Y by A1,A3,A5,A9,A8,A6,ZF_FUND1:16;
      hence thesis by A10,Th4;
    end;
  end;
  hence thesis;
end;
