Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
(** * Theorems about the unit type *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
LocalOpen Scope path_scope.Local Set Universe Minimization ToSet.Generalizable VariablesA.(** ** Eta conversion *)Definitioneta_unit (z : Unit) : tt = z
:= match z with tt => 1end.(** ** Paths *)(* This is all kind of ridiculous, but it fits the pattern. *)Definitionpath_unit_uncurried (zz' : Unit) : Unit -> z = z'
:= fun_ => match z, z' with tt, tt => 1end.Definitionpath_unit (zz' : Unit) : z = z'
:= path_unit_uncurried z z' tt.
z, z': Unit p: z = z'
path_unit z z' = p
z, z': Unit p: z = z'
path_unit z z' = p
z: Unit
path_unit z z = 1
path_unit tt tt = 1
reflexivity.Defined.
z, z': Unit
IsEquiv (path_unit_uncurried z z')
z, z': Unit
IsEquiv (path_unit_uncurried z z')
z, z': Unit
forallx : Unit,
match
path_unit_uncurried z z' x as p in (_ = z')
return (path_unit_uncurried z z' tt = p)
with
| 1 =>
match
z return (path_unit_uncurried z z tt = 1)
with
| tt => 1endend =
ap (path_unit_uncurried z z')
match x as x0 return (tt = x0) with
| tt => 1end
intros []; destruct z, z'; reflexivity.Defined.Definitionequiv_path_unit (zz' : Unit) : Unit <~> (z = z')
:= Build_Equiv _ _ (path_unit_uncurried z z') _.(** ** Transport *)(** Is a special case of transporting in a constant fibration. *)(** ** Universal mapping properties *)(* The positive universal property *)Arguments Unit_ind [A] a u : rename.Instanceisequiv_unit_ind `{Funext} (A : Unit -> Type)
: IsEquiv (@Unit_ind A) | 0
:= isequiv_adjointify _
(funf : forallu:Unit, A u => f tt)
(funf : forallu:Unit, A u => path_forall (@Unit_ind A (f tt)) f
(funx => match x with tt => 1end))
(fun_ => 1).Instanceisequiv_unit_rec `{Funext} (A : Type)
: IsEquiv (@Unit_ind (fun_ => A)) | 0
:= isequiv_unit_ind (fun_ => A).#[local]
Hint Extern4 => progress (cbv beta iota) : typeclass_instances.Definitionequiv_unit_rec `{Funext} (A : Type)
: A <~> (Unit -> A)
:= (Build_Equiv _ _ (@Unit_ind (fun_ => A)) _).(* For various reasons, it is typically more convenient to define functions out of the unit as constant maps, rather than [Unit_ind]. *)Notationunit_name x := (fun (_ : Unit) => x).
H: Funext A: Type
IsEquiv (funa : A => unit_name a)
H: Funext A: Type
IsEquiv (funa : A => unit_name a)
H: Funext A: Type
(funx : Unit -> A => unit_name (x tt)) == idmap
H: Funext A: Type
idmap == idmap
H: Funext A: Type
(funx : Unit -> A => unit_name (x tt)) == idmap
H: Funext A: Type f: Unit -> A x: Unit
f tt = f x
apply ap@{i i}, path_unit.
H: Funext A: Type
idmap == idmap
intros a; reflexivity.Defined.(* The negative universal property *)Definitionunit_coind {A : Type} : Unit -> (A -> Unit)
:= fun__ => tt.
H: Funext A: Type
IsEquiv unit_coind
H: Funext A: Type
IsEquiv unit_coind
H: Funext A: Type
(fun_ : A -> Unit => unit_coind tt) == idmap
H: Funext A: Type
unit_name tt == idmap
H: Funext A: Type
(fun_ : A -> Unit => unit_coind tt) == idmap
H: Funext A: Type f: A -> Unit
unit_coind tt = f
apply path_forall; intros x; apply path_unit.
H: Funext A: Type
unit_name tt == idmap
intro x; destruct x; reflexivity.Defined.Definitionequiv_unit_coind `{Funext} (A : Type)
: Unit <~> (A -> Unit)
:= Build_Equiv _ _ (@unit_coind A) _.(** ** Truncation *)(* The Unit type is contractible *)Instancecontr_unit : Contr Unit | 0 := Build_Contr _ tt (funt : Unit => match t with tt => 1end).(** ** Equivalences *)(** A contractible type is equivalent to [Unit]. *)Definitionequiv_contr_unit `{Contr A} : A <~> Unit
:= equiv_contr_contr.(* Conversely, a type equivalent to [Unit] is contractible. We don't make this an instance because Coq would have to guess the equivalence. And when it has a map in mind, it would try to use [isequiv_contr_contr], which would cause a cycle. *)Definitioncontr_equiv_unit (A : Type) (f : A <~> Unit) : Contr A
:= contr_equiv' Unit f^-1%equiv.(** The constant map to [Unit]. We define this so we can get rid of an unneeded universe variable that Coq generates when [const tt] is used in a context that doesn't have [Universe Minimization ToSet] as this file does. If we ever set that globally, then we could get rid of this and remove some imports of this file. *)Definitionconst_tt (A : Type) := @const A Unit tt.