reserve x,y,z,x1,x2,x3,x4,y1,y2,s for Variable,
  M for non empty set,
  a,b for set,
  i,j,k for Element of NAT,
  m,m1,m2,m3,m4 for Element of M,
  H,H1,H2 for ZF-formula,
  v,v9,v1,v2 for Function of VAR,M;

theorem Th3:
  (ex i st for j st x.j in variables_in H holds j < i) &
  ex x st not x in variables_in H
proof
  defpred P[ZF-formula] means ex i st for j st x.j in variables_in $1 holds j
  < i;
A1: for x,y holds P[x '=' y] & P[x 'in' y]
  proof
    let x,y;
    consider i such that
A2: x = x.i by ZF_LANG1:77;
    consider j such that
A3: y = x.j by ZF_LANG1:77;
    j <= j+i by NAT_1:11;
    then
A4: j < i+j+1 by NAT_1:13;
    i <= i+j by NAT_1:11;
    then
A5: i < i+j+1 by NAT_1:13;
A6: variables_in (x '=' y) = {x,y} by ZF_LANG1:138;
    thus P[x '=' y]
    proof
      take i+j+1;
      let k be Element of NAT;
      assume x.k in variables_in (x '=' y);
      then x.k = x.i or x.k = x.j by A2,A3,A6,TARSKI:def 2;
      hence thesis by A5,A4,ZF_LANG1:76;
    end;
    take i+j+1;
    let k be Element of NAT;
A7: variables_in (x 'in' y) = {x,y} by ZF_LANG1:139;
    assume x.k in variables_in (x 'in' y);
    then x.k = x.i or x.k = x.j by A2,A3,A7,TARSKI:def 2;
    hence thesis by A5,A4,ZF_LANG1:76;
  end;
A8: for H1,H2 st P[H1] & P[H2] holds P[H1 '&' H2]
  proof
    let H1,H2;
    given i1 being Element of NAT such that
A9: for j st x.j in variables_in H1 holds j < i1;
    given i2 being Element of NAT such that
A10: for j st x.j in variables_in H2 holds j < i2;
    i1 <= i2 or i1 > i2;
    then consider i such that
A11: i1 <= i2 & i = i2 or i1 > i2 & i = i1;
    take i;
    let j;
    assume x.j in variables_in (H1 '&' H2);
    then x.j in variables_in H1 \/ variables_in H2 by ZF_LANG1:141;
    then x.j in variables_in H1 or x.j in variables_in H2 by XBOOLE_0:def 3;
    then j < i1 or j < i2 by A9,A10;
    hence thesis by A11,XXREAL_0:2;
  end;
A12: for H,x st P[H] holds P[All(x,H)]
  proof
    let H,x;
    given i1 being Element of NAT such that
A13: for j st x.j in variables_in H holds j < i1;
    consider i2 be Element of NAT such that
A14: x = x.i2 by ZF_LANG1:77;
    i1 <= i2+1 or i1 > i2+1;
    then consider i such that
A15: i1 <= i2+1 & i = i2+1 or i1 > i2+1 & i = i1;
    take i;
    let j;
    assume x.j in variables_in All(x,H);
    then x.j in variables_in H \/ {x} by ZF_LANG1:142;
    then x.j in variables_in H or x.j in {x} & i2+0 = i2 & 0 < 1 by
XBOOLE_0:def 3;
    then j < i1 or x.j = x.i2 & i2 < i2+1 by A13,A14,TARSKI:def 1,XREAL_1:6;
    then j < i1 or j < i2+1 by ZF_LANG1:76;
    hence thesis by A15,XXREAL_0:2;
  end;
A16: for H st P[H] holds P['not' H]
  proof
    let H;
    variables_in 'not' H = variables_in H by ZF_LANG1:140;
    hence thesis;
  end;
  for H holds P[H] from ZF_LANG1:sch 1(A1,A16,A8,A12);
  then consider i such that
A17: for j st x.j in variables_in H holds j < i;
  thus ex i st for j st x.j in variables_in H holds j < i by A17;
  take x.i;
  thus thesis by A17;
end;
