Threads point from one group of pegs into another, leaving one target peg unused.

Codomain definition

The codomain of a function is the set declared to contain all its outputs.

In Spanish
codominio
Topic
Relations and mappings

Codomain in a picture

Codomain diagramThe codomain can contain values the function never reaches.f: {1, 2} → {a, b, c}The codomain has a, b, and cf(1) = a, f(2) = bThese are the only outputsRange: {a, b}The codomain also contains c
The codomain can contain values the function never reaches.

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.