TITLE: Hidden usage of countable choice
QUESTION [5 upvotes]: In some variations of constructive mathematics, Countable Choice can be even proven (example $-$ this relatively fresh book). In formal terms, the statement is as following:
$$ \forall x \exists y . \varphi[x, y] \implies \exists f \forall x . \varphi[x, f(x)].$$
In the Countable Choice, $x$ is a natural number unlike in usual the Axiom of Choice where $x$ may be anything. In constructive math, there needs to be an algorithm producing $y$ from the given $x$ with the property $\varphi[x, y]$. More details in here.
Now let us recall in which cases we really need the Choice. The answer is, when we deal with infinite sets and the object, that we seek, is not uniquely defined.
My questions thus is: Can we turn any proof of a theorem that uses the Countable Choice into a working computer program?

REPLY [2 votes]: The OP is suggesting that it is possible to do the following constructively:
Conjecture: Let $x_1, \ldots, x_n \in \mathbb{R}$ and $M = \max(x_1, \ldots, x_n)$. For every $\epsilon > 0$ the set $\{i \in \mathbb{N} \mid |M - x_i| < \epsilon\}$ has a smallest element.
I will show that the case $n = 3$, $\epsilon = 2$ implies LLPO, which is not constructively valid. Let $(a_k)_k$ be an infinite binary sequence which contains at most one $1$. We would like to decide whether $a_{2 k} = 0$ for all $k$, or $a_{2 k + 1} = 0$ for all $k$. For this purpose define the numbers
$$x_1 = \sum_{k=0}^\infty a_{2 k} \cdot 2^{-k}$$
and
$$x_2 = \sum_{k=0}^\infty a_{2 k + 1} \cdot 2^{-k}$$
and
$$x_3 = 2$$
Note that $0 \leq x_1, x_2 \leq 2$, therefore $\max(x_1, x_2, x_3) = 2$. By the conjecture, the set $\{i \in \{1, 2, 3\} \mid |2 - x_i| < 2\}$ has a smallest element $j$:

If $j = 1$ then $x_1 > 0$ therefore for some $k \in \mathbb{N}$ we have $a_{2 k} = 1$, from which it follows that $a_{2 k + 1} = 0$ for all $k$.
If $j = 2$ or $j = 3$ then $x_1 = 0$ therefore $a_{2 k} = 0$ for all $k$.

We are done.