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}

Added 12 September 2018.

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}

Added 15th November 2023.

\begin{code}

open import UF.Base

WLPO-traditional : 𝓀₀ Μ‡
WLPO-traditional = (Ξ± : β„• β†’ 𝟚) β†’ is-decidable ((n : β„•) β†’ Ξ± n = ₁)

open import MLTT.Two-Properties

WLPO-gives-WLPO-traditional : funext 𝓀₀ 𝓀₀ β†’ WLPO β†’ WLPO-traditional
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 ⟩
             ₁                         =⟨ refl ⟩
             β„•βˆž-to-β„•β†’πŸš ∞ n             ∎

  IV : is-decidable ((n : β„•) β†’ Ξ± n = ₁)
  IV = map-decidable II III I

WLPO-traditional-gives-WLPO : funextβ‚€ β†’ WLPO-traditional β†’ WLPO
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-gives-WLPO-traditional
 : WLPO-variation
 β†’ WLPO-traditional
WLPO-variation-gives-WLPO-traditional wlpov Ξ±
 = 𝟚-equality-cases I II
 where
  I : Ξ± 0 = β‚€ β†’ ((n : β„•) β†’ Ξ± n = ₁) + Β¬ ((n : β„•) β†’ Ξ± n = ₁)
  I p = inr (Ξ» (Ο• : (n : β„•) β†’ Ξ± n = ₁)
               β†’ zero-is-not-one
                  (β‚€   =⟨ p ⁻¹ ⟩
                   Ξ± 0 =⟨ Ο• 0 ⟩
                   ₁   ∎))

  II : Ξ± 0 = ₁ β†’ ((n : β„•) β†’ Ξ± n = ₁) + Β¬ ((n : β„•) β†’ Ξ± n = ₁)
  II p = map-decidable
          (Ξ» (Ο• : (n : β„•) β†’ Ξ± n = Ξ± 0) (n : β„•)
             β†’ Ξ± n =⟨ Ο• n ⟩
               α 0 =⟨ p ⟩
               ₁   ∎)
          (Ξ» (Ξ³ : (n : β„•) β†’ Ξ± n = ₁) (n : β„•)
             β†’ Ξ± n =⟨ Ξ³ n ⟩
               ₁   =⟨ p ⁻¹ ⟩
               α 0 ∎)
          (wlpov Ξ±)

\end{code}

TODO. The converse.