A function is more than a formula: its input set, output set, and assignment rule determine what claims about it mean. This chapter keeps definitions, injectivity, surjectivity, composition, and inverses together because each answers a question about the same mapping. It builds on Naive Set Theory and prepares the view of a sequence as an indexed function [1][1] T. Button, Set Theory. Open Logic Project, 2026. Fall 2021 course text, revised July 2026. https://builds.openlogicproject.org/courses/set-theory/settheory-screen.pdf.
Specify the domain, codomain, and rule
A function assigns to every exactly one element . Its domain is and its codomain is . Its image, or range, is , a subset of .
For with , the codomain is all integers but the image is . We regard functions as typed mappings: equality requires the same domain, codomain, and outputs. Thus the same formula with a different declared codomain can have different mapping properties.
There is one function from to any set , the empty function. There is no function from a nonempty to . These cases follow from the definition; it is unnecessary to ban empty sets from the definition of function.
The graph of is the set of ordered pairs . As a subset of , it must associate exactly one output with every input. A relation may associate several outputs or none, so not every relation is a function. Detailed relation theory belongs to Relations and Order.
A formula must actually define a function
The rule does not define a total function , but does define one on . On the same declared domain and codomain, and give exactly the same rule. The notation for an inverse function, discussed below, is a separate use of the superscript.
A rule must also be independent of how an input is represented. For example, “send the rational number to its numerator ” is not well-defined, since would produce different outputs for the same rational number. To define a function on equivalence classes or other represented objects, check all allowed representations.
Images and preimages of sets
For and , define
The first moves a subset forward; the second collects inputs whose outputs lie in a specified subset. The preimage notation is defined for every function and does not require an inverse function.
For , , the image of is , while the preimage of is . Multiple inputs may contribute the same image element, which is listed only once.
For ,
If , choose with . The input lies in at least one of , so . Conversely, if belongs to either image, a witnessing input belongs to , giving membership in its image. This proves both inclusions.
There is therefore no counterexample to equality here. Intersections behave differently:
For the square function with and , the left side is empty but the right side is . The two separate image memberships may be witnessed by different inputs.
Preimages preserve both unions and intersections, as well as complements relative to the declared sets:
For example, membership in the left side means that and , exactly the condition on the right. A preimage test always concerns the same input , explaining why no injectivity assumption is needed.
Injective, surjective, and bijective
| Property | Meaning | How to prove it |
|---|---|---|
| Injective | Equal outputs force equal inputs | Assume and derive |
| Surjective onto | Every element of the codomain is reached | Take arbitrary and construct with |
| Bijective | Both of the above | Establish both obligations |
To disprove injectivity, find distinct inputs with the same output. To disprove surjectivity, find a codomain element with no preimage. Having an output for every input is already required of a function; it is not the definition of surjectivity.
The function from to is neither injective nor surjective: collide and is not reached. From to , it is surjective but still not injective. Restricting both the domain and codomain to makes it bijective.
Let be . If , then , so and is injective. Given arbitrary , choose . It is real and satisfies , proving surjectivity. Therefore is bijective.
For finite domain and codomain of the same size, injectivity and surjectivity are equivalent: selecting distinct outputs uses all available outputs. That statement does not extend unchanged to infinite sets. The map from to itself is injective but misses .
Use mappings to compare cardinalities
The one-to-one pairing in Naive Set Theory is now precisely a bijection . It certifies . An injection places distinct elements of at distinct locations in ; this is the meaning of for general sets.
If is countable and there is an injection , then is countable. For a finite , there are only finitely many available locations. For a countably infinite , scan an enumeration of and retain the locations used by the injection. Each element of is recovered at most once, and none is missed.
A related statement is useful for sequences: a nonempty set is countable exactly when some surjection exists. A finite nonempty list can be prolonged by repeating one element. Conversely, from a surjective list, keep each value only at its first occurrence; the resulting list is finite or countably infinite and includes every element. The empty set is countable too, but no function exists.
These are statements about the existence of mappings. The instruction to retain first occurrences explains a mathematical listing; without computable data and equality tests, it does not promise an executable enumeration algorithm.
Composition and what can be inferred from it
If and , then is defined by . The function on the right acts first. Composition is associative but generally not commutative. Identity functions satisfy .
For and on , we get and . Pointwise multiplication instead gives . The operations answer different questions even when both functions share a numerical domain.
If are injective and , injectivity of gives , then that of gives .
If are surjective, take arbitrary . Choose with , then with . Thus . Therefore a composition of bijections is a bijection.
Some converse conclusions are weaker: if is injective, must be injective; if is surjective, must be surjective. One cannot conclude that both component functions are bijective merely because the composition is. An exercise below provides a counterexample.
Inverse functions and inverse images
A two-sided inverse of is a function satisfying
Such an inverse exists exactly when is bijective. If is bijective, every has exactly one preimage; assigning that preimage defines . Conversely, the first identity makes injective, and the second makes it surjective. The inverse is unique and is denoted .
For , the inverse is , not . An injective always has an inverse after regarding it as a bijection ; that does not make it invertible on all of when some outputs are missed.
The expression still denotes a preimage set even when no inverse function exists. When is bijective, it agrees with the image of under the inverse function. Keeping the brackets and domains explicit prevents the two meanings from being confused.
Restrictions and partial functions
For , the restriction keeps the same outputs on a smaller domain. It is a total function on its own declared domain . A partial function instead has an actual domain while retaining as the ambient input set; some ambient inputs may have no output.
The reciprocal rule is partial on ambient input set , but total as a map . To encode missing outputs, introduce a fresh symbol and define a total map which agrees with on and returns elsewhere. This changes the codomain explicitly; it does not prove that the original rule had an output at every input.
Exercises
For a mapping with domain and codomain , explain why is a valid input and a valid output value, while is not a valid input.
Show solution
The first component must lie in , and the second must be a subset of . The first pair meets both requirements. The second has an invalid first component and an integer rather than an integer subset as its second component. Knowing that is in the codomain does not determine which input, if any, maps to it.
Do and the relation define functions ? Give a precise function obtained by making appropriate restrictions.
Show solution
The real square-root rule is undefined for negative inputs. The relation also allows two outputs for positive . Requiring and choosing the nonnegative root gives the function , . Its existence and uniqueness are properties of the real numbers, not consequences of merely writing the relation.
For , , determine whether is injective and whether it is surjective.
Show solution
It is surjective: for arbitrary , take . It is not injective, since and both map to . Every claimed witness belongs to the declared product domain.
Take and . Let send to , and let send both inputs to . Check , , and .
Show solution
The composition is the identity on the singleton and hence bijective. But misses and is not surjective; identifies two distinct inputs and is not injective. This refutes the claim that a bijective composition forces both factors to be bijections.
Prove that an injective satisfies . Identify where injectivity is used.
Show solution
The forward inclusion holds for every function. For the reverse, take with and . Injectivity gives , so this common input lies in and witnesses membership on the left. The square-function counterexample in the text shows why the equality can fail without injectivity.
For , , find its inverse and compute for . Repeat the preimage computation when the domain is all of .
Show solution
On the nonnegative domain, the inverse is and the preimage of is . On all reals, the preimage becomes , even though the function is no longer injective and has no two-sided inverse. This distinguishes a preimage operation from an inverse function.
Continue with Sequences and Series. For detailed properties of elementary real functions, see the calculus collection; their long catalogue is not needed to establish the mapping concepts here.
Comments