reserve A,B,C,O for Ordinal,
        X for set,
        o for object,
        x,y,z,t,r,l for Surreal;

theorem Th12:
  for S be non empty surreal-membered set st S is finite
     ex Min,Max be Surreal st Min in S & Max in S &
       for x st x in S holds Min <= x <= Max
proof
  defpred P[Nat] means
  for S be non empty surreal-membered set st $1=card S
    ex Min,Max be Surreal st Min in S & Max in S &
  for x st x in S holds Min <= x <= Max;
  A1: P[0];
  A2: for n be Nat holds P[n] implies P[n+1]
  proof
    let n be Nat;
    assume A3:P[n];
    let S be non empty surreal-membered set such that A4:n+1=card S;
    consider s be object such that
    A5: s in S by XBOOLE_0:def 1;
    reconsider s as Surreal by SURREAL0:def 16,A5;
    set Ss=S\{s};
    per cases;
    suppose A6:Ss is empty;
      take s,s;
      thus s in S & s in S by A5;
      let x be Surreal;assume x in S;
      hence thesis by A6,ZFMISC_1:56;
    end;
    suppose A7:Ss is non empty;
      card Ss =n by A4,A5,STIRL2_1:55;
      then consider Min,Max be Surreal such that
      A8:Min in Ss & Max in Ss &
      for x st x in Ss holds Min <= x <= Max by A3,A7;
      A9: Min <= Max by A8;
      per cases;
      suppose A10:Max < s;
        take Min,s;
        thus Min in S & s in S by A5,A8;
        let x;
        assume x in S;
        then per cases by ZFMISC_1:56;
        suppose x in Ss;
          then Min <= x <= Max by A8;
          hence thesis by A10,Th4;
        end;
        suppose x=s;
          hence thesis by A9,A10,Th4;
        end;
      end;
      suppose A11:s < Min;
        take s,Max;
        thus s in S & Max in S by A5,A8;
        let x;
        assume x in S;
        then per cases by ZFMISC_1:56;
        suppose x in Ss;
          then Min <= x <= Max by A8;
          hence thesis by A11,Th4;
        end;
        suppose x=s;
          hence thesis by A9,A11,Th4;
        end;
      end;
      suppose A12:Min <= s <= Max;
        take Min,Max;
        thus Min in S & Max in S by A8;
        let x;assume x in S;
        then x in Ss or x =s by ZFMISC_1:56;
        hence thesis by A8,A12;
      end;
    end;
  end;
  A13:for n be Nat holds P[n] from NAT_1:sch 2(A1,A2);
  let S be non empty surreal-membered set;
  assume S is finite;
  then card S is Nat;
  hence thesis by A13;
end;
