13
$\begingroup$

Can't figure out the difference between them. I have read wiki article about codomains and images, but what is the difference? It seems confusing the examples part in codomain article. How can we claim this:

$f: \mathbb R \to \mathbb R$,

where $f(x) = x^2$? This function will never assume negative number, so why the codomain is R? After all, the authors might have gone even further and claim that codomain is the set of complex numbers!

  • 2
    closely related: http://math.stackexchange.com/questions/5480/how-is-the-codomain-for-a-function-defined2012-01-08

1 Answers 1

19

You cannot read off the codomain from the formula $f(x)=x^2$.

Domain and codomain really are part of the data which comes with a function. This means that you cannot just say

"Let $f$ be the function $x\mapsto x^2$."

Instead, you always have to specify domain and codomain first, as in

"Let $f$ be the function from $\mathbb R$ to $\mathbb R$ mapping $x$ to $x^2$."

Or, as you mentioned, it could be

"Let $f$ be the function from $\mathbb R$ to $\mathbb C$ mapping $x$ to $x^2$."

or

"Let $f$ be the function from $\mathbb C$ to $\mathbb C$ mapping $x$ to $x^2$."

This will really be different functions.

Of course, if you want to define a function $f\colon X\to Y$ you have to make sure that $f(x)$ actually is an element in $Y$. Therefore,

"Let $f$ be the function from $\mathbb C$ to $\mathbb R$ mapping $x$ to $x^2$."

does not define a function.

The image of a function $f\colon X\to Y$ is, by the way, the subset of $Y$ consisting of all element $y\in Y$ for which there exists an element $x\in X$ with $f(x)=y$.

  • 0
    Thanks a lot, Rasmus! But isn't square of complex number a rational number?2012-01-08
  • 2
    @Zapadlo: No, it's not. The answer is also no, if you meant real instead of positive. The square of $1+i$, for instance, is not a real number.2012-01-08
  • 0
    (replace real with rational in my previous comment)2012-01-08
  • 0
    Are domain and images then same ?2017-02-01
  • 0
    Do you mean to define a function we first need to define its domain, codomain and then what it maps its argument to? If it is so, I have never met such statement about function. Could you please recommend a book where I can read about this? I am beginner in math.2017-12-25
  • 0
    @Rasmus - thanks for the excellent answer. Could you motivate why we define a function as a map from a domain to a co-domain, as opposed to a map from a domain to the image? Why do we want the extra information of the co-domain (since the image is always a subset, and sometimes a proper subset, of the co-domain)?2018-01-09
  • 2
    @bodo For one thing, it might be extremely hard to determine the image of a given function. Let's consider a complicated curve in the plane. The codomain is just the plane because that's where the curve "lives". But writing down the list of points met by the curve is going to be messy and not something we want to do just to be able to define the curve.2018-01-09