reserve X,Y,Z for set,
  x,y,z for object,
  E for non empty set,
  A,B,C for Ordinal ,
  L,L1 for Sequence,
  f,f1,f2,h for Function,
  d,d1,d2,d9 for Element of E;

theorem Th5:
  ex A st d in Collapse (E,A)
proof
  defpred P[object] means not ex A st $1 in Collapse (E,A);
  defpred R[object,object] means
    ex A st $2 = A & $1 in Collapse(E,A) & for B st $1
  in Collapse(E,B) holds A c= B;
  consider X such that
A1: for x being object holds x in X iff x in E & P[x] from XBOOLE_0:sch 1;
 now
    given x such that
A2: x in X;
    consider m being set such that
A3: m in X and
A4: X misses m by A2,XREGULAR:1;
    reconsider m as Element of E by A1,A3;
A5: now
      let x be object;
      defpred Q[Ordinal] means x in Collapse(E,$1);
      assume
A6:   x in m /\ E;
      then x in m by XBOOLE_0:def 4;
      then
A7:   not x in X by A4,XBOOLE_0:3;
      x in E by A6,XBOOLE_0:def 4;
      then
A8:   ex A st Q[A] by A1,A7;
      ex A st Q[A] & for B st Q[B] holds A c= B from ORDINAL1:sch 1(A8 );
      hence ex y being object st R[x,y];
    end;
    consider f such that
A9: dom f = m /\ E & for x being object st x in m /\ E holds R[x,f.x] from
    CLASSES1:sch 1(A5);
    y in rng f implies y is Ordinal
    proof
      assume y in rng f;
      then consider x being object such that
A10:  x in dom f and
A11:  y = f.x by FUNCT_1:def 3;
      ex A st f.x = A & x in Collapse (E,A) & for B st x in Collapse (E,B
      ) holds A c= B by A9,A10;
      hence thesis by A11;
    end;
    then consider A such that
A12: rng f c= A by ORDINAL1:24;
  for d st d in m ex B st B in A & d in Collapse (E,B)
    proof
      let d;
      assume d in m;
      then
A13:  d in m /\ E by XBOOLE_0:def 4;
      then consider B such that
A14:  f.d = B and
A15:  d in Collapse (E,B) and
      for C st d in Collapse (E,C) holds B c= C by A9;
      take B;
      B in rng f by A9,A13,A14,FUNCT_1:def 3;
      hence thesis by A12,A15;
    end;
    then m in { d9 : for d st d in d9 ex B st B in A & d in Collapse (E,B) };
    then m in Collapse (E,A) by Th1;
    hence contradiction by A1,A3;
  end;
  hence thesis by A1;
end;
