Martin Escardo, July 2025. π-injecting maps and π-injective types. The motivation for this discussion is two-fold: (1) Injective types don't have any non-trivial decidable properties in general. (2) In particular, totally separated types, which have plenty of decidable properties by definition, are not injective in general. Can the totally separated types be the injective types with respect to *some* class of maps? We consider π-injecting maps as a candidate for that. But, for the moment, they are not necessarily the answer, although we can show that injective types over π-injecting maps are totally separared. \begin{code} {-# OPTIONS --safe --without-K #-} open import UF.FunExt module gist.2-injective-types (fe : FunExt) where open import MLTT.Spartan open import TypeTopology.TotallySeparated open import UF.Embeddings open import UF.Retracts open import UF.Subsingletons open import UF.Subsingletons-FunExt private fe' : Fun-Ext fe' {π€} {π₯} = fe π€ π₯ \end{code} The double-dualization monad with base π, incompletely defined. \begin{code} K : π€ Μ β π€ Μ K X = (X β π) β π K-functor : {X : π€ Μ } {Y : π₯ Μ } β (X β Y) β K X β K Y K-functor f Ο v = Ο (v β f) Ξ· : {X : π€ Μ } β X β K X Ξ· x u = u x ΞΌ : {X : π€ Μ } β K (K X) β K X ΞΌ F u = F (Ξ» Ο β Ο u) K-ext : {X : π€ Μ } {Y : π₯ Μ } β (X β K Y) β K X β K Y K-ext f Ο v = Ο (Ξ» x β f x v) K-strength : {X : π€ Μ } {Y : π₯ Μ } β X Γ K Y β K (X Γ Y) K-strength (x , Ξ³) w = Ξ³ (Ξ» y β w (x , y)) K-prod : {X : π€ Μ } {Y : π₯ Μ } β K X Γ K Y β K (X Γ Y) K-prod (Ο , Ξ³) w = Ο (Ξ» x β Ξ³ (Ξ» y β w (x , y))) K-depprod : {X : π€ Μ } {Y : π₯ Μ } β K X β (X β K Y) β K (X Γ Y) K-depprod Ο Ξ³ w = Ο (Ξ» x β Ξ³ x (Ξ» y β w (x , y))) \end{code} (We probably defined above more than what we need for now, but we may need it in the future to answer some of the questions below.) A map j : X β Y is π-injecting if the type π is algebraically injective with respect to it. We don't require π-injecting maps to be embeddings (but see the discussion below). \begin{code} π-injecting : {X : π€ Μ } {Y : π₯ Μ } β (X β Y) β π€ β π₯ Μ π-injecting j = (f : domain j β π) β Ξ£ f' κ (codomain j β π) , f' β j βΌ f \end{code} A type is π-injective if it is injective over π-injecting maps. \begin{code} π-injective : π¦ Μ β (π€ π₯ : Universe) β π¦ β (π€ β π₯)βΊ Μ π-injective {π¦} D π€ π₯ = {X : π€ Μ } {Y : π₯ Μ } (j : X β Y) β π-injecting j β (f : X β D) β Ξ£ f' κ (Y β D) , f' β j βΌ f \end{code} We name the two projections `extension` and `extension-property`. \begin{code} module _ {D : π¦ Μ } {X : π€ Μ } {Y : π₯ Μ } (i : π-injective D π€ π₯) (j : X β Y) (k : π-injecting j) (f : X β D) where extension : (Y β D) extension = prβ (i j k f) extension-property : extension β j βΌ f extension-property = prβ (i j k f) \end{code} We'll see below that the extension property really is property, rather than general data. By construction, the type π is π-injective. \begin{code} π-is-π-injective : π-injective π π€ π₯ π-is-π-injective j = id \end{code} The π-injective types are closed under products and retracts. \begin{code} π-injectives-closed-under-Ξ : {I : π£ Μ } {D : I β π¦ Μ } β ((i : I) β π-injective (D i) π€ π₯) β π-injective (Ξ D) π€ π₯ π-injectives-closed-under-Ξ {π£} {π¦} {I} {D} D-π-inj j j-π-injecting f = (Ξ» y i β extension (D-π-inj i) j j-π-injecting (Ξ» x β f x i) y) , (Ξ» x β dfunext fe' (Ξ» i β extension-property (D-π-inj i) j j-π-injecting (Ξ» x β f x i) x)) \end{code} Free algebras of the π-based double dualization monad are injective. \begin{code} K-π-injective : {X : π£ Μ } β π-injective (K X) π€ π₯ K-π-injective = π-injectives-closed-under-Ξ (Ξ» i β π-is-π-injective) \end{code} The unit of the monad is π-injecting. \begin{code} Ξ·-π-injecting : {X : π€ Μ } β π-injecting (Ξ· {π€} {X}) Ξ·-π-injecting f = (Ξ» Ο β Ο f) , (Ξ» x β refl) \end{code} For future reference, notice that the map Ξ· {π€} {X} is not in general an embedding. Hence every π-injective type is a retract of a free algebra. \begin{code} π-injectives-are-K-retracts : {D : π€ Μ } β π-injective D π€ π€ β retract D of K D π-injectives-are-K-retracts D-π-inj = extension D-π-inj Ξ· Ξ·-π-injecting id , Ξ· , extension-property D-π-inj Ξ· Ξ·-π-injecting id \end{code} And therefore the π-injective types are all totally separated, because the type π is totally separated, and the totally separated types are closed under products and retracts. \begin{code} K-is-totally-separated : {X : π€ Μ } β is-totally-separated (K X) K-is-totally-separated = Ξ -is-totally-separated fe' (Ξ» _ β π-is-totally-separated) π-injectives-are-totally-separated : {D : π€ Μ } β π-injective D π€ π€ β is-totally-separated D π-injectives-are-totally-separated D-π-inj = retract-of-totally-separated (π-injectives-are-K-retracts D-π-inj) K-is-totally-separated \end{code} This shows that a π-injecting map doesn't need to be an embedding. Indeed, we have seen that the map Ξ· : X β K X is always π-injecting, but we also know that it is an embedding if and only if X is totally separated. \begin{code} _ : {X : π€ Μ } β is-embedding (Ξ· {π€} {X}) β is-totally-separated X _ = totally-separatedβ-gives-totally-separated fe' , totally-separated-gives-totally-separatedβ fe' \end{code} The extension property really is property, even though the choice of extension is data. \begin{code} module _ {D : π€ Μ } {X : π€ Μ } {Y : π€ Μ } (i : π-injective D π€ π€) (j : X β Y) (k : π-injecting j) (f : X β D) where extension-property-is-prop : is-prop (extension i j k f β j βΌ f) extension-property-is-prop = Ξ -is-prop fe' (Ξ» x β totally-separated-types-are-sets fe' D (π-injectives-are-totally-separated i)) \end{code} TODO. (1) Can we generalize the universes in `π-injectives-are-totally-separated` and (hence) the above? (2) Can we show that every totally separated type is π-injective? I can't even show, at the time of writing, that β, a totally separated type, is π-injective. (3) Do totally separated types "think that π-injecting maps are embeddings"? Formulate this question precisely, and maybe answer it. (4) Can we show that the totally separated types are precisely the algebras of the π-based double dualization monad? (5) Now let's go back to (algebraic) injectivity with respect to all embeddings. Say that a map j : X β Y is injecting if all algebraically injective types with respect to embeddings are injective with respect to j. Question. Can we show that j is necessarily an embedding? Perhaps an embedding is precisely the same thing as an Ξ©-injecting map.