Tom de Jong, 1 and 4 April 2022.
\begin{code}
{-# OPTIONS --safe --without-K #-}
module Ordinals.Taboos where
open import MLTT.Plus-Properties
open import MLTT.Spartan hiding (๐ ; โ ; โ)
open import Ordinals.Equivalence
open import Ordinals.Maps
open import Ordinals.Notions
open import Ordinals.Type
open import Ordinals.Underlying
open import UF.DiscreteAndSeparated hiding (๐-is-discrete)
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.ClassicalLogic
open import UF.FunExt
open import UF.PropTrunc
open import UF.Size
open import UF.Subsingletons
open import UF.UA-FunExt
open import UF.Univalence
\end{code}
We show that two classically true statements about ordinals are constructively
unacceptable, because each of them implies excluded middle.
The first statement is that every discrete ordinal is trichotomous. Classically,
this is trivial, because every ordinal is trichotomous (and discrete).
Constructively, the converse (trichotomous implies discrete) *does* hold.
The second statement is that the supremum of a family of trichotomous ordinals
indexed by a discrete type is again discrete.
\begin{code}
Every-Discrete-Ordinal-Is-Trichotomous : (๐ค : Universe) โ ๐ค โบ ฬ
Every-Discrete-Ordinal-Is-Trichotomous ๐ค =
((ฮฑ : Ordinal ๐ค) โ is-discrete โจ ฮฑ โฉ
โ is-trichotomous-order (underlying-order ฮฑ))
module suprema-of-ordinals-assumptions
(pt : propositional-truncations-exist)
(sr : Set-Replacement pt)
(ua : Univalence)
where
open import Ordinals.OrdinalOfOrdinalsSuprema ua
open suprema pt sr public
Sups-Of-Discretely-Indexed-Trichotomous-Ordinals-Are-Discrete :
(๐ค : Universe) โ ๐ค โบ ฬ
Sups-Of-Discretely-Indexed-Trichotomous-Ordinals-Are-Discrete ๐ค =
(I : ๐ค ฬ ) โ is-discrete I โ (ฮฑ : I โ Ordinal ๐ค)
โ ((i : I) โ is-trichotomous-order (underlying-order (ฮฑ i)))
โ is-discrete โจ sup ฮฑ โฉ
\end{code}
In showing that the first statement implies excluded middle, the two-element
type in some fixed but arbitrary universe ๐ค will be useful.
\begin{code}
module _ {๐ค : Universe} where
๐ : ๐ค ฬ
๐ = ๐ {๐ค} + ๐ {๐ค}
pattern โ = inl โ
pattern โ = inr โ
๐-is-discrete : is-discrete ๐
๐-is-discrete = +-is-discrete ๐-is-discrete ๐-is-discrete
\end{code}
We now work towards proving that excluded middle follows from the assertion that
every discrete ordinal is trichotomous.
The outline of the proof is given here:
(1) Fix a type P and construct a transitive and well-founded relation โบ on ๐
involving P.
(2) If P is a proposition, then โบ is prop-valued.
(3) If ยฌยฌ P holds, then โบ is extensional.
(4) Hence, if P is a proposition such that ยฌยฌ P holds, then (๐ , โบ) is a
(discrete) ordinal.
(5) The order โบ is trichotomous if and only if P holds.
Hence, if every discrete ordinal is trichotomous, then ยฌยฌ P โ P for every
proposition P, which is equivalent to excluded middle.
\begin{code}
module discrete-trichotomous-taboo-construction
(P : ๐ค ฬ )
where
_โบ_ : ๐ {๐ค} โ ๐ {๐ค} โ ๐ค ฬ
โ โบ โ = ๐
โ โบ โ = P
โ โบ โ = ๐
โ โบ โ = ๐
โบ-is-prop-valued : is-prop P โ is-prop-valued _โบ_
โบ-is-prop-valued i โ โ = ๐-is-prop
โบ-is-prop-valued i โ โ = i
โบ-is-prop-valued i โ โ = ๐-is-prop
โบ-is-prop-valued i โ โ = ๐-is-prop
โบ-is-transitive : transitive _โบ_
โบ-is-transitive โ โ โ u v = v
โบ-is-transitive โ โ โ u v = u
โบ-is-transitive โ โ z u v = ๐-elim u
โบ-is-transitive โ โ z u v = ๐-elim u
โบ-well-founded-lemma : (y : ๐) โ y โบ โ โ is-accessible _โบ_ y
โบ-well-founded-lemma โ l = ๐-elim l
โบ-well-founded-lemma โ l = ๐-elim l
โบ-is-well-founded : is-well-founded _โบ_
โบ-is-well-founded โ = acc โบ-well-founded-lemma
โบ-is-well-founded โ = acc ฮณ
where
ฮณ : (y : ๐) โ y โบ โ โ is-accessible _โบ_ y
ฮณ โ l = acc โบ-well-founded-lemma
โบ-is-extensional : ยฌยฌ P โ is-extensional _โบ_
โบ-is-extensional h โ โ u v = refl
โบ-is-extensional h โ โ u v = refl
โบ-is-extensional h โ โ u v = ๐-elim (h ฮณ)
where
ฮณ : ยฌ P
ฮณ p = ๐-elim (v โ p)
โบ-is-extensional h โ โ u v = ๐-elim (h ฮณ)
where
ฮณ : ยฌ P
ฮณ p = ๐-elim (u โ p)
๐โบ-ordinal : is-prop P โ ยฌยฌ P โ Ordinal ๐ค
๐โบ-ordinal i h = ๐ , _โบ_ , โบ-is-prop-valued i , โบ-is-well-founded
, โบ-is-extensional h , โบ-is-transitive
โบ-trichotomous-characterization : is-trichotomous-order _โบ_ โ P
โบ-trichotomous-characterization = โฆ
โโฆ , โฆ
โโฆ
where
โฆ
โโฆ : P โ is-trichotomous-order _โบ_
โฆ
โโฆ p โ โ = inr (inl refl)
โฆ
โโฆ p โ โ = inl p
โฆ
โโฆ p โ โ = inr (inr p)
โฆ
โโฆ p โ โ = inr (inl refl)
โฆ
โโฆ : is-trichotomous-order _โบ_ โ P
โฆ
โโฆ t = lemma (t โ โ)
where
lemma : (โ โบ โ) + (โ ๏ผ โ) + (โ โบ โ) โ P
lemma (inl p) = p
lemma (inr (inl e)) = ๐-elim (+disjoint e)
lemma (inr (inr l)) = ๐-elim l
\end{code}
The above construction quickly yields the first promised result.
\begin{code}
DNE-if-Every-Discrete-Ordinal-Is-Trichotomous :
Every-Discrete-Ordinal-Is-Trichotomous ๐ค
โ DNE ๐ค
DNE-if-Every-Discrete-Ordinal-Is-Trichotomous h P P-is-prop not-not-P =
lr-implication โบ-trichotomous-characterization
(h (๐โบ-ordinal P-is-prop not-not-P) (๐-is-discrete))
where
open discrete-trichotomous-taboo-construction P
EM-if-Every-Discrete-Ordinal-Is-Trichotomous :
funext ๐ค ๐คโ
โ Every-Discrete-Ordinal-Is-Trichotomous ๐ค
โ EM ๐ค
EM-if-Every-Discrete-Ordinal-Is-Trichotomous fe h =
DNE-gives-EM fe (DNE-if-Every-Discrete-Ordinal-Is-Trichotomous h)
\end{code}
It is somewhat more involved to get a taboo from the assertion that
discretely-indexed suprema of trichotomous ordinals are discrete.
The first step is fairly straightforward however and once again involves
constructing an ordinal that depends on a proposition P. What matters is that:
(1) the constructed ordinal is trichotomous;
(2) an initial segment of the ordinal is equivalent to P.
\begin{code}
module _
(fe : FunExt)
where
open import Ordinals.Arithmetic fe
open import Ordinals.WellOrderArithmetic
module discrete-sup-taboo-construction-I
(P : ๐ค ฬ )
(P-is-prop : is-prop P)
where
P' : Ordinal ๐ค
P' = prop-ordinal P P-is-prop +โ ๐โ
P'-is-trichotomous : is-trichotomous-order (underlying-order P')
P'-is-trichotomous = trichotomy-preservation (prop.trichotomous P P-is-prop)
(prop.trichotomous ๐ ๐-is-prop)
where
open plus (prop.order P P-is-prop) (prop.order ๐ ๐-is-prop)
\end{code}
Next, we turn to the second part of our construction, which defines a
discretely-indexed family of trichotomous ordinals. To work with (suprema of)
ordinals, we need additional assumptions and imports.
\begin{code}
module _
(pt : propositional-truncations-exist)
(sr : Set-Replacement pt)
(ua : Univalence)
where
open suprema-of-ordinals-assumptions pt sr ua
private
fe : FunExt
fe = Univalence-gives-FunExt ua
open import NotionsOfDecidability.Decidable
open import Ordinals.Arithmetic fe
open import Ordinals.OrdinalOfOrdinals ua
open import Ordinals.WellOrderArithmetic
open import UF.Embeddings
open import UF.ImageAndSurjection pt
module discrete-sup-taboo-construction-II
(P : ๐ค ฬ )
(P-is-prop : is-prop P)
where
open discrete-sup-taboo-construction-I fe P P-is-prop
I : ๐ค ฬ
I = ๐ {๐ค}
ฮฑ : I โ Ordinal ๐ค
ฮฑ โ = P'
ฮฑ โ = ๐โ +โ ๐โ
ฮฑ-is-trichotomous : (i : I) โ is-trichotomous-order (underlying-order (ฮฑ i))
ฮฑ-is-trichotomous โ = P'-is-trichotomous
ฮฑ-is-trichotomous โ = trichotomy-preservation trichotomous trichotomous
where
open prop ๐ ๐-is-prop
open plus (underlying-order ๐โ) (underlying-order ๐โ)
\end{code}
We will derive decidability of P from the assumption that the supremum of ฮฑ is
discrete.
The idea of the proof is captured by NBโ and NBโ below. We will decide P by
deciding whether (ฮฑ โ โ inr โ) and (ฮฑ โ โ inr โ) are equivalent ordinals.
This, in turn, is decidable, because both ordinals are images of an embedding
e : โจ sup ฮฑ โฉ โ Ordinal ๐ค and โจ sup ฮฑ โฉ is discrete by assumption.
\begin{code}
fact-I : โจ ฮฑ โ โ inr โ โฉ โ P
fact-I (inl p , _) = p
NBโ : โจ ฮฑ โ โ inr โ โฉ โ P
NBโ = qinveq f (g , ฮท , ฮต)
where
f : โจ ฮฑ โ โ โ โฉ โ P
f = fact-I
g : P โ โจ ฮฑ โ โ โ โฉ
g p = (inl p , โ)
ฮท : g โ f โผ id
ฮท (inl p , _) = to-subtype-๏ผ (ฮป x โ Prop-valuedness P' x โ) refl
ฮต : f โ g โผ id
ฮต p = P-is-prop (f (g p)) p
NBโ : โจ ฮฑ โ โ inr โ โฉ โ ๐{๐ค}
NBโ = singleton-โ-๐ (x , c)
where
x : โจ ฮฑ โ โ inr โ โฉ
x = (inl โ , โ)
c : is-central (โจ ฮฑ โ โ inr โ โฉ) (โ , โ)
c (inl โ , โ) = refl
fact-II : P โ (ฮฑ โ โ inr โ) โโ (ฮฑ โ โ inr โ)
fact-II p = f , (f-order-pres , f-is-equiv , g-order-pres)
where
f : โจ ฮฑ โ โ inr โ โฉ โ โจ ฮฑ โ โ inr โ โฉ
f _ = inl โ , โ
g : โจ ฮฑ โ โ inr โ โฉ โ โจ ฮฑ โ โ inr โ โฉ
g _ = inl p , โ
f-order-pres : is-order-preserving (ฮฑ โ โ inr โ) (ฮฑ โ โ inr โ) f
f-order-pres (inl p , _) (inl q , _) l = ๐-elim l
g-order-pres : is-order-preserving (ฮฑ โ โ inr โ) (ฮฑ โ โ inr โ) g
g-order-pres (inl โ , _) (inl โ , _) l = ๐-elim l
f-is-equiv : is-equiv f
f-is-equiv = qinvs-are-equivs f (g , ฮท , ฮต)
where
ฮต : f โ g โผ id
ฮต (inl โ , _) = refl
ฮท : g โ f โผ id
ฮท (inl q , _) = to-subtype-๏ผ (ฮป x โ Prop-valuedness P' x โ)
(ap inl (P-is-prop p q))
fact-III : (ฮฑ โ โ inr โ) โโ (ฮฑ โ โ inr โ) โ P
fact-III e = fact-I (โโ-to-funโปยน (ฮฑ โ โ inr โ) (ฮฑ โ โ inr โ) e (inl โ , โ))
decidability-if-sup-of-ฮฑ-discrete : is-discrete โจ sup ฮฑ โฉ โ is-decidable P
decidability-if-sup-of-ฮฑ-discrete ฮด = decidable-โ (fact-III , fact-II) dec
where
r : image (sum-to-ordinals ฮฑ) โ Ordinal ๐ค
r = restriction (sum-to-ordinals ฮฑ)
c : (ฮฃ i ๊ I , โจ ฮฑ i โฉ) โ image (sum-to-ordinals ฮฑ)
c = corestriction (sum-to-ordinals ฮฑ)
ฯ : โจ sup ฮฑ โฉ โ image (sum-to-ordinals ฮฑ)
ฯ = sup-is-image-of-sum-to-ordinals ฮฑ
f : (ฮฃ i ๊ I , โจ ฮฑ i โฉ) โ โจ sup ฮฑ โฉ
f = โ ฯ โโปยน โ c
e : โจ sup ฮฑ โฉ โ Ordinal ๐ค
e = r โ โ ฯ โ
e-is-embedding : is-embedding e
e-is-embedding =
โ-is-embedding (equivs-are-embeddings โ ฯ โ (โโ-is-equiv ฯ))
(restrictions-are-embeddings (sum-to-ordinals ฮฑ))
e-after-f-lemma : e โ f โผ sum-to-ordinals ฮฑ
e-after-f-lemma (i , x) =
(r โ โ ฯ โ โ โ ฯ โโปยน โ c) (i , x) ๏ผโจ h โฉ
r (c (i , x)) ๏ผโจ refl โฉ
sum-to-ordinals ฮฑ (i , x) โ
where
h = ap r (inverses-are-sections โ ฯ โ (โโ-is-equiv ฯ) (c (i , x)))
dec : is-decidable ((ฮฑ โ โ inr โ) โโ (ฮฑ โ โ inr โ))
dec = decidable-cong ฮณ (ฮด (f (โ , inr โ)) (f (โ , inr โ)))
where
ฮณ = (f (โ , inr โ) ๏ผ f (โ , inr โ)) โโจ โฆ
1โฆ โฉ
(e (f (โ , inr โ)) ๏ผ e (f (โ , inr โ))) โโจ โฆ
2โฆ โฉ
((ฮฑ โ โ inr โ) ๏ผ (ฮฑ โ โ inr โ)) โโจ โฆ
3โฆ โฉ
((ฮฑ โ โ inr โ) โโ (ฮฑ โ โ inr โ)) โ
where
โฆ
1โฆ = โ-sym (embedding-criterion-converse e e-is-embedding
(f (โ , inr โ)) (f (โ , inr โ)))
โฆ
2โฆ = ๏ผ-cong _ _ (e-after-f-lemma (โ , inr โ))
(e-after-f-lemma (โ , inr โ))
โฆ
3โฆ = UAโ-โ (ua ๐ค) (fe _ _) (ฮฑ โ โ inr โ) (ฮฑ โ โ inr โ)
\end{code}
Finally, we derive excluded middle from the assumption that discretely-indexed
suprema of trichotomous ordinals are discrete, as announced at the top of this
file.
\begin{code}
EM-if-Sups-Of-Discretely-Indexed-Trichotomous-Ordinals-Are-Discrete :
Sups-Of-Discretely-Indexed-Trichotomous-Ordinals-Are-Discrete ๐ค
โ EM ๐ค
EM-if-Sups-Of-Discretely-Indexed-Trichotomous-Ordinals-Are-Discrete h P i =
decidability-if-sup-of-ฮฑ-discrete ฮณ
where
open discrete-sup-taboo-construction-II P i
ฮณ : is-discrete โจ sup ฮฑ โฉ
ฮณ = h ๐ ๐-is-discrete ฮฑ ฮฑ-is-trichotomous
\end{code}