Martin Escardo 2012

\begin{code}

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

module EffectfulForcing.MFPSAndVariations.Continuity where

open import MLTT.Spartan
open import MLTT.Athenian

Baire : 𝓤₀ ̇
Baire =   

data _=⟪_⟫_ {X : 𝓤₀ ̇ } : (  X)  List   (  X)  𝓤₀ ̇ where
 []  : {α α' :   X}  α =⟪ []  α'
 _∷_ : {α α' :   X} {i : } {s : List }
      α i  α' i
      α =⟪ s  α'
      α =⟪ i  s  α'

infix 0 _=⟪_⟫_
infixr 3 _∷_

is-continuous : (Baire  )  𝓤₀ ̇
is-continuous f =  α  Σ s  List  , (∀ α'  α =⟪ s  α'  f α  f α')

continuity-extensional : (f g : Baire  )
                        (f  g)
                        is-continuous f
                        is-continuous g
continuity-extensional f g t c α = (pr₁ (c α) ,
                                     α' r  g α  =⟨ (t α)⁻¹ 
                                              f α  =⟨ pr₂(c α) α' r 
                                              f α' =⟨ t α' 
                                              g α' ))

Cantor : 𝓤₀ ̇
Cantor =   𝟚

data BT (X : 𝓤₀ ̇ ) : 𝓤₀ ̇ where
  []   : BT X
  _∷_ : X  (𝟚  BT X)  BT X

data _=⟦_⟧_ {X : 𝓤₀ ̇ } : (  X)  BT   (  X)  𝓤₀ ̇ where
  []  : {α α' :   X}  α =⟦ []  α'
  _∷_ : {α α' :   X}{i : }{s : 𝟚  BT }
       α i  α' i
       ((j : 𝟚)  α =⟦ s j  α')
       α =⟦ i  s  α'

is-uniformly-continuous : (Cantor  )  𝓤₀ ̇
is-uniformly-continuous f = Σ s  BT  , (∀ α α'  α =⟦ s  α'  f α  f α')

UC-extensional : (f g : Cantor  )
                (f  g)
                is-uniformly-continuous f
                is-uniformly-continuous g
UC-extensional f g t (u , c) = (u ,
                                 α α' r  g α  =⟨ (t α)⁻¹ 
                                            f α  =⟨ c α α' r 
                                            f α' =⟨ t α' 
                                            g α' ))
embedding-𝟚-ℕ : 𝟚  
embedding-𝟚-ℕ  = 0
embedding-𝟚-ℕ  = 1

embedding-C-B : Cantor  Baire
embedding-C-B = embedding-𝟚-ℕ ∘_

C-restriction : (Baire  )  (Cantor  )
C-restriction = _∘ embedding-C-B

\end{code}

TODO. Formulate the usual notions of (uniform) continuity and prove
that they are logically equivalent to the above.

TODO completed for continuity in `ContinuityProperties.lagda` by Ayberk Tosun on
2023-06-13.

TODO completed for uniform continuity in `ContinuityProperties.lagda` by Ayberk
Tosun at 2023-11-16T23:47:43.