Tom de Jong & MartΓn EscardΓ³, 8 & 10 September 2023.
Moved to its own file on 29 October 2025.
The type of non-empty types is injective. This should be contrasted with the
fact that the type of inhabited types is not necessarily injective, see
InjectiveTypes.InhabitedTypesTaboo.
An alternative proof of the injectivity of the type of non-empty types
may be found in InjectiveTypes.MathematicalStrutures.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan
open import UF.Univalence
open import UF.PropTrunc
module InjectiveTypes.NonEmptyTypes
(pt : propositional-truncations-exist)
(ua : Univalence)
(π€ : Universe)
where
open PropositionalTruncation pt
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.FunExt
open import UF.Retracts
open import UF.Subsingletons
open import UF.Subsingletons-FunExt
open import UF.UA-FunExt
private
fe : FunExt
fe = Univalence-gives-FunExt ua
fe' : Fun-Ext
fe' {π€} {π₯} = fe π€ π₯
pe : PropExt
pe = Univalence-gives-PropExt ua
pe' : Prop-Ext
pe' {π€} = pe π€
open import InjectiveTypes.Blackboard fe
Non-Empty : π€ βΊ Μ
Non-Empty = Ξ£ X κ π€ Μ , is-nonempty X
Non-Empty-retract : retract Non-Empty of (π€ Μ )
Non-Empty-retract = Ο , Ο , ΟΟ
where
Ο : π€ Μ β Non-Empty
Ο X = (¬¬ X β X) , double-negation-elimination-inside-double-negation X
Ο : Non-Empty β π€ Μ
Ο = prβ
ΟΟ : Ο β Ο βΌ id
ΟΟ (X , X-non-empty) = to-subtype-οΌ (Ξ» Y β negations-are-props fe')
(eqtoid (ua π€) (¬¬ X β X) X e)
where
e = (¬¬ X β X) ββ¨ I β©
(π{π€} β X) ββ¨ β-sym (πβ fe') β©
X β
where
I = βcong'' fe' fe' (idtoeq (¬¬ X) π II)
where
II : ¬¬ X οΌ π
II = holds-gives-equal-π pe' (¬¬ X) (negations-are-props fe') X-non-empty
Non-Empty-is-injective : ainjective-type Non-Empty π€ π€
Non-Empty-is-injective =
retract-of-ainjective Non-Empty (π€ Μ )
(universes-are-ainjective (ua π€))
Non-Empty-retract
\end{code}