2

It seems to me that any proof of

If $I\subseteq \mathbb{R}$ is an interval and $h:I\to\mathbb{Q}$ is continuous, then it is constant $\hspace{4mm}$ ($\ast$)

or variants thereof that invokes the Intermediate Value Theorem (IVT) is incorrect because (as far as I'm aware) the proofs I've seen of the IVT relies on the fact that the image of $f$ must be connected. However if the codomain of $f$ is already restricted to $\mathbb{Q}$ (or if we stipulate the image of $f$ to only rational values) then we cannot apply the IVT. Is it just me or am I missing something here?

The highest voted answers for these questions below uses the IVT where the first question has been an accepted as an answer.

Prove that if $f: \mathbb{R} \to \mathbb{Q}$ is continuous then $f$ is constant

Is a rational-valued continuous function $f\colon[0,1]\to\mathbb{R}$ constant?

Addendum:

Statement of the IVT that I am using:

Let $I$ be an interval and suppose $f:I\to\mathbb{R}$ is continuous. If $a,b\in I$ and $y\in\mathbb{R}$ satisfies $f(a)<y<f(b)$ then there is a $c\in (a,b)$ such that $f(c)=y$

I have resolved my confusion and it comes down to the assumption of $f$ having codomain $\mathbb{R}$ in the statement of the IVT. I was thinking that if we had a function, say the one in ($\ast$) where the codomain is $\mathbb{Q}$ then we cannot apply the IVT because it does not meet the assumptions of the theorem, so then I had to look at the proof of the theorem to see if the codomain really had to be $\mathbb{R}$. In all the proofs I have seen (and I'm sure that almost every proof of the IVT would have this step) there is this step where we suppose that

" $y\in \mathbb{R}$ such that $f(a) < y < f(b)$ "

that caused me to conclude that the codomain had to be $\mathbb{R}$ in order for the IVT to work because $y$ can be irrational, and if $f:I\to\mathbb{Q}$ then how can we conclude that there is a $c\in (a,b)$ such that $f(c)=y$ because $f$ can only take rational values? That erroneously caused me to conclude that the assumption that the function has codomain $\mathbb{R}$ had to be the case. However, this is exactly the flaw in my thinking because as stated in the comments, the codomain does not exactly have to be $\mathbb{R}$ but as long as it is a subset of $\mathbb{R}$. Thus, the IVT should really be of the form

Let $I$ be an interval and $S\subseteq \mathbb{R}$. Suppose $f:I\to S$ is continuous. If $a,b\in I$ and $y\in\mathbb{R}$ satisfies $f(a)<y<f(b)$ then there is a $c\in (a,b)$ such that $f(c)=y$.

Hence, $S$ is just some arbitrary subset of $\mathbb{R}$ and in proving the theorem we conclude that $S$ had to in fact be an interval. That's why I had my qualm as to why we can use the IVT to prove ($\ast$) since $h$ does not meet the assumptions of the theorem since the codomain of $h$ is $\mathbb{Q}$.

Now some may ask, but since $\mathbb{Q} \subseteq \mathbb{R}$ then surely the IVT can still be applied to any function who's codomain is a subset of $\mathbb{R}$. I'm not sure if in general we can do this even though in the case of the IVT it happens to be fine?

tcmtan
  • 1,941
  • 4
    Why do you say that we cannot apply the IVT? Note that if $f$ is a real-valued function on $[a,b]$, our notion of continuity doesn't appeal to what the codomain is, we only care that it is a subset of $\mathbb{R}$. – csch2 Apr 21 '21 at 03:27
  • The intermediate value theorem claims, as stated here, that, if $I$ is an interval and $f$ is continuous, then $f(I)$ is an interval as well.

    Bear in mind that the converse is not implied here (that is, we do not assume $f(I)$ is an interval), so you've got things backwards or the proofs you've seen have been somewhat missing the point.

    – PrincessEev Apr 21 '21 at 03:34
  • 1
    What's your precise statement of the IVT? Keep in mind that any function with codomain $\mathbb{Q}$ may be viewed as also being a function with codomain $\mathbb{R}$ whose range happens to be contained in $\mathbb{Q} \subset \mathbb{R}$. – Nate Eldredge Apr 21 '21 at 03:42
  • I have resolved my confusion thanks to your replies. I'm not sure how we would accept an answer though because I had to think about it and the confusion and it's resolution is in the addendum above – tcmtan Apr 22 '21 at 04:58

1 Answers1

1

The intermediate value theorem can be restated as saying that the image of an interval is connected. It does not assume its conclusion.

Igor Rivin
  • 26,372