The unit type

Content created by Fredrik Bakke, Egbert Rijke, Jonathan Prieto-Cubides, Fernando Chu, Daniel Gratzer and Elisabeth Stenholm.

Created on 2022-01-27.
Last modified on 2026-05-02.

module foundation.unit-type where
Imports
open import foundation.dependent-pair-types
open import foundation.universe-levels

open import foundation-core.constant-maps
open import foundation-core.contractible-types
open import foundation-core.diagonal-maps-of-types
open import foundation-core.equivalences
open import foundation-core.homotopies
open import foundation-core.identity-types
open import foundation-core.injective-maps
open import foundation-core.propositions
open import foundation-core.retractions
open import foundation-core.sets
open import foundation-core.truncated-types
open import foundation-core.truncation-levels

Idea

The unit type is a type inductively generated by a single point.

Definition

The unit type

record unit : UU lzero where
  instance constructor star

{-# BUILTIN UNIT unit #-}

The induction principle of the unit type

ind-unit : {l : Level} {P : unit  UU l}  P star  (x : unit)  P x
ind-unit p star = p

The terminal map out of a type

module _
  {l : Level} (A : UU l)
  where

  terminal-map : A  unit
  terminal-map = const A star

Points as maps out of the unit type

module _
  {l : Level} {A : UU l}
  where

  point : A  (unit  A)
  point = diagonal-exponential A unit

Properties

The unit type is contractible

abstract
  is-contr-unit : is-contr unit
  pr1 is-contr-unit = star
  pr2 is-contr-unit _ = refl

Any contractible type is equivalent to the unit type

module _
  {l : Level} {A : UU l}
  where

  is-equiv-terminal-map-is-contr : is-contr A  is-equiv (terminal-map A)
  is-equiv-terminal-map-is-contr H =
    is-equiv-is-invertible  _  center H)  _  refl) (contraction H)

  equiv-unit-is-contr : is-contr A  A  unit
  equiv-unit-is-contr H = terminal-map A , is-equiv-terminal-map-is-contr H

  is-contr-retraction-terminal-map : retraction (terminal-map A)  is-contr A
  is-contr-retraction-terminal-map (h , H) = h star , H

  is-contr-is-equiv-terminal-map : is-equiv (terminal-map A)  is-contr A
  is-contr-is-equiv-terminal-map H =
    is-contr-retraction-terminal-map (retraction-is-equiv H)

  is-contr-equiv-unit : A  unit  is-contr A
  is-contr-equiv-unit e = (map-inv-equiv e star , is-retraction-map-inv-equiv e)

  is-contr-equiv-unit' : unit  A  is-contr A
  is-contr-equiv-unit' e = (map-equiv e star , is-section-map-inv-equiv e)

The unit type is a proposition

abstract
  is-prop-unit : is-prop unit
  is-prop-unit = is-prop-is-contr is-contr-unit

unit-Prop : Prop lzero
unit-Prop = unit , is-prop-unit

The unit type is a set

abstract
  is-set-unit : is-set unit
  is-set-unit = is-trunc-succ-is-trunc neg-one-𝕋 is-prop-unit

unit-Set : Set lzero
unit-Set = unit , is-set-unit

All parallel maps into unit are equal

module _
  {l : Level} {A : UU l} {f g : A  unit}
  where

  eq-map-into-unit : f  g
  eq-map-into-unit = refl

The map point x is injective for every x

module _
  {l : Level} {A : UU l} (x : A)
  where

  is-injective-point : is-injective (point x)
  is-injective-point _ = refl

  point-injection : injection unit A
  pr1 point-injection = point x
  pr2 point-injection = is-injective-point

The map point x has a retraction for every x

module _
  {l : Level} {A : UU l} (x : A)
  where

  retraction-point : retraction (point x)
  retraction-point = terminal-map A , refl-htpy

Contractibility of dependent sums over the unit type

abstract
  is-contr-Σ-unit :
    {l : Level} {B : unit  UU l}  is-contr (B star)  is-contr (Σ unit B)
  is-contr-Σ-unit = is-contr-Σ is-contr-unit star

Recent changes