Mathematics · Notes

Sets, relations, and functions

25 September 2026

This note collects the definitions used in Tool 02. It relies on the logic of the previous note: each definition below is a statement built from connectives and quantifiers.

Sets

We write x∈Ax \in A when xx is an element of the set AA, and x∉Ax \notin A otherwise.

The set operations are defined by connectives applied to membership:

SetIts elements xx satisfy
A∪BA \cup B (union)x∈A∨x∈Bx \in A \lor x \in B
A∩BA \cap B (intersection)x∈A∧x∈Bx \in A \land x \in B
A∖BA \setminus B (difference)x∈A∧x∉Bx \in A \land x \notin B
A△BA \mathbin{\triangle} B (symmetric difference)xx lies in exactly one of AA and BB
AcA^{c} (complement)x∈U∧x∉Ax \in U \land x \notin A

Equivalently, A△B=(A∖B)∪(B∖A)A \mathbin{\triangle} B = (A \setminus B) \cup (B \setminus A).

Because each operation is a connective in disguise, set identities mirror logical equivalences. For example, De Morgan’s laws become (A∪B)c=Ac∩Bc(A \cup B)^{c} = A^{c} \cap B^{c} and (A∩B)c=Ac∪Bc(A \cap B)^{c} = A^{c} \cup B^{c}.

Venn regions. With three sets AA, BB, CC inside UU, every element of UU lies in exactly one of 23=82^3 = 8 regions, according to whether or not it is in AA, in BB and in CC. Whether an element belongs to a set built from AA, BB and CC depends only on its region. So two such expressions are equal for every choice of AA, BB, CC exactly when they shade the same regions. The regions play the role of the rows of a truth table. If the two sides differ on a region, any element placed in that region is a counterexample.

Ordered pairs and Cartesian products

An ordered pair (a,b)(a, b) records two objects in order: (a,b)=(c,d)(a, b) = (c, d) exactly when a=ca = c and b=db = d. In particular, (a,b)≠(b,a)(a, b) \ne (b, a) when a≠ba \ne b.

The Cartesian product of AA and BB is

A×B={(a,b):a∈A, b∈B}.A \times B = \{(a, b) : a \in A,\ b \in B\}.

For finite sets, ∣A×B∣=∣A∣⋅∣B∣\lvert A \times B \rvert = \lvert A \rvert \cdot \lvert B \rvert. In general A×B≠B×AA \times B \ne B \times A.

Power sets

The power set of AA is the set of all subsets of AA:

P(A)={X:X⊆A}.P(A) = \{X : X \subseteq A\}.

Its elements are sets. Both ∅\varnothing and AA belong to P(A)P(A). For finite AA, ∣P(A)∣=2∣A∣\lvert P(A) \rvert = 2^{\lvert A \rvert}, since a subset is fixed by deciding, element by element, whether to include it.

Keep two distinctions in view. First, the element aa and the set {a}\{a\} are different objects, linked by membership and inclusion: a∈Aa \in A exactly when {a}⊆A\{a\} \subseteq A, that is, when {a}∈P(A)\{a\} \in P(A). Second, ∅⊆A\varnothing \subseteq A always holds, while ∅∈A\varnothing \in A usually does not.

Relations

A relation on a set SS is a subset R⊆S×SR \subseteq S \times S. We write (x,y)∈R(x, y) \in R, or xRyx \mathrel{R} y. A finite relation can be drawn as a directed graph: an arrow from xx to yy when (x,y)∈R(x, y) \in R, and a loop at xx when (x,x)∈R(x, x) \in R.

PropertyDefinitionIn the graph
reflexive∀x:(x,x)∈R\forall x : (x, x) \in Revery node has a loop
symmetric∀x ∀y:(x,y)∈R→(y,x)∈R\forall x\, \forall y : (x, y) \in R \to (y, x) \in Revery arrow has a reverse arrow
antisymmetric∀x ∀y:(x,y)∈R∧(y,x)∈R→x=y\forall x\, \forall y : (x, y) \in R \land (y, x) \in R \to x = yno two distinct nodes are joined in both directions
transitive∀x ∀y ∀z:(x,y)∈R∧(y,z)∈R→(x,z)∈R\forall x\, \forall y\, \forall z : (x, y) \in R \land (y, z) \in R \to (x, z) \in Revery two-step path has a direct arrow
complete∀x ∀y:(x,y)∈R∨(y,x)∈R\forall x\, \forall y : (x, y) \in R \lor (y, x) \in Revery pair of nodes, and every node with itself, is joined in at least one direction

Some texts call a complete relation total or connected; complete is the term used in economics.

Two remarks help with the exercises.

Named classes of relations.

Functions

A function f:A→Bf : A \to B assigns to each x∈Ax \in A exactly one element f(x)∈Bf(x) \in B. The set AA is the domain and BB the codomain. In an arrow diagram, exactly one arrow leaves each element of AA; an element of BB may receive any number of arrows, including none.

Images and preimages. For C⊆AC \subseteq A and D⊆BD \subseteq B:

f(C)={f(x):x∈C}⊆B,f−1(D)={x∈A:f(x)∈D}⊆A.f(C) = \{f(x) : x \in C\} \subseteq B, \qquad f^{-1}(D) = \{x \in A : f(x) \in D\} \subseteq A .

f(C)f(C) is the image of CC, and f(A)f(A) is the range of ff. f−1(D)f^{-1}(D) is the preimage of DD. The preimage is defined for every function: the notation does not assume that ff has an inverse.

Injective, surjective, bijective.

Composition. For f:A→Bf : A \to B and g:B→Cg : B \to C, the composite g∘f:A→Cg \circ f : A \to C is defined by (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)). For f:A→Af : A \to A, the composite f∘ff \circ f is defined, and f∘f=ff \circ f = f means f(f(x))=f(x)f(f(x)) = f(x) for every x∈Ax \in A. Two special functions on AA are the identity, f(x)=xf(x) = x for every xx, and the constant functions, f(x)=cf(x) = c for every xx and some fixed cc.

The pigeonhole principle. If mm objects are placed in nn boxes and m>nm > n, then some box contains at least two objects.

Test these definitions in Tool 02. Some of its exercises ask for a relation or function with a given list of properties, and some of those lists cannot be met. Showing why is part of the exercise.