Altanis

1.3Functions of Sets

Updated 19 Aug 2026Chapter (PDF)

[1.3.1]Definition(Function, Graph of Function)#

A function f:ABf: A \to B is a map between sets in which each element aAa \in A is mapped to exactly one f(a)Bf(a) \in B. The graph of a function is defined by

Γf={(a,b)A×B:b=f(a)}={(a,f(a)):aA}.\Gamma_f = \{(a, b) \in A \times B : b = f(a)\} = \{(a, f(a)) : a\in A\}.

As notation, note af(a)a \mapsto f(a) means a “maps to” f(a)f(a), and

diagrammatically notes AA is mapped to BB by the function ff.

Suppose f:ABf: A \to B and g:BCg: B \to C. The composition (gf):AC(g \circ f): A \to C can be drawn by a commutative diagram.

[1.3.2]Definition(Commutative Diagram)#

A diagram is said to commute if, when going through any path prescribed by the diagram between two endpoints, the result is the same.

Suppose f:AB,g:BC,h:CDf: A \to B, g: B \to C, h: C \to D.

Note the diagram is commutative, and accordingly, h(gf)=(hg)fh \circ (g \circ f) = (h \circ g) \circ f. The associativity of function compositions is trivial and left without proof.

[1.3.3]Definition(Injectivity and Surjectivity)#

A function f:ABf: A \to B is:

  1. injective if, for every a,aAa, a' \in A such that aaa \ne a', it follows that f(a)f(a)f(a) \ne f(a'). Equivalently, for every a,aAa, a' \in A such that f(a)=f(a)f(a) = f(a'), it follows that a=aa = a'.

  2. surjective if, for every bBb \in B, there exists some aAa \in A such that f(a)=bf(a) = b. Equivalently, if im(f)=B\im(f) = B.

Injections and surjections are noted by \hookrightarrow and \twoheadrightarrow respectively, a homage to the notation of monomorphisms and epimorphisms (an equivalent categorization in the category of sets, Set\Set).

If f:ABf: A \to B is both injective and surjective, it is indeed bijective, and accordingly AA and BB are isomorphic as sets. We say f:ABf: A \stackrel{\sim}{\to} B, or ABA \cong B.

Suppose f:ABf: A \to B is bijective. Then, we are justified in “flipping” the diagram that defines ff to produce g:BAg: B \to A such that a=g(b)a = g(b) whenever b=f(a)b = f(a). Diagrammatically,

commutes, so gf=idAg \circ f = \id_A and fg=idBf \circ g = \id_B. The first diagram says gg is a left-inverse of ff (as reference to gg being left to ff in composition notation, which is read right-to-left), and conversely the second diagram says gg is a right-inverse of ff. Indeed, we simply say gg is the inverse of ff, for which we write g=f1g = f^{-1} since two-sided inverses are unique (this is trivial and left without proof).

[1.3.4]Theorem(Injectivity, Surjectivity, Bijectivity Characterized by Invertibility)#

Suppose f:ABf: A \to B with AA \ne \emptyset. Then

  1. ff has a left-inverse if and only if it is injective.

  2. ff has a right-inverse if and only if it is surjective.

  3. ff has a (unique) two-sided inverse if and only if it is bijective.

Proof.

This is trivial and left without proof.