Timings for Cantor.v
Require Import HoTT.Basics HoTT.Types.
Local Open Scope nat_scope.
Local Open Scope path_scope.
(** * Cantor space 2^N *)
Definition Cantor : Type := nat -> Bool.
Definition cantor_fold : Cantor + Cantor -> Cantor.
Definition cantor_unfold : Cantor -> Cantor + Cantor.
exact (inl (fun n => c n.+1)).
exact (inr (fun n => c n.+1)).
Instance isequiv_cantor_fold `{Funext} : IsEquiv cantor_fold.
refine (isequiv_adjointify _ cantor_unfold _ _).
intros c; apply path_arrow; intros n.
intros [c|c]; apply path_sum; reflexivity.
Definition equiv_cantor_fold `{Funext} : Cantor + Cantor <~> Cantor
:= Build_Equiv _ _ cantor_fold _.
Definition equiv_cantor_unfold `{Funext} : Cantor <~> Cantor + Cantor
:= Build_Equiv _ _ cantor_unfold (isequiv_inverse equiv_cantor_fold).