03 Relations and Functions
A progressive guide to relations, their structural properties, and the ways functions can be classified and inverted.
Relations as sets of ordered pairs
A describes which elements of one set are connected to elements of another set. If and are sets, a from to is a subset of , so each connection is written as an ordered pair .
For example, let
and let
The domain is , because these are the first coordinates that occur. The range is , because these are the second coordinates that occur. A on is a from to itself, so it is a subset of .
Takeaway: Relations are sets of ordered pairs; their domain and range are determined by the coordinates that actually occur.
Testing properties
The properties of a describe how its ordered pairs behave.
: Every element is related to itself, so for every .
: Reversing a related pair preserves the , so implies .
: If both directions hold, then the elements must be equal: .
: Two links can be chained: .
The on the integers illustrates several properties at once. It is because , because and imply , and because and imply . It is not : for instance, but .
Takeaway: Test each property separately. means that opposite relations force equality; it does not mean simply “not .”
Equivalence and order structures
Two important combinations of properties organize sets in different ways.
An is , , and . Congruence modulo is an example on :
For example, modulo ,
Equivalence classes group elements that are equivalent under the . These classes form a partition: they do not overlap, and every element belongs to exactly one class.
A is , , and . Subset inclusion on is a . Unlike a total order, a does not require every pair to be comparable. In , neither nor holds.
Takeaway: Equivalence relations produce partitions, while partial orders organize elements without necessarily comparing every pair.
Functions and their parts
A is a special kind of : each input in the domain must have exactly one output in the codomain. Multiple inputs may share an output, but a single input cannot be assigned two different outputs.
For example,
is a from to . Every input appears exactly once with one output. By contrast,
is not a because the input has two different outputs.
For a , distinguish the following sets:
The domain is , the set of allowed inputs.
The codomain is , the set in which outputs are required to lie.
The image or range is , the set of outputs actually produced.
The image can be smaller than the codomain. This distinction becomes essential when deciding whether a is surjective.
Takeaway: The defining test for a is exactly one output for every input.
Injective, surjective, and bijective behavior
Injectivity and surjectivity measure different aspects of how a connects its domain and codomain.
An never sends two distinct inputs to the same output. A useful test is
For on , if , then
so the is injective. The rule is not injective on , since .
A reaches every element of its codomain. For , this means
The rule is surjective from to , because every real target has the preimage . The rule is not surjective from to , because no real input produces a negative output; it is surjective when the codomain is .
A is both injective and surjective. Therefore, each codomain element has exactly one preimage.
Takeaway: Injectivity prevents repeated outputs from different inputs; surjectivity ensures that no codomain elements are missed.
Inverses and reversible functions
An inverse reverses the input-output assignments of a . For an to exist on the entire codomain, the original must be bijective: injectivity ensures that each output has at most one preimage, and surjectivity ensures that each codomain element has at least one preimage.
Consider
Solve for :
Therefore,
The two composition checks are
and
Do not confuse the with a reciprocal. If , then
whereas
is a different .
Takeaway: To find an inverse, solve the equation for , then verify both composition identities when appropriate.
Connecting the concepts
The main ideas form a hierarchy:
A is any set of ordered pairs.
properties such as reflexivity, symmetry, antisymmetry, and transitivity describe structural behavior.
Equivalence relations partition sets into equivalence classes.
Partial orders organize sets while allowing incomparable elements.
A is a with exactly one output for every input.
Injectivity concerns repeated outputs, while surjectivity concerns whether the codomain is fully reached.
A has both properties and therefore has an .
When analyzing a new example, first identify the sets and ordered pairs. Then determine the domain, range, and relevant properties. If the object is a , compare its image with its codomain and check whether different inputs can share an output. These steps reveal whether the is injective, surjective, bijective, or invertible.
Final takeaway: Relations provide the general framework; functions impose a unique-output rule; bijections are exactly the functions whose assignments can be reversed.