02 Sets and Set Operations

A progressive guide to representing sets, comparing them, performing set operations, working with products and power sets, organizing indexed families, and proving set identities.

Sets, Elements, and Notation

A is a well-defined collection of objects called elements or members. Sets are usually named with capital letters and written with braces. For example, A={1,2,3,4}A=\{1,2,3,4\}.

The notation x∈Ax\in A means that xx is an of AA, and x∉Ax\notin A means that it is not. Sets ignore order and repetition:

{1,2,3}={3,1,2}={1,1,2,3}.\{1,2,3\}=\{3,1,2\}=\{1,1,2,3\}.

The relationship is different from the relationship discussed later. An object such as aa may satisfy a∈Aa\in A, while the one- {a}\{a\} may satisfy {a}⊆A\{a\}\subseteq A.

Two common descriptions

  • Roster notation lists the elements explicitly, such as E={2,4,6,8}E=\{2,4,6,8\}.

  • -builder notation specifies a property, such as E={x∈Z∣x is even and 0<x<10}E=\{x\in\mathbb{Z}\mid x\text{ is even and }0<x<10\}.

The symbol ∣\mid means “such that.” The ∅\varnothing has no elements. A is completely determined by its elements, a principle called extensionality.

Takeaway: Read a by asking which objects belong to it; order and repeated listings do not change the .

Subsets and Equality

A A⊆BA\subseteq B is a for which every of AA is also an of BB:

A⊆B⟺∀x (x∈A⇒x∈B).A\subseteq B\quad\Longleftrightarrow\quad \forall x\,(x\in A\Rightarrow x\in B).

For example, if A={1,3}A=\{1,3\} and B={1,2,3,4}B=\{1,2,3,4\}, then A⊆BA\subseteq B. Every has the two basic inclusions ∅⊆A\varnothing\subseteq A and A⊆AA\subseteq A.

A A⊊BA\subsetneq B is a that is not equal to BB:

A⊊B⟺A⊆B and A≠B.A\subsetneq B\quad\Longleftrightarrow\quad A\subseteq B\text{ and }A\ne B.

Two sets are equal precisely when they include each other:

A=B⟺A⊆B and B⊆A.A=B\quad\Longleftrightarrow\quad A\subseteq B\text{ and }B\subseteq A.

This is the double-inclusion method. For example, let

A={x∈Z∣x is divisible by 6}A=\{x\in\mathbb{Z}\mid x\text{ is divisible by }6\}

and

B={x∈Z∣x is divisible by 2 and by 3}.B=\{x\in\mathbb{Z}\mid x\text{ is divisible by }2\text{ and by }3\}.

An integer is divisible by 66 exactly when it is divisible by both 22 and 33, so every of AA is in BB, and every of BB is in AA. Therefore, A=BA=B.

Takeaway: To prove equality of sets, prove both inclusions rather than relying on the way the sets are written.

, , , and

Assume that all sets under discussion are contained in a fixed universal UU. The main operations are defined by membership conditions.

  • The A∪BA\cup B contains elements in at least one :

    A∪B={x∣x∈A or x∈B}.A\cup B=\{x\mid x\in A\text{ or }x\in B\}.
  • The A∩BA\cap B contains elements common to both:

    A∩B={x∣x∈A and x∈B}.A\cap B=\{x\mid x\in A\text{ and }x\in B\}.
  • The A∖BA\setminus B contains elements in AA that are not in BB:

    A∖B={x∣x∈A and x∉B}.A\setminus B=\{x\mid x\in A\text{ and }x\notin B\}.
  • The AcA^c contains elements of UU that are not in AA:

    Ac={x∈U∣x∉A}.A^c=\{x\in U\mid x\notin A\}.

For A={1,2,3}A=\{1,2,3\} and B={3,4,5}B=\{3,4,5\}, these operations give

A∪B={1,2,3,4,5},A∩B={3},A\cup B=\{1,2,3,4,5\},\qquad A\cap B=\{3\},
A∖B={1,2},B∖A={4,5}.A\setminus B=\{1,2\},\qquad B\setminus A=\{4,5\}.

The sets are disjoint when A∩B=∅A\cap B=\varnothing. is not generally commutative, so the order in A∖BA\setminus B matters. If U={1,2,3,4,5}U=\{1,2,3,4,5\} and A={1,3}A=\{1,3\}, then Ac={2,4,5}A^c=\{2,4,5\}.

Takeaway: Translate “or,” “and,” and “not” into , , and , while remembering that a requires a specified universal .

Cartesian Products and Ordered Pairs

The A×BA\times B consists of all ordered pairs whose first coordinate comes from AA and whose second coordinate comes from BB:

A×B={(a,b)∣a∈A and b∈B}.A\times B=\{(a,b)\mid a\in A\text{ and }b\in B\}.

If A={1,2}A=\{1,2\} and B={x,y,z}B=\{x,y,z\}, then

A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}.A\times B=\{(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)\}.

Order matters in an ordered pair, so (a,b)(a,b) is generally different from (b,a)(b,a), and A×BA\times B is generally different from B×AB\times A. For finite sets with ∣A∣=m|A|=m and ∣B∣=n|B|=n, the number of ordered pairs is

∣A×B∣=mn.|A\times B|=mn.

The product of a with itself is written A2=A×AA^2=A\times A. More generally,

An=A×A×⋯×A⏟n factors.A^n=\underbrace{A\times A\times\cdots\times A}_{n\text{ factors}}.

In particular, R2=R×R\mathbb{R}^2=\mathbb{R}\times\mathbb{R} is the of ordered pairs of real numbers and represents the coordinate plane.

Takeaway: A records position: the first supplies the first component, and the second supplies the second component.

Power Sets and Counting

The P(A)\mathcal{P}(A) is the of every of AA:

P(A)={B∣B⊆A}.\mathcal{P}(A)=\{B\mid B\subseteq A\}.

For A={a,b}A=\{a,b\},

P(A)={∅,{a},{b},{a,b}}.\mathcal{P}(A)=\{\varnothing,\{a\},\{b\},\{a,b\}\}.

It is important to distinguish an from a one- . The statements a∈Aa\in A and {a}⊆A\{a\}\subseteq A can both be true, but aa and {a}\{a\} are different objects.

If AA is finite and ∣A∣=n|A|=n, then

∣P(A)∣=2n.|\mathcal{P}(A)|=2^n.

Each has two choices when forming a : include it or omit it. Thus, a three- has 23=82^3=8 subsets. The provides an important example:

P(∅)={∅}.\mathcal{P}(\varnothing)=\{\varnothing\}.

The is therefore not empty, even though its only is the .

Takeaway: To count subsets of a finite , give each an include-or-omit choice, producing 2n2^n possibilities.

Indexed Families of Sets

An labels many sets using an index II, written {Ai}i∈I\{A_i\}_{i\in I}. If I={1,2,3}I=\{1,2,3\}, the family represents A1A_1, A2A_2, and A3A_3.

The indexed contains an if it belongs to at least one member of the family:

⋃i∈IAi={x∣there exists i∈I such that x∈Ai}.\bigcup_{i\in I}A_i=\{x\mid \text{there exists }i\in I\text{ such that }x\in A_i\}.

The indexed contains an only if it belongs to every member:

⋂i∈IAi={x∣for every i∈I, x∈Ai}.\bigcap_{i\in I}A_i=\{x\mid \text{for every }i\in I,\ x\in A_i\}.

For

A1={1,2,3},A2={2,3,4},A3={3,4,5},A_1=\{1,2,3\},\qquad A_2=\{2,3,4\},\qquad A_3=\{3,4,5\},

we obtain

⋃i=13Ai={1,2,3,4,5},⋂i=13Ai={3}.\bigcup_{i=1}^{3}A_i=\{1,2,3,4,5\}, \qquad \bigcap_{i=1}^{3}A_i=\{3\}.

The same notation extends to infinite families such as {An}n∈N\{A_n\}_{n\in\mathbb{N}}. The uses an “at least one” condition, whereas the uses an “every” condition.

Takeaway: Indexed notation extends ordinary and to any labeled collection of sets, including infinite collections.

Fundamental Identities

identities can be checked by translating membership into logic. Important laws include commutativity,

A∪B=B∪A,A∩B=B∩A,A\cup B=B\cup A, \qquad A\cap B=B\cap A,

associativity,

(A∪B)∪C=A∪(B∪C),(A∩B)∩C=A∩(B∩C),(A\cup B)\cup C=A\cup(B\cup C), \qquad (A\cap B)\cap C=A\cap(B\cap C),

and distributivity,

A∩(B∪C)=(A∩B)∪(A∩C),A\cap(B\cup C)=(A\cap B)\cup(A\cap C),
A∪(B∩C)=(A∪B)∩(A∪C).A\cup(B\cap C)=(A\cup B)\cap(A\cup C).

Other useful laws are

A∪∅=A,A∩U=A,A\cup\varnothing=A,\qquad A\cap U=A,
A∪U=U,A∩∅=∅,A\cup U=U,\qquad A\cap\varnothing=\varnothing,
A∪A=A,A∩A=A.A\cup A=A,\qquad A\cap A=A.

describe complements of compound sets:

(A∪B)c=Ac∩Bc,(A∩B)c=Ac∪Bc.(A\cup B)^c=A^c\cap B^c, \qquad (A\cap B)^c=A^c\cup B^c.

can also be rewritten using complements:

A∖B=A∩Bc.A\setminus B=A\cap B^c.

This form often makes additional identities easier to recognize, such as

A∖(B∪C)=(A∖B)∩(A∖C).A\setminus(B\cup C)=(A\setminus B)\cap(A\setminus C).

Takeaway: identities behave like logical equivalences; rewrite membership conditions carefully and apply the matching law.

Proving Identities by

To prove an identity, use : choose an arbitrary xx, translate each membership statement into logic, simplify, and translate back. Consider

A∩(B∪C)=(A∩B)∪(A∩C).A\cap(B\cup C)=(A\cap B)\cup(A\cap C).

Begin with an arbitrary xx in the left-hand side:

x∈A∩(B∪C)⟺x∈A and (x∈B or x∈C)⟺(x∈A and x∈B) or (x∈A and x∈C)⟺x∈(A∩B)∪(A∩C).\begin{aligned} x\in A\cap(B\cup C) &\Longleftrightarrow x\in A\text{ and }(x\in B\text{ or }x\in C)\\ &\Longleftrightarrow (x\in A\text{ and }x\in B)\text{ or }(x\in A\text{ and }x\in C)\\ &\Longleftrightarrow x\in(A\cap B)\cup(A\cap C). \end{aligned}

The first equivalence uses the definition of and . The second uses the distributive law of logic. The final equivalence translates the logical statement back into notation.

Because xx was arbitrary, the two sets have exactly the same elements, so the identity holds. The same strategy can prove equality by showing both inclusions: prove that an arbitrary of the first belongs to the second, then reverse the roles.

Takeaway: proofs become systematic when every step states an equivalent condition for membership.