A function assigns exactly one output in the specified codomain to each input in its domain of a function . Its rule may be a formula, a finite table, or another unambiguous assignment. The outputs actually reached form its image of a function . A codomain states where outputs are allowed; the image of a function records where they actually land. Oscar Levin's introduction makes this distinction explicit. [ref]
https://discrete.openmathbooks.org/preview/sec_intro-functions.html. Levin, Discrete Mathematics: An Open Introduction, Functions
.For example, , , has the entire real line as its domain of a function and codomain, but its image of a function is . Both and give the output : several inputs sharing an output is permitted. Assigning two distinct outputs to one input is not permitted. A partial function can be undefined at some elements of a larger specified source set; an ordinary function on must be defined at every element of .
Three properties describe how a function uses its target. An injective function never sends distinct inputs to the same output. A surjective function reaches every member of its specified codomain. A bijection does both, pairing each source element with exactly one target element. These are different requirements, as finite arrow diagrams show.
The chosen codomain matters even when the formula does not change. The function from to is not surjective, whereas the same rule from to is surjective. Both fail injectivity. Further restricting the domain of a function to makes it a bijection onto , with square root as its inverse function.
Functions make transformations composable: if and , their function composition is . Identifying each intermediate codomain prevents attempting to feed an output into a rule that is not defined there. When a transformation is a bijection, an inverse function recovers the original input without ambiguity. This is useful whenever information must be transported or a calculation reversed.
New to topics? Read the docs here!
