Composition and Inverse Mappings

Chapter 15, Mappings and Permutations

Learning objectives

  • Compute the composition of two mappings
  • Identify injective (one-to-one) mappings
  • Identify surjective (onto) mappings
  • Determine if a mapping is bijective

Mappings get interesting when you start combining them. Composition lets you chain two mappings into a third; the identity mapping is the "do nothing" rule; inverse mappings undo each other. With those three ingredients, plus the three labels injective / surjective / bijective, you have the entire vocabulary that linear algebra, group theory, and topology will demand of you for the next several years.

Composition

Given mappings f:Aβ†’Bf: A \to B and g:Bβ†’Cg: B \to C, the composition 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)).

Read right to left: apply ff first, then gg. The notation looks odd until you realise it matches the order in which you actually evaluate. If f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^2, then (g∘f)(3)=g(f(3))=g(7)=49(g \circ f)(3) = g(f(3)) = g(7) = 49.

Associative, but not commutative

Composition is associative: h∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f. So you can drop the brackets, h∘g∘fh \circ g \circ f is unambiguous.

Composition is not commutative: in general f∘gβ‰ g∘ff \circ g \neq g \circ f. With the same ff and gg as above, (f∘g)(x)=f(g(x))=f(x2)=2x2+1(f \circ g)(x) = f(g(x)) = f(x^2) = 2x^2 + 1, which is not the same as (g∘f)(x)=(2x+1)2=4x2+4x+1(g \circ f)(x) = (2x + 1)^2 = 4x^2 + 4x + 1. Order matters.

The three labels

A mapping f:A→Bf: A \to B is

  • injective (one-to-one) if different inputs give different outputs: f(a1)=f(a2)β€…β€ŠβŸΉβ€…β€Ša1=a2f(a_1) = f(a_2) \implies a_1 = a_2.
  • surjective (onto) if every element of BB is hit: for every b∈Bb \in B there is some a∈Aa \in A with f(a)=bf(a) = b.
  • bijective if it is both injective and surjective.

Examples on ℝ→ℝ\mathbb{R} \to \mathbb{R}: f(x)=x2f(x) = x^2 is neither (not injective: f(βˆ’1)=f(1)f(-1) = f(1); not surjective: nothing hits βˆ’1-1). f(x)=x3f(x) = x^3 is bijective. f(x)=exf(x) = e^x is injective but not surjective (codomain is all of ℝ\mathbb{R} but the image is (0,∞)(0, \infty)).

Identity and inverse

The identity mapping idA:Aβ†’A\text{id}_A: A \to A sends every element to itself: idA(x)=x\text{id}_A(x) = x. It is the neutral element of composition: f∘idA=ff \circ \text{id}_A = f and idB∘f=f\text{id}_B \circ f = f.

A bijection f:Aβ†’Bf: A \to B has an inverse mapping fβˆ’1:Bβ†’Af^{-1}: B \to A uniquely determined by fβˆ’1(b)=aβ€…β€ŠβŸΊβ€…β€Šf(a)=bf^{-1}(b) = a \iff f(a) = b. The defining identities are

fβˆ’1∘f=idA,f∘fβˆ’1=idB.f^{-1} \circ f = \text{id}_A, \quad f \circ f^{-1} = \text{id}_B.

To find fβˆ’1f^{-1} for f(x)=2x+35f(x) = \frac{2x + 3}{5}: set y=2x+35y = \frac{2x + 3}{5}, solve for xx: x=5yβˆ’32x = \frac{5y - 3}{2}, so fβˆ’1(x)=5xβˆ’32f^{-1}(x) = \frac{5x - 3}{2}.

Where this shows up
  • Programming: Function composition in JavaScript or Python (f(g(x))) is exactly this section's composition; lodash.flow([g, f]) is a library helper for it, and the order matters, f∘gβ‰ g∘ff \circ g \neq g \circ f in general.
  • Type Theory: An injective function is the proof that a "subtype" embeds into a "supertype"; a surjective function is a "quotient" or "coverage"; bijection is type-isomorphism. Modern type-system design uses these three concepts daily.
  • Databases: Inner joins correspond to injective mappings (no row matched twice); a LEFT JOIN that fills nulls corresponds to a partial mapping. Schema-design correctness checks reduce to mapping properties.

Injective vs not-injective functionsXYinjective βœ“XYnot injective βœ—

(Pick "bijection" from the dropdown, then alter one arrow to break it. Failing elements glow red (two x's sharing a y) or grey (a y with no preimage). The bottom of the widget tells you whether the current mapping is injective, surjective, and/or bijective.)

The pigeonhole principle

For finite sets of the same size, the three labels collapse. If ∣A∣=∣B∣|A| = |B| and f:Aβ†’Bf: A \to B is a mapping, then injective, surjective, and bijective are equivalent. The reason is the pigeonhole principle: if nn arrows leave AA and land in a set of size nn, then no doubling-up forces no skipping, and vice versa. For infinite sets, this fails, f:β„•β†’β„•f: \mathbb{N} \to \mathbb{N}, f(n)=2nf(n) = 2n is injective but not surjective.

Try it

  • Let f(x)=x+3f(x) = x + 3 and g(x)=2xg(x) = 2x. Compute (f∘g)(x)(f \circ g)(x) and (g∘f)(x)(g \circ f)(x) and confirm they differ.
  • Is f:ℝ→ℝf: \mathbb{R} \to \mathbb{R}, f(x)=x3βˆ’xf(x) = x^3 - x, injective? (Hint: check f(0)f(0) and f(1)f(1).)
  • Find the inverse of f(x)=3xβˆ’7f(x) = 3x - 7 and verify f∘fβˆ’1=idf \circ f^{-1} = \text{id} by composing.

Pause: if ff is injective but not surjective, can it still have a "left inverse", a mapping gg with g∘f=idg \circ f = \text{id}? Try to construct one for f(x)=exf(x) = e^x.

A trap to watch for

Students compose g∘fg \circ f and apply gg first because gg appears on the left. This is the wrong reading. The notation (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)) requires applying ff first, because ff is what touches xx inside the parentheses. Reading right-to-left feels strange at first; the convention exists because the input enters on the right and travels leftward through the chain of functions. Whenever you see Οƒβˆ˜Ο„\sigma \circ \tau in the next section on permutations, the same right-to-left reading applies, Ο„\tau acts first, then Οƒ\sigma.

What you now know

You can compose two mappings in the correct order, classify a mapping as injective / surjective / bijective, find the inverse of a bijection by solving for the input, and apply the pigeonhole principle to mappings between finite sets of equal size. The next section specialises this entire toolbox to a single beautiful case, permutations, the bijections of a finite set to itself, and shows you that they form a group under composition.

Quick check

Mark section complete β†’

References

  • Lang, S. (1971). Basic Mathematics. Springer. Chapter 14 Section 2, composition, identity, inverse, and the three classification labels.
  • Rudin, W. (1976). Principles of Mathematical Analysis, 3rd ed. McGraw-Hill. Chapter 2: bijections and inverse mappings in the analysis setting.
  • Halmos, P. (1974). Naive Set Theory. Springer. Sections 7–9, functions, composition, and inverse mappings between abstract sets.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.