Martin Escardo, 23 June 2025.
The following paper has a notion of flabbiness in the internal
language of a 1-topos.
[1] Ingo Blechschmidt (2018). Flabby and injective objects in toposes.
https://arxiv.org/abs/1810.12708
More recent version at
https://www.speicherleck.de/iblech/stuff/paper-flabby-objects.pdf
This definition of flabbiness uses the two notions of "subterminal"
and "subsingleton" subsets, as defined in e.g.
[2] Kock, A. (1991). Algebras for the partial map classifier
monad. In: Carboni, A., Pedicchio, M.C., Rosolini, G. (eds)
Category Theory. Lecture Notes in Mathematics, vol 1488. Springer,
Berlin, Heidelberg. https://doi.org/10.1007/BFb0084225
We show that the notion of flabbiness defined in [1] coincides with
ours for types that are sets, or 1-types, in the sense of HoTT/UF.
*Terminological warning.* Sometimes we use, in names of functions, and
in discussions, the word "set" to refer to "subset", to e.g. avoid
awkward names such as "is-subterminal-subset".
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import UF.FunExt
module InjectiveTypes.AlternativeFlabbiness
(fe : Fun-Ext)
where
open import InjectiveTypes.Blackboard
open import InjectiveTypes.Structure
open import MLTT.Spartan
open import UF.Embeddings
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.Powerset
open import UF.PropTrunc
open import UF.Sets
open import UF.Subsingletons
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier
\end{code}
The references [1] and [2] work with the following two concepts, in
the internal language of an elementary 1-topos.
(1) A set K : ๐ X is *subterminal* if and only if any two elements of
K are equal.
(2) A set K : ๐ X is a *subsingleton* if there is xโ : X with K โ {xโ}.
In our more general setting of HoTT/UF, which can be considered as an
internal language for โ-toposes, the singleton {xโ} can be formed if X
is a set, or 1-type, in the sense of HoTT/UF (and if and only if xโ is
homotopy isolated, meaning that the equality xโ = x is a proposition
for every x : X).
But K โ {xโ}, in their setting, amounts to the implication
x โ K โ x ๏ผ xโ, and so that we can circumvent this obstacle.
(2') A set K : ๐ X is a *subsingleton* if there is xโ : X such that
x โ K implies x ๏ผ xโ for all x : X.
In the setting of [1] and [2], conditions (2) and (2') are equivalent,
but only (2') makes sense in our setting for an arbitrary type X,
which is what we adopt below.
However, in any case, we will eventually need to assume that X is a
1-type, as the internal definition of flabbiness given in [1] is
tailored for 1-toposes.
We have that (1) is property if X is a set, and that the above
reformulation (2') of (2) is always property.
To begin with, we will work with the following notion, which is data
rather than property.
(3) *Subsingleton data* for a set K : ๐ X consists of a designated point
xโ : X such that x โ K implies x = xโ for all x : X.
The difference between (2) and (3) is that in (2) the point xโ merely
exists, but in (3) it is part of the data.
We begin by formally discussing (1) and (3), leaving (2) for later.
\begin{code}
module _ {X : ๐ค ฬ } (K : ๐ X) where
subterminal-set : ๐ค ฬ
subterminal-set = (x y : X) โ x โ K โ y โ K โ x ๏ผ y
\end{code}
Notice that the above is strictly speaking data unless X is a set.
\begin{code}
being-subterminal-set-is-prop
: is-set X
โ is-prop subterminal-set
being-subterminal-set-is-prop X-is-set
= ฮ โ-is-prop fe (ฮป _ _ _ _ โ X-is-set)
subsingleton-set-data : ๐ค ฬ
subsingleton-set-data = ฮฃ xโ ๊ X , ((x : X) โ x โ K โ x ๏ผ xโ)
subsingleton-set-point : subsingleton-set-data โ X
subsingleton-set-point = prโ
subsingleton-set-condition : (s : subsingleton-set-data)
โ (x : X) โ x โ K โ x ๏ผ subsingleton-set-point s
subsingleton-set-condition = prโ
\end{code}
As observed in [1], subsingleton sets are subterminal. We also have
the following, replacing the subsigleton property by subsingleton
data.
\begin{code}
sets-with-subsingleton-data-are-subterminal
: subsingleton-set-data
โ subterminal-set
sets-with-subsingleton-data-are-subterminal (xโ , ฯ) x y i j
= x ๏ผโจ ฯ x i โฉ
xโ ๏ผโจ (ฯ y j)โปยน โฉ
y โ
\end{code}
The following is the internal definition of functional flabbiness
proposed in [1], as a converse of the above fact.
We make the converse construction, which isn't always possible, into
an alternative definition of flabby structure. This appears in [1]
under the name "functionally flabby".
\begin{code}
functionally-flabby : ๐ค ฬ โ ๐ค โบ ฬ
functionally-flabby X = (K : ๐ X)
โ subterminal-set K
โ subsingleton-set-data K
\end{code}
The following two observations are not used directly in our
discussion, but may be enlightening. They say that the total space
๐ K := ฮฃ x ๊ X , x โ K of the subset K of X is a proposition, assuming
that K is subterminal, and, in particular, that it is equipped with
subsingleton data.
\begin{code}
module _ {X : ๐ค ฬ } (K : ๐ X) where
subterminals-have-propositional-total-space
: subterminal-set K
โ is-prop (๐ K)
subterminals-have-propositional-total-space s (x , m) (y , n)
= to-subtype-๏ผ (โ-is-prop K) (s x y m n)
types-with-subsubgleton-data-have-propositional-total-space
: subsingleton-set-data K
โ is-prop (๐ K)
types-with-subsubgleton-data-have-propositional-total-space s
= subterminals-have-propositional-total-space
(sets-with-subsingleton-data-are-subterminal K s)
\end{code}
We define, in an imported module, flabby structure for a type X to be
a map โจ : (P : ฮฉ) โ (P โ X) โ X together with equality data โจ P f = f p
for every p : P.
We now show that we can construct flabby structure from functional
flabbiness, and conversely.
The first direction requires X to be a 1-type, or set.
\begin{code}
module _ {X : ๐ค ฬ } where
functionally-flabby-gives-flabby-structure
: is-set X
โ functionally-flabby X
โ flabby-structure X ๐ค
functionally-flabby-gives-flabby-structure X-is-set ฯ = โจ , e
where
module _ (P : ฮฉ ๐ค) (f : P holds โ X) where
K : ๐ X
K x = fiber f x ,
maps-of-props-into-sets-are-embeddings f (holds-is-prop P) X-is-set x
I : subterminal-set K
I x y (p , d) (q , e) = x ๏ผโจ d โปยน โฉ
f p ๏ผโจ ap f (holds-is-prop P p q) โฉ
f q ๏ผโจ e โฉ
y โ
II : subsingleton-set-data K
II = ฯ K I
โจ : X
โจ = subsingleton-set-point K II
_ : (x : X) โ fiber f x โ x ๏ผ โจ
_ = subsingleton-set-condition K II
e : (p : P holds) โ โจ ๏ผ f p
e p = (subsingleton-set-condition K II (f p) (to-fiber f p))โปยน
\end{code}
The converse doesn't require X to be a 1-type.
\begin{code}
flabby-structure-gives-functionally-flabby
: flabby-structure X ๐ค
โ functionally-flabby X
flabby-structure-gives-functionally-flabby (โจ , e) K K-subterminal = xโ , I
where
P : ฮฉ ๐ค
P = (ฮฃ x ๊ X , x โ K) ,
(ฮป {(x , m) (y , n) โ to-subtype-๏ผ
(โ-is-prop K)
(K-subterminal x y m n)})
_ : ๐-to-carrier K ๏ผ (prโ โถ ((ฮฃ x ๊ X , x โ K) โ X))
_ = refl
xโ : X
xโ = โจ P (๐-to-carrier K)
I : (x : X) โ x โ K โ x ๏ผ xโ
I x m = (e P (๐-to-carrier K) (x , m))โปยน
\end{code}
The above maps are mutually inverse if X is a set, and hence give a
typal equivalence.
\begin{code}
functionally-flabby-is-equiv-to-flabby-structure
: propext ๐ค
โ is-set X
โ functionally-flabby X โ flabby-structure X ๐ค
functionally-flabby-is-equiv-to-flabby-structure pe X-is-set =
qinveq ฮฑ (ฮฒ , ฮท , ฮต)
where
ฮฑ = functionally-flabby-gives-flabby-structure X-is-set
ฮฒ = flabby-structure-gives-functionally-flabby
ฮท : ฮฒ โ ฮฑ โผ id
ฮท ฯ = dfunext fe (ฮป K โ
dfunext fe (ฮป s โ
to-subtype-๏ผ
(ฮป x โ ฮ โ-is-prop fe (ฮป _ _ โ X-is-set))
(III K s)))
where
module _ (K : ๐ X) (s : subterminal-set K) where
I : โ {K' s'}
โ K' ๏ผ K
โ subsingleton-set-point K' (ฯ K' s') ๏ผ subsingleton-set-point K (ฯ K s)
I {.K} {s'} refl = ap (subsingleton-set-point K โ ฯ K)
(being-subterminal-set-is-prop K X-is-set s' s)
K' : ๐ X
K' x = fiber (๐-to-carrier K) x , _
II : K' ๏ผ K
II = subset-extensionality'' pe fe fe
(from-๐-fiber K โถ (K' โ K))
(to-๐-fiber K โถ (K โ K'))
III : subsingleton-set-point K' (ฯ K' _) ๏ผ subsingleton-set-point K (ฯ K s)
III = I II
ฮต : ฮฑ โ ฮฒ โผ id
ฮต (โจ , e) = to-subtype-๏ผ
(ฮป _ โ ฮ โ-is-prop fe (ฮป _ _ _ โ X-is-set))
(dfunext fe (ฮป P โ dfunext fe (I P)))
where
module _ (P : ฮฉ ๐ค) (f : P holds โ X) where
P' : ฮฉ ๐ค
P' = (ฮฃ x ๊ X , fiber f x) , _
I : โจ P' prโ ๏ผ โจ P f
I = โจ-change-of-variable-โ X pe fe โจ prโ (total-fiber-is-domain f)
\end{code}
We now discuss the truncated version.
We have already defined the notions (1) and (3) above, and it remains
to define the notion (2), which we call is-subsingleton-set. For that
purpose, we need to assume that propositional truncations exist, so
that we have the existential quantifier โ available.
\begin{code}
module _ (pt : propositional-truncations-exist) where
open PropositionalTruncation pt
open injective (ฮป ๐ค ๐ฅ โ fe {๐ค} {๐ฅ}) pt
module _ (K : ๐ X) where
is-subsingleton-set : ๐ค ฬ
is-subsingleton-set = โ xโ ๊ X , ((x : X) โ x โ K โ x ๏ผ xโ)
being-subsingleton-set-is-prop : is-prop is-subsingleton-set
being-subsingleton-set-is-prop = โ-is-prop
\end{code}
As observed in [1], subsingleton sets are subterminal. In our more
general setting, we need to assume that X is a 1-type to reach the
same conclusion.
\begin{code}
subsingleton-sets-are-subterminal
: is-set X
โ is-subsingleton-set
โ subterminal-set K
subsingleton-sets-are-subterminal X-is-set =
โฅโฅ-rec
(being-subterminal-set-is-prop K X-is-set)
(sets-with-subsingleton-data-are-subterminal K)
\end{code}
And the following is the internal definition of flabbiness proposed in [1],
as a converse of the above fact.
\begin{code}
flabby' : ๐ค โบ ฬ
flabby' = (K : ๐ X)
โ subterminal-set K
โ is-subsingleton-set K
\end{code}
In this repository we have our own internal definition of flabbiness
of a type X, called "flabby", which says that for every propositon P
and function f : P โ X, there exists x : X such that x = f p
for all p : P.
We now show that this is equivalent to the definition given in [1],
where the first direction assumes that X is a set.
Notice that this is a logical equivalence, as stated, but also a typal
equivalence, as a consequence, because the two notions of flabbiness
are property, when X is a 1-type, or set.
\begin{code}
flabby'-gives-flabby : is-set X โ flabby' โ flabby X ๐ค
flabby'-gives-flabby X-is-set ฯ P P-is-prop f = IV
where
K : ๐ X
K x = fiber f x ,
maps-of-props-into-sets-are-embeddings f P-is-prop X-is-set x
I : subterminal-set K
I x y (p , d) (q , e) = x ๏ผโจ d โปยน โฉ
f p ๏ผโจ ap f (P-is-prop p q) โฉ
f q ๏ผโจ e โฉ
y โ
II : is-subsingleton-set K
II = ฯ K I
III : (ฮฃ xโ ๊ X , ((x : X) โ x โ K โ x ๏ผ xโ))
โ (ฮฃ x ๊ X , ((p : P) โ x ๏ผ f p))
III (xโ , ฮฑ) = xโ , (ฮป p โ (ฮฑ (f p) (to-fiber f p))โปยน)
IV : โ x ๊ X , ((p : P) โ x ๏ผ f p)
IV = โฅโฅ-functor III II
flabby-gives-flabby' : flabby X ๐ค โ flabby'
flabby-gives-flabby' ฯ K K-subterminal = II
where
P : ฮฉ ๐ค
P = (ฮฃ x ๊ X , x โ K) ,
(ฮป {(x , m) (y , n) โ to-subtype-๏ผ
(โ-is-prop K)
(K-subterminal x y m n)})
f : P holds โ X
f = prโ
I : โ xโ ๊ X , ((p : P holds) โ xโ ๏ผ prโ p)
I = ฯ (P holds) (holds-is-prop P) f
II : โ xโ ๊ X , ((x : X) โ x โ K โ x ๏ผ xโ)
II = โฅโฅ-functor (ฮป (xโ , e) โ xโ , (ฮป x m โ (e (x , m))โปยน)) I
\end{code}
So, at least for sets, this justifies our internal definition of
flabbiness used in this repository. Perhaps an โ-topos theorist can
chime in and discuss whether our proposed internal definition does
correspond to any external definition of flabbiness discussed in the
โ-topos literature.