Set Theory – When Do Two Functions Become Equal?

elementary-set-theoryfunctions

When do two functions become equal?

I have stumbled over this definition of equality of functions in elementary real analysis.

Let $X$ and $Y$ be two sets. Let $f:X\rightarrow Y$ and $g:X\rightarrow Y$ be two functions. $f=g$ iff $f(x)=g(x)$ for all $x\in X$.

Of course, this definition is so standard and I have no problem with it. However, as far as I know, this definition is actually a theorem. It can be proved in ZFC set theory. A function is just a set of ordered pairs (with some conditions). Two sets are equal if they have the same elements (the Axiom of Extensionality). With this assumption, one can prove the above definition. However, the proof does not require that the ranges of $f$ and $g$ have to be the same.

Suppose that the ranges are different, let's say $f:\mathbb{R}\rightarrow\mathbb{R}$ defined by $f(x)=x$ and $g:\mathbb{R}\rightarrow\mathbb{C}$ defined by $g(x)=x$. If we consider these functions as sets of ordered pairs, then they are just the set $\lbrace (x,x):x\in\mathbb{R}\rbrace$. Thus they are equal by the Axiom of Extensionality. However, the equality also requires that if objects $a$ and $b$ are equal, then any property which is true for $a$ is also true for $b$. In this case, we know that $f$ is a surjective, but $g$ isn't. Thus $f$ should not be equal to $g$ and hence a contradiction. But this is not a proof by contradiction to show that the ranges must be equal, everything assumed here is just axioms of ZFC and what is equality itself. So it looks like it is inconsistent.

I have searched similar questions in this website, but there is no question or answer that relate to this. The most related answer would be $f$ and $g$ must have the same range so there would be no problem. But logically, this is just an additional assumption to restrict the ability to compare two functions. If they don't have the same range, then you can't compare it, or there will be a paradox. The problem for this answer is, it doesn't solve the above paradox. It just restricts itself to the situation that the paradox won't arise, but the inconsistency is still there.

Lastly, I found another way to solve this problem in a set theory book. In the book, when one considers surjection, one have to specify which set the surjection is over. For example, one has to say whether it's surjection over $\mathbb{R}$ or surjection over $\mathbb{C}$. In this case, the paradox won't arise because $f$ and $g$ are both surjective over $\mathbb{R}$ and not surjective over $\mathbb{C}$. Thus the surjective property are the same for $f$ and $g$. The only problem for this answer is, if one consider the property of 'surjection over its range' instead, then this property is true for $f$ but not for $g$, which implies that $f\neq g$ again.

When do two functions become equal in general? Can anyone clarify this for me?

Thank you in advance.

Best Answer

The problem is that there are two slightly different conventions about what “function” means. The more common one is that, for any function, the codomain has to be specified. So, if two functions have different codomains (e.g. $\Bbb R$ and $\Bbb C$ in your example), then they are different functions, even if they have the same graph. The other convention is to identify the function with its graph, so that any set $f$ of ordered pairs $(x,y)$ such that $y_1=y_2$ whenever $(x,y_1)\in f$ and $(x,y_2)\in f$ is a function. This latter convention is elegant, and does away with the seemingly unnecessary codomain. However, the property of being “onto” becomes relative—onto what?—and the idea of a function being a surjection cannot be used. This matters in some branches of mathematics but not in others.

Related Question