6

If two functions defined on metric spaces $X$ and $Y$ are equal on a dense subset of $X$ and are continuous also, then are they equal on all of the metric space $X$?

  • 2
    That does not seem to be a question, but an assertion. (It looks to be a true assertion, by the way). – hmakholm left over Monica Sep 25 '12 at 17:35
  • Dear @HenningMakholm, I have another question: assume the two functions are $1/x$ on $\mathbb R \setminus {0}$. After extending them, can we say that they are equal at $0$? I asked this related question here. Can one say $\infty = \infty$? Probably, since otherwise the answer to this question would have to be "no". – Rudy the Reindeer Oct 18 '12 at 14:10
  • 1
    @MattN.: In this question, the functions were (at least in my understanding) supposed to already be continuous on the entire metric space; it was just the equality between them that was known only for a dense subset. It is true that "any two continuous functions $\mathbb R\to\mathbb R$ that are $1/x$ on $\mathbb R\setminus{0}$ are equal", but only vacuously so, because there are no such functions in the first place! – hmakholm left over Monica Oct 18 '12 at 14:31

4 Answers4

4

This is correct. Suppose $f$ and $g$ are continuous functions on a metric space $X$ and agree on a dense subset $Y$. For any $x\in X$, we have some sequence $(y_n)$ in $Y$ such that $y_n\to x$, so $f(y_n)\to f(x)$ and $g(y_n)\to g(x)$. Since $f(y_n)=g(y_n)$ for all $n$, this implies $f(x)=g(x)$.

Alex Becker
  • 60,569
3

Yes. The set of points where the functions $f,g\colon X\to Y$ agree is closed and contains a dense subset. The closure of a dense subset is $X$. (This does not require metric spaces, it is sufficient that $X$ is any topological space and $Y$ is Hausdorff)

2

Another proof:

Let $h = f-g$, $h:X\to Y$. Since $f$ and $g$ are continuous, so is $h$. Hence, $h^{-1}(\{0\})$ is a closed subset of $X$, and since it contains a dense subset of $X$, then it is equal to $X$. Therefore, $h=0$ on $X$, and so $f=g$ on $X$.

Majid
  • 3,357
0

Here is another proof. Let's denote by $D$ the dense subset of $X$, i.e., $\overline{D}=X$. Also, by hypothesis, we have two continuous functions $f,g\colon X\rightarrow Y$ such that the restriction $f|_{D}=g|_{D}$. Note also that we have the following inclusion: \begin{equation} D\subseteq \{x\in X\colon f(x)=g(x)\}\subseteq X. \end{equation} If we take closures, as these preserve the inclusion, we just need to show that $\{x\in X\colon f(x)=g(x)\}$ is closed and it will follow that $\{x\in X\colon f(x)=g(x)\} = X$. Now, consider the diagonal: \begin{align} \Delta = \{(y,y)\colon y\in Y\}\subseteq Y\times Y. \end{align} Since $Y$ is a metric space, it is Hausdorff and therefore $\Delta$ is closed (easy to prove). Now consider the function $h\colon X\rightarrow Y\times Y$ given by $h(x)=(f(x),g(x))$. This function is continuous because both $f$ and $g$ are continuous. Since $\Delta \subseteq Y\times Y$ and $\Delta$ is closed, then the inverse image $h^{-1}(\Delta)$ is closed, and note that \begin{align} h^{-1}(\Delta) = \{x\in X\colon f(x)=g(x)\}, \end{align} which completes the proof.