Codomain definition
The codomain of a function is the set declared to contain all its outputs.
Codomain in a picture
How it works
In f: A → B, the domain is A and the codomain is B. Each input must give an output in B. The range is the set of outputs actually attained, so it is a subset of B. Specifying a different codomain can change whether the function is onto.
Worked examples
For f: ℝ → ℝ with f(x) = x², what is the codomain?
All real numbers.
What is the range for that function?
The nonnegative real numbers.
If the same rule is declared from ℝ to [0, ∞), what changes?
The codomain becomes the nonnegative real numbers, so the function is onto.
Common mistake
Read the codomain from the function declaration. Use the rule and domain to determine the range.
Quick check
In f: A → B, which set is the codomain?
Show answer
B.
Can the range contain something outside the codomain?
Show answer
No.
When does the range equal the codomain?
Show answer
When the function is surjective.
Sources
Flashcard
Codomain
Reveal the definition
The codomain of a function is the set declared to contain all its outputs.
Effortless Math. “Codomain.” Math Dictionary.



