Martin Escardo, 14th January 2022. An isomorphic copy of ββ defined in CoNaturals.GenericConvergentSequence. The isomorphism is proved in CoNaturals.Equivalence. \begin{code} {-# OPTIONS --safe --without-K #-} module CoNaturals.GenericConvergentSequence2 where open import MLTT.Spartan open import MLTT.Two-Properties open import Notation.CanonicalMap open import TypeTopology.Cantor open import UF.DiscreteAndSeparated open import UF.FunExt open import UF.NotNotStablePropositions open import UF.Sets open import UF.Subsingletons open import UF.Subsingletons-FunExt T-cantor : (β β π) β π€β Μ T-cantor Ξ± = Ξ£ n κ β , Ξ± n οΌ β private T = T-cantor has-at-most-one-β : (β β π) β π€β Μ has-at-most-one-β Ξ± = is-prop (T Ξ±) has-at-most-one-β-is-prop : funextβ β (Ξ± : β β π) β is-prop (has-at-most-one-β Ξ±) has-at-most-one-β-is-prop fe Ξ± = being-prop-is-prop fe ββ' : π€β Μ ββ' = Ξ£ Ξ± κ (β β π) , has-at-most-one-β Ξ± ββ'-to-ββπ : ββ' β (β β π) ββ'-to-ββπ = prβ ββ'-to-ββπ-lc : funextβ β left-cancellable ββ'-to-ββπ ββ'-to-ββπ-lc fe = prβ-lc (being-prop-is-prop fe) ββ'-is-¬¬-separated : funextβ β is-¬¬-separated ββ' ββ'-is-¬¬-separated fe = subtype-is-¬¬-separated prβ (ββ'-to-ββπ-lc fe) (Cantor-is-¬¬-separated fe) ββ'-is-set : funextβ β is-set ββ' ββ'-is-set fe = ¬¬-separated-types-are-sets fe (ββ'-is-¬¬-separated fe) private Β¬T : (β β π) β π€β Μ Β¬T Ξ± = (n : β) β Ξ± n οΌ β not-T-gives-Β¬T : {Ξ± : β β π} β Β¬ (T Ξ±) β Β¬T Ξ± not-T-gives-Β¬T {Ξ±} Ο n = different-from-β-equal-β (Ξ» (e : Ξ± n οΌ β) β Ο (n , e)) Β¬T-gives-not-T : {Ξ± : β β π} β Β¬T Ξ± β Β¬ (T Ξ±) Β¬T-gives-not-T {Ξ±} Ο (n , e) = zero-is-not-one ((Ο n)β»ΒΉ β e) to-T-οΌ : {Ξ± : β β π} {n n' : β} β n οΌ n' β {e : Ξ± n οΌ β} {e' : Ξ± n' οΌ β} β (n , e) οΌ[ T Ξ± ] (n' , e') to-T-οΌ p = to-subtype-οΌ (Ξ» - β π-is-set) p from-T-οΌ : {Ξ± : β β π} {n n' : β} β {e : Ξ± n οΌ β} {e' : Ξ± n' οΌ β} β (n , e) οΌ[ T Ξ± ] (n' , e') β n οΌ n' from-T-οΌ p = ap prβ p index-uniqueness : (Ξ± : β β π) β is-prop (T Ξ±) β {n n' : β} β Ξ± n οΌ β β Ξ± n' οΌ β β n οΌ n' index-uniqueness Ξ± i {n} {n'} e e' = from-T-οΌ (i (n , e) (n' , e')) index-uniqueness-converse : (Ξ± : β β π) β ({n n' : β} β Ξ± n οΌ β β Ξ± n' οΌ β β n οΌ n') β is-prop (T Ξ±) index-uniqueness-converse Ξ± Ο (n , e) (n' , e') = to-T-οΌ (Ο e e') private instance canonical-map-ββ'-ββπ : Canonical-Map ββ' (β β π) ΞΉ {{canonical-map-ββ'-ββπ}} = ββ'-to-ββπ ββ'-to-ββπ-at-most-one-β : (u : ββ') β is-prop (T (ββ'-to-ββπ u)) ββ'-to-ββπ-at-most-one-β = prβ ββ'-index-uniqueness : (u : ββ') β {n n' : β} β ΞΉ u n οΌ β β ΞΉ u n' οΌ β β n οΌ n' ββ'-index-uniqueness (Ξ± , i) = index-uniqueness Ξ± i Zero' : ββ' Zero' = Ξ± , h where Ξ± : β β π Ξ± 0 = β Ξ± (succ n) = β i : is-prop (T Ξ±) i (0 , e) (0 , e') = to-T-οΌ refl h : has-at-most-one-β Ξ± h (n , e) (n' , e') = to-T-οΌ (index-uniqueness Ξ± i e e') Succ' : ββ' β ββ' Succ' (Ξ± , h) = cons β Ξ± , h' where h' : has-at-most-one-β (cons β Ξ±) h' (succ n , e) (succ n' , e') = to-T-οΌ (ap succ (index-uniqueness Ξ± h e e')) β-to-ββ' : β β ββ' β-to-ββ' 0 = Zero' β-to-ββ' (succ n) = Succ' (β-to-ββ' n) private instance Canonical-Map-β-ββ' : Canonical-Map β ββ' ΞΉ {{Canonical-Map-β-ββ'}} = β-to-ββ' is-finite' : ββ' β π€β Μ is-finite' u@(Ξ± , a) = T Ξ± being-finite'-is-prop : funextβ β (u : ββ') β is-prop (is-finite' u) being-finite'-is-prop feβ u@(Ξ± , a) = a size' : {u : ββ'} β is-finite' u β β size' (n , e) = n size'-property : {u : ββ'} (Ο : is-finite' u) β ββ'-to-ββπ u (size' {u} Ο) οΌ β size'-property (n , e) = e Zero'-is-finite : is-finite' Zero' Zero'-is-finite = 0 , refl is-finite'-up : (u : ββ') β is-finite' u β is-finite' (Succ' u) is-finite'-up _ (n , e) = succ n , e is-finite'-down : (u : ββ') β is-finite' (Succ' u) β is-finite' u is-finite'-down _ (succ n , e) = n , e β-to-ββ'-is-finite' : (n : β) β is-finite' (ΞΉ n) β-to-ββ'-is-finite' 0 = Zero'-is-finite β-to-ββ'-is-finite' (succ n) = is-finite'-up (ΞΉ n) (β-to-ββ'-is-finite' n) β' : ββ' β' = (Ξ» _ β β) , (Ξ» (n , e) (n' , e') β π-elim (zero-is-not-one e)) not-finite'-is-β' : funextβ β (u : ββ') β Β¬ is-finite' u β u οΌ β' not-finite'-is-β' fe u Ξ½ = ββ'-to-ββπ-lc fe (dfunext fe (Ξ» i β different-from-β-equal-β (Ξ» (e : ββ'-to-ββπ u i οΌ β) β Ξ½ (i , e)))) not-T-is-β' : funextβ β (u : ββ') β Β¬ T (ΞΉ u) β u οΌ β' not-T-is-β' fe u Ξ½ = ββ'-to-ββπ-lc fe (dfunext fe (not-T-gives-Β¬T Ξ½)) is-infinite-β' : Β¬ is-finite' β' is-infinite-β' (n , e) = zero-is-not-one e \end{code}