Partial vs Total Functions: The Subtle Differences in High School to University Mathematics

When I first started studying mathematics at university, one of the earliest surprises was discovering that the definition of a function was not what I’d learned in high school. I had assumed functions were straightforward—expressions like \( f(x) = \sqrt{x} \), sketching graphs, finding intercepts, and maybe talking briefly about domains and ranges. But the university definition introduced entirely new language, structure, and rigour.

In university mathematics, a function is defined formally as a map between two sets:
\[f : A \to B\]
with the requirement that for every element \( a \in A \), there exists exactly one element \( b \in B \) such that \( f(a) = b\). This is known as a total function.

Under this definition, the function
\[f : \mathbb{R} \to \mathbb{R}, \quad f(x) = \sqrt{x}\]
is not well-defined, because negative real inputs do not have real square roots. The function fails to assign outputs to all inputs in \( \mathbb{R} \), violating the requirement that every element in the domain must be assigned a value.

Partial Functions: The Unspoken High School Convention

In contrast, high school mathematics avoids the formalism of domain-codomain notation altogether. Functions are treated more intuitively: given an expression like \( f(x) = \sqrt{x} \), students are expected to understand that it’s “only defined for \( x \ge 0 \)”—but this restriction is usually implicit.

In practice, the type of function being used is a partial function:
\[f : A \to B\]
where the definition is relaxed: for every \( a \in A \), there is at most one \( b \in B \) such that \( f(a) = b \). That is, some inputs in \( A \) may be left undefined.

High school mathematics is by default working with partial functions \( f : \mathbb{R} \to \mathbb{R} \) and working out the domain of definition is usually a problem solving exercise.

Take for example, \( f(x) = \sqrt{x} \), the actual function is only defined on the domain of definition:
\[D = [0, \infty)\]
which makes the function well-defined if considered as a total function \( f : D \to \mathbb{R}\), or as a partial function \( f:\mathbb{R} \to \mathbb{R} \).

Invertibility: A Subtle Difference

A consequence of the total vs partial distinction arises when discussing invertible functions.

In the context of total functions \( f : A \to B \), a function is invertible if and only if it is:

  • Injective (one-to-one): no two inputs map to the same output, and
  • Surjective (onto): every element of \( B \) is mapped to by some input in \( A \).

Together, these properties ensure that the inverse \(f^{-1} : B \to A\) exists and is also a total function.

For example:
\[f : [0,\infty) \to [0,\infty), \quad f(x) = \sqrt{x}\]
is both injective and surjective, so it has an inverse \(f^{-1}: [0,\infty) \to [0,\infty), \quad f^{-1}(x) = x^2 \), which is also a total function.

In the case of partial functions, however, invertibility requires only injectivity (one-to-one). Surjectivity is not necessary, because the inverse can be defined only on the range of \( f \). The inverse becomes a partial function, whose domain is the set of outputs actually attained by \( f \).

For instance:
\[f : [0, \infty) \to \mathbb{R}, \quad f(x) = \sqrt{x}\]
is injective but not surjective. However, its inverse
\[f^{-1}: \mathbb{R} \to [0,\infty), \quad f^{-1}(x) = x^2 \quad \text{defined for } x \ge 0\]
still exists as a partial function. The codomain \( \mathbb{R} \) contains many elements not hit by \( f \), but these are simply excluded from the domain of definition of the inverse.

This subtle difference allows many functions used in high school to be “inverted” informally, even though they lack full surjectivity.

Conclusion

The transition from high school to university mathematics reveals a hidden conceptual shift in the very definition of a function. High school conventions, while practical for computation and modelling, often obscure the formal structure of functions as mappings between sets.

Partial functions are silently assumed when expressions are undefined for some inputs, and totality is never questioned. But in formal mathematics, precision about domain, codomain, and definition matters—and it shapes the way we reason about composition, invertibility, and structure.

Understanding this distinction helps clarify many inconsistencies students may have sensed but not been able to articulate. It also lays the groundwork for more abstract concepts encountered later on—whether in analysis, algebra, or category theory.

Next time you talk about functions, be aware of the context and the audience you are with: are you talking about total functions? or partial functions?

Comments

2 responses to “Partial vs Total Functions: The Subtle Differences in High School to University Mathematics”

  1. Brailey Sims Avatar
    Brailey Sims

    In the section on invertibility your example,
    f : (-∞. 0] —> [0, ∞), f(x) := √x
    Needs correcting

    1. ringomok Avatar

      Yep! Just fixed it

Leave a Reply

Your email address will not be published. Required fields are marked *