# Diaconescu's theorem

In mathematical logic, Diaconescu's theorem, or the Goodman–Myhill theorem, states that the full axiom of choice is sufficient to derive the law of the excluded middle or restricted forms of it.
The theorem was discovered in 1975 by Radu Diaconescu and later by Goodman and Myhill. Already in 1967, Errett Bishop posed the theorem as an exercise (Problem 2 on page 58 in Foundations of constructive analysis).

## In set theory

The theorem is a foregone conclusion over classical logic, where law of the excluded middle is assumed. The proof below is therefore given using the means of a constructive set theory. It is evident from the proof how the theorem relies on the axiom of pairing as well as an axiom of separation, of which there are notable variations. A crucial role in the set theoretic proof is also played by the axiom of extensionality. The subtleties the latter two axioms introduce are discussed further below.
Fixing terminology for the proof: Call a set finite if there exists a bijection with a natural number, i.e. a finite von Neumann ordinal. In particular, write $0:=\{\}$, $1:=\{0\}$ and $2:=\{0,1\}$. For example, a set is finite with cardinality one (an inhabited singleton) if and only if there provenly exists a bijective function out of the set $1$. The proof below is straight forward in that it does not require pathological distinctions concerning the empty set. For a set $X$ to have choice shall mean that if all its members are inhabited, $X$ is the domain of a choice function. Lastly, for inhabited $X$, denote by $X\leq ^{*}Y$ the proposition that $Y$ surjects onto $X$.
The strategy of the proof is to couple a given proposition $P$ to a potential choice domain $X$. And in the end, only a rather restrained form of full choice must be made use of. For concreteness and simplicity, the section supposes a constructive set theory with full Separation, i.e. we allow for comprehension involving any proposition $P$. In that context, the following lemma then more sharply isolates the core insight:
    The law of excluded middle is equivalent to choice in all inhabited sets $X\leq ^{*}2$.
Once the backward-direction of this equivalence is a given, then the axiom of choice, in particular granting a choice function on all sets of this form, implies excluded middle for all propositions.

### Proof of the lemma

Choice is valid in all finite sets. Given that in classical set theory the sets under consideration here are provably all finite (with exactly either the cardinalities one or two), the forward direction of the equivalence is thus established.
To prove the backward-direction one considers two subsets of any doubleton with two distinguishable members. As $0\neq 1$, a convenient choice is again $\{0,1\}$. So, using Separation, let
    $U=\{x\in \{0,1\}\mid (x=0)\vee P\}$
and
    $V=\{x\in \{0,1\}\mid (x=1)\lor P\}.$
Both $U$ and $V$ are inhabited, as witnessed by $0\in U$ and $1\in V$. If the proposition $P$ can be proven, then both of these sets equal $\{0,1\}$. In particular, $P\,\to \,U=V$ by extensionality. In turn, for any mathematical function $g$ that can take both of these sets as an argument, one finds $P\,\to \,g(U)=g(V)$, the contrapositive of which is $g(U)\neq g(V)\,\to \,\neg P$.
The rest of the proof concerns the pair $X:=\{U,V\}$, a set of inhabited sets. (Indeed, $X$ is itself inhabited and even validates $X\leq ^{*}2$, meaning it is finitely indexed. However, note that when not assuming excluded middle, $X$ need not be provably finite, in the bijection sense.)
A choice function $f$ on $X$ by definition has to map into the general union, which here is $\{0,1\}$, and fulfill
    $f(U)\in U\,\land \,f(V)\in V.$
Using the definition of the two subsets and the function's established codomain, this reduces to
    ${\bigf(U)=0\lor P{\big )}\land {\bigf(V)=1\lor P{\big )}.$
Using the law of distributivity, this in turn implies $P\lor {\bigf(U)\neq f(V){\big )}$. By the previous comment on functions, the existence of a choice function on this set thus implies the disjunction $P\lor \neg P$. This concludes the proof of the lemma.

### Discussion

As noted, $P$ implies that both defined sets equal $\{0,1\}$. In that case, the pair $\{U,V\}$ equals the singleton set $\{\{0,1\}\}$ and there are two possible choice functions on that domain, picking either $0$ or $1$. If, instead, $P$ can be rejected, i.e. if $\neg P$ holds, then $U=\{0\}$ and $V=\{1\}$. So in that case $U\neq V$, and on the proper pair $\{\{0\},\{1\}\}$ there is only one possible choice function, picking the unique inhabitant of each singleton set. This last assignment "$U\mapsto 0$ and $V\mapsto 1$" is not viable if $P$ holds, as then the two inputs are actually the same. Similarly, the former two assignments are not viable if $\neg P$ holds, as then the two inputs share no common member. What can be said is that if a choice function exists at all, then it takes values in $\{0,1\}$ and then there exists a choice function choosing $0$ from $U$, and one (possibly the same function) choosing $1$ from $V$.
For bivalent semantics, the above three explicit candidates are all the possible choice assignments.
One may define certain sets in terms of the proposition $P$ and, using excluded middle, in classical set theory prove that these sets constitute choice functions $f\colon \{U,V\}\to \{0,1\}$. Such a set represents an assignment conditioned on whether or not $P$ holds. If $P$ can be decided true or false, then such a set explicitly simplifies to one of the above three candidates. But, in any case, one may not necessarily be able to establish either $P$ nor $\neg P$. Indeed, they may be provably independent of the theory at hand. Then, since the former two explicit candidates are each incompatible with the third, it is generally not possible to explicitly identify both of the choice function's return values, $f(U)$ and $f(V)$, among the two terms $0$ and $1$. So it is not a function in the sense of the word that it could be explicitly evaluated into its codomain of distinguishable values.

#### Finitude

In a theory not assuming the disjunction $P\lor \neg P$ or any principle implying it, it cannot even be proven that a disjunction of the set equality statements above must be the case. In fact, constructively also the two sets $U$ and $V$ are not even provably finite. (However, any finite ordinal injects into any Dedekind-infinite set and so a subset of a finite ordinal does validate the logically negative notion of Dedekind-finiteness. This is the case for both $U$ and $V$, into which $\{0,1,2\}$ cannot be injected. As an aside, it is consistent also with classical ${\mathsf {ZF}}$ that there exist sets which are neither Dedekind-infinite nor finite.)
In turn, the pairing $\{U,V\}$ is also elusive. It is in the surjective image of the domain $2$, but regarding choice assignments it is not known how explicit value-assignments for both $U$ and $V$ can be made, or even how many different assignments would have to be specified. So there is generally no (set) definition such that a constructive theory would prove that joint assignment (set) to be a choice function with domain $\{U,V\}$. Note that such a situation does not arise with the domain of choice functions granted by the weaker principles of countable and dependent choice, since in these cases the domain is always just $\mathbb {N}$, the trivially countable first infinite cardinal.
Adopting the full axiom of choice or classical logic formally implies that the cardinality of $\{U,V\}$ is either $1$ or $2$, which in turn implies that it is finite. But a postulate such as this mere function existence axiom still does not resolve the question what exact cardinality this domain has, nor does it determine the cardinality of the set of that functions possible output values.

### Role of separation

In summary, functions are related to equality (by the definition of unique existence used in functionality), equality is related to membership (directly through the axiom of extensionality and also through the formalization of choice in sets) and membership is related to predicates (through an axiom of separation). Using the disjunctive syllogism, the statement $P$ ends up equivalent to the extensional equality of the two sets. And the excluded middle statement for it is equivalent to the existence of some choice function on $\{U,V\}$. Both goes through whenever $P$ can be used in a set separation principle.
In theories with only restricted forms of separation, the types of propositions $P$ for which excluded middle is implied by choice is also restricted. In particular, in the axiom schema of predicative separation only sentences with set bound quantifiers may be used. The restricted form of excluded middle provable in that context is however still not acceptable constructively. For example, when arithmetic has a model (when, relevantly, the infinite collection of natural numbers form a set one may quantify over), then set-bounded but undecidable propositions can be expressed.

#### Other frameworks

In constructive type theory, or in Heyting arithmetic extended with finite types, there is typically no separation principle at all - subsets of a type are given different treatments. There, a form of the axiom of choice is a theorem, yet excluded middle is not.

## In topoi

In Diaconescu's original paper, the theorem is presented in terms of topos models of constructive set theory.