Evanalysis
2.2Estimated reading time: 35 min

2.2 Functions and relations

Read functions and relations as subsets of products, then use that language to understand image, preimage, inverse maps, partial orders, and equivalence classes.

Course contents

Functions and relations turn product sets into structured mathematical objects: functions impose unique outputs, while relations record general connections.

Functions are special relations

Definition

A function

A function from XX to YY is a subset of X×YX \times Y such that every x∈Xx \in X is paired with exactly one y∈Yy \in Y.

The same information can be read in several equivalent ways:

  • XX is the domain, the set of allowed inputs.
  • YY is the target, the set of possible outputs.
  • The graph of ff is {(x,f(x)):x∈X}\{(x,f(x)):x\in X\}, the set of pairs with input x∈Xx\in X and output f(x)f(x).
  • The image of a set is the set of outputs reached by that set.
  • The preimage of a set is the set of inputs that land there.

Common mistake

A function must not send one input to two outputs

A relation may connect one input to many outputs. A function cannot. Every input must have exactly one output.

How to test a proposed graph

For a subset Δ⊂X×Y\Delta \subset X \times Y to be the graph of a function X→YX \to Y, every x∈Xx \in X must occur in exactly one pair (x,y)∈Δ(x,y) \in \Delta. There are two separate failure modes. A missing input has no corresponding output, so it violates existence. An input paired with two different outputs violates uniqueness. The entire stated domain must be covered exactly once.

For example, Δ={(n+10,n):n∈N}\Delta=\{(n+10,n):n\in\mathbb N\} viewed as a subset of N×Z\mathbb N\times\mathbb Z misses input 00, since n+10=0n+10=0 would require n=−10n=-10. It is therefore not a graph of a function from N\mathbb N. By contrast, {(n+10,n):n∈Z}\{(n+10,n):n\in\mathbb Z\} is a graph from Z\mathbb Z to Q\mathbb Q: for each integer xx, the unique choice is n=x−10n=x-10. The set {(x2,x3):x∈Q}\{(x^2,x^3):x\in\mathbb Q\} is also not a graph from Q\mathbb Q to Q\mathbb Q; it misses negative inputs and has both (1,1)(1,1) and (1,−1)(1,-1) as pairs for input 11.

Common mistake

The domain may depend on context

The formula 1/x1/x is not a single function unless you specify a domain. It can be a function on R∖{0}R \setminus \{0\}, on Q∖{0}Q \setminus \{0\}, or on another domain where division by zero is excluded.

The set of all functions

Once functions have been defined as sets of ordered pairs, we can also make a set whose elements are functions. If AA and BB are sets, the notation

BAB^A

means the set of all functions from AA to BB.

This notation is not accidental. When AA is finite with nn elements and BB is finite with mm elements, a function A→BA \to B is made by choosing one of mm outputs for each of the nn inputs. Hence there are mnm^n such functions. For example, if A={a,b,c}A = \{a,b,c\} and B={0,1}B=\{0,1\}, then BAB^A has 23=82^3=8 functions. This is the same counting principle behind ∣P(A)∣=2{∣A∣}|P(A)| = 2^\{|A|\}.

Worked example

Read BAB^A as a function set

Let A={a,b}A=\{a,b\} and B={0,1}B=\{0,1\}. Then BAB^A contains exactly four functions:

abf100f201f310f411\begin{array}{c|cc} & a & b \\ \hline f_1 & 0 & 0\\ f_2 & 0 & 1\\ f_3 & 1 & 0\\ f_4 & 1 & 1 \end{array}

Each row is one whole function, not one value of a single function.

Reading a function carefully

Worked example

The square function has repeated outputs

Take the rule f(x)=x2f(x) = x^2.

Then f(−2)=4f(-2) = 4 and f(2)=4f(2) = 4, so different inputs may share the same output. That is allowed.

What is not allowed is a single input having two different outputs.

For example, the relation “y2=xy^2 = x” on Z×ZZ \times Z is not a function if you read it as a rule from xx to yy, because x=4x = 4 allows both y=2y = 2 and y=−2y = -2.

The graph of a function is a very special subset of a product: every vertical line through an allowed input hits the graph exactly once.

Image, preimage, and composition

For a function f:X→Yf : X \to Y, the course uses the word image in three related ways:

  • f(x)f(x) is the image of the single input xx.
  • If A⊂XA \subset X, then f(A)=f(x)∣x∈Af(A) = {f(x) \mid x \in A} is the image of the set.
  • f(X)f(X) is the full image of ff, meaning the actual outputs that appear.

The preimage of a set B⊂YB \subset Y is

f−1(B)={x∈X∣f(x)∈B}.f^{-1}(B) = \{x \in X \mid f(x) \in B\}.

This exists even when ff does not have an inverse function.

Composition is defined by

(g∘f)(x)=g(f(x)).(g \circ f)(x) = g(f(x)).

The order matters: g∘fg \circ f means “first ff, then gg”.

Worked example: computing compositions

For f(x)=x+1f(x)=x+1, g(x)=x2g(x)=x^2, and h(x)=x−7h(x)=x-7, direct substitution gives

f∘f:x↦x+2,f∘g:x↦x2+1,f∘h:x↦x−6,g∘f:x↦(x+1)2,g∘g:x↦x4,g∘h:x↦(x−7)2,h∘f:x↦x−6,h∘g:x↦x2−7,h∘h:x↦x−14.\begin{aligned} f\circ f&:x\mapsto x+2, & f\circ g&:x\mapsto x^2+1, & f\circ h&:x\mapsto x-6,\\ g\circ f&:x\mapsto (x+1)^2, & g\circ g&:x\mapsto x^4, & g\circ h&:x\mapsto (x-7)^2,\\ h\circ f&:x\mapsto x-6, & h\circ g&:x\mapsto x^2-7, & h\circ h&:x\mapsto x-14. \end{aligned}

The rightmost function is applied first.

Image and preimage identities

Let f:X→Yf:X\to Y, A,B⊂XA,B\subset X, and C,D⊂YC,D\subset Y. The image of a union satisfies

f(A∪B)=f(A)∪f(B).f(A\cup B)=f(A)\cup f(B).

For the inclusion from left to right, take y∈f(A∪B)y\in f(A\cup B). Then y=f(x)y=f(x) for some x∈A∪Bx\in A\cup B. If x∈Ax\in A, then y∈f(A)y\in f(A); if x∈Bx\in B, then y∈f(B)y\in f(B). Thus y∈f(A)∪f(B)y\in f(A)\cup f(B). Conversely, if y∈f(A)∪f(B)y\in f(A)\cup f(B), it has a preimage in AA or in BB, and that preimage also lies in A∪BA\cup B; hence y∈f(A∪B)y\in f(A\cup B).

For intersections only inclusion is guaranteed:

f(A∩B)⊂f(A)∩f(B).f(A\cap B)\subset f(A)\cap f(B).

Indeed, a value obtained from an input in A∩BA\cap B is obtained from an input in each of AA and BB. Equality can fail when two different inputs collide. Take X={1,2}X=\{1,2\}, Y={0}Y=\{0\}, f(1)=f(2)=0f(1)=f(2)=0, A={1}A=\{1\}, and B={2}B=\{2\}. Then f(A∩B)=∅f(A\cap B)=\varnothing, while f(A)∩f(B)={0}f(A)\cap f(B)=\{0\}.

Preimages preserve both unions and intersections, with full membership proofs:

f−1(C∪D)=f−1(C)∪f−1(D),f−1(C∩D)=f−1(C)∩f−1(D).f^{-1}(C\cup D)=f^{-1}(C)\cup f^{-1}(D), \qquad f^{-1}(C\cap D)=f^{-1}(C)\cap f^{-1}(D).

For the union, x∈f−1(C∪D)x\in f^{-1}(C\cup D) means f(x)∈C∪Df(x)\in C\cup D, so f(x)∈Cf(x)\in C or f(x)∈Df(x)\in D; this is exactly x∈f−1(C)∪f−1(D)x\in f^{-1}(C)\cup f^{-1}(D). Reading the same equivalence backwards proves the reverse inclusion. For the intersection, x∈f−1(C∩D)x\in f^{-1}(C\cap D) means f(x)∈Cf(x)\in C and f(x)∈Df(x)\in D, which is exactly x∈f−1(C)∩f−1(D)x\in f^{-1}(C)\cap f^{-1}(D); again both directions are the same membership equivalence.

The corresponding difference and complement laws must state their ambient sets:

f−1(C∖D)=f−1(C)∖f−1(D),f−1(Y∖C)=X∖f−1(C).f^{-1}(C\setminus D)=f^{-1}(C)\setminus f^{-1}(D), \qquad f^{-1}(Y\setminus C)=X\setminus f^{-1}(C).

For example, xx belongs to the first left side exactly when f(x)∈Cf(x)\in C and f(x)∉Df(x)\notin D, which is the condition on the right. In the complement law, Y∖CY\setminus C is the complement inside the target YY, while X∖f−1(C)X\setminus f^{-1}(C) is the complement inside the domain XX.

Worked example

Compare image and preimage for f(x)=x2f(x)=x^2

Let f:R→Rf : R \to R be given by f(x)=x2f(x) = x^2, and let

A={−2,−1,0,1,2},B={0,1,4}.A = \{-2, -1, 0, 1, 2\}, \qquad B = \{0, 1, 4\}.

Then

f(A)={0,1,4}.f(A) = \{0, 1, 4\}.

Also,

f−1(B)={−2,−1,0,1,2},f^{-1}(B) = \{-2, -1, 0, 1, 2\},

Every listed point maps into BB. Conversely, if x2∈{0,1,4}x^2\in\{0,1,4\}, then x2=0x^2=0, x2=1x^2=1, or x2=4x^2=4. Factoring each equation gives respectively x=0x=0, x=±1x=\pm1, or x=±2x=\pm2. Hence there are no other real preimages.

If we instead take C={4}C = \{4\}, then

f−1(C)={−2,2}.f^{-1}(C) = \{-2, 2\}.

Injective, surjective, bijective

Definition

Three useful words

  • Injective means different inputs never collide.
  • Surjective means every target value is hit.
  • Bijective means both injective and surjective.

Equivalent formulations are often useful:

  • ff is injective if f(x1)=f(x2)f(x1) = f(x2) implies x1=x2x1 = x2.
  • ff is surjective if f(X)=Yf(X) = Y.
  • ff is bijective if every element of the target is hit exactly once.

Worked examples: injectivity and surjectivity

First consider the finite map X={0,1,3,5}X=\{0,1,3,5\}, Y={5,7,11}Y=\{5,7,11\}, with values f(0)=7f(0)=7, f(1)=5f(1)=5, f(3)=11f(3)=11, and f(5)=5f(5)=5, the value 55 is attained by two inputs, so the map is not injective. All three elements of YY occur, so it is surjective.

Next consider f:{−2,−1,0,1,2}→Zf:\{-2,-1,0,1,2\}\to\mathbb Z is f(x)=x5+3x+1f(x)=x^5+3x+1. Its five values are

f(−2)=−37,f(−1)=−3,f(0)=1,f(1)=5,f(2)=39.f(-2)=-37,\quad f(-1)=-3,\quad f(0)=1,\quad f(1)=5,\quad f(2)=39.

They are distinct, so this map is injective. It is not surjective onto Z\mathbb Z, since, for example, 00 is not among the values.

Finally, f:Z→Zf:\mathbb Z\to\mathbb Z, f(x)=x2+xf(x)=x^2+x, is not injective: f(0)=f(−1)=0f(0)=f(-1)=0 with 0≠−10\ne-1. It is not surjective either, because x2+x=x(x+1)x^2+x=x(x+1) is always even, so no odd integer can be an output.

Read the arrows to distinguish the definitions

An arrow diagram tests unique outputs, collisions, and whether the target is covered.

Read a function as arrows

Use one arrow diagram to keep domain, target, image, preimage, injectivity, surjectivity, and composition distinct.

  1. Domain and target

    A function f:X->Y is a relation where every input in X has exactly one output in the target Y.

  2. Graph as ordered pairs

    The graph stores the same arrows as ordered pairs inside X x Y, with one pair for each input.

  3. Image and preimage

    Image is read forward to reached outputs; preimage is read backward from an output set to the inputs that land there.

  4. Injective

    Injective means no collision: if two inputs have the same output, they must have been the same input.

  5. Surjective

    Surjective means the actual image equals the whole target, so no target element is missed.

  6. Composition

    For g o f, first apply f and then feed the resulting output into g.

The same arrow diagram separates the main definitions. A function gives each input exactly one output, injectivity forbids collisions, surjectivity covers the target, and composition feeds one output into the next map.

Theorem

Inverse functions exist exactly for bijections

For a function f:X→Yf : X \to Y, an inverse function exists if and only if ff is bijective.

Proof: why a bijection has an inverse

If ff is injective and surjective, then for every y∈Yy \in Y there is a unique x∈Xx \in X with f(x)=yf(x) = y.

That uniqueness lets us define a new function g:Y→Xg : Y \to X by declaring g(y)g(y) to be the unique xx satisfying f(x)=yf(x)=y.

By construction, g(f(x))=xg(f(x)) = x and f(g(y))=yf(g(y)) = y, so gg is the inverse of ff.

Proof: uniqueness and existence of inverses

Suppose g,h:Y→Xg,h:Y\to X are both inverses of f:X→Yf:X\to Y. Using associativity of composition and both inverse equations,

g=g∘idY=g∘(f∘h)=(g∘f)∘h=idX∘h=h.g=g\circ id_Y=g\circ(f\circ h)=(g\circ f)\circ h=id_X\circ h=h.

Thus an inverse, when it exists, is unique. Composition is associative: if f:X→Yf:X\to Y, g:Y→Zg:Y\to Z, and k:Z→Wk:Z\to W, then for every x∈Xx\in X,

k∘(g∘f)(x)=k(g(f(x)))=(k∘g)∘f(x).k\circ(g\circ f)(x)=k(g(f(x)))=(k\circ g)\circ f(x).

The later inverse-implications proof establishes necessity: an inverse makes ff bijective. The construction above gives the inverse of a bijection.

Worked example

Construct injective and non-injective examples

The function n↦n+1n \mapsto n + 1 on ZZ is injective and surjective, so it is bijective.

The function x↦x2x \mapsto x^2 on RR is not injective because 11 and −1-1 have the same image.

The function x↦exx \mapsto e^x on RR is injective but not surjective onto RR, because it never reaches nonpositive numbers.

Common mistake

Do not confuse preimage with inverse function

f{−1}(B)f^\{-1\}(B) always makes sense as a preimage. The inverse function f{−1}f^\{-1\} only exists when ff is bijective.

Left and right inverses

  • A left inverse hh satisfies h∘f=idh \circ f = id.
  • A right inverse gg satisfies f∘g=idf \circ g = id.

These conditions are not the same in general.

Worked example

One map with a left inverse but no right inverse

Let X={a,b,c}X = \{a, b, c\} and Y={α,β,γ,δ}Y = \{α, β, γ, δ\}. Define

f1(a)=α,f1(b)=β,f1(c)=γ.f_1(a)=α,\qquad f_1(b)=β,\qquad f_1(c)=γ.

This map is injective but not surjective, because δδ is never hit. So it can have a left inverse, but it cannot have a right inverse.

For instance, define h:Y→Xh : Y \to X by

h(α)=a,h(β)=b,h(γ)=c,h(δ)=a.h(α)=a,\qquad h(β)=b,\qquad h(γ)=c,\qquad h(δ)=a.

Then h∘f1=idXh \circ f_1 = id_X.

The missing value δδ rules out f1∘g=idYf_1\circ g=id_Y, so no right inverse exists.

Worked example

One map with a right inverse but no left inverse

Define f2:Y→Xf_2 : Y \to X by

f2(α)=a,f2(β)=a,f2(γ)=b,f2(δ)=c.f_2(α)=a,\qquad f_2(β)=a,\qquad f_2(γ)=b,\qquad f_2(δ)=c.

This map is surjective but not injective, so it can have a right inverse but no left inverse.

A right inverse is given by g:X→Yg : X \to Y with

g(a)=α,g(b)=γ,g(c)=δ.g(a)=α,\qquad g(b)=γ,\qquad g(c)=δ.

Then f2∘g=idXf_2 \circ g = id_X.

The collision f2(α)=f2(β)f_2(α)=f_2(β) rules out a left inverse.

Theorem

Finite self-maps: a left inverse already forces an inverse

Let XX be finite and let g:X→Xg : X \to X. If there exists h:X→Xh : X \to X with h∘g=idXh \circ g = id_X, then gg is bijective and hh is also a right inverse of gg.

Proof: a finite self-map with a left inverse

The equation h∘g=idXh \circ g = id_X says that gg is injective: if g(x1)=g(x2)g(x_1)=g(x_2), then applying hh gives x1=x2x_1=x_2.

For a finite set, an injective map from XX to itself is automatically surjective. Thus gg is bijective. Since its inverse is unique and hh already undoes gg on the left, hh must be the inverse function. Therefore g∘h=idXg \circ h = id_X as well.

Proof: inverse implications and their converses

For f:X→Yf:X\to Y and h:Y→Xh:Y\to X, if h∘f=id⁡Xh\circ f=\operatorname{id}_X, then f(x)=f(x′)f(x)=f(x') implies x=h(f(x))=h(f(x′))=x′x=h(f(x))=h(f(x'))=x'. Thus a left inverse implies injectivity. If f∘h=id⁡Yf\circ h=\operatorname{id}_Y, each yy equals f(h(y))f(h(y)), so a right inverse implies surjectivity.

Conversely, suppose ff is injective and X≠∅X\ne\varnothing. Fix one x0∈Xx_0\in X. Define h(y)h(y) as the unique preimage when y∈f(X)y\in f(X) and as x0x_0 otherwise. This is a left inverse and uses no axiom of choice: one fixed fallback value suffices. For X=∅X=\varnothing, the injection into a nonempty YY has no left inverse, since no map Y→∅Y\to\varnothing exists. When both sets are empty, the empty map is its own inverse.

For a surjection, constructing a right inverse means choosing one element from each fibre f−1({y})f^{-1}(\{y\}). Explicit choices or finite choices require no general choice axiom. The assertion that every arbitrary surjection has a right inverse invokes the axiom of choice. This differs from the unique preimages of a bijection, which require no such selection principle.

Worked example

An infinite inclusion with a total left inverse

Let i:N→Zi:\mathbb N\to\mathbb Z be i(n)=ni(n)=n, with 0∈N0\in\mathbb N. Define h:Z→Nh:\mathbb Z\to\mathbb N by h(z)=zh(z)=z for z≥0z\ge0 and h(z)=0h(z)=0 for z<0z<0. Then h(i(n))=nh(i(n))=n for every nn. There is no right inverse because a negative integer, such as −1, has no preimage under ii.

Relations

Definition

A relation

A relation on a pair of sets XX and YY is any subset of X×YX \times Y.

If X=YX = Y, we simply call it a relation on XX.

We write xRyxRy to mean (x,y)∈R(x, y) \in R.

This is the broader notion. A function is just a relation with the extra rule that every input has exactly one output.

For a relation R⊂X×YR \subset X \times Y:

  • the domain of RR is the set of xx that relate to at least one yy;
  • the image or range of RR is the set of yy that are hit by at least one xx.

Worked example

A relation need not be a function

Let XX be the set of countries and YY the set of cities.

The relation “yy is a capital city of xx” is a relation on X×YX \times Y. Whether it is a function depends on the historical period and the country.

The relation y2=xy^2 = x on Z×ZZ \times Z is also a relation. It is not a function when read from xx to yy, because one input may have multiple outputs.

Relations let us talk about connections without forcing uniqueness. That is exactly what we need for order relations and equivalence relations later on.

Relations on one set

Relations R⊂X×XR \subset X \times X are especially important.

Theorem

Four properties used constantly

A relation on XX may have these properties:

  • Reflexive: xRxxRx for every x∈Xx \in X
  • Symmetric: xRyxRy implies yRxyRx
  • Antisymmetric: if xRyxRy and yRxyRx, then x=yx = y
  • Transitive: if xRyxRy and yRzyRz, then xRzxRz

Two special kinds of relations appear everywhere in later chapters:

  • a partial order is reflexive, antisymmetric, and transitive;
  • an equivalence relation is reflexive, symmetric, and transitive.

The difference between symmetric and antisymmetric is easy to blur:

  • symmetric says the arrows go both ways whenever one goes one way;
  • antisymmetric says two-way arrows force equality.

Worked example

The divisibility relation is a partial order

On the positive integers Z>0\mathbb Z_{\gt0}, write a∣ba \mid b when aa divides bb.

This relation is reflexive because every number divides itself. It is antisymmetric because if a∣ba \mid b and b∣ab \mid a, then a=ba = b for positive integers. It is transitive because divisibility passes through chains.

So divisibility is a partial order.

The qualification “positive” matters. On all of Z\mathbb Z, both 1∣−11\mid-1 and −1∣1-1\mid1, although 1≠−11\ne-1, so antisymmetry would fail there.

Posets are not just a vocabulary item. They let us organize objects by how one contains, refines, or divides another.

Relation tests and counterexamples

Let X=P({1,2,3,4})X=\mathcal P(\{1,2,3,4\}) and define xRyxRy by x∩y=∅x\cap y=\varnothing. This relation is not reflexive: a nonempty set such as {1}\{1\} does not have empty intersection with itself. It is symmetric because intersection is symmetric. It is not transitive: with x={1}x=\{1\}, y=∅y=\varnothing, and z={1}z=\{1\}, we have xRyxRy and yRzyRz, but not xRzxRz. It is not antisymmetric: {1}R{2}\{1\}R\{2\} and {2}R{1}\{2\}R\{1\}, although the two sets are different.

Now test the following relations on the integers:

  • x−yx-y odd is not reflexive, since x−x=0x-x=0; it is symmetric, but not transitive, since 0R10R1 and 1R21R2 while 00 is not related to 22.
  • x+yx+y even is an equivalence relation. Reflexivity and symmetry are immediate, and if x+yx+y and y+zy+z are even, then (x+z)=(x+y)+(y+z)−2y(x+z)=(x+y)+(y+z)-2y is even. Its two classes are the even integers and the odd integers.
  • x+y=0x+y=0 is not reflexive (except at 00) and is not transitive: 1R(−1)1R(-1) and (−1)R1(-1)R1, but 11 is not related to itself.
  • The condition x∣y∣=∣x∣yx|y|=|x|y is reflexive and symmetric because it is equivalent to saying that xx and yy have the same sign, or that at least one is zero. It is not transitive: 1R01R0 and 0R(−1)0R(-1), but 11 is not related to −1-1. Therefore it is not an equivalence relation, and it has no equivalence classes to list.

These examples show why each relation property must be tested separately; a single failed property is enough to rule out equivalence.

Worked example

The subset relation as a small poset

Let X={a,b}X=\{a,b\} and consider P(X)P(X), the set of all subsets of XX. Order P(X)P(X) by inclusion.

The bottom element is ∅\varnothing, the top element is {a,b}\{a,b\}, and the two middle elements are {a}\{a\} and {b}\{b\}. The only immediate covering relations are

∅⊂{a},∅⊂{b},{a}⊂{a,b},{b}⊂{a,b}.\varnothing \subset \{a\},\quad \varnothing \subset \{b\},\quad \{a\}\subset \{a,b\},\quad \{b\}\subset \{a,b\}.

A Hasse diagram draws only these immediate covers; all longer comparisons are then understood by transitivity.

Worked example

A simple equivalence relation

Congruence modulo mm is an equivalence relation on ZZ: integers are related when they have the same remainder. Modulo 33, the three classes contain the integers congruent to 00, 11, and 22, and these classes partition ZZ.

Proof: congruence modulo mm

Fix m∈Zm\in\mathbb Z with m>0m\gt0. Define a≡b(modm)a\equiv b\pmod m when m∣(a−b)m\mid(a-b). This is an equivalence relation on Z\mathbb Z.

It is reflexive because a−a=0a-a=0 and every positive mm divides 00. It is symmetric because if m∣(a−b)m\mid(a-b), then m∣−(a−b)=b−am\mid-(a-b)=b-a. It is transitive: if m∣(a−b)m\mid(a-b) and m∣(b−c)m\mid(b-c), then mm divides their sum (a−b)+(b−c)=a−c(a-b)+(b-c)=a-c. Thus all three required properties hold.

The class of aa is

[a]m={b∈Z:m∣(a−b)},[a]_m=\{b\in\mathbb Z:m\mid(a-b)\},

so the classes are exactly the residue classes modulo mm.

Equivalence classes and quotient sets

An equivalence relation declares which differences we will ignore. Before constructing a new object from its equivalence class, we must prove that every representative gives the same class. The partition theorem below makes that step precise; the integer and rational constructions will reuse it.

Definition

Equivalence class

Let RR be an equivalence relation on XX. For x∈Xx \in X, the equivalence class of xx is

[x]R={y∈X∣yRx}.[x]_R = \{y \in X \mid yRx\}.

Definition

Quotient set

If ∼\sim is an equivalence relation on XX, then the set of equivalence classes is written X/∼X / \sim.

Theorem

Equivalence classes partition the set

If RR is an equivalence relation on XX, then the equivalence classes cover XX, and any two classes are either equal or disjoint.

Proof: overlapping equivalence classes are equal

Reflexivity gives xRxxRx, hence x∈[x]Rx\in[x]_R for every x∈Xx\in X. Thus the classes cover XX.

Suppose z∈[x]R∩[y]Rz\in[x]_R\cap[y]_R. Then zRxzRx and zRyzRy. If u∈[x]Ru\in[x]_R, we have uRxuRx; symmetry gives xRzxRz, and transitivity gives uRzuRz and then uRyuRy. Hence u∈[y]Ru\in[y]_R, proving [x]R⊆[y]R[x]_R\subseteq[y]_R.

Conversely, if v∈[y]Rv\in[y]_R, then vRyvRy; symmetry gives yRzyRz, so transitivity yields vRzvRz and then vRxvRx. Thus v∈[x]Rv\in[x]_R, proving [y]R⊆[x]R[y]_R\subseteq[x]_R. Two inclusions give equality. Therefore unequal classes cannot intersect, and the distinct classes form a partition of XX.

Cardinality and operation language

Cardinality means size, but in set theory the correct comparison is not always ordinary counting. Two sets XX and YY have the same cardinality when there is a bijection between them:

∣X∣=∣Y∣means there exists a bijection X→Y.|X| = |Y| \quad \text{means there exists a bijection } X \to Y.

Worked example

A first bijection between NN and ZZ

0,1,−1,2,−2,3,−3,…0, 1, -1, 2, -2, 3, -3, \ldots

This corresponds to a function f:N→Zf : N \to Z such as

f(0)=0,f(2k+1)=k+1,f(2k+2)=−(k+1).f(0)=0,\qquad f(2k+1)=k+1,\qquad f(2k+2)=-(k+1).

Every integer appears exactly once in this list, so this is a bijective enumeration.

Worked example

An injection from N×NN \times N into NN

One useful countability test is whether an ordered pair of natural numbers can be encoded by a single natural number. A clean answer is

F(m,n)=2m3n.F(m,n)=2^m3^n.

This defines a function F:N×N→NF : N \times N \to N, because 2m3n2^m3^n is a natural number for every pair (m,n)(m,n).

To see that FF is injective, suppose

F(m,n)=F(m′,n′).F(m,n)=F(m',n').

Then

2m3n=2m′3n′.2^m3^n = 2^{m'}3^{n'}.

Unique prime factorization says that a positive integer has only one factorization into powers of primes. Therefore the exponent of 22 must agree on both sides, and the exponent of 33 must agree on both sides:

m=m′,n=n′.m=m', \qquad n=n'.

So two different ordered pairs cannot be sent to the same natural number.

Definition

Operations as functions

An nn-ary operation on a set SS is a function

Sn→S.S^n \to S.

For example, addition is a binary operation because it takes a pair of inputs and returns one output in the same set.

A 00-ary operation may look strange at first. It is a function with no input slot and one value in SS, so it can be read as choosing a distinguished element of SS.

Common mistakes

Common mistake

Do not treat preimage as inverse function

f{−1}(B)f^\{-1\}(B) is always a subset of the domain. It does not require ff to be bijective.

Common mistake

Symmetric is not the same as antisymmetric

≤≤ is antisymmetric but not symmetric. Equality is both symmetric and antisymmetric, while divisibility on Z>0\mathbb Z_{\gt0} is antisymmetric but not symmetric.

Common mistake

A relation can fail to be a function in several ways

It may send one input to many outputs, or it may leave some inputs with no output at all.

Quick checks

Checkpoint

Is x≤yx ≤ y on the real numbers a relation? Is it a function?

First ask whether it is a subset of R×RR \times R. Then ask whether every input has exactly one output.

Solution · Answer

It is a relation, because it is a subset of R×RR \times R. It is not a function, because one input xx is related to many possible values of yy.

Checkpoint

Is f{−1}(B)f^\{-1\}(B) defined when ff is not bijective?

Separate preimage notation from inverse-function notation.

Solution · Answer

Yes. The preimage always exists.

Checkpoint

If AA has three elements and BB has two elements, how many functions are in BAB^A?

Choose one output in BB for each input in AA.

Solution · Answer

There are 23=82^3 = 8 functions.

Checkpoint

If g:X→Xg : X \to X has a left inverse and XX is finite, what property of gg comes first in the proof that gg is invertible?

Use the equation h∘g=idXh \circ g = id_X.

Solution · Answer

First prove that gg is injective. Since XX is finite, injective then implies surjective, so gg is bijective.

Checkpoint

Why does F(m,n)=2m3nF(m,n)=2^m3^n define an injection from N×NN \times N to NN?

Use the exponents of the primes 22 and 33.

Solution · Answer

If 2m3n=2{m′}3{n′}2^m3^n = 2^\{m'\}3^\{n'\}, unique prime factorization forces m=m′m=m' and n=n′n=n'. Therefore equal outputs imply equal ordered pairs, so FF is injective.

Checkpoint

If a relation is reflexive, symmetric, and transitive, what is it called?

Recall the special name for a relation that partitions the set into classes.

Solution · Answer

It is an equivalence relation.

Practice

Work out your answer, then check it. You can revise and try again.

Loading…

Key terms in this unit