module Data.Set.Projective where

Set-projective types🔗

A type is set-projective if we can commute propositional truncation past families.

is-set-projective :  {} (A : Type ℓ)  (κ : Level)  Type _
is-set-projective A κ =
   (P : A  Type κ)
   (∀ a  is-set (P a))
   (∀ a  ∥ P a ∥)
  (∀ a  P a)

Intuitively, a type is set-projective if it validates a sort of version of the axiom of choice.

If is a set, then is set-projective if and only if every surjection from a set splits.

surjections-split→set-projective
  :  {ℓ ℓ'} {A : Type ℓ}
   is-set A
   (∀ (E : Type (ℓ ⊔ ℓ'))  is-set E
      (f : E  A)  is-surjective f
     (∀ a  fibre f a))
   is-set-projective A (ℓ ⊔ ℓ')

sets-projective→surjections-split
  :  {ℓ ℓ'} {A : Type ℓ}
   is-set A
   is-set-projective A (ℓ ⊔ ℓ')
    {E : Type ℓ'}  is-set E
   (f : E  A)  is-surjective f
  (∀ a  fibre f a)
This is essentially a specialization of the of the proof that the axiom of choice is equivalent to every surjection splitting, so we will not dwell on the details.
surjections-split→set-projective {A = A} A-set surj-split P P-set ∥P∥ =
  ∥-∥-map
    (Equiv.to (Π-cod≃ (Fibre-equiv P)))
    (surj-split (Σ[ x ∈ A ] (P x)) (Σ-is-hlevel 2 A-set P-set) fst λ x 
      ∥-∥-map (Equiv.from (Fibre-equiv P x)) (∥P∥ x))

sets-projective→surjections-split A-set A-pro E-set f =
  A-pro (fibre f)  x  fibre-is-hlevel 2 E-set A-set f x)

Closure of set-projectivity🔗

Set-projective types are closed under Σ-types. Suppose that is a set-projective type, and that is a family of set-projective types, and let be a family of merely inhabited sets. Note that is a family of merely inhabited sets for every so its product must also be inhabited by projectivity of Moreover, is also projective, so is also merely inhabited, as is an family of merely inhabited sets. We can then uncurry this family to finish the proof.

Σ-set-projective
  :  {A : Type ℓ} {B : A  Type ℓ'}
   is-set-projective A (ℓ' ⊔ ℓ'')
   (∀ a  is-set-projective (B a) ℓ'')
   is-set-projective (Σ[ a ∈ A ] B a) ℓ''
Σ-set-projective {A = A} {B = B} A-pro B-pro P P-set ∥P∥ = do
  ∥-∥-map uncurry $
    A-pro  a  ((b : B a)  P (a , b)))  a  Π-is-hlevel 2 λ b  P-set (a , b)) λ a 
    B-pro a  b  P (a , b))  b  P-set (a , b)) λ b  ∥P∥ (a , b)

Moreover, set-projective types are stable under retracts. Suppose that we have with with set-projective, and let be a family of merely inhabited sets. We can precompose with to obtain an family of sets whose product must be inhabited via projectivity of Moreover, we can precompose again with to see that is merely inhabited. Finally, so is merely inhabited.

retract→set-projective
  :  {A : Type ℓ} {B : Type ℓ'}
   (f : A  B) (g : B  A)
   is-left-inverse f g
   is-set-projective A ℓ''
   is-set-projective B ℓ''
retract→set-projective {A = A} {B = B} f g retract A-pro P P-set ∥P∥ =
  ∥-∥-map  k b  subst P (retract b) (k (g b)))
    (A-pro (P ∘ f) (P-set ∘ f) (∥P∥ ∘ f))

This gives us a nice proof that set-projectivity is stable under equivalence.

Equiv→set-projective
  :  {A : Type ℓ} {B : Type ℓ'}
   A ≃ B
   is-set-projective A ℓ''
   is-set-projective B ℓ''
Equiv→set-projective f A-pro =
  retract→set-projective (Equiv.to f) (Equiv.from f) (Equiv.ε f) A-pro

By the theorem of finite choice, finite sets are projective.

Fin-set-projective :  {n}  is-set-projective (Fin n)
Fin-set-projective {n = n} P P-set ∥P∥ = finite-choice n ∥P∥

finite→set-projective
  : {A : Type ℓ}
   Finite A
   is-set-projective A ℓ'
finite→set-projective finite =
  rec!  enum  Equiv→set-projective (enum e⁻¹) Fin-set-projective)
    (Finite.enumeration finite)

Taboos🔗

As it turns out, the finite types are the only types that are projective constructively! The general sketch of the taboo is that it is consistent that:

  1. Propositions are projective.
  2. Every infinite set admits an injection from Nat. In other words, every infinite set is Dedekind-infinite.
  3. Countable choice fails (IE: the natural numbers are not set-projective).

The existence of such a model is out of scope for this page, so we will focus our attention on the internal portion of the argument. In particular, we will prove that if propositions are set-projective, then the existence of an Dedekind-infinite set-projective type implies countable choice.

First, note that if propositions are set-projective, then the image of every function into a set-projective type is itself set-projective. This follows directly from the definition of images, along with closure of projectives under Σ.

module _
  (props-projective :  {ℓ ℓ'}  (A : Type ℓ)  is-prop A  is-set-projective A ℓ')
  where

  props-projective→image-projective
    :  {A : Type ℓ} {B : Type ℓ'}
     (f : A  B)
     is-set-projective B (ℓ ⊔ ℓ' ⊔ ℓ'')
     is-set-projective (image f) ℓ''
  props-projective→image-projective f B-pro =
    Σ-set-projective B-pro λ b  props-projective _ (hlevel 1)

This in turn implies that set-projective types are stable under embeddings, as the image of an embedding is equivalent to

  props-projective+is-embedding→set-projective
    :  {A : Type ℓ} {B : Type ℓ'} {f : A  B}
     is-embedding f
     is-set-projective B (ℓ ⊔ ℓ' ⊔ ℓ'')
     is-set-projective A ℓ''
  props-projective+is-embedding→set-projective {f = f} f-emb B-pro =
    Equiv→set-projective
      (is-embedding→image-equiv f-emb e⁻¹)
      (props-projective→image-projective f B-pro)

If we specialise this result to embeddings then we obtain countable choice from the existence of a Dedekind-infinite type.

  props-projective+dedekind-infinite-projective→countable-choice
    :  {A : Type ℓ} {f : Nat  A}
     is-embedding f
     is-set-projective A (ℓ ⊔ ℓ')
     is-set-projective Nat ℓ'
  props-projective+dedekind-infinite-projective→countable-choice =
    props-projective+is-embedding→set-projective

Note that the set-projectivity of propositions is itself a taboo: in particular, every proposition is set-projective if and only if every set has split support. The following proof is adapted from (Kraus et al. 2016).

We will start with the reverse direction. Suppose that every proposition is set projective, and let be a set. The truncation of is a propositon, and the constant family is a set-indexed family, so projectivity of directly gives us split support.

props-projective→split-support
  :  {}
   ((A : Type ℓ)  is-prop A  is-set-projective A ℓ)
    (A : Type ℓ)  is-set A (∥ A ∥  A)
props-projective→split-support props-projective A A-set =
  props-projective ∥ A ∥ (hlevel 1)  _  A)  _  A-set) id

For the forward direction, suppose that every set has split support, let be a proposition, and a family of merely inhabited sets. Note that the type is a set, so it must have split support Moreover, is always merely inhabited, so we can readily show that Finally, is a proposition, so we can obtain a from for any if we combine this with our previous observation, we immediately get

split-support→props-projective
  :  {}
   (∀ (A : Type ℓ)  is-set A (∥ A ∥  A))
   (A : Type ℓ)  is-prop A  is-set-projective A ℓ
split-support→props-projective split-support A A-prop P P-set ∥P∥ = do
  s ← split-support (Σ[ a ∈ A ] P a) (Σ-is-hlevel 2 (is-prop→is-set A-prop) P-set)
  pure λ a  subst P (A-prop _ _) (snd (s (∥-∥-map  p  (a , p)) (∥P∥ a))))

References

  • Kraus, Nicolai, M. Escardó, T. Coquand, and Thorsten Altenkirch. 2016. “Notions of Anonymous Existence in Martin-Löf Type Theory.” Log. Methods Comput. Sci.