60. Codomain

For a function 𝑓:𝑋𝑌, the codomain is the set 𝑌 where outputs are declared to live — though outputs don’t necessarily fill it.

𝑌=codomain(𝑓)

The actual subset of 𝑌 that gets hit by 𝑓 is the image (or range) — always a subset of the codomain, sometimes strict.

Example

𝑓:, 𝑓(𝑥)=𝑥2.

  • Codomain:
  • Image: [0,)

Negative reals like 3 are in the codomain (they’re “allowed” outputs by the type signature) but not in the image (no real 𝑥 produces them).

60.1. Codomain vs image

The choice of codomain is partly conventional. Two functions can be the “same” with different codomains:

𝑓1:,𝑓1(𝑥)=𝑥2𝑓2:[0,),𝑓2(𝑥)=𝑥2

𝑓2 is surjective (image = codomain); 𝑓1 is not.

60.2. For matrices

If 𝑇(𝑥)=𝐴𝑥 with 𝐴 an 𝑚×𝑛 matrix:

60.3. See also