{ }

Definitions & Notation

Sets, elements, and how we write them

Definition

Set

A well-defined collection of distinct objects, called elements (or members). "Well-defined" means that for every object it is possible to determine whether it belongs to the collection or not.

Definition∈, ∉

Element

An object that belongs to a set. We write x ∈ S to mean "x is an element of S" and x ∉ S to mean "x is not an element of S."

DefinitionU

Universal Set U

The set of all elements under consideration in a given context. Every set in the discussion is a subset of U. The choice of U depends on the problem.

Note

Convention — 0 ∈ ℕ in this course. Some textbooks start the natural numbers at 1, but in Discrete Mathematics we follow the convention ℕ = {0, 1, 2, 3, …}.

Definitionℕ, ℤ, ℚ, ℝ

Standard Number Sets

ℕ = {0, 1, 2, 3, …} (natural numbers)

ℤ = {…, −2, −1, 0, 1, 2, …} (integers)

ℚ = the set of all rational numbers (fractions p/q where p, q ∈ ℤ and q ≠ 0)

ℝ = the set of all real numbers (rationals and irrationals)

Definition{1, 2, 3}

Roster Notation

A way of describing a set by explicitly listing all of its elements between curly braces, separated by commas. For example, {1, 2, 3} is the set containing exactly 1, 2, and 3.

Definition{x ∈ S | P(x)}

Set-Builder Notation

A way of describing a set by specifying a property that its elements must satisfy. Written as {x ∈ S | P(x)}, which reads "the set of all x in S such that P(x) is true." The vertical bar | (or colon :) means "such that."

Example

Write in set-builder notation: "the set of natural numbers less than 5."

Definition∅ or {}

Empty Set

The set with no elements, denoted ∅ or {}. It is unique: there is exactly one set with no elements.

Warning

∅ ≠ {∅} — the empty set is different from a set containing the empty set. ∅ has 0 elements, but {∅} has 1 element (that element is ∅ itself). This distinction comes up frequently on exams!

Definition{a}

Singleton

A set with exactly one element, written {a}. For example, {7} is the singleton containing only the number 7. Note that a ≠ {a} — an element is not the same as the singleton set containing it.

Example

Is 3 ∈ {1, 2, 3}? Is {3} ∈ {1, 2, 3}?

Section Quiz

Test your understanding with 6 questions

Relationships

Subsets, equality, and common traps

DefinitionA ⊆ B

Subset

A is a subset of B, written A ⊆ B, if and only if every element of A is also an element of B. Formally: A ⊆ B ⟺ ∀x(x ∈ A → x ∈ B).

DefinitionA ⊂ B

Proper Subset

A is a proper subset of B, written A ⊂ B, if and only if A ⊆ B and A ≠ B. This means every element of A is in B, but B contains at least one element not in A.

Formal definition of subset

A ⊆ B ⟺ ∀x(x ∈ A → x ∈ B)

Theorem

Empty Set Subset

∅ ⊆ A for every set A.

Theorem

Subset Reflexivity

A ⊆ A for every set A.

DefinitionA = B ⟺ A ⊆ B ∧ B ⊆ A

Set Equality

Two sets A and B are equal, written A = B, if and only if A ⊆ B and B ⊆ A. This is called the principle of double containment (or mutual inclusion). In other words, A and B have exactly the same elements.

Example

Prove that {1, 2, 3} = {3, 1, 2}.

Warning

Common mistake — confusing ∈ and ⊆.

• 1 ∈ {1, 2} ✓ (1 is an element of the set)

• {1} ⊆ {1, 2} ✓ ({1} is a subset — every element of {1} is in {1, 2})

• 1 ⊆ {1, 2} ✗ (1 is not a set, so ⊆ does not apply)

• {1} ∈ {1, 2} ✗ (the elements of {1, 2} are 1 and 2, not {1})

Remember: ∈ relates an element to a set; ⊆ relates a set to a set.

Example

Let A = {1, {2}}. Determine which of the following are true: 1 ∈ A, {2} ∈ A, 2 ∈ A, {1} ⊆ A.

Section Quiz

Test your understanding with 6 questions

∩ ∪

Operations

Combining and separating sets

DefinitionA ∪ B

Union

The union of A and B, written A ∪ B, is the set of all elements that belong to A or to B (or both). A ∪ B = {x | x ∈ A or x ∈ B}.

DefinitionA ∩ B

Intersection

The intersection of A and B, written A ∩ B, is the set of all elements that belong to both A and B. A ∩ B = {x | x ∈ A and x ∈ B}.

DefinitionĀ, A', Aᶜ

Complement

The complement of A (with respect to the universal set U), written Ā, A', or Aᶜ, is the set of all elements in U that are not in A. Aᶜ = {x ∈ U | x ∉ A}.

Note

Two important special cases of complement:

• Uᶜ = ∅ (nothing can be in U and not in U at the same time)

• ∅ᶜ = U (every element of U is not in the empty set)

DefinitionA \ B or A − B

Set Difference

The difference of A and B, written A \ B or A − B, is the set of all elements that belong to A but not to B. A \ B = {x | x ∈ A and x ∉ B}.

DefinitionA △ B

Symmetric Difference

The symmetric difference of A and B, written A △ B, is the set of elements that belong to exactly one of A or B. Equivalently:

A △ B = (A \ B) ∪ (B \ A) = (A ∪ B) \ (A ∩ B).

Example

Let U = {1, 2, 3, 4, 5}, A = {1, 2, 3}, B = {3, 4, 5}. Find A ∪ B, A ∩ B, A \ B, B \ A, and Ā.

💡Tip

Think of ∪ as "or", ∩ as "and", complement as "not", and \ as "but not". This maps directly to logical connectives and helps you translate between set expressions and logic.

Intersection in logical notation

A ∩ B = {x | x ∈ A ∧ x ∈ B}

Example

When are two sets disjoint? Give an example.

Section Quiz

Test your understanding with 6 questions

D̄M

De Morgan's Laws

The two laws that flip everything

Theorem

De Morgan's First Law

(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ

The complement of a union is the intersection of the complements.

Theorem

De Morgan's Second Law

(A ∩ B)ᶜ = Aᶜ ∪ Bᶜ

The complement of an intersection is the union of the complements.

💡Tip

Memory trick by Yusuf (Y-U-S-U-F)

Say it out loud:

• If you can't be in both, then you're missing at least one.

→ (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ

"Not in A AND B" means "not in A OR not in B."

• If you're not in either one, then you're missing both.

→ (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ

"Not in A OR B" means "not in A AND not in B."

The complement always flips the operation: AND ↔ OR, ∩ ↔ ∪.

Example

Give an element-chasing proof that (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ.

Example

Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A = {1, 2, 3, 4}, B = {3, 4, 5, 6}. Verify that (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ.

Note

De Morgan's Laws extend to any finite (or even infinite) number of sets:

(A₁ ∪ A₂ ∪ … ∪ Aₙ)ᶜ = A₁ᶜ ∩ A₂ᶜ ∩ … ∩ Aₙᶜ

(A₁ ∩ A₂ ∩ … ∩ Aₙ)ᶜ = A₁ᶜ ∪ A₂ᶜ ∪ … ∪ Aₙᶜ

The pattern is the same: complement distributes by flipping ∪ and ∩.

Section Quiz

Test your understanding with 6 questions

Theorems & Proof Patterns

Learn the patterns first, then the laws

Note

This section is longer and a bit harder than the earlier ones. First you'll learn three proof patterns, then the algebra laws. Take it step-by-step, Tasnim — there's no rush.

Master these three proof patterns and you can handle almost any set proof on the exam.

Definition

Proof Pattern: Subset (A ⊆ B)

To prove A ⊆ B, pick an arbitrary element from A and show it must also be in B.

 

Template:

1. "Let x ∈ A."

2. Use definitions to figure out properties of x.

3. Conclude "so x ∈ B."

4. Since x was arbitrary, A ⊆ B. □

 

This is called "element chasing" — you chase a generic element from one side to the other.

Example

Prove that (A ∩ B) ⊆ A.

Hint: If x is in the intersection, what do you know about x?

💡Tip

Always start with "Let x ∈ [left side]" and work toward showing "x ∈ [right side]." Never start with the right side. This direction matters for the proof to be logically correct.

Note

Try it yourself: Can you prove that A ⊆ A? (Every set is a subset of itself.) Use the template above — it should be just 2-3 lines.

Definition

Proof Pattern: Equality (A = B)

To prove A = B, show both directions:

1. Show A ⊆ B (every element of A is in B).

2. Show B ⊆ A (every element of B is in A).

 

This is called "double containment" or "mutual inclusion." If both sides contain each other, they must be the same set.

Example

Prove that A ∩ (A ∪ B) = A. (This is the absorption law — we'll name it properly below.)

Hint: For ⊆, start with x in the left side. For ⊇, start with x in A.

Note

Try it yourself: Prove that A ∪ (A ∩ B) = A. (Hint: this is the other absorption law. Use double containment — show each side is a subset of the other.)

Definition

Proof Pattern: Empty Set (A = ∅)

To prove A = ∅, show that no element can be in A. The most common way is proof by contradiction:

 

1. "Suppose for contradiction that x ∈ A."

2. Derive a contradiction (like x ∈ S and x ∉ S).

3. Conclude "no such x exists, so A = ∅."

Example

Prove that A ∩ (B ∩ Aᶜ) = ∅.

Hint: Assume an element exists in the set and find a contradiction.

Note

Try it yourself: Prove that A ∩ Aᶜ = ∅. (Hint: assume x ∈ A ∩ Aᶜ and show you get a contradiction.)

Now the laws. Think of these like arithmetic rules but for sets — they let you simplify and transform expressions.

Theorem

Commutative Laws

A ∪ B = B ∪ A

A ∩ B = B ∩ A

Order doesn't matter for union or intersection, just like 3 + 5 = 5 + 3 in arithmetic.

Theorem

Associative Laws

A ∪ (B ∪ C) = (A ∪ B) ∪ C

A ∩ (B ∩ C) = (A ∩ B) ∩ C

Grouping doesn't matter. You can drop the parentheses and just write A ∪ B ∪ C or A ∩ B ∩ C.

Theorem

Identity Laws

A ∪ ∅ = A

A ∩ U = A

Union with the empty set changes nothing (∅ adds no elements). Intersection with the universal set changes nothing (everything in A is already in U).

Theorem

Domination Laws

A ∪ U = U

A ∩ ∅ = ∅

Union with U always gives U (you can't go beyond everything). Intersection with ∅ always gives ∅ (there's nothing to share).

Theorem

Idempotent Laws

A ∪ A = A

A ∩ A = A

Combining a set with itself gives back the same set.

Theorem

Complement Laws

A ∪ Aᶜ = U

A ∩ Aᶜ = ∅

Every element in U is either in A or not in A — so their union is all of U. And nothing can be in A and not in A at the same time — so their intersection is empty.

Theorem

Involution Law (Double Complement)

(Aᶜ)ᶜ = A

Complementing twice gives you back the original set. "Not not A" is just A.

Theorem

Absorption Laws

A ∪ (A ∩ B) = A

A ∩ (A ∪ B) = A

A "absorbs" the extra part. A ∩ B is already inside A, so unioning adds nothing. Similarly, every element of A is in A ∪ B, so the intersection just gives A.

Theorem

Distributive Laws

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)

A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

Union distributes over intersection, and intersection distributes over union. It works just like how multiplication distributes over addition: a × (b + c) = a × b + a × c.

Theorem

De Morgan's Laws (recap)

(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ

(A ∩ B)ᶜ = Aᶜ ∪ Bᶜ

We covered these in detail in the De Morgan section. The complement flips ∪ ↔ ∩.

Note

You don't need to memorize all of these perfectly — the exam usually gives you a reference sheet. What matters is that you can recognize which law applies and use it correctly in proofs and simplifications.

Practice proofs (exam-style) Try each proof on paper first, then reveal the solution. These are the kinds of proofs that show up on exams.

Example

Practice proof 1: Prove that (A ∩ B) ⊆ A.

Hint: Use the subset proof pattern. Start with "Let x ∈ A ∩ B."

Example

Practice proof 2: Prove that if A ⊆ B, then A ∩ C ⊆ B ∩ C.

Hint: Start with "Let x ∈ A ∩ C" and use the assumption A ⊆ B.

Example

Practice proof 3: Prove that A ∩ (B ∩ Aᶜ) = ∅.

Hint: Use the empty set proof pattern: assume an element exists and find a contradiction.

Example

Practice proof 4: Prove that (A ∩ B) ∪ (A ∩ Bᶜ) = A.

Hint: This says A can be split into two parts based on B. Use double containment.

Section Quiz

Test your understanding with 6 questions

2ⁿ

Cardinality & Power Set

Counting elements and subsets

Definition|A|

Cardinality

The cardinality of a finite set A, written |A|, is the number of distinct elements in A. For example, |{a, b, c}| = 3.

Warning

Duplicates don't count! Since sets contain only distinct elements, repetition in roster notation doesn't increase cardinality. |{1, 1, 2}| = |{1, 2}| = 2.

Example

Find |∅|, |{a}|, and |{1, 2, 3}|.

DefinitionP(A) or 𝒫(A)

Power Set

The power set of A, written P(A) or 𝒫(A), is the set of all subsets of A, including the empty set ∅ and A itself. P(A) = {S | S ⊆ A}.

Cardinality of the power set

|P(A)| = 2^{|A|}

Example

Find P(A) and |P(A)| for A = {1, 2}.

Example

Find P(A) and |P(A)| for A = {a, b, c}.

💡Tip

To find P(A), systematically include or exclude each element of A. Each element has 2 choices (in or out), giving 2ⁿ subsets total. Organizing subsets by size (0, 1, 2, …, n) helps ensure you don't miss any.

Theorem

Inclusion-Exclusion Principle (Two Sets)

|A ∪ B| = |A| + |B| − |A ∩ B|

When counting the union, we add the sizes of A and B but subtract the overlap (intersection) to avoid double-counting elements that appear in both sets.

Section Quiz

Test your understanding with 6 questions

×

Cartesian Product

Ordered pairs and product sets

Definition(a, b)

Ordered Pair

An ordered pair (a, b) is a pair of objects where the order matters. Two ordered pairs are equal if and only if their corresponding components are equal: (a, b) = (c, d) ⟺ a = c and b = d. In particular, (a, b) ≠ (b, a) unless a = b.

DefinitionA × B

Cartesian Product

The Cartesian product of A and B, written A × B, is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B. A × B = {(a, b) | a ∈ A and b ∈ B}.

Cardinality of the Cartesian product

|A × B| = |A| · |B|

Example

Let A = {1, 2} and B = {x, y}. Find A × B and |A × B|.

Warning

A × B ≠ B × A in general! For example, if A = {1} and B = {x}, then A × B = {(1, x)} and B × A = {(x, 1)}. Since (1, x) ≠ (x, 1), the two products are different sets.

Example

Find {1, 2} × {1, 2}.

Note

ℝ × ℝ = ℝ² is the Cartesian plane — the familiar x-y coordinate plane. Every point on the plane is an ordered pair (x, y) where x, y ∈ ℝ. This is where the name "Cartesian" comes from (after René Descartes).

Theorem

Cartesian Product Distributes over Union

A × (B ∪ C) = (A × B) ∪ (A × C)

The Cartesian product distributes over union. An ordered pair (a, x) is in A × (B ∪ C) precisely when a ∈ A and x ∈ B ∪ C, i.e., x ∈ B or x ∈ C, which means (a, x) is in A × B or A × C.

Section Quiz

Test your understanding with 6 questions

Practice Sets

Mixed problems for exam prep

These problems cover all topics from the previous sections. Try each one on paper before checking the solution! Working through these will prepare you for exam-style questions.

Example

Let A = {1, 2, 3, 4}, B = {3, 4, 5, 6}, U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find:

(a) A ∪ B

(b) A ∩ B

(c) A \ B

(d) Aᶜ

(e) (A ∩ B)ᶜ

(f) Aᶜ ∪ Bᶜ

Example

Find P({1, 2, 3}) and its cardinality.

Example

Let A = {a, b} and B = {1, 2, 3}. Find A × B and |A × B|.

Example

Prove: If A ⊆ B, then A ∩ C ⊆ B ∩ C.

Example

Is {∅} ∈ P({1, 2})?

Example

How many elements does P(P(∅)) have?

💡Tip

On exams, always check your work by:

1. Verifying cardinalities match (e.g., |P(A)| = 2^|A|, |A × B| = |A| · |B|).

2. Checking that De Morgan's Laws hold for your computed sets.

3. Confirming ∅ ⊆ A for any set A you produce.

4. Making sure you haven't confused ∈ with ⊆.

These quick sanity checks can catch careless errors before you submit.

📝

Ready for the exam?

20 questions + written proofs · 45 minutes

Go to Exam