00.02.05 · precalc / set-and-function

Function

shipped3 tiersLean: full

Anchor (Master): Halmos Naive Set Theory §8; Bourbaki Theory of Sets Ch. II

Intuition [Beginner]

A function is a dependable rule. Give it an allowed input, and it gives back one output.

Think of a vending machine with labeled buttons. Press button 2, and the machine gives the snack assigned to button 2. A good function does not hesitate between two snacks for the same button.

Functions matter because mathematics constantly compares things by sending one kind of object to another: a number to its square, a point to its height, a vector to its length, or a symmetry move to where it sends a corner.

Visual [Beginner]

Each input has exactly one outgoing arrow. Different inputs may land on the same output.

A diagram of inputs on the left, outputs on the right, and one arrow leaving each input.

The rule may miss some outputs. It may also send several inputs to the same output.

Worked example [Beginner]

Use the rule "double the number and add 1."

Input 0 gives output 1.

Input 3 gives output 7.

Input 10 gives output 21.

The same input always gives the same output. That is the important point. The rule is not "maybe 7, maybe 8" when the input is 3.

What this tells us: a function is a controlled assignment from inputs to outputs.

Check your understanding [Beginner]

Formal definition [Intermediate+]

Let and be sets. A function assigns to every element a unique element . The set is the domain, and is the codomain. The image of is

Equivalently, a function is a subset such that each occurs in exactly one pair [Halmos §8]. This subset is the graph of .

The function is injective if implies . It is surjective if . It is bijective if it is both injective and surjective.

Key theorem with proof [Intermediate+]

Theorem (inverse criterion). A function is bijective if and only if there exists a function such that

Proof. Assume first that is bijective. For each , surjectivity gives at least one with . Injectivity makes that unique. Define to be this unique element. Then for every , and for every .

Conversely, assume such a function exists. If , then applying gives

so is injective. For any , the identity shows that lies in the image of , so is surjective. Thus is bijective.

Bridge. The construction here builds toward 01.01.03 (vector space), where the same data is upgraded, and the symmetry side is taken up in 01.02.01 (group). The defining pattern appears again in those units in a sharpened form, where the local data is glued or quotiented. Putting these together, the foundational insight is that the data of this unit gives the structural signature that the rest of the strand reads off.

Exercises [Intermediate+]

Lean formalization [Intermediate+]

[object Promise]

Advanced results [Master]

The category Set has sets as objects and functions as morphisms. Composition is ordinary composition, and the identity morphism on is . The associativity and identity laws are equations of functions, checked by evaluating both sides at an element [Bourbaki Ch. II].

A function is a monomorphism in Set precisely when it is injective, and an epimorphism precisely when it is surjective. For monomorphisms, the proof is cancellation against maps from a one-point test set. For epimorphisms, cancellation against all maps forces every point of to lie in the image of .

The graph description embeds functions into relations. In that language, functions are exactly the total single-valued relations. This viewpoint is used in set-theoretic foundations, while algebra and geometry usually use the arrow notation .

Synthesis. This construction generalises the linear baseline of earlier strands, with the rigid pairing replaced by its structured analogue. Read in the opposite direction, the construction is dual to the metric story: complements and orthogonality are taken with respect to the bilinear datum of this unit, not a metric, and the resulting category of subobjects is the one the rest of the strand classifies. The central insight is that this datum identifies algebra with geometry: functions become vector fields, subspaces become quotients, and invariants become cohomology classes — and that identification is the engine driving every theorem downstream.

Full proof set [Master]

Proposition. In Set, monomorphisms are injective functions.

If is injective and satisfy , then for each , so and hence .

Conversely, assume is a monomorphism. If , let and define , . Then , so , hence . Thus is injective.

Proposition. In Set, epimorphisms are surjective functions.

If is surjective and satisfy , then for every choose with . The equality gives , so .

Conversely, if is not surjective, choose an element not in its image. Let . Define by for all , and define by and for . Then but , so is not an epimorphism.

Connections [Master]

  • Functions are the input language for vector spaces 01.01.03, where addition and scalar multiplication are functions satisfying axioms.

  • Groups 01.02.01 are sets with multiplication, identity, and inverse functions satisfying algebraic identities.

  • Group actions 03.03.02 are functions encoding how symmetries move points.

  • Continuous maps 02.01.02 are functions that preserve topological closeness.

Historical & philosophical context [Master]

Dedekind, Frege, Peano, and Cantor helped shift nineteenth-century mathematics toward mappings and sets as primitive organizing language. Bourbaki later standardized the terminology of mappings, products, graphs, injections, surjections, and bijections in a set-theoretic framework [Bourbaki Ch. II].

Halmos's Naive Set Theory presents functions as set-theoretic graphs with the single-valued condition, a formulation that remains compatible with modern model-theoretic and category-theoretic treatments [Halmos §8].

Bibliography [Master]

[object Promise]