Sets and Set Operations

Introduction

Sets are the foundation of modern mathematics. A set is simply a collection of distinct objects, called elements or members. Despite this simple definition, set theory provides the language in which essentially all of mathematics can be expressed—from numbers to functions to probability spaces.

Set theory was developed in the late 19 19th century by Georg Cantor and has since become indispensable in computer science (databases, type theory), probability (sample spaces and events), and logic. Understanding sets and their operations is a prerequisite for nearly every advanced mathematical topic.

Basic Definitions

Notation and Membership

Sets are typically denoted by capital letters (A,B,C A comma B comma C and elements by lowercase letters(a,b,c) open paren a comma b comma c close paren. If x x is an element of set A A we write x∈A x is a member of A (read "x x is in A A" or "x x belongs to A A"). If x x is not in A A we write x∉A x is not a member of A

Sets can be defined by listing elements (roster notation): A={1,2,3,4,5} A equals the set 1 comma 2 comma 3 comma 4 comma 5 or by describing a property (set-builder notation): A={x∈ℤ:1≤x≤5} A equals the set of all x in the integers such that 1 is less than or equal to x is less than or equal to 5

Important Sets

Standard number sets have special symbols:

N={1,2,3,…} N equals the set 1 comma 2 comma 3 comma dot dot dot — natural numbers (some include 0 0)

Z={…,−2,−1,0,1,2,…} Z equals the set dot dot dot comma negative 2 comma negative 1 comma 0 comma 1 comma 2 comma dot dot dot — integers

Q Q — rational numbers (fractions p/q p divided by q where p,q∈Z p comma q is a member of Z, q≠0 q is not equal to 0)

R R — real numbers

C C — complex numbers

The empty set ∅ empty set (or {} the empty set) contains no elements. It is a subset of every set.

Subsets and Equality

Set A A is a subset of B B, written A⊆B A subset of or equal to B, if every element of A A is also in B B:

A⊆B⟺(∀⁢x)⁢(x∈A⇒x∈B) A subset of or equal to B long left right double arrow open paren for all x close paren times open paren x is a member of A right double arrow x is a member of B close paren

Two sets are equal if and only if each is a subset of the other:

A=B⟺(A⊆B and B⊆A) A equals B long left right double arrow open paren A subset of or equal to B and B subset of or equal to A close paren

A proper subset A⊂B A subset of B (or A⊊B A subset of or not equals B) means A⊆B A subset of or equal to B and A≠B A is not equal to B.

Set Operations

Union

The union of A A and B B contains all elements in either set:

A∪B={x:x∈A or x∈B} A union B equals the set of all x such that x is a member of A or x is a member of B

Intersection

The intersection of A A and B B contains elements in both sets:

A∩B={x:x∈A and x∈B} A intersection B equals the set of all x such that x is a member of A and x is a member of B

Sets are disjoint if their intersection is empty: A∩B=∅ A intersection B equals empty set.

Difference

The difference (or relative complement) A∖B A set minus B contains elements in A A but not in B B:

A∖B={x:x∈A and x∉B}=A∩Bc A set minus B equals the set of all x such that x is a member of A and x is not a member of B equals A intersection B to the c-th power

Complement

Given a universal set U U containing all objects under consideration, the complement of A A is:

Ac=A¯=U∖A={x∈U:x∉A} A to the c-th power equals A bar equals U set minus A equals the set of all x in U such that x is not a member of A

Cartesian Product

The Cartesian product A×B A times B is the set of all ordered pairs:

A×B={(a,b):a∈A and b∈B} A times B equals the set of all open paren a comma b close paren such that a is a member of A and b is a member of B

For example, R×R=R2 R times R equals R squared is the Cartesian plane.

Power Set

The power set 𝒫⁢(A) script P times A (or 2A 2 to the A power) is the set of all subsets of A A:

𝒫⁢(A)={S:S⊆A} script P times A equals the set of all S such that S subset of or equal to A

If |A|=n the absolute value of A equals n, then |𝒫⁢(A)|=2n the absolute value of script P times A equals 2 to the n-th power. For example,
𝒫⁢({1,2})={∅,{1},{2},{1,2}} script P times open paren the set 1 comma 2 close paren equals the set empty set comma the set 1 comma the set 2 comma the set 1 comma 2.

Laws of Set Algebra

Set operations satisfy fundamental algebraic properties that parallel logical operations.

Commutative Laws

A∪B=B∪A,A∩B=B∩A A union B equals B union A comma A intersection B equals B intersection A

Associative Laws

(A∪B)∪C=A∪(B∪C),(A∩B)∩C=A∩(B∩C) open paren A union B close paren union C equals A union open paren B union C close paren comma open paren A intersection B close paren intersection C equals A intersection open paren B intersection C close paren

Distributive Laws

A∩(B∪C)=(A∩B)∪(A∩C) A intersection open paren B union C close paren equals open paren A intersection B close paren union open paren A intersection C close paren

A∪(B∩C)=(A∪B)∩(A∪C) A union open paren B intersection C close paren equals open paren A union B close paren intersection open paren A union C close paren

De Morgan's Laws

(A∪B)c=Ac∩Bc,(A∩B)c=Ac∪Bc open paren A union B close paren to the c-th power equals A to the c-th power intersection B to the c-th power comma open paren A intersection B close paren to the c-th power equals A to the c-th power union B to the c-th power

These laws state that the complement of a union is the intersection of complements, and vice versa.

Identity and Domination

A∪∅=A,A∩U=A A union empty set equals A comma A intersection U equals A (identity)

A∪U=U,A∩∅=∅ A union U equals U comma A intersection empty set equals empty set (domination)

Complement Laws

A∪Ac=U,A∩Ac=∅,(Ac)c=A A union A to the c-th power equals U comma A intersection A to the c-th power equals empty set comma A to the c-th power to the c-th power equals A

Cardinality

The cardinality |A| the absolute value of A of a finite set is the number of elements it contains.

The inclusion–exclusion principle gives the cardinality of a union:

|A∪B|=|A|+|B|−|A∩B| the absolute value of A union B equals the absolute value of A plus the absolute value of B minus the absolute value of A intersection B

For three sets:

|A∪B∪C|=|A|+|B|+|C|−|A∩B|−|A∩C|−|B∩C|+|A∩B∩C| the absolute value of A union B union C equals the absolute value of A plus the absolute value of B plus the absolute value of C minus the absolute value of A intersection B minus the absolute value of A intersection C minus the absolute value of B intersection C plus the absolute value of A intersection B intersection C

Connection to Other Concepts

In probability, the sample space is a set and events are subsets. The probability axioms and rules (including inclusion-exclusion) mirror set operations.

Functions are defined as special relations, which are subsets of Cartesian products. The domain, codomain, range, and graph of a function are all sets.

In topology, open sets and their properties define the structure of a space. In measure theory, sigma-algebras are collections of sets closed under countable operations.

Summary

A set is a collection of distinct elements. Membership (∈ is a member of and subset (⊆ subset of or equal to are the fundamental relations. Sets are equal if they have exactly the same elements.

The core operations—union (∪ union, intersection (∩ intersection, complement, and difference—satisfy algebraic laws including commutativity, associativity, distributivity, and De Morgan's laws.

Sets provide the language for mathematics, underpinning everything from number systems to probability to analysis. Mastery of set notation and operations is essential for advanced study.