Cartesian products, mappings, injections, surjections, and bijections
A function sends each input to exactly one output. Build pairs, draw arrows, and see which mappings make the cut.
Enter the elements of A and B, then click pairs in the grid to pick out a relation. Notice the grid always has |A| × |B| cells.
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 ⊆ A x B =
{ ∅ }
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.
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.
Click an element of A, then an element of B, to draw an arrow. The checklist tells you when your arrows form a function: one output for every input.
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.
Step through the examples, or change any arrow by clicking a domain element and then a codomain element. Watch the three checks decide injective, surjective, or bijective.
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)
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.
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.
Spot a mistake or have an idea?