
theorem :: Ex8:
  for X being finite set, F being Dependency-set of X, K being Subset of
  X st F = { [A, B] where A, B is Subset of X : K c= A or B c= A } holds
  candidate-keys F = {K}
proof
  let X be finite set, F be Dependency-set of X, K be Subset of X;
  assume F = { [A, B] where A, B is Subset of X : K c= A or B c= A };
  then
A1: Maximal_wrt F = {[K, X]}\/{[A, A] where A is Subset of X : not K c= A}
  by Th30;
  now
    let x be object;
    hereby
      assume x in candidate-keys F;
      then consider a being Subset of X such that
A2:   x = a and
A3:   [a,X] in Maximal_wrt F;
      per cases by A1,A3,XBOOLE_0:def 3;
      suppose
        [a,X] in {[K, X]};
        then [a,X] = [K,X] by TARSKI:def 1;
        then a = K by XTUPLE_0:1;
        hence x in {K} by A2,TARSKI:def 1;
      end;
      suppose
        [a,X] in {[A, A] where A is Subset of X : not K c= A};
        then consider A being Subset of X such that
A4:     [a,X] = [A,A] and
A5:     not K c= A;
        X = A by A4,XTUPLE_0:1;
        hence x in {K} by A5;
      end;
    end;
    assume x in {K};
    then
A6: x = K by TARSKI:def 1;
    [K,X] in {[K,X]} by TARSKI:def 1;
    then [K,X] in Maximal_wrt F by A1,XBOOLE_0:def 3;
    hence x in candidate-keys F by A6;
  end;
  hence thesis by TARSKI:2;
end;
