
theorem Th20: :: THEOREM 4.19 (i)
  for L be non empty Poset for p be Element of L holds p is
completely-irreducible iff ex q be Element of L st p < q & (for s be Element of
  L st p < s holds q <= s) & uparrow p = {p} \/ uparrow q
proof
  let L be non empty Poset;
  let p be Element of L;
  thus p is completely-irreducible implies ex q be Element of L st p < q & (
  for s be Element of L st p < s holds q <= s) & uparrow p = {p} \/ uparrow q
  proof
    assume
A1: p is completely-irreducible;
    then ex_min_of (uparrow p)\{p},L;
    then
A2: ex_inf_of (uparrow p)\{p},L by WAYBEL_1:def 4;
    take q = "/\" ((uparrow p)\{p},L);
    now
      let s be Element of L;
      assume s in (uparrow p)\{p};
      then s in uparrow p by XBOOLE_0:def 5;
      hence p <= s by WAYBEL_0:18;
    end;
    then p is_<=_than (uparrow p)\{p} by LATTICE3:def 8;
    then
A3: p <= q by A2,YELLOW_0:def 10;
A4: {p} \/ uparrow q c= uparrow p
    proof
      let x be object;
      assume
A5:   x in {p} \/ uparrow q;
      now
        per cases by A5,XBOOLE_0:def 3;
        suppose
A6:       x in {p};
A7:       p <= p;
          x = p by A6,TARSKI:def 1;
          hence thesis by A7,WAYBEL_0:18;
        end;
        suppose
A8:       x in uparrow q;
          then reconsider x1 = x as Element of L;
          q <= x1 by A8,WAYBEL_0:18;
          then p <= x1 by A3,ORDERS_2:3;
          hence thesis by WAYBEL_0:18;
        end;
      end;
      hence thesis;
    end;
    "/\"((uparrow p)\{p},L) <> p by A1,Th19;
    hence p < q by A3,ORDERS_2:def 6;
A9: q is_<=_than (uparrow p)\{p} by A2,YELLOW_0:def 10;
    thus for s be Element of L st p < s holds q <= s
    proof
      let s be Element of L;
      assume
A10:  p < s;
      then p <= s by ORDERS_2:def 6;
      then
A11:  s in uparrow p by WAYBEL_0:18;
      not s in {p} by A10,TARSKI:def 1;
      then s in (uparrow p)\{p} by A11,XBOOLE_0:def 5;
      hence thesis by A9,LATTICE3:def 8;
    end;
    uparrow p c= {p} \/ uparrow q
    proof
      let x be object;
      assume
A12:  x in uparrow p;
      then reconsider x1 = x as Element of L;
      p = x1 or x1 in uparrow p & not x1 in {p} by A12,TARSKI:def 1;
      then p = x1 or x1 in (uparrow p)\{p} by XBOOLE_0:def 5;
      then p = x1 or "/\" ((uparrow p)\{p},L) <= x1 by A9,LATTICE3:def 8;
      then x in {p} or x in uparrow q by TARSKI:def 1,WAYBEL_0:18;
      hence thesis by XBOOLE_0:def 3;
    end;
    hence uparrow p = {p} \/ uparrow q by A4;
  end;
  thus (ex q be Element of L st p < q & (for s be Element of L st p < s holds
  q <= s) & uparrow p = {p} \/ uparrow q) implies p is completely-irreducible
  proof
    given q be Element of L such that
A13: p < q and
A14: for s be Element of L st p < s holds q <= s and
A15: uparrow p = {p} \/ uparrow q;
A16: not q in {p} by A13,TARSKI:def 1;
    ex q be Element of L st (uparrow p)\{p} is_>=_than q & for b be
    Element of L st (uparrow p)\{p} is_>=_than b holds q >= b
    proof
      take q;
      now
        let a be Element of L;
        assume
A17:    a in (uparrow p)\{p};
        then not a in {p} by XBOOLE_0:def 5;
        then
A18:    a <> p by TARSKI:def 1;
        a in uparrow p by A17,XBOOLE_0:def 5;
        then p <= a by WAYBEL_0:18;
        then p < a by A18,ORDERS_2:def 6;
        hence q <= a by A14;
      end;
      hence (uparrow p)\{p} is_>=_than q by LATTICE3:def 8;
      let b be Element of L;
      assume
A19:  (uparrow p)\{p} is_>=_than b;
      q <= q;
      then q in uparrow q by WAYBEL_0:18;
      then
A20:  q in {p} \/ uparrow q by XBOOLE_0:def 3;
      not q in {p} by A13,TARSKI:def 1;
      then q in (uparrow p)\{p} by A15,A20,XBOOLE_0:def 5;
      hence thesis by A19,LATTICE3:def 8;
    end;
    then
A21: ex_inf_of (uparrow p)\{p},L by YELLOW_0:16;
A22: now
      let b be Element of L;
      assume
A23:  b is_<=_than (uparrow p)\{p};
      p <= q by A13,ORDERS_2:def 6;
      then
A24:  q in uparrow p by WAYBEL_0:18;
      not q in {p} by A13,TARSKI:def 1;
      then q in (uparrow p)\{p} by A24,XBOOLE_0:def 5;
      hence q >= b by A23,LATTICE3:def 8;
    end;
    p <= q by A13,ORDERS_2:def 6;
    then
A25: q in uparrow p by WAYBEL_0:18;
    now
      let c be Element of L;
      assume c in (uparrow p)\{p};
      then c in uparrow p & not c in {p} by XBOOLE_0:def 5;
      then c in uparrow q by A15,XBOOLE_0:def 3;
      hence q <= c by WAYBEL_0:18;
    end;
    then q is_<=_than (uparrow p)\{p} by LATTICE3:def 8;
    then q = "/\"((uparrow p)\{p},L) by A22,YELLOW_0:31;
    then "/\"((uparrow p)\{p},L) in (uparrow p)\{p} by A25,A16,XBOOLE_0:def 5;
    then ex_min_of (uparrow p)\{p},L by A21,WAYBEL_1:def 4;
    hence thesis;
  end;
end;
