Map
BasisPrerequisites
A map is the precise mathematical name for a rule that sends each element of one set to exactly one element of another. Every function you write in a programming language is a map in this sense. Getting comfortable with the formal definition — and the vocabulary around it — unlocks a large part of modern mathematics.
Definition
Let and be sets. A map from to , written
is a rule that assigns to every element exactly one element .
- is the domain of .
- is the codomain of .
- is the image of under (also called the value of at ).
The notation (read: ” maps to ”) specifies what does to a single element. A complete map specification combines both:
Example. The squaring map on the integers:
Here , , .
Terminology note. The words map, function, and mapping are used interchangeably in most of mathematics. In analysis, “function” often implicitly carries a notion of continuity, while “map” is the neutral general term.
Image and preimage of sets
You can extend a map from individual elements to whole subsets.
The image of a subset under is the set of all values produces on :
The image of the entire domain, , is called the range of . The range is always a subset of the codomain — but it need not equal the codomain.
The preimage (or inverse image) of a subset is the set of all elements in that map into :
Note that is well-defined for any map — it does not require to have an inverse.
Injective, surjective, bijective
These three adjectives classify how a map relates its domain to its codomain.
Injective (one-to-one)
A map is injective when distinct inputs always produce distinct outputs:
Equivalently (the contrapositive): .
An injective map embeds inside without collisions.
Example. is injective: if then .
Non-example. is not injective: but .
Surjective (onto)
A map is surjective when every element of is hit by at least one element of :
Equivalently, the range equals the entire codomain: .
Example. is surjective: for any , take .
Non-example. is not surjective: is never in the range, since has no integer solution.
Bijective
A map that is both injective and surjective is bijective. A bijection pairs every element of with exactly one element of , with no element of left out and none doubled up.
Bijections are the correct notion of “same size” between sets. Two sets and have the same cardinality if and only if there exists a bijection . This definition works even for infinite sets.
The identity map
For any set , the identity map is defined by
It is trivially bijective and serves as the neutral element for composition.
Composition
Given maps and , their composition is defined by
The notation reads right-to-left: apply first, then . The types must align — the codomain of must equal the domain of .
Composition satisfies:
- Associativity: whenever the types match.
- Identity laws: and .
Compositions of injections are injective; compositions of surjections are surjective; compositions of bijections are bijective.
Inverse map
If is bijective, its inverse is the unique map satisfying
Concretely, is the unique element with .
A map has an inverse if and only if it is bijective. This is why bijections are also called invertible maps.
Summary
- A map assigns each element of the domain exactly one element in the codomain .
- is the image of ; the set is the range of (a subset of the codomain).
- is the preimage of and is defined for any map.
- Injective : distinct inputs give distinct outputs — no collisions.
- Surjective : every element of the codomain is hit — the range fills .
- Bijective: both; the map is invertible and witnesses that .
- Composition applies then ; it is associative and respects injectivity/surjectivity/bijectivity.
- A bijection has a unique inverse .