reserve X for set;

theorem Th4:
  for S being non empty Subset-Family of X holds
  meet S = X \ union (X \ S) & union S = X \ meet (X \ S)
proof
  let S be non empty Subset-Family of X;
A1: X \ union (X \ S) c= meet S
  proof
    let x be object;
    assume
A2: x in X \ union (X \ S);
    then
A3: not x in union (X \ S) by XBOOLE_0:def 5;
    for Y being set st Y in S holds x in Y
    proof
      let Y be set;
      assume that
A4:   Y in S and
A5:   not x in Y;
      reconsider Y as Subset of X by A4;
      Y`` in S by A4;
      then
A6:   Y` in X \ S by SETFAM_1:def 7;
      x in Y` by A2,A5,SUBSET_1:29;
      hence contradiction by A3,A6,TARSKI:def 4;
    end;
    hence thesis by SETFAM_1:def 1;
  end;
  meet S c= X \ union (X \ S)
  proof
    let x be object;
    assume
A7: x in meet S;
    not x in union (X \ S)
    proof
      assume x in union (X \ S);
      then consider Z being set such that
A8:   x in Z and
A9:   Z in X \ S by TARSKI:def 4;
      reconsider Z as Subset of X by A9;
      Z` in S & not x in Z` by A8,A9,SETFAM_1:def 7,XBOOLE_0:def 5;
      hence thesis by A7,SETFAM_1:def 1;
    end;
    hence thesis by A7,XBOOLE_0:def 5;
  end;
  hence meet S = X \ union (X \ S) by A1;
  thus union S c= X \ meet (X \ S)
  proof
    let x be object;
    assume x in union S;
    then consider Y being set such that
A10: x in Y and
A11: Y in S by TARSKI:def 4;
    reconsider Y as Subset of X by A11;
    not x in meet (X \ S)
    proof
      Y`` in S by A11;
      then
A12:  Y` in X \ S by SETFAM_1:def 7;
      assume
A13:  x in meet (X \ S);
      not x in Y` by A10,XBOOLE_0:def 5;
      hence thesis by A13,A12,SETFAM_1:def 1;
    end;
    hence thesis by A10,A11,XBOOLE_0:def 5;
  end;
  let x be object;
  assume
A14: x in X \ meet (X \ S);
  then not x in meet (X \ S) by XBOOLE_0:def 5;
  then consider Z being set such that
A15: Z in X \ S and
A16: not x in Z by SETFAM_1:def 1;
  reconsider Z as Subset of X by A15;
A17: Z` in S by A15,SETFAM_1:def 7;
  x in Z` by A14,A16,SUBSET_1:29;
  hence thesis by A17,TARSKI:def 4;
end;
