Composition and Inverse Mappings
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 and , the composition is defined by
Read right to left: apply first, then . The notation looks odd until you realise it matches the order in which you actually evaluate. If and , then .
Associative, but not commutative
Composition is associative: . So you can drop the brackets, is unambiguous.
Composition is not commutative: in general . With the same and as above, , which is not the same as . Order matters.
The three labels
A mapping is
- injective (one-to-one) if different inputs give different outputs: .
- surjective (onto) if every element of is hit: for every there is some with .
- bijective if it is both injective and surjective.
Examples on : is neither (not injective: ; not surjective: nothing hits ). is bijective. is injective but not surjective (codomain is all of but the image is ).
Identity and inverse
The identity mapping sends every element to itself: . It is the neutral element of composition: and .
A bijection has an inverse mapping uniquely determined by . The defining identities are
To find for : set , solve for : , so .
- 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, 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 JOINthat fills nulls corresponds to a partial mapping. Schema-design correctness checks reduce to mapping properties.
(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 and is a mapping, then injective, surjective, and bijective are equivalent. The reason is the pigeonhole principle: if arrows leave and land in a set of size , then no doubling-up forces no skipping, and vice versa. For infinite sets, this fails, , is injective but not surjective.
Try it
- Let and . Compute and and confirm they differ.
- Is , , injective? (Hint: check and .)
- Find the inverse of and verify by composing.
Pause: if is injective but not surjective, can it still have a "left inverse", a mapping with ? Try to construct one for .
A trap to watch for
Students compose and apply first because appears on the left. This is the wrong reading. The notation requires applying first, because is what touches 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 in the next section on permutations, the same right-to-left reading applies, acts first, then .
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 §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.