If math allowed mutable state, we could reduce the axiom of choice to excluded middle:
def axiom_of_choice(family):
cache = {}
def choice_fn(index):
if index not in cache:
cache[index] = family(index)
return cache[index]
return choice_fnThis relies on excluded middle because the ability to check whether an index is in the cache and if so look it up requires the ability to compare indices by equality.
(Sampling from family(index) is legit. The axiom of choice asserts that dependent products commute with propositional truncation. Propositional truncation does not destroy the computational content of the realizers of the family, it just quotients the realizers to be equal for when it comes to determining the well-definedness of functions. Since we use a cache, the resulting choice_fn still respects equality.
This isn't valid type theory of course, since type theory has models that don't permit this stuff and requires propositional truncation to be explicit.)
I think of this as a sort of converse of Diaconescu's theorem.
This isn't actually how the effective topos gets countable choice. Instead I believe the effective topos relies on the fact that realizers of functions out of
I guess to add, the thing about constructive math (which avoids excluded middle and unrestricted choice) is that it permits models where everything is computational. What I hope I've shown is that in some such models, the obstacle to choice really just boils down to excluded middle. (Probably - again it's really difficult to combine mutable state with other stuff in pure math.)