Professional Documents
Culture Documents
A B x[ x A x B ]
A equals B iff for all x, x is in A iff x is in B
A B x[( x A x B) ( x B x A)]
or
A B A BB A
pq p q q p biconditional
q p converse
p q inverse
q p pq contrapositive
Union of two sets
A B {x | x A x B}
Example
A {1,2,3,4,5} B {4,5,6,7,8}
A membership table
A B {1,2,3,4,5,6,7,8}
A B A B
0 0 0
0 1 1
1 0 1
1 1 1 OR
Union of two sets
A B {x | x A x B}
Note:
we are using set builder notation and the
laws of logical equivalence (propositional equivalence)
Intersection of two sets
A B {x | x A x B}
Example
A {1,2,3,4,5} B {4,5,6,7,8}
A B {4,5}
A B A B
0 0 0
0 1 0
1 0 0 AND
1 1 1
A B {x | x A x B}
Disjoint sets
A B {} disjoint ( A, B)
x[ x A x B ]
Difference of two sets
A B A B
0 0 0
0 1 0
1 0 1
1 1 0 A B
A B {x | x A x B}
Note: Compliment of a set
A {x | x U x A}
Symmetric Difference of two sets
A B ( A B ) ( B A)
Example
A {1,2,3,4,5} B {4,5,6,7,8}
A B {1,2,3,6,7,8}
A B A B
0 0 0
0 1 1
1 0 1 XOR
1 1 0
A B ( A B ) ( B A)
Complement of a set
A {x | x A}
Example
A {1,2,3,4,5}
U {0,1,2,3,4,5,6,7,8,9,10} U is the “universal set”
A U A
A {0,6,7,8,9,10}
Not
Cardinality of a Set
In claire
• A = {1,3,5,7}
• B = {2,4,6}
• C = {5,6,7,8}
• |A u B| ?
• |A u C|
• |B u C|
• |A u B u C|
Cardinality of a Set
A {} A
Identity
A U A
A U U Domination
A {} {}
A A A
Indempotent
A A A
•Think of
• U as true (universal)
• {} as false (empty)
• Union as OR
• Intersection as AND
• Complement as NOT
Set Identities Note similarity to logical equivalences!
A B B A
Commutative
A B B A
A ( B C ) ( A B) C
Associative
A ( B C ) ( A B) C
A ( B C ) ( A B) ( A C ) Distributive
A ( B C ) ( A B) ( A C )
A B A B
De Morgan
A B A B
Equivalence Name
p T p
identity law
p F p
p T T
domination law
pF F
p p p
indempotent laws
p p p
(p) p double negation law
pq q p
commutative laws
pq q p
( p q) r p (q r )
associative laws
( p q) r p (q r )
p (q r ) ( p q) ( p r )
distributive law
p (q r ) ( p q) ( p r )
( p q ) p q
De Morgan's laws
( p q ) p q
p ( p q) p
absorption laws
p ( p q) p
p p T
negation laws
p p F
Four ways to prove two sets A and B equal
• a membership table
• a containment proof
• show that A is a subset of B
• show that B is a subset of A
• set builder notation and logical equivalences
• Venn diagrams
RTP : A B A B
{x | x A B}
{x | ( x A B )} Defn of complement
De Morgan law
{x | ( x A) ( x B)}
Defn of complement
{x | x A x B }
{x | x A B } Defn of union
Class
RTP : A B A B
RTP : A B A B
A B {x | x A B}
{x | ( x A B)} Defn of
{x | ( x A x B} Defn of (union)
{x | ( x A) ( x B))} De Morgan law
{x | ( x A) ( x B)} Defn of
{x | ( x A) ( x B)} Defn of complement
{x | x A B} Defn of (intersection)
A B Meaning of set builder notation
RTP : A ( B A) {} Prove using set builder and logical equivalences
A ( B A)
{x | x A x ( B A)}
{x | x A ( x B x A)}
{x | x A x A x B}
{x | x {} x B}
{}
A containment proof
A i A1 A2 ... An
i 1
A i A1 A2 ... An
i 1