Definition of Functions
A function is one of the most fundamental concepts in all of mathematics. At its core, a function is a special type of relation between two sets — one that assigns to every input exactly one output. You can think of a function as a reliable machine: you feed it a value, and it always returns exactly one result, never two, never zero. This precise, dependable behavior is what distinguishes a function from a more general relation. Functions appear everywhere in mathematics and the real world. The rule that assigns to each student in a class their exam score is a function, because each student has exactly one score. The rule that assigns to each real number its square root, however, requires care: if we include both positive and negative roots, one input gives two outputs, which would violate the definition of a function. Understanding what qualifies as a function, and what does not, is essential for almost every topic you will encounter in algebra, calculus, and beyond. In this article, we will define functions precisely using the language of sets and relations, explore the concepts of domain, codomain, and range, learn the vertical line test for identifying functions graphically, and examine examples that sharpen your intuition. By the end, you will be able to determine whether any given relation is a function and describe its key properties.
- Relations: The Starting Point
- The Key Restriction: One Output Per Input
- Domain, Codomain, and Range
- Function Notation
- The Vertical Line Test
- One-to-One vs. Many-to-One Functions
Relations: The Starting Point
A relation from a set A to a set B is any set of ordered pairs (a, b) where a ∈ A and b ∈ B. For example, if A = {1, 2, 3} and B = {4, 5}, then R = {(1, 4), (2, 5), (3, 4)} is a relation. Relations can be completely arbitrary — an element of A might be paired with many elements of B, or with none at all.
The Key Restriction: One Output Per Input
A function f from set A to set B, written f : A → B, is a relation in which every element of A is paired with exactly one element of B. Two conditions must both hold: (1) Every element in A must appear as a first coordinate — no input is left without an output. (2) No element in A appears as a first coordinate more than once — no input can produce two different outputs. If R = {(1, 4), (1, 5), (2, 4)} the pair (1,4) and (1,5) show that input 1 maps to both 4 and 5, so R is NOT a function.
Domain, Codomain, and Range
Given f : A → B, the domain of f is the set A — the set of all allowed inputs. The codomain is the set B — the set of all possible outputs that were declared. The range (or image) of f is the set of values that f actually produces: range(f) = {f(x) : x ∈ A}. The range is always a subset of the codomain, but not necessarily equal to it. For example, f : ℝ → ℝ defined by f(x) = x² has codomain ℝ, but range [0, ∞) because squares are never negative.
Function Notation
We write f(x) = expression to define a function, where x is the independent variable (input) and f(x) is the dependent variable (output). For example, f(x) = 2x + 3 means: take any real number x, multiply it by 2, then add 3. To evaluate: f(5) = 2(5) + 3 = 13. The notation f(x) does NOT mean f multiplied by x; it means 'the value of f at x.' Other common letters for functions are g, h, and in applied contexts, specific names like T for temperature.
The Vertical Line Test
When a relation is drawn on a coordinate plane, you can test whether it is a function using the vertical line test: if every vertical line x = c intersects the graph at most once, the relation IS a function. The reasoning is direct — a vertical line x = c represents a single input value c, and its intersection(s) with the graph represent the output(s) assigned to c. If a vertical line hits the graph at two points, there are two outputs for one input, violating the definition. A circle fails this test; a parabola opening up or down passes it.
One-to-One vs. Many-to-One Functions
Functions can be many-to-one: different inputs can share the same output. For instance, f(x) = x² gives f(2) = 4 and f(−2) = 4. Two inputs, one output — still a valid function. A function is called one-to-one (injective) if different inputs always produce different outputs: f(a) = f(b) implies a = b. Additionally, a function is onto (surjective) if every element of the codomain is actually achieved. These properties become critical when studying inverse functions.
The Key Equation
- f — Function (none): The rule or mapping that assigns outputs to inputs
- A — Domain (set): The set of all valid input values
- B — Codomain (set): The set from which all outputs are drawn
- x — Independent variable (element of A): The input to the function
- y — Dependent variable (element of B): The unique output produced by the function for input x
- \exists! — There exists exactly one (quantifier): Logical symbol meaning 'there exists one and only one'
Worked Example
Problem. Determine which of the following relations are functions. For those that are, state the domain and range. (a) R₁ = {(1, 3), (2, 5), (3, 3), (4, 7)} (b) R₂ = {(1, 2), (1, 4), (3, 6)} (c) f(x) = √x defined for x ≥ 0, outputting only the non-negative square root.
Answer. R₁ is a function with domain {1,2,3,4} and range {3,5,7}. R₂ is NOT a function because input 1 maps to two outputs. f(x)=√x (non-negative branch) IS a function with domain [0,∞) and range [0,∞).
Origins · 1 minPeter Gustav Lejeune Dirichlet and how this was discovered
Dirichlet gave the modern definition of a function in 1837, moving mathematics away from the vague idea that a function must be a single 'formula' toward the precise set-based definition we use today. He defined a function as any rule that assigns to each value of x a unique value of y, without requiring the rule to be expressible by a single algebraic formula. This was a conceptual revolution that opened the door to modern analysis. Dirichlet was famously not a letter-writer — it is said he once sent his father-in-law a note containing only the symbols '2+1=3' to announce the birth of his third child, communicating numerically rather than in words!
Related Concepts
- Definition of Relations — Functions are a special type of relation; understanding general relations is essential before narrowing to functions.
- Domain and Range — Domain and range are core properties of every function, describing the set of valid inputs and actual outputs.
- Function Notation — Learning f(x) notation is the direct next step after understanding what a function is.
- Inverse Functions — Inverse functions reverse the mapping of a function; they require a function to be one-to-one, building directly on the definition.
- Vertical Line Test — The vertical line test is the graphical method for determining whether a relation satisfies the definition of a function.