Why f:domain->codomain instead of f:domain->range?







I never understood why the notation

f:X->Y

instead of

f:X->f(X)

In other words, I don't understand the utility of the notion of a
codomain. Why not make the definition of "function" be so that
every function is surjective? I'm sure there are very good reasons
for this, but I don't see them.

The only explanation I can think of is that there are often times
when it is much easier to describe a function's codomain than than
its range. Is this it? Or are there more fundamental reasons
behind this practice?

I suspect the answer has to do with category theory (or its
antecedents), but this is a wild, ignorant guess.

Does anyone know who generally gets the credit (fairly or not) for
realizing that the codomain was more suitable than the range in
the definition of concept of a function?

Pardon my rambling.

Any clues would be appreciated.

kj

--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
.