Altanis

1.3Functions of Sets

Updated 19 Aug 2026Chapter (PDF)

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

A function f:A→Bf: A \to B is a map between sets in which each element a∈Aa \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)):a∈A}.\Gamma_f = \{(a, b) \in A \times B : b = f(a)\} = \{(a, f(a)) : a\in A\}.

As notation, note a↦f(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:A→Bf: A \to B and g:B→Cg: B \to C. The composition (g∘f):A→C(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:A→B,g:B→C,h:C→Df: A \to B, g: B \to C, h: C \to D.

Note the diagram is commutative, and accordingly, h∘(g∘f)=(h∘g)∘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:A→Bf: A \to B is:

  1. injective if, for every a,a′∈Aa, a' \in A such that a≠a′a \ne a', it follows that f(a)≠f(a′)f(a) \ne f(a'). Equivalently, for every a,a′∈Aa, a' \in A such that f(a)=f(a′)f(a) = f(a'), it follows that a=a′a = a'.

  2. surjective if, for every b∈Bb \in B, there exists some a∈Aa \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:A→Bf: A \to B is both injective and surjective, it is indeed bijective, and accordingly AA and BB are isomorphic as sets. We say f:A→∼Bf: A \stackrel{\sim}{\to} B, or A≅BA \cong B.

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

commutes, so g∘f=idAg \circ f = \id_A and f∘g=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=f−1g = 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:A→Bf: A \to B with A≠∅A \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.