reserve x, X, Y for set;
reserve L for complete LATTICE,
  a for Element of L;

theorem Th23:
  for L being non empty RelStr holds (for X holds ex_sup_of X,L)
  iff (for Y holds ex_inf_of Y,L)
proof
  let L be non empty RelStr;
  hereby
    assume
A1: for X holds ex_sup_of X,L;
    let Y;
    set X = {x where x is Element of L: x is_<=_than Y};
    ex_sup_of X,L by A1;
    then consider a being Element of L such that
A2: X is_<=_than a and
A3: for b being Element of L st X is_<=_than b holds b >= a and
A4: for c being Element of L st X is_<=_than c & for b being Element
    of L st X is_<=_than b holds b >= c holds c = a by YELLOW_0:def 7;
A5: a is_<=_than Y
    proof
      let b be Element of L;
      assume
A6:   b in Y;
      b is_>=_than X
      proof
        let c be Element of L;
        assume c in X;
        then ex x being Element of L st c = x & x is_<=_than Y;
        hence thesis by A6;
      end;
      hence thesis by A3;
    end;
A7: for c being Element of L st Y is_>=_than c & for b being Element of L
    st Y is_>=_than b holds b <= c holds c = a
    proof
      let c be Element of L such that
A8:   Y is_>=_than c and
A9:   for b being Element of L st Y is_>=_than b holds b <= c;
A10:  for b being Element of L st X is_<=_than b holds b >= c
      proof
        let b be Element of L;
        assume
A11:    X is_<=_than b;
        c in X by A8;
        hence thesis by A11;
      end;
      X is_<=_than c
      proof
        let b be Element of L;
        assume b in X;
        then ex x being Element of L st b = x & x is_<=_than Y;
        hence thesis by A9;
      end;
      hence thesis by A4,A10;
    end;
    for b being Element of L st Y is_>=_than b holds a >= b
    proof
      let b be Element of L;
      assume b is_<=_than Y;
      then b in X;
      hence thesis by A2;
    end;
    hence ex_inf_of Y,L by A5,A7,YELLOW_0:def 8;
  end;
  assume
A12: for Y holds ex_inf_of Y,L;
  let X;
  set Y = {y where y is Element of L: X is_<=_than y};
  ex_inf_of Y,L by A12;
  then consider a being Element of L such that
A13: Y is_>=_than a and
A14: for b being Element of L st Y is_>=_than b holds b <= a and
A15: for c being Element of L st Y is_>=_than c & for b being Element of
  L st Y is_>=_than b holds b <= c holds c = a by YELLOW_0:def 8;
A16: X is_<=_than a
  proof
    let b be Element of L;
    assume
A17: b in X;
    b is_<=_than Y
    proof
      let c be Element of L;
      assume c in Y;
      then ex y being Element of L st c = y & X is_<=_than y;
      hence thesis by A17;
    end;
    hence thesis by A14;
  end;
A18: for c being Element of L st X is_<=_than c & for b being Element of L
  st X is_<=_than b holds b >= c holds c = a
  proof
    let c be Element of L such that
A19: X is_<=_than c and
A20: for b being Element of L st X is_<=_than b holds b >= c;
A21: for b being Element of L st Y is_>=_than b holds b <= c
    proof
      let b be Element of L;
      assume
A22:  Y is_>=_than b;
      c in Y by A19;
      hence thesis by A22;
    end;
    Y is_>=_than c
    proof
      let b be Element of L;
      assume b in Y;
      then ex x being Element of L st b = x & x is_>=_than X;
      hence thesis by A20;
    end;
    hence thesis by A15,A21;
  end;
  for b being Element of L st X is_<=_than b holds a <= b
  proof
    let b be Element of L;
    assume X is_<=_than b;
    then b in Y;
    hence thesis by A13;
  end;
  hence thesis by A16,A18,YELLOW_0:def 7;
end;
