Question: Wikipedia says that the [intermediate value theorem](https://en.wikipedia.org/wiki/Intermediate_value_theorem) “depends on (and is actually equivalent to) the completeness of the real numbers.” It then offers a simple counterexample to the analogous proposition on ℚ and a proof of the theorem in terms of the completeness property.

Does an analogous result hold for the computable reals (perhaps assuming that the function in question is computable)? If not, is there a nice counterexample?

Answer: 
Let me assume that you are speaking about computable reals and functions in the sense of
[computable analysis](https://en.wikipedia.org/wiki/Computable_analysis), which is one of the most successful approaches to the topic. (One must be careful, since there are several incompatible notions of computability on the reals.)

In computable analysis, the [computable real numbers](https://en.wikipedia.org/wiki/Computable_real_number) are those that can be computed to within any desired precision by a finite, terminating algorithm (e.g. using Turing machines). One should imagine receiving rational approximations to the given real. In this subject, functions on the reals are said to be computable, if there is an algorithm that can compute, for any desired degree of accuracy, the value of the function, for any algorithm that produces approximations to the input with sufficient accuracy. That is, if we want to know f(x) to within epsilon, then the algorithm is allowed to ask for x to within any delta it cares to.

The **Computable Intermediate Value Theorem** would be the assertion that if f is a computable continuous function and f(a)< c<f(b) for computable reals a, b, c, then there is a computable real d with f(d)=c.

The book [Computable analysis: an introduction](https://books.google.com/books?id=OPolVWVFDJYC&dq=computable+analysis&printsec=frontcover&source=bl&ots=_QlUjkXhSy&sig=5m7E0aXQ-CVl8HcF77tzW2AW5Pk&hl=en&ei=Eh8pS93oN4Oj8AbDoIW1DQ&sa=X&oi=book_result&ct=result&resnum=10&ved=0CEIQ6AEwCQ#v=onepage&q=&f=false) by Klaus Weihrauch discusses exactly this question in Example 6.3.6.

The basic situation is as follows. The answer is **Yes**. If f happens to be increasing, then the usual bisection proof of existence turns out to be effective. For other f, however, one can use a trisection proof. Theorem 6.3.8 says that if f is computable and f(x)\*f(z)<0, then f has a computable zero. This implies the Computable Intermediate Value theorem above.

In contrast, the same theorem also says that there is a non-negative computable continuous function f on [0,1], such that the sets of zeros of f has Lebesgue measure greater than 1/2, but f has no computable zero.

In summary, if the function crosses the line, you can compute a crossing point, but if it stays on one side, then you might not be able to compute a kissing point, even if it is kissing on a large measure set.
I am afraid Joel has missed an important detail there, which is worth pointing out. Suppose $f$ is continuous and computable on $[a,b]$ and $f(a) \cdot f(b) < 0$. We must be careful to distinguish between

1. there exists a computable $x$ in $[a,b]$ such that $f(x) = 0$, and
2. there is an algorithm which accepts as input $f$, $a$, and $b$ and outputs $x$ in $[a,b]$ such that $f(x) = 0$.

In the first case we have a **classical** existence of a computable entity $x$, while in case (b) we have a **computable** existence of a computable entity.

I am pretty sure Weihrauch only proves 1., and it is impossible to prove 2., even if we further assume that $f$ is not only computable but computably continuous, or even Lipshitz with a known computable constant. The basic reason why 2. does not hold is that the $x$ cannot be chosen continuously with respect to the input data: essentially, a very small perturbation of $f$ can cause $x$ to jump around. Because all computable maps are continuos, we cannot have an algorithm computing $x$ (this is not a proof, just the idea, you have to work a bit harder to get all the details right).

However, you can impose fairly mild conditions on $f$ that are typically satisfied in practice. For example, if $f$ is locally non-constant, by which I mean that for every $y$ in $[a,b]$ we can compute nearby points $z$ and $w$ such that $f(z) \neq f(w)$, then IVT holds computably in the sense of 2. To see this, just perform bisection, but always avoid hitting a zero by going to a nearby non-zero point (because either $f(z)$ or $f(w)$ is non-zero, and we can compute which one). This condition is satisfied by non-trivial polynomials, for example, as well as for any differentiable function wose derivative only has isolated zeroes.

Let me also say a bit about the use of completeness of reals in IVT. Neel's remark translates from constructive mathematics to computability as follows: we can compute arbitrarily good approximations to the IVT. The trouble is that the approximations need not converge to anything, at least not computably. Classically they have an accumulation point, but we can't compute any information from it.

A second point is that IVT holds not because $\mathbb{R}$ is complete, but because it is connected. A very thorough analysis of this was made by Paul Taylor in his paper "A lambda-calculus for real analysis", see <http://www.paultaylor.eu/ASD/lamcra/> . It's not easy reading, but it is very educational.