R i c e ' s   T h e o r e m   f o r   t h e

  M a r t i n - L o f   u n i v e r s e

    Martin Escardo, University of Birmingham, UK.
    February 2012, update 06 April 2012.

    This is a proof in intensional Martin-Lof type theory,
    extended with the propositional axiom of extensionality as a
    postulate, written in Agda notation. The K-rule or UIP axiom
    are not used, except in instances where they can be
    proved. The proof type-checks in Agda 2.3.2

    An addendum included 21 August 2014.

A b s t r a c t. We show that a Martin-Lof universe `a la Russell
satisfies the conclusion of Rice's Theorem: it has no non-trivial,
decidable, extensional properties. We derive this as a corollary
of more general topological facts in type theory, which don't rely
on Brouwerian continuity axioms.

I n t r o d u c t i o n

We don't manipulate syntax or Turing machines to prove this
claim. We show, within type theory, that the hypothetical
existence of a non-trivial, decidable extensional property of the
universe leads to a construction that is known to be impossible,
namely WLPO, defined and discussed below.

Hence this version of Rice's Theorem for the universe remains true
when type theory is extended with any kind of postulated axiom
(e.g. univalence, Church's thesis, Brouwerian continuity axioms,
Markov principle, to name a few of the contentious axioms that one
may wish to consider in constructive mathematics). One possible
reaction to our result is that this is to be expected: after all,
there are no elimination rules for the universe. But our arguments
show that, even if there were, Rice's Theorem for the universe
would still hold, which justifies the lack of elimination rules.

Of course, if we postulate classical logic, for example in its
extreme version given by the principle of excluded middle, then
there are decidable properties of the universe. Our theorem is
compatible with that. In fact, what our construction does is to
produce a classical conclusion from the hypothetical premise.

Our assumption of the axiom of extensionality may seem dubious. In
any case, we do get a meta-theorem that does not rely on
extensionality: For all closed terms p: U β†’ 𝟚 with p extensional
and X,Y: U, there is no closed term of type p(X) ≑ β‚€ ∧ P(Y) ≑ ₁,
where U is the universe of types and where 𝟚 is a type with two
distinct elements β‚€ and ₁, and with decidable equality.

We derive this claim as a corollary or more general topological
constructions developed in the module TheTopologyOfTheUniverse,
which is the interesting and non-trivial technical aspect of this
work. We emphasize that we don't postulate any continuity axiom in
that module (or in fact any axiom other than extensionality).


{-# OPTIONS --without-K --exact-split --safe #-}

open import UF-FunExt

module RicesTheoremForTheUniverse (fe : FunExt) where

open import SpartanMLTT

open import UF-Equiv
open import UF-EquivalenceExamples
open import TheTopologyOfTheUniverse fe
open import GenericConvergentSequence
open import WLPO
open import BasicDiscontinuityTaboo fe


Our promised corollary of the universe indiscreteness theorem is that
the hypothetical existence of an extensional P : U β†’ 𝟚 with two
different values is a taboo.


extensional :(𝓀 Μ‡ β†’ 𝟚) β†’ 𝓀 ⁺ Μ‡
extensional P = βˆ€ X Y β†’ X ≃ Y β†’ P X ≑ P Y

Rice's-Theorem-for-U :

    (P : 𝓀 Μ‡ β†’ 𝟚) β†’ extensional P β†’ (X Y : 𝓀 Μ‡ ) β†’ P X ≑ β‚€ β†’ P Y ≑ ₁ β†’ WLPO

Rice's-Theorem-for-U {𝓀} P e X Y r s = basic-discontinuity-taboo p (p-lemma , p-lemma∞)
  Q : β„•βˆž β†’ 𝓀 Μ‡
  Q = pr₁ (Universe-Indiscreteness-Theorem (Ξ» i β†’ X) Y)

  Q-lemma : (i : β„•) β†’ Q(under i) ≃ X
  Q-lemma = pr₁ (prβ‚‚ (Universe-Indiscreteness-Theorem (Ξ» i β†’ X) Y))

  Q-lemma∞ : Q ∞ ≃ Y
  Q-lemma∞ = prβ‚‚ (prβ‚‚ (Universe-Indiscreteness-Theorem (Ξ» i β†’ X) Y))

  p : β„•βˆž β†’ 𝟚
  p u = P(Q u)

  p-lemma : (i : β„•) β†’ p(under i) ≑ β‚€
  p-lemma i = e (Q(under i)) X (Q-lemma i) βˆ™ r

  p-lemma∞ : p ∞ ≑ ₁
  p-lemma∞ = e (Q ∞) Y Q-lemma∞ βˆ™ s


Notice that although the proof uses topological techniques, the
formulation of the theorem doesn't mention topology.

One can get more milleage exploiting the fact that β„•βˆž is compact, in
the sense that it satisfies Bishop's principle of omniscience, as
proved in the module GenericConvergentSequence. As a simple example,
one can conclude LPO rather than WLPO.

The type-inhabitedness predicate is clearly extensional. By the
above theorem, this means that there is no algorithm within type
theory that decides whether any given type is inhabited, that is,
whether a proposition has a proof. Of course we already know this
since the time of Godel, Turing and Church, in stronger forms
(such as adding general recursion to type theory). But we
emphasize again that our development is syntax-free (or
Godel-number free), and hence make senses in any model of type

We have the following meta-theorem as a corollary, *without*
assuming the propositional axiom of extensionality:

  For all closed terms P: 𝓀 Μ‡ β†’ 𝟚 and X,Y: 𝓀 Μ‡ with a given proof of
  extensionality of P, there is no closed term of type P(X) β‰  P(Y).

Proof. Assuming the axiom of extensionality, there can't be such
closed terms, as there is a realizability interpretation, e.g.
Hyland's effective topos, where WLPO solves the Halting
Problem. Without postulating the axiom, fewer terms are definable
in the language, and hence the omission of extensionality gives
the same result. Q.E.D.

Added 21 August 2014:

WLPO amounts to saying that we can solve the halting problem. If we
cannot, then all 𝟚-valued functions on 𝓀 Μ‡ must be constant:


Rice's-contrapositive : βˆ€ {𝓀}

 β†’ Β¬ WLPO β†’ (P : 𝓀 Μ‡ β†’ 𝟚) β†’ extensional P β†’ (X Y : 𝓀 Μ‡ ) β†’ P X ≑ P Y

Rice's-contrapositive {𝓀} nwlpo P e = f
  a : (X Y : 𝓀 Μ‡ ) β†’ P X ≑ β‚€ β†’ P Y ≑ ₁ β†’ WLPO
  a X Y = Rice's-Theorem-for-U P e X Y
  b : (X Y : 𝓀 Μ‡ ) (m n : 𝟚) β†’ P X ≑ m β†’ P Y ≑ n β†’ m ≑ n
  b X Y β‚€ β‚€ p q = refl
  b X Y β‚€ ₁ p q = 𝟘-elim (nwlpo (a X Y p q))
  b X Y ₁ β‚€ p q = 𝟘-elim (nwlpo (a Y X q p))
  b X Y ₁ ₁ p q = refl
  f : (X Y : 𝓀 Μ‡ ) β†’ P X ≑ P Y
  f X Y = b X Y (P X) (P Y) refl refl