reserve H,S for ZF-formula,
  x for Variable,
  X,Y for set,
  i for Element of NAT,
  e,u for set;
reserve M,M1,M2 for non empty set,
  f for Function,
  v1 for Function of VAR,M1,
  v2 for Function of VAR,M2,
  F,F1,F2 for Subset of WFF,
  W for Universe,
  a,b,c for Ordinal of W,
  A,B,C for Ordinal,
  L for DOMAIN-Sequence of W,
  va for Function of VAR,L.a,
  phi,xi for Ordinal-Sequence of W;
reserve psi for Ordinal-Sequence;

theorem Th29:
  omega in W & phi is increasing & phi is continuous implies ex a
  st b in a & phi.a = a & a is_cofinal_with omega
proof
  assume that
A1: omega in W and
A2: phi is increasing and
A3: phi is continuous;
A4: omega in On W by A1,ORDINAL1:def 9;
  deffunc D(Ordinal,set) = 0-element_of W;
  deffunc C(Ordinal,Ordinal of W) = succ(phi.$2);
  consider nu be Ordinal-Sequence of W such that
A5: nu.0-element_of W = b and
A6: for a holds nu.succ a = C(a,nu.a) and
  for a st a <> 0-element_of W & a is limit_ordinal holds nu.a = D(a,nu|a)
  from ZF_REFLE:sch 3;
  set xi = nu|omega;
  set a = sup xi;
A7: On W c= W by ORDINAL2:7;
  dom nu = On W by FUNCT_2:def 1;
  then
A8: omega c= dom nu by A4;
  then
A9: dom xi = omega by RELAT_1:62;
  rng xi c= rng nu & rng nu c= On W by RELAT_1:def 19;
  then rng xi c= On W;
  then rng xi c= W by A7;
  then reconsider a as Ordinal of W by A1,A9,Th11,ZF_REFLE:19;
A10: a in dom phi by ORDINAL4:34;
  then
A11: a c= dom phi by ORDINAL1:def 2;
  then
A12: dom (phi|a) = a by RELAT_1:62;
A13: xi is increasing
  proof
    let A,B;
    assume that
A14: A in B and
A15: B in dom xi;
    defpred P[Ordinal] means A+^$1 in dom xi & $1 <> {} implies xi.A in xi.(A
    +^$1);
A16: for B st B <> 0 & B is limit_ordinal & for C st C in B holds P[C]
    holds P[B]
    proof
      let B;
      assume that
A17:  B <> 0 and
A18:  B is limit_ordinal;
      {} in B by A17,ORDINAL3:8;
      then
A19:  omega c= B by A18,ORDINAL1:def 11;
      B c= A+^B by ORDINAL3:24;
      hence thesis by A9,A19,ORDINAL1:5;
    end;
A20: for C st P[C] holds P[succ C]
    proof
      let C such that
A21:  A+^C in dom xi & C <> {} implies xi.A in xi.(A+^C) and
A22:  A+^succ C in dom xi and
      succ C <> {};
A23:  A+^succ C in On W by A4,A9,A22,ORDINAL1:10;
      then reconsider asc = A+^succ C as Ordinal of W by ZF_REFLE:7;
A24:  A+^C in asc by ORDINAL1:6,ORDINAL2:32;
      then A+^C in On W by A23,ORDINAL1:10;
      then reconsider ac = A+^C as Ordinal of W by ZF_REFLE:7;
A25:  now
        nu.ac in dom phi by ORDINAL4:34;
        then
A26:    nu.ac c= phi.(nu.ac) by A2,ORDINAL4:10;
        asc = succ ac by ORDINAL2:28;
        then
A27:    nu.asc = succ (phi.(nu.ac)) by A6;
        assume C = {};
        then
A28:    ac = A by ORDINAL2:27;
        xi.ac = nu.ac & xi.asc = nu.asc by A22,A24,FUNCT_1:47,ORDINAL1:10;
        hence thesis by A28,A27,A26,ORDINAL1:6,12;
      end;
A29:  succ ac = asc & nu.ac in dom phi by ORDINAL2:28,ORDINAL4:34;
      A+^C in dom xi by A22,A24,ORDINAL1:10;
      then
      xi.A in xi.ac & nu.asc = succ (phi.(nu.ac)) & nu.ac = xi.ac & phi.(
nu.ac) in succ(phi.(nu.ac)) & nu.ac c= phi.(nu.ac) or C = {} by A2,A6,A21,A29,
FUNCT_1:47,ORDINAL1:6,ORDINAL4:10;
      then
      xi.A in nu.ac & nu.ac in nu.asc & nu.asc = xi.asc or C = {} by A22,
FUNCT_1:47,ORDINAL1:12;
      then xi.A in nu.ac & nu.ac c= xi.asc or C = {} by ORDINAL1:def 2;
      hence thesis by A25;
    end;
A30: P[0];
A31: P[C] from ORDINAL2:sch 1(A30,A20,A16);
    ex C st B = A+^C & C <> {} by A14,ORDINAL3:28;
    hence thesis by A15,A31;
  end;
  then
A32: a is limit_ordinal by A9,Lm2,ORDINAL4:16;
  take a;
  0-element_of W in dom nu by ORDINAL4:34;
  then
A33: b in rng xi by A5,Lm1,FUNCT_1:50;
  hence b in a by ORDINAL2:19;
A34: a <> {} by A33,ORDINAL2:19;
  a in dom phi by ORDINAL4:34;
  then
A35: phi.a is_limes_of phi|a by A3,A32,A34;
  phi|a is increasing by A2,ORDINAL4:15;
  then sup (phi|a) = lim (phi|a) by A32,A34,A12,ORDINAL4:8;
  then
A36: phi.a = sup rng (phi|a) by A35,ORDINAL2:def 10;
  thus phi.a c= a
  proof
    let A;
    assume A in phi.a;
    then consider B such that
A37: B in rng (phi|a) and
A38: A c= B by A36,ORDINAL2:21;
    consider e being object such that
A39: e in a and
A40: B = (phi|a).e by A12,A37,FUNCT_1:def 3;
    reconsider e as Ordinal by A39;
    consider C such that
A41: C in rng xi and
A42: e c= C by A39,ORDINAL2:21;
A43: e c< C iff e c= C & e <> C;
    consider u being object such that
A44: u in omega and
A45: C = xi.u by A9,A41,FUNCT_1:def 3;
    reconsider u as Ordinal by A44;
    u c= omega by A44,ORDINAL1:def 2;
    then reconsider u as Ordinal of W by A1,CLASSES1:def 1;
A46: succ u in dom nu by ORDINAL4:34;
    C in a by A41,ORDINAL2:19;
    then e = C or e in C & C in dom phi by A11,A42,A43,ORDINAL1:11;
    then
A47: phi.e = phi.C or phi.e in phi.C by A2;
A48: nu.succ u = succ (phi.(nu.u)) by A6;
    succ u in omega by A44,Lm2,ORDINAL1:28;
    then nu.succ u in rng xi by A46,FUNCT_1:50;
    then
A49: nu.succ u in a by ORDINAL2:19;
    C = nu.u by A9,A44,A45,FUNCT_1:47;
    then
A50: phi.e c= phi.(nu.u) by A47,ORDINAL1:def 2;
    phi.e = B by A12,A39,A40,FUNCT_1:47;
    then B in nu.succ u by A48,A50,ORDINAL1:6,12;
    then B in a by A49,ORDINAL1:10;
    hence thesis by A38,ORDINAL1:12;
  end;
  thus a c= phi.a by A2,A10,ORDINAL4:10;
  take xi;
  rng xi c= a
  proof
    let e be object;
    assume
A51: e in rng xi;
    then consider u being object such that
 u in dom xi and
A52: e = xi.u by FUNCT_1:def 3;
    thus thesis by A51,A52,ORDINAL2:19;
  end;
  hence thesis by A8,A13,RELAT_1:62;
end;
