# $(\Bbb R \to \Bbb R : x\mapsto x^2)\equiv(\Bbb R \to \Bbb{R}_{\geq 0} : x \mapsto x^2) \not\equiv (\Bbb C \to \Bbb C:x\mapsto x^2)$

Consider the following functions:
$f:\Bbb R \to \Bbb R : x\mapsto x^2$
$g:\Bbb R \to \Bbb{R}_{\geq 0} : x \mapsto x^2$
$h:\Bbb C \to \Bbb C:x\mapsto x^2$

I'm quite sure that $h$ is not equal to $f$ or $g$, but I'm not sure if $f$ and $g$ are equal or inequal.

If you see $f$ and $g$ as subsets of $\Bbb R \times \Bbb R$, then I think both are equal. However, the codomain of $f$ is not the same as the codomain of $g$, therefor you could argue, $f$ and $g$ are not equal. If we would agree that $f=g$, I would not see the point of specifying the codomain.

At university I learned this definition from "Reading, Writing, and Proving: A Closer Look at Mathematics":

A function $f:X\to Y$ is a relation $f$ from $X$ to $Y$ satisfying:
i). $\forall x\in X ,\exists y\in Y :(x,y)\in f$
ii). $\forall x\in X,\forall y_1,y_2 \in Y : (x,y_1),(x,y_2)\in f\implies y_1=y_2$

An function is often called an map or a mapping. The set is $X$ is called the domain and denoted by $\text{dom}(f)$, and the set $Y$ is called the codomain and denoted by $\text{cod}(f)$. When we know what these two sets are and the two conditions are satisfied, we say that $f$ is a well defined function.

From this definition I would conclude that $f\not=g$. Is this correct ? Are there definitions in mathematics where $f=g$? Can somebody enlighten me a little bit here ?

-
I can't even parse the formula you want to be true or false -- I'm not aware of any notation convention that gives a meaning to that mishmash of colons and arrows (six colons in one formula?). Could you try to rewrite it with more standard notation? Or even better, explain in words what you're asking? –  Henning Makholm Feb 24 '13 at 21:55
Unless a "relation from $X$ to $Y$" somehow encodes $X$ and especially $Y$, the definition you quote implies that $f=g$. Also it implies that $\operatorname{cod}(f)$ is not defined. So could it be that in your book alread a relation is something like a triple $(X,Y,R)$ with $R\subseteq X\times Y$ and not just as $R$ alone? –  Hagen von Eitzen Feb 24 '13 at 21:59
@HenningMakholm Changed it. –  Kasper Feb 24 '13 at 22:02
@HagenvonEitzen I think it would be weird if $f=g$ but $\text{cod}(f)\not =\text{cod}(g)$, right ? This sentence also convinced me that $f\not=g$ in this context: When we know what these two sets are and the two conditions are satisfied, we say that f is a well defined function. But I'm not sure. I have my books at uni, so I will look how a relation is specified tomorrow, I don't think it is defined as a triple. –  Kasper Feb 24 '13 at 22:05

If you define a function as a set of ordered pairs with a certain property, then $f$ and $g$ are equal. They both have the same ordered pairs.

If you define a function as a triplet of domain, codomain and a graph (which is the set of ordered pairs from the first definition, in many cases), then $f$ and $g$ are not equal because they have different codomains.

In either case, $h$ is different because it has a different domain and different ordered pairs (e.g. the pair $(i,-1)$ is not in $f$ or $g$, or in their graphs as per the second definition).

The former definition is very useful in set theory, the latter is very useful in category theory. Generally, it doesn't really matter for the mathematics as long as you understand the fine point of differences and how to go from one form to another when you do need to.

Also interesting: Definition of Function (MathOverflow).

-
Of course it does matter if one wants to contemplate statements such as "$f$ is surjective". –  Hagen von Eitzen Feb 24 '13 at 21:56
@Hagen: Yes, but even in set theory when a function is defined as a set of ordered pairs the statement "$f$ is surjective" has meaning in a non-vacuous way. We simply require more context which is provided by defining the codomain explicitly, rather than embedding it into the definition of the function. –  Asaf Karagila Feb 24 '13 at 21:58
Sorry, I do close to nothing about set theory, but how do you define surjective in set theory if you don't have a codomain ? –  Kasper Feb 24 '13 at 22:28
@Kasper: You add context. You don't just say "$f$ is surjective", you say "$f\colon A\to B$ is surjective". Or you say "$f\colon A\to B$ is onto $B$". –  Asaf Karagila Feb 24 '13 at 22:32
oh of course, I understand. –  Kasper Feb 24 '13 at 22:33

As I understand it, in some areas of mathematics, they may talk about "the curve $y=x^2$, and then sometimes talk about "real points on the curve" or "complex points on the curve" and so on. In that case, I guess the curve itself is not a set of ordered pairs in the sense of your textbook.

-

I would say that indeed $f \equiv g$ in this situation, because since $\mathbb{R} \times \mathbb{R}_{\ge0} \subset \mathbb{R} \times \mathbb{R}$, then $g\in\mathbb{R} \times \mathbb{R}_{\ge0}$ also means that $g\in\mathbb{R} \times \mathbb{R}$

-