reserve A, B, X, Y, Z, x, y for set;
reserve f for Function;
reserve O for Ordinal;

theorem Th6:
  A is finite implies for X being Subset-Family of A st X <> {}
  ex x being set st x in X &
    for B being set st B in X holds x c= B implies B = x
proof
  assume
A1: A is finite;
  let X be Subset-Family of A such that
A2: X <> {};
  consider p be Function such that
A3: rng p = A and
A4: dom p in omega by A1;
  defpred P[set] means p.:$1 in X;
  consider G being set such that
A5: for x holds x in G iff x in bool dom p & P[x] from XFAMILY:sch 1;
  G c= bool dom p
  by A5;
  then reconsider GX=G as Subset-Family of dom p;
  set x = the Element of X;
  x is Subset of A by A2,TARSKI:def 3;
  then
A6: p.:(p"x) = x by A3,FUNCT_1:77;
  p"x c= dom p by RELAT_1:132;
  then
A7: GX <> {} by A2,A5,A6;
  defpred P[set] means
  $1 in omega implies for X being Subset-Family of $1 st X <> {}
  ex x being set st
  x in X & for B being set st B in X holds x c= B implies B = x;
A8: P[0]
  proof
    assume 0 in omega;
    let X be Subset-Family of 0;
    assume X <> {};
    then
A9: X = {{}} by ZFMISC_1:1,33;
    take {};
    thus thesis by A9,TARSKI:def 1;
  end;
A10: P[O] implies P[succ O]
  proof
    assume
A11: O in omega implies for X being Subset-Family of O st X <> {}
    ex x being set st
    x in X & for B being set st B in X holds x c= B implies B = x;
    thus succ O in omega implies
    for X being Subset-Family of succ O st X <> {} ex x being set st
    x in X & for B being set st B in X holds x c= B implies B = x
    proof
      assume succ O in omega;
      then
A12:  succ O c= omega by ORDINAL1:def 2;
      let X be Subset-Family of succ O such that
A13:  X <> {};
      defpred P[set] means ex A st A in X & $1 = A \ {O};
      consider X1 being set such that
A14:  for x holds x in X1 iff x in bool O & P[x] from XFAMILY:sch 1;
      X1 c= bool O
      by A14;
      then reconsider X2=X1 as Subset-Family of O;
      set y = the Element of X;
      y is Subset of succ O by A13,TARSKI:def 3;
      then y \ {O} c= (O \/ {O}) \ {O} by XBOOLE_1:33;
      then
A15:  y \ {O} c= O \ {O} by XBOOLE_1:40;
A16:  O in succ O by ORDINAL1:6;
A17:  not O in O;
      then y \ {O} c= O by A15,ZFMISC_1:57;
      then X2 <> {} by A13,A14;
      then consider Z such that
A18:  Z in X2 and
A19:  for B being set st B in X2 holds Z c= B implies B = Z by A11,A12,A16;
      consider X1 being set such that
A20:  X1 in X and
A21:  Z=X1 \ {O} by A14,A18;
A22:  O in {O} by TARSKI:def 1;
      then
A23:  not O in Z by A21,XBOOLE_0:def 5;
A24:  now
        assume
A25:    Z \/ {O} in X;
        take A=Z \/ {O};
        for B being set st B in X holds A c= B implies B = A
        proof
          let B such that
A26:      B in X;
          assume
A27:      A c= B;
A28:      now
            assume
A29:        O in B;
            set Y = B \ {O};
            {O} c= B by A29,ZFMISC_1:31;
            then
A30:        B = Y \/ {O} by XBOOLE_1:45;
            A \ {O} c= Y by A27,XBOOLE_1:33;
            then
A31:        Z \ {O} c= Y by XBOOLE_1:40;
            not O in Z by A21,A22,XBOOLE_0:def 5;
            then
A32:        Z c= Y by A31,ZFMISC_1:57;
            Y c= (O \/ {O}) \ {O} by A26,XBOOLE_1:33;
            then Y c= O \ {O} by XBOOLE_1:40;
            then Y c= O by A17,ZFMISC_1:57;
            then Y in X2 by A14,A26;
            hence thesis by A19,A30,A32;
          end;
          now
            assume
A33:        not O in B;
            O in {O} by TARSKI:def 1;
            then O in A by XBOOLE_0:def 3;
            hence contradiction by A27,A33;
          end;
          hence thesis by A28;
        end;
        hence thesis by A25;
      end;
      now
        assume
A34:    not Z \/ {O} in X;
        take A=Z;
        now
          assume O in X1;
          then X1 = X1 \/ {O} by ZFMISC_1:40
            .= Z \/ {O} by A21,XBOOLE_1:39;
          hence contradiction by A20,A34;
        end;
        then
A35:    A in X by A20,A21,ZFMISC_1:57;
        for B being set st B in X holds A c= B implies B = A
        proof
          let B;
          assume
A36:      B in X;
          then B \ {O} c= (O \/ {O}) \ {O} by XBOOLE_1:33;
          then B \ {O} c= O \ {O} by XBOOLE_1:40;
          then B \ {O} c= O by A17,ZFMISC_1:57;
          then
A37:      B \ {O} in X2 by A14,A36;
          assume
A38:      A c= B;
          then A \ {O} c= B \ {O} by XBOOLE_1:33;
          then
A39:      A c= B \ {O} by A23,ZFMISC_1:57;
A40:      now
            assume
A41:        O in B;
            A \/ {O} = (B \ {O}) \/ {O} by A19,A37,A39
              .= B \/ {O} by XBOOLE_1:39
              .= B by A41,ZFMISC_1:40;
            hence contradiction by A34,A36;
          end;
A42:      B c= O
          proof
            let x be object such that
A43:        x in B;
            x in O or x in {O} by A36,A43,XBOOLE_0:def 3;
            hence thesis by A40,A43,TARSKI:def 1;
          end;
          B \ {O} = B by A40,ZFMISC_1:57;
          then B in X2 by A14,A36,A42;
          hence thesis by A19,A38;
        end;
        hence thesis by A35;
      end;
      hence thesis by A24;
    end;
  end;
A44: O <> 0 & O is limit_ordinal & (for B being Ordinal st B in O holds P[B])
  implies P[O]
  proof
    assume that
A45: O <> 0 and
A46: O is limit_ordinal and for B being Ordinal st B in O holds P[B] and
A47: O in omega;
    {} in O by A45,ORDINAL1:14;
    then omega c= O by A46,ORDINAL1:def 11;
    then O in O by A47;
    hence thesis;
  end;
  P[O] from ORDINAL2:sch 1(A8,A10,A44);
  then consider g being set such that
A48: g in GX and
A49: for B being set st B in GX holds g c= B implies B=g by A4,A7;
  take p.:g;
  for B st B in X holds p.:g c= B implies B = p.:g
  proof
    let B;
    assume
A50: B in X;
    assume p.:g c= B;
    then
A51: p"(p.:g) c= p"B by RELAT_1:143;
A52: g c= p"(p.:g) by A48,FUNCT_1:76;
A53: p.:(p"B) = B by A3,A50,FUNCT_1:77;
    p"B c= dom p by RELAT_1:132;
    then p"B in GX by A5,A50,A53;
    hence thesis by A49,A51,A52,A53,XBOOLE_1:1;
  end;
  hence thesis by A5,A48;
end;
