Martin Escardo 2012.

The Weak Limited Principle of Omniscience (only somebody called Bishop
could have called it that), or WLPO for short, says that every
infinity binary sequence is either constantly 1 or it isn't.

This is equivalent to saying that every decreasing infinity binary
sequence os either constantly one or not.

The type ββ of decreasing binary sequences is defined in the module
GenericConvergentSequence. The constantly 1 sequence is called β.

WLPO is independent of type theory: it holds in the model of classical
sets, and it fails in recursive models, because it amounts to a
solution of the Halting Problem. But we want to keep it undecided, for
the sake of being compatible with classical mathematics, following the
wishes of Bishop, and perhaps upsetting those of Brouwer who was happy
to accept continuity principles that falsify WLPO. In the words of
Aczel, WLPO is a taboo.  More generally, anything that implies a taboo
is a taboo, and any taboo is undecided. Taboos are boundary
propositions: they are classically true, recursively false, and
constructively, well, taboos!

\begin{code}

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

module Taboos.WLPO where

open import MLTT.Spartan
open import CoNaturals.Type
open import UF.DiscreteAndSeparated
open import UF.FunExt
open import NotionsOfDecidability.Decidable

WLPO : π€β Μ
WLPO = (u : ββ) β (u οΌ β) + (u β  β)

\end{code}

If ββ is discrete, i.e. has decidable equality, then WLPO follows:

\begin{code}

ββ-discrete-gives-WLPO : is-discrete ββ β WLPO
ββ-discrete-gives-WLPO d u = d u β

\end{code}

Conversely, assuming function extensionality, WLPO implies that ββ is
discrete. The proof uses a codistance (or closeness) function
c : ββ β ββ β ββ such that c u v οΌ β β u οΌ v.

\begin{code}

WLPO-gives-ββ-discrete : FunExt β WLPO β is-discrete ββ
WLPO-gives-ββ-discrete fe wlpo u v =
Cases (wlpo (ββ-closeness u v))
(Ξ» (p : ββ-closeness u v οΌ β)
β inl (ββ-infinitely-close-are-equal u v p))
(Ξ» (n : ββ-closeness u v β  β)
β inr (contrapositive (Ξ» (q : u οΌ v)
β ββ-equal-are-infinitely-close u v q) n))
where
open import TWA.Closeness fe

\end{code}

More discussion about WLPO is included in the modules
TheTopologyOfTheUniverse and FailureOfTotalSeparatedness, among
others.

Notice that weak excluded middle implies WLPO.

\begin{code}

open import UF.ClassicalLogic

WEM-gives-WLPO : funextβ β WEM π€β β WLPO
WEM-gives-WLPO fe wem u = Cases (wem (u οΌ β))
(Ξ» (p : (u β  β))
β inr p)
(Ξ» (Ξ½ : Β¬ (u β  β))
β inl (ββ-is-Β¬Β¬-separated fe u β Ξ½))
\end{code}

\begin{code}

open import UF.Base

WLPO-traditional = (Ξ± : β β π) β is-decidable ((n : β) β Ξ± n οΌ β)

open import MLTT.Two-Properties

WLPO-gives-WLPO-traditional fe wlpo Ξ± = IV
where
I : (ββπ-to-ββ Ξ± οΌ β) + (ββπ-to-ββ Ξ± β  β)
I = wlpo (ββπ-to-ββ Ξ±)

II :  ββπ-to-ββ Ξ± οΌ β β (n : β) β Ξ± n οΌ β
II p n = IIβ
where
IIβ : ββ-to-ββπ (ββπ-to-ββ Ξ±) οΌ ββ-to-ββπ β
IIβ = ap ββ-to-ββπ p

IIβ : force-decreasing Ξ± n οΌ β
IIβ = ap (Ξ» - β - n) IIβ

IIβ : Ξ± n οΌ β
IIβ = β€β-criterion-converse (force-decreasing-is-smaller Ξ± n) IIβ

III : ((n : β) β Ξ± n οΌ β) β ββπ-to-ββ Ξ± οΌ β
III Ο = ββ-to-ββπ-lc fe (dfunext fe IIIβ)
where
IIIβ : (n : β) β force-decreasing Ξ± n οΌ Ξ± n
IIIβ = force-decreasing-unchanged Ξ±
(Ξ» i β transportβ _β€β_
((Ο (succ i))β»ΒΉ)
((Ο i)β»ΒΉ)
(β€β-refl {β}))

IIIβ : ββ-to-ββπ (ββπ-to-ββ Ξ±) βΌ ββ-to-ββπ β
IIIβ n = ββ-to-ββπ (ββπ-to-ββ Ξ±) n οΌβ¨ refl β©
force-decreasing Ξ± n      οΌβ¨ IIIβ n β©
Ξ± n                       οΌβ¨ Ο n β©
ββ-to-ββπ β n             β

IV : is-decidable ((n : β) β Ξ± n οΌ β)
IV = map-decidable II III I

WLPO-traditional-gives-WLPO fe wlpot u = IV
where
I : is-decidable ((n : β) β ββ-to-ββπ u n οΌ β)
I = wlpot (ββ-to-ββπ u)

II : ((n : β) β ββ-to-ββπ u n οΌ β) β u οΌ β
II Ο = ββ-to-ββπ-lc fe (dfunext fe Ο)

III :  u οΌ β β (n : β) β ββ-to-ββπ u n οΌ β
III e n = ap (Ξ» - β ββ-to-ββπ - n) e

IV : (u οΌ β) + (u β  β)
IV = map-decidable II III I

\end{code}

Added 9th September 2024. WLPO amounts to saying that the constancy of
a binary sequence is decidable.

\begin{code}

WLPO-variation : π€β Μ
WLPO-variation = (Ξ± : β β π) β is-decidable ((n : β) β Ξ± n οΌ Ξ± 0)

: WLPO-variation
= π-equality-cases I II
where
I : Ξ± 0 οΌ β β ((n : β) β Ξ± n οΌ β) + Β¬ ((n : β) β Ξ± n οΌ β)
I p = inr (Ξ» (Ο : (n : β) β Ξ± n οΌ β)
β zero-is-not-one
Ξ± 0 οΌβ¨ Ο 0 β©
β   β))

II : Ξ± 0 οΌ β β ((n : β) β Ξ± n οΌ β) + Β¬ ((n : β) β Ξ± n οΌ β)
II p = map-decidable
(Ξ» (Ο : (n : β) β Ξ± n οΌ Ξ± 0) (n : β)
β Ξ± n οΌβ¨ Ο n β©
β   β)
(Ξ» (Ξ³ : (n : β) β Ξ± n οΌ β) (n : β)
β Ξ± n οΌβ¨ Ξ³ n β©
Ξ± 0 β)
(wlpov Ξ±)

\end{code}

TODO. The converse.