Tom de Jong and MartΓ­n EscardΓ³, 18 January 2024.

The carrier of a pointed dcpo is an algebraically injective type.

More precisely, if 𝓓 is a poset with a least element and suprema for directed
families indexed by types in a universe π“₯, then the carrier of 𝓓 is
algebraically injective with respect to embeddings of types in π“₯.

We emphasize that this does *not* mean that pointed dcpos are injective in the
category of dcpos and continuous maps (which they are not). For this reason we
explicitly talk about the carrier of a pointed dcpo above.

\begin{code}

{-# OPTIONS --safe --without-K #-}

open import MLTT.Spartan

open import UF.FunExt
open import UF.PropTrunc

module InjectiveTypes.PointedDcpos
        (fe : FunExt)
        (pt : propositional-truncations-exist)
        (π“₯ : Universe)
       where

private
 fe' : Fun-Ext
 fe' {𝓀} {π“₯} = fe 𝓀 π“₯

open import DomainTheory.Basics.Pointed pt fe' π“₯
open import InjectiveTypes.Blackboard fe

pointed-dcpos-are-aflabby-types : (𝓓 : DCPOβŠ₯ {𝓀} {𝓣}) β†’ aflabby βŸͺ 𝓓 ⟫ π“₯
pointed-dcpos-are-aflabby-types 𝓓 P P-is-prop f = I , II
 where
  I : βŸͺ 𝓓 ⟫
  I = ∐˒˒ 𝓓 f P-is-prop
  II : (p : P) β†’ I = f p
  II p = ∐˒˒-=-if-domain-holds 𝓓 P-is-prop p

pointed-dcpos-are-ainjective-types :
 (𝓓 : DCPOβŠ₯ {𝓀} {𝓣}) β†’ ainjective-type βŸͺ 𝓓 ⟫ π“₯ π“₯
pointed-dcpos-are-ainjective-types 𝓓 =
 aflabby-types-are-ainjective βŸͺ 𝓓 ⟫ (pointed-dcpos-are-aflabby-types 𝓓)

\end{code}