reserve x,y,Y,Z for set,
  L for LATTICE,
  l for Element of L;

theorem Th22:
  for L being Semilattice, l being Element of L holds l is prime
  iff for A being finite non empty Subset of L st l >= inf A ex a being Element
  of L st a in A & l >= a
proof
  let L be Semilattice, l be Element of L;
  thus l is prime implies for A being finite non empty Subset of L st l >= inf
  A ex a being Element of L st a in A & l >= a
  proof
    defpred P[set] means $1 is non empty & l >= "/\"($1,L) implies (ex k being
    Element of L st k in $1 & l >= k);
    assume
A1: for x,y being Element of L st l >= x"/\"y holds l >= x or l >= y;
    let A be finite non empty Subset of L;
A2: now
      let x,B be set such that
A3:   x in A and
A4:   B c= A and
A5:   P[B];
      thus P[B \/ {x}]
      proof
        reconsider a = x as Element of L by A3;
        reconsider C = B as finite Subset of L by A4,XBOOLE_1:1;
        assume that
        B \/ {x} is non empty and
A6:     l >= "/\"(B \/ {x},L);
        per cases;
        suppose
          B = {};
          then "/\"(B \/ {a},L) = a & a in B \/ {a} by TARSKI:def 1,YELLOW_0:39
;
          hence thesis by A6;
        end;
        suppose
A7:       B <> {};
A8:       inf {a} = a by YELLOW_0:39;
A9:       ex_inf_of {a}, L by YELLOW_0:55;
          ex_inf_of C, L by A7,YELLOW_0:55;
          then
A10:      "/\"(B \/ {x},L) = (inf C)"/\"inf {a} by A9,YELLOW_2:4;
          hereby
            per cases by A1,A6,A10,A8;
            suppose
              inf C <= l;
              then consider b being Element of L such that
A11:          b in B and
A12:          b <= l by A5,A7;
              b in B \/ {x} by A11,XBOOLE_0:def 3;
              hence thesis by A12;
            end;
            suppose
A13:          a <= l;
              a in {a} by TARSKI:def 1;
              then a in B \/ {x} by XBOOLE_0:def 3;
              hence thesis by A13;
            end;
          end;
        end;
      end;
    end;
A14: P[{}];
A15: A is finite;
    P[A] from FINSET_1:sch 2(A15,A14,A2);
    hence thesis;
  end;
  assume
A16: for A being finite non empty Subset of L st l >= inf A ex a being
  Element of L st a in A & l >= a;
  let a,b be Element of L;
  set A = {a,b};
A17: inf A = a"/\"b by YELLOW_0:40;
  assume a "/\" b <= l;
  then ex k being Element of L st k in A & l >= k by A16,A17;
  hence thesis by TARSKI:def 2;
end;
