------------------------------------------------------------------------------ Mohamed G. Gouda CS 311 Summer 2014 Homework 3 ------------------------------------------------------------------------------ 1. (4 points) Use direct inference to prove the predicate (A sub AvB) where A and B are sets, "sub" denotes "subset", and "v" denotes the set union operator. (Hint: The first predicate in the proof is (x in A) and the last predicate in the proof is (x in AvB).) ------------------------------------------------------------------------------- 2. (2 points) Use direct inference to prove the predicate (AvB sub A) => (B sub A) where A and B are sets, "sub" denotes "subset", and "v" denotes the set union operator. (Hint: The first predicate in the proof is (x in B) and the last predicate in the proof is (x in A).) ------------------------------------------------------------------------------- 3. (4 points) Use direct inference to prove the predicate (AvB = A) => (B sub A) where A and B are sets, "sub" denotes "subset", and "v" denotes the set union operator. (Hint: The first predicate in the proof is (AvB = A) and the last predicate in the proof is (B sub A).) ------------------------------------------------------------------------------- Solutions: ------------------------------------------------------------------------------- 1. (x in A) => {P => (P or F)} (x in A) or ((x in B) and not(x in B)) => {distribution of and over or} ((x in A) or (x in B)) and ((x in A) or not(x in B)) => {(P and Q) => P} ((x in A) or (x in B)) => {definition of the v set operattor} (x in AvB) -------------------------------------------------------------------------------- 2. (x in B) => {(AvB sub A) is assumed to be T} (x in B) and (AvB sub A) => {definition of (AvB sub A)} (x in B) and (All y, (y in AvB) => (y in A)) => {choosing y to be x} (x in B) and ((x in AvB) => (x in A)) => {definition of AvB} (x in B) and ((x in A or x in B) => (x in A)) => {from (P or Q)=> R infer ((P=>R) and (Q=>R))} (x in B) and ((x in A) => (x in A)) and ((x in B) => (x in A)) => {from P and (P => Q) infer Q} (x in A) -------------------------------------------------------------------------------- 3. (AvB = A) => {definition of =} (AvB sub A) and (A sub AvB) => {Problem 2: (AvB sub A) => (B sub A)} (B sub A) and (A sub AvB) => {(P and Q) => P} (B sub A) ----------------------------------------------------------------------------------