reserve i for Nat,
  j for Element of NAT,
  X,Y,x,y,z for set;

theorem Th22:
  for X being finite Subset of Rank omega holds X in Rank omega
proof
  let X be finite Subset of Rank omega;
  deffunc F(object) = the_rank_of $1;
  consider f being Function such that
A1: dom f = X and
A2: for x being object st x in X holds f.x = F(x) from FUNCT_1:sch 3;
A3: rng f c= NAT
  proof
    let y be object;
    assume y in rng f;
    then consider x being object such that
A4: x in X and
A5: y = f.x by A1,FUNCT_1:def 3;
    the_rank_of x in omega by A4,CLASSES1:66;
    hence thesis by A2,A4,A5;
  end;
  per cases;
  suppose X = {};
    then the_rank_of X = 0 by CLASSES1:71;
    hence thesis by CLASSES1:66;
  end;
  suppose X <> {};
    then reconsider Y = rng f as finite non empty Subset of NAT
    by A1,A3,FINSET_1:8,RELAT_1:42;
    reconsider mY = max Y as Element of NAT by ORDINAL1:def 12;
    set i = 1+mY;
    X c= Rank i
    proof
      let x be object;
      reconsider xx=x as set by TARSKI:1;
      assume
A6:   x in X;
      then
A7:   f.x in Y by A1,FUNCT_1:def 3;
A8:   f.x = the_rank_of xx by A2,A6;
      reconsider j = f.x as Element of NAT by A7;
      j <= mY by A7,XXREAL_2:def 8;
      then Segm j c= Segm mY by NAT_1:39;
      then
A9:   j in succ mY by ORDINAL1:22;
      succ Segm mY = Segm i by NAT_1:38;
      hence thesis by A8,A9,CLASSES1:66;
    end;
    then the_rank_of X c= i by CLASSES1:65;
    then
A10: the_rank_of X in succ i by ORDINAL1:22;
    Segm(i+1) = succ Segm i by NAT_1:38;
    hence thesis by A10,CLASSES1:66;
  end;
end;
