reserve X,Y,x,y for set;
reserve A for non empty Poset;
reserve a,a1,a2,a3,b,c for Element of A;
reserve S,T for Subset of A;

theorem
  S c= T & the InternalRel of A well_orders T & (for a1,a2 st a2 in S &
  a1 < a2 holds a1 in S) implies S = T or S is Initial_Segm of T
proof
  assume that
A1: S c= T and
A2: the InternalRel of A well_orders T and
A3: for a1,a2 st a2 in S & a1 < a2 holds a1 in S and
A4: S <> T;
  per cases;
  case
    T <> {};
    set Y = T \ S;
    not T c= S by A1,A4;
    then Y <> {} by XBOOLE_1:37;
    then consider x being object such that
A5: x in Y and
A6: for y being object st y in Y holds [x,y] in the InternalRel of A
by A2,WELLORD1:5
,XBOOLE_1:36;
    reconsider x as Element of A by A5;
    take x;
    thus
A7: x in T by A5,XBOOLE_0:def 5;
    S = LowerCone{x} /\ T
    proof
      thus S c= LowerCone{x} /\ T
      proof
        let y be object;
        assume
A8:     y in S;
        then reconsider a = y as Element of A;
        now
          let a1;
          assume that
A9:       a1 in {x} and
A10:      not a < a1;
A11:      a1 = x by A9,TARSKI:def 1;
          then
A12:      a1 <> a by A5,A8,XBOOLE_0:def 5;
          T is Chain of A by A2,Th13;
          then a1 <= a by A1,A7,A8,A10,A11,Th12;
          then a1 < a by A12;
          then a1 in S by A3,A8;
          hence contradiction by A5,A11,XBOOLE_0:def 5;
        end;
        then y in {a1 : for a2 st a2 in {x} holds a1 < a2};
        hence thesis by A1,A8,XBOOLE_0:def 4;
      end;
      let y be object;
      assume
A13:  y in LowerCone{x} /\ T;
      then y in LowerCone{x} by XBOOLE_0:def 4;
      then consider a such that
A14:  a = y and
A15:  for a2 st a2 in {x} holds a < a2;
A16:  now
        assume y in Y;
        then [x,y] in the InternalRel of A by A6;
        then
A17:    x <= a by A14;
        x in {x} by TARSKI:def 1;
        hence contradiction by A15,A17,Th6;
      end;
      y in T by A13,XBOOLE_0:def 4;
      hence thesis by A16,XBOOLE_0:def 5;
    end;
    hence thesis;
  end;
  case
    T = {};
    hence thesis by A1;
  end;
end;
