reserve x,y,z for Variable,
  H for ZF-formula,
  E for non empty set,
  a,b,c,X,Y,Z for set,
  u,v,w for Element of E,
  f,g,h,i,j for Function of VAR,E;

theorem Th2:
  E is epsilon-transitive implies (E |= the_axiom_of_pairs iff for
  u,v holds { u,v } in E)
proof
  assume
A1: X in E implies X c= E;
A2: a in u implies a is Element of E
  proof
    assume
A3: a in u;
    u c= E by A1;
    hence thesis by A3;
  end;
A4: E |= All(x1,Ex(x2,All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) )) iff
  E |= Ex(x2,All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) ) by ZF_MODEL:23;
  thus E |= the_axiom_of_pairs implies for u,v holds { u,v } in E
  proof
    set fv = the Function of VAR,E;
    assume
A5: E |= the_axiom_of_pairs;
    let u,v;
    set g = fv+*(x0,u);
    set f = g+*(x1,v);
    E,f |= Ex(x2,All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) ) by A4,A5,
ZF_MODEL:23;
    then consider h such that
A6: for x st h.x <> f.x holds x2 = x and
A7: E,h |= All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) by ZF_MODEL:20;
A8: f.x1 = v by FUNCT_7:128;
A9: g.x0 = u by FUNCT_7:128;
    then
A10: f.x0 = u by FUNCT_7:32;
    for a be object holds a in h.x2 iff a = u or a = v
    proof
      let a be object;
      thus a in h.x2 implies a = u or a = v
      proof
        assume
A11:    a in h.x2;
        then reconsider a9 = a as Element of E by A2;
        set f3 = h+*(x3,a9);
A12:    f3.x3 = a9 by FUNCT_7:128;
        for x st f3.x <> h.x holds x3 = x by FUNCT_7:32;
        then E,f3 |= x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1 by A7,ZF_MODEL:16;
        then
A13:    E,f3 |= x3 'in' x2 iff E,f3 |= x3 '=' x0 'or' x3 '=' x1 by ZF_MODEL:19;
        f3.x2 = h.x2 by FUNCT_7:32;
        then E,f3 |= x3 '=' x0 or E,f3 |= x3 '=' x1 by A11,A12,A13,ZF_MODEL:13
,17;
        then
A14:    f3.x3 = f3.x0 or f3.x3 = f3.x1 by ZF_MODEL:12;
A15:    f3.x1 = h.x1 by FUNCT_7:32;
        f3.x0 = h.x0 & h.x0 = f.x0 by A6,FUNCT_7:32;
        hence thesis by A9,A8,A6,A12,A14,A15,FUNCT_7:32;
      end;
      assume
A16:  a = u or a = v;
      then reconsider a9 = a as Element of E;
      set f3 = h+*(x3,a9);
A17:  f3.x3 = a9 by FUNCT_7:128;
      for x st f3.x <> h.x holds x3 = x by FUNCT_7:32;
      then E,f3 |= x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1 by A7,ZF_MODEL:16;
      then
A18:  E,f3 |= x3 'in' x2 iff E,f3 |= x3 '=' x0 'or' x3 '=' x1 by ZF_MODEL:19;
A19:  f3.x1 = h.x1 & h.x1 = f.x1 by A6,FUNCT_7:32;
      f3.x0 = h.x0 & h.x0 = f.x0 by A6,FUNCT_7:32;
      then E,f3 |= x3 '=' x0 or E,f3 |= x3 '=' x1 by A8,A10,A16,A17,A19,
ZF_MODEL:12;
      then f3.x3 in f3.x2 by A18,ZF_MODEL:13,17;
      hence thesis by A17,FUNCT_7:32;
    end;
    then h.x2 = { u,v } by TARSKI:def 2;
    hence thesis;
  end;
  assume
A20: for u,v holds { u,v } in E;
  let f;
  now
    let g such that
    for x st g.x <> f.x holds x0 = x or x1 = x;
    reconsider w = { g.x0,g.x1 } as Element of E by A20;
    set h = g+*(x2,w);
A21: h.x2 = w by FUNCT_7:128;
    now
      let m be Function of VAR,E;
A22:  h.x0 = g.x0 & h.x1 = g.x1 by FUNCT_7:32;
A23:  E,m |= x3 'in' x2 iff m.x3 in m.x2 by ZF_MODEL:13;
A24:  E,m |= x3 '=' x0 'or' x3 '=' x1 iff E,m |= x3 '=' x0 or E,m |= x3
      '=' x1 by ZF_MODEL:17;
A25:  E,m |= x3 '=' x1 iff m.x3 = m.x1 by ZF_MODEL:12;
A26:  E,m |= x3 '=' x0 iff m.x3 = m.x0 by ZF_MODEL:12;
      assume
A27:  for x st m.x <> h.x holds x3 = x;
      then
A28:  m.x2 = h .x2;
      m.x0 = h.x0 & m.x1 = h.x1 by A27;
      hence E,m |= x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1 by A21,A22,A28,A23
,A26,A25,A24,TARSKI:def 2,ZF_MODEL:19;
    end;
    then
A29: E,h |= All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) by ZF_MODEL:16;
    for x st h.x <> g.x holds x2 = x by FUNCT_7:32;
    hence
    E,g |= Ex(x2,All(x3,x3 'in' x2 <=> x3 '=' x0 'or' x3 '=' x1) ) by A29,
ZF_MODEL:20;
  end;
  hence thesis by ZF_MODEL:21;
end;
