Cartesian products, mappings, injections, surjections, and bijections
A relation between sets A and B is any subset of the Cartesian product A × B -- a collection of ordered pairs (a, b). A function is a special kind of relation where each element of A maps to exactly one element of B.
Functions are classified by how they map: injections (one-to-one) never repeat outputs, surjections (onto) hit every target, and bijections do both -- establishing a perfect correspondence between sets.
Build the Cartesian product A × B and see all possible ordered pairs. Select subsets of these pairs to define relations.
The grid shows all ordered pairs (a, b) where a is from A and b is from B. Click cells to select pairs and define a relation R from A to B.
| A \\ B | 1 | 2 | 3 |
|---|---|---|---|
| a | |||
| b | |||
| c |
|A x B|
9 pairs
Selected (relation R)
0 pairs
Relation R \u2286 A x B =
{ ∅ }
Key insight: The Cartesian product A × B contains every possible pairing of elements from A with elements from B. If |A| = m and |B| = n, then |A × B| = mn. Every relation is a subset of this product.
Draw arrows from domain to codomain to define mappings. The visualizer checks whether your mapping satisfies the function property (each input has exactly one output).
Click an element in A (left), then click an element in B (right) to draw an arrow. Click the same pair again to remove it. The system classifies your mapping automatically.
Current mapping:
Not a function
Key insight: A function f: A → B assigns to each element of A exactly one element of B. The "vertical line test" in graphing is really checking this single-output property.
Classify functions by their mapping behavior. Toggle between injective (one-to-one), surjective (onto), and bijective (both) examples.
Browse preset examples, or modify any mapping by clicking domain then codomain elements.
Bijective
1 of 5
Each element in A maps to a unique element in B, and every element in B is covered. This is both injective and surjective.
Classification Checklist
Result: Bijective (one-to-one correspondence)
Key insight: A bijection is both injective and surjective -- it pairs every element of A with a unique element of B, with nothing left over on either side. Bijections are the key to comparing the sizes of sets.