Mapping Rules
A function assigns to each element of the domain exactly one element of the codomain . The image (range) is the set of outputs actually hit.
Three core properties describe how functions map sets:
| Property | Definition | Key Formula / Rule |
|---|---|---|
| Injective | One-to-one, no two inputs collide | |
| Surjective | Onto, codomain is fully covered | |
| Bijective | Both injective and surjective | Perfect pairing between and |
Bijections are invertible, possessing an inverse that undoes the mapping. They define set cardinality, letting us compare even infinite sets by checking if a bijection exists between them.
Composition and Pitfalls
Functions compose: given and , the composition applies first, then . Programs are built from composed functions transforming data step-by-step.
Common Pitfall: Mixing up injective and surjective, or misreading composition order. Injective means inputs do not collide; surjective means the codomain is fully covered. Always remember that means apply then —the right-hand function runs first, which looks backwards until you practice it.