reserve i,j,k,n,m for Nat,
  x,y,z,y1,y2 for object, X,Y,D for set,
  p,q for XFinSequence;

theorem Th2:
  for X0 being finite natural-membered set holds ex n st X0 c= Segm n
proof
  let X0 be finite natural-membered set;
  consider p being Function such that
A1: rng p = X0 and
A2: dom p in NAT by FINSET_1:def 1;
  reconsider np=dom p as Element of NAT by A2;
  np=dom p;
  then reconsider p as XFinSequence by AFINSQ_1:5;
  X0 c= NAT by MEMBERED:6;
  then reconsider p as XFinSequence of NAT by A1,RELAT_1:def 19;
  defpred P[Nat] means ex n st for i st i in Segm $1 & $1-'1 in
  dom p holds p.i in n;
A3: for k st P[k] holds P[k+1]
  proof
    let k;
    assume P[k];
    then consider n such that
A4: for i st i in k & k-'1 in dom p holds p.i in n;
    per cases;
    suppose
A5:   k+1-1 <len p;
      set m=p.(k);
      set m2=max(n,m+1);
      k-'1<=k by NAT_D:35;
      then k-'1 < len p by A5,XXREAL_0:2;
      then
A6:   k-'1 in dom p by AFINSQ_1:86;
      for i st i in Segm(k+1) & k+1-'1 in dom p holds p.i in Segm m2
      proof
        let i;
        assume that
A7:     i in Segm(k+1) and
        k+1-'1 in dom p;
A8:     i<k+1 by A7,NAT_1:44;
        per cases;
        suppose
A9:       i<k;
          set k0=p.i;
          i in Segm k by A9,NAT_1:44;
          then p.i in Segm n by A4,A6;
          then k0<n by NAT_1:44;
          hence thesis by NAT_1:44,XXREAL_0:30;
        end;
        suppose
A10:      i>=k;
          m<m+1 by XREAL_1:29;
          then
A11:      m<m2 by XXREAL_0:30;
          i<=k by A8,NAT_1:13;
          then p.i=m by A10,XXREAL_0:1;
          hence thesis by A11,NAT_1:44;
        end;
      end;
      hence thesis;
    end;
    suppose
A12:  k+1-1>=len p;
      k+1-'1=k by NAT_D:34;
      then
      for i st i in (k+1) & (k+1)-'1 in dom p holds p.i in 2
               by A12,AFINSQ_1:86;
      hence thesis;
    end;
  end;
  for i st i in 0 & 0-'1 in dom p holds p.i in 0;
  then
A13: P[0];
  for k holds P[k] from NAT_1:sch 2(A13,A3);
  then consider n such that
A14: for i st i in Segm len p & len p -'1 in dom p holds p.i in n;
  rng p c= Segm n
  proof
    let y be object;
    assume y in rng p;
    then consider x being object such that
A15: x in dom p and
A16: y=p.x by FUNCT_1:def 3;
A17: len p -1<len p by XREAL_1:44;
    0 < len p by A15;
    then (0 qua Element of NAT )+1 <= len p by NAT_1:13;
    then len p-'1=len p-1 by XREAL_1:233;
    then len p -'1 in dom p by A17,AFINSQ_1:86;
    hence thesis by A14,A15,A16;
  end;
  hence thesis by A1;
end;
