reserve a for set;
reserve L for lower-bounded sup-Semilattice;
reserve x for Element of L;
reserve L for complete LATTICE;
reserve AR for Relation of L;
reserve x, y, z for Element of L;

theorem
  for L being RelStr, X being set, x being Element of L holds
  x is_maximal_in X iff x in X & not ex y being Element of L st y in X & x < y
proof
  let L be RelStr, X be set, x be Element of L;
  hereby
    assume x is_maximal_in X;
    then
A1: x is_maximal_wrt X, the InternalRel of L;
    hence x in X;
    let y be Element of L;
    per cases by A1;
    suppose not y in X;
      hence not y in X or not x < y;
    end;
    suppose y = x;
      hence not y in X or not x < y;
    end;
    suppose not [x,y] in the InternalRel of L;
      then not x <= y by ORDERS_2:def 5;
      hence not y in X or not x < y by ORDERS_2:def 6;
    end;
  end;
  assume that
A2: x in X and
A3: not ex y be Element of L st y in X & x < y;
  assume not x is_maximal_in X;
  then not x is_maximal_wrt X, the InternalRel of L;
  then consider y be set such that
A4: y in X and
A5: y <> x and
A6: [x,y] in the InternalRel of L by A2;
  reconsider y as Element of L by A6,ZFMISC_1:87;
  x <= y by A6,ORDERS_2:def 5;
  then x < y by A5,ORDERS_2:def 6;
  hence thesis by A3,A4;
end;
