reserve L for Lattice,
  p,q,r for Element of L,
  p9,q9,r9 for Element of L.:,
  x, y for set;
reserve I,J for Ideal of L,
  F for Filter of L;
reserve D for non empty Subset of L,
  D9 for non empty Subset of L.:;
reserve D1,D2 for non empty Subset of L,
  D19,D29 for non empty Subset of L.:;
reserve B for B_Lattice,
  IB,JB for Ideal of B,
  a,b for Element of B;
reserve a9 for Element of (B qua Lattice).:;

theorem
  IB is max-ideal iff IB <> the carrier of B & for a holds a in IB or a` in
IB
proof
  reconsider FB = IB.: as Filter of B.:;
A1: FB is being_ultrafilter iff FB <> carr(B.:) & for a being Element of B.:
  holds a in FB or a` in FB by FILTER_0:44;
  thus IB is max-ideal implies IB <> carr(B) & for a holds a in IB or a` in
IB
  proof
    assume
A2: IB is max-ideal;
    hence IB <> carr(B);
    let a;
    reconsider b = a as Element of B.:;
    b in FB or b` in FB & a.:` = a` by A1,A2,Th32,Th54;
    hence thesis;
  end;
  assume that
A3: IB <> carr(B) and
A4: for a holds a in IB or a` in IB;
  now
    let a be Element of B.:;
    reconsider b = a as Element of B;
    b in FB or b` in FB & ( .:(a qua Element of (B qua Lattice).:))` = a`
    by A4,Th54;
    hence a in FB or a` in FB;
  end;
  hence thesis by A1,A3,Th32;
end;
