Formal Definition of a Function

The informal idea of a function as a "rule" is intuitive but imprecise. This section gives the rigorous, set-theoretic definition of a function based on ordered pairs, removing all ambiguity and providing a foundation for advanced mathematics.

Quick Reference

Concept Formal Meaning
Ordered pair where is the first member and is the second
Function A set of ordered pairs with no two pairs sharing the same first member
Domain Set of all first members of pairs in
Range Set of all second members of pairs in
Function notation means the pair belongs to

Why a Formal Definition?

Previously, we described a function as a "rule" or "procedure" that assigns to each element of a set exactly one element in a set . However, the words rule, procedure, and assigns are not mathematical concepts: they can mean different things to different people. To make the definition completely precise, we reformulate it using the mathematical concept of an ordered pair.

Ordered Pairs

An ordered pair consists of two objects, where is the first member and is the second. Two ordered pairs and are equal if and only if both members match:

You have already seen ordered pairs in coordinate geometry: the point is different from the point . In an ordered pair, order matters.

Definition of a Function

A function is a set of ordered pairs in which no two pairs share the same first member.

The set of all elements that appear as first members of pairs in is called the domain of . The set of all second members is called the range (or set of values) of .

Think of a function as a two-column table: the left column holds -values (the domain), the right column holds the corresponding -values (the range). The key rule is that no two rows can have the same -value with different -values. In set notation:

Let

Solution is a function because no two pairs share the same first element. The domain and range are: Notice that the pairs and share the same second element . That is perfectly fine: different inputs may produce the same output. What is forbidden is the same input producing two different outputs. Now consider is not a function because both and belong to : the input is mapped to two different outputs and .

Function Notation Revisited

Since for every in the domain there is precisely one with , once is specified, is uniquely determined. This justifies the familiar notation

which simply means "the pair belongs to the set ." The notation is more efficient and readable than writing every time.

Domain, Range, and Codomain

When we write , we declare:

  • is the domain of : the set of allowable inputs.
  • is the codomain of : the set that outputs are supposed to lie in.
  • The range of is the set of outputs actually produced: , which is always a subset of .

The range may be strictly smaller than the codomain. For example, defined by has codomain but range .

In the next section, we will study domain and range of a function in more detail and various examples.

Frequently Asked Questions

Why define a function as a set of ordered pairs instead of a rule? Defining a function as a set of ordered pairs is precise and unambiguous. The word "rule" is informal: two different-looking rules (e.g., and for ) might define the same or different functions depending on their domains. The ordered-pair definition settles such questions immediately.

Is the pair in the same function as ? There is no contradiction: a function can contain both and as long as those are the only pairs with first members 2 and 5, respectively. The function that contains both pairs would satisfy and .

Can the range equal the codomain? Yes. When the range equals the codomain, the function is called surjective (or onto). For example, , has range , which equals its codomain.

Is a function the same as a relation? A relation from to is any set of ordered pairs with first members in and second members in . A function is a special kind of relation where no two pairs share the same first member. Every function is a relation, but not every relation is a function.