The Problem with Codomains
Lasse Kliemann
Version 2026-09(Sep)-27
Full article (PDF)
Abstract
A function f typically consists of three parts:
- a set called the domain of f, which we denote by dom(f);
- a set called the codomain of f, which we denote by cod(f);
- a mapping rule, which is some expression that, given x ∈ dom(f), names an element of cod(f), called the image of x under f and denoted by f(x); the element x is called the argument in this context, and we say that x is mapped to f(x) or that f assumes the value f(x) at x.
Define the image of function f: img(f) ≔ {f(x) | x ∈ dom(f)} ⊆ cod(f). So the image of f is the set of all values that f assumes.
In this article, I argue that a function should not consist of three parts, but instead only of two parts, namely domain and mapping rule, no codomain. I will show that:
- In most situations, the codomain is irrelevant.
- When it is not irrelevant, we can look at the image instead. In particular the concept of an inverse function works well by looking at the image; we require neither a codomain nor the notion of surjectivity.
- If taken seriously, the codomain can make things extremely complicated and cause serious problems, without providing any benefit. I present examples of such problems in the context of function vector spaces and derivatives.
As function notation, I suggest (A; x ↦ E), where A is the domain and x ↦ E is the mapping rule. For example, (ℝ; x ↦ x²) would be the function with domain ℝ which maps each element of ℝ to its square.