Codomain — Definition & Example
The codomain of a function is the set of values its outputs are allowed to come from. It is declared ahead of time, so some of its members might never actually be produced as outputs.
For a function written , the set is the codomain. Every input must have . The range (image) is , which always satisfies . The codomain is part of the function's definition. Two functions with the same rule and domain but different codomains are, strictly speaking, different functions.
Worked Example
Problem: Let be defined by . Identify the codomain, find the range, and compare the two sets.
Step 1: Read the codomain from the notation. It is the set written after the arrow.
Step 2: Apply the rule to every input in the domain to find the actual outputs.
Step 3: Collect the outputs into the range. Then check which members of the codomain are never reached.
Answer: The codomain is and the range is . The values 1, 3, and 5 are in the codomain, but no input produces them.
Why It Matters
In precalculus and later in discrete math, you call a function onto (surjective) exactly when its range equals its codomain. That condition helps decide whether a function has an inverse. Programmers use the same idea when they declare a function's return type, such as integer, before knowing which specific values it will return.
Common Mistakes
Mistake: Treating the codomain and the range as the same set. For example, saying the codomain of is when the function was given as .
Correction: The codomain is whatever set the definition declares, which is here. The range is the set of outputs actually produced, . The range is always a subset of the codomain, but it can be smaller.
