module Cat.Displayed.Comprehension.Coproduct.Strong where
Strong comprehension coproductsπ
Let and be a pair of comprehension categories over the same base category , such that has coproducts over . Type theoretically, this (roughly) corresponds to a type theory with a pair of syntactic categories (for instance, types and kinds), along with mixed-mode types.
We can model this using coproducts over a comprehension category, but the elimination principle we get from this setup is pretty weak: we really only have a recursion principle, not an elimination principle. That has to be be captured through an extra condition.
We say that a comprehension category has strong comprehension coproducts if (it has comprehension coproducts, and) the canonical substitution forms an orthogonal factorisation system with the weakening maps . In more elementary terms, this means that any square diagram, as below, has a unique diagonal filler.
That's a very concise definition: too concise. Let's dig a bit deeper. In the diagram, $B$ is a type in some context $\Delta$, and we have a substitution $\sigma : \Gamma , \coprod_X A \to \Delta$ --- but, for intuition, we might as well zap $\sigma$ to the identity: $B$ is a type in context $\Gamma, \coprod_X A$. In this simplified setting, the top morphism $\nu : \Gamma, X, A \to \Gamma, B$ must be entirely determined by a "term" $\Gamma, x : X, a : A \vdash \nu : B\langle x, a \rangle$, for the outer square to commute. Then, we see that the diagonal filler is exactly an elimination principle: since it too commutes with weakening, it must be determined by a "term" $\Gamma, v : \coprod_X A \vdash B(v)$! However, note that this elimination principle does **not** allow us to eliminate an arbitrary object from $\cE$, which corresponds type-theoretically having _no_ $\cE$-large elimination. This large elimination is captured by [[very strong comprehension coproducts]], which are extremely rare.opaque β-strong-elim : β {Ξ Ξ} {x : E.Ob[ Ξ ]} {a : D.Ob[ Ξ Q.β¨Ύ x ]} {b : D.Ob[ Ξ ]} β (Ο : Hom (Ξ P.β¨Ύ β x a) Ξ) (Ξ½ : Hom (Ξ Q.β¨Ύ x P.β¨Ύ a) (Ξ P.β¨Ύ b)) β Ο β (Q.ΟαΆ P.β¨ΎΛ’ β¨ x , a β©) β‘ P.ΟαΆ β Ξ½ β Hom (Ξ P.β¨Ύ β x a) (Ξ P.β¨Ύ b) β-strong-elim {x = x} {a = a} {b = b} Ο Ξ½ p = strong x a b p .centre .fst
The upper-left triangle of the diagram gives us our $\beta$ law; eliminating out of a substitution extended with an introduction form gives us the original substitution.opaque unfolding β-strong-elim β-strong-Ξ² : β {Ξ Ξ} {x : E.Ob[ Ξ ]} {a : D.Ob[ Ξ Q.β¨Ύ x ]} {b : D.Ob[ Ξ ]} β {Ο : Hom (Ξ P.β¨Ύ β x a) Ξ} {Ξ½ : Hom (Ξ Q.β¨Ύ x P.β¨Ύ a) (Ξ P.β¨Ύ b)} β (p : Ο β (Q.ΟαΆ P.β¨ΎΛ’ β¨ x , a β©) β‘ P.ΟαΆ β Ξ½) β β-strong-elim Ο Ξ½ p β (Q.ΟαΆ P.β¨ΎΛ’ β¨ x , a β©) β‘ Ξ½ β-strong-Ξ² p = strong _ p .centre .snd .fst
The lower-right triangle describes how substitution interacts with eliminators; if we forget the thing we just eliminated into, then we recover the substitution from $\Gamma, \coprod X A \to \Delta$.
<a id="strong-comprehension-coproducts.β-strong-sub"></a><a id="6937" href="Cat.Displayed.Comprehension.Coproduct.Strong.html#6937" data-type="(Pβ : Comprehension D)
(coprods : has-comprehension-coproducts D-fib E-fib Q) (strong :
strong-comprehension-coproducts Pβ coprods) (p : Bβ .Precategory._β_ Ο
((D Comprehension.β¨ΎΛ’ D-fib) Pβ (Comprehension.ΟαΆ E E-fib Q) (coprods
.has-comprehension-coproducts.β¨,β© x a)) β‘ Bβ .Precategory._β_
(Comprehension.ΟαΆ D D-fib Pβ) Ξ½) β Bβ .Precategory._β_ (Comprehension.ΟαΆ
D D-fib Pβ) (strong-comprehension-coproducts.β-strong-elim Pβ coprods
strong Ο Ξ½ p) β‘ Οβ class=βFunctionβ>β-strong-sub
: β
{Ξ
Ξ}
{x
:
E.Ob[
Ξ
]}
{a
:
D.Ob[
Ξ
Q.β¨Ύ
x
]}
{b
:
D.Ob[
Ξ
]}
β
{Ο
:
Hom
(Ξ
P.β¨Ύ
β
x
a)
Ξ}
{Ξ½
:
Hom
(Ξ
Q.β¨Ύ
x
P.β¨Ύ
a)
(Ξ
P.β¨Ύ
b)}
β
(p
:
Ο
β
(Q.ΟαΆ
P.β¨ΎΛ’
β¨
x
,
a
β©)
β‘
P.ΟαΆ
β
Ξ½)
β
P.ΟαΆ
β
β-strong-elim
Ο
Ξ½
p
β‘
Ο
β-strong-sub
p
=
strong
_
p
.centre
.snd
.snd
Finally, uniqueness gives us an $\eta$; any other substitution that walks like the eliminator and quacks like the eliminator is the eliminator.
<a id="strong-comprehension-coproducts.β-strong-Ξ·"></a><a id="7396" href="Cat.Displayed.Comprehension.Coproduct.Strong.html#7396" data-type="(Pβ : Comprehension D)
(coprods : has-comprehension-coproducts D-fib E-fib Q) (strong :
strong-comprehension-coproducts Pβ coprods) (p : Bβ .Precategory._β_ Ο
((D Comprehension.β¨ΎΛ’ D-fib) Pβ (Comprehension.ΟαΆ E E-fib Q) (coprods
.has-comprehension-coproducts.β¨,β© x a)) β‘ Bβ .Precategory._β_
(Comprehension.ΟαΆ D D-fib Pβ) Ξ½) (other : Bβ .Precategory.Hom ((D
Comprehension.β¨Ύ D-fib) Pβ Ξβ (coprods .has-comprehension-coproducts.β x
a)) ((D Comprehension.β¨Ύ D-fib) Pβ Ξβ b)) β Bβ .Precategory._β_ other ((D
Comprehension.β¨ΎΛ’ D-fib) Pβ (Comprehension.ΟαΆ E E-fib Q) (coprods
.has-comprehension-coproducts.β¨,β© x a)) β‘ Ξ½ β Bβ
.Precategory._β_ (Comprehension.ΟαΆ D D-fib Pβ) other β‘ Ο β other β‘
strong-comprehension-coproducts.β-strong-elim Pβ coprods strong Ο Ξ½ pβ
class=βFunctionβ>β-strong-Ξ· :
β
{Ξ
Ξ}
{x
:
E.Ob[
Ξ
]}
{a
:
D.Ob[
Ξ
Q.β¨Ύ
x
]}
{b
:
D.Ob[
Ξ
]}
β
{Ο
:
Hom
(Ξ
P.β¨Ύ
β
x
a)
Ξ}
{Ξ½
:
Hom
(Ξ
Q.β¨Ύ
x
P.β¨Ύ
a)
(Ξ
P.β¨Ύ
b)}
β
(p
:
Ο
β
(Q.ΟαΆ
P.β¨ΎΛ’
β¨
x
,
a
β©)
β‘
P.ΟαΆ
β
Ξ½)
β
(other
:
Hom
(Ξ
P.β¨Ύ
β
x
a)
(Ξ
P.β¨Ύ
b))
β
other
β
(Q.ΟαΆ
P.β¨ΎΛ’
β¨
x
,
a
β©)
β‘
Ξ½
β
P.ΟαΆ
β
other
β‘
Ο
β
other
β‘
β-strong-elim
Ο
Ξ½
p
β-strong-Ξ·
p
other
Ξ²
sub
=
ap
fst
(sym
$
strong
_
p
.paths
(other
,
Ξ²
,
sub))
Now, for some useful lemmas. If we eliminate by simply packaging up the data into a pair, then we've done nothing. Categorically, this means the unique filler of the following diagram is the identity morphism. ~~~{.quiver} \begin{tikzcd} {\Gamma,_{\cE}X,_{\cD}A} && {\Gamma,_{\cD}\coprod X A} \\ \\ {\Gamma,_{\cD}\coprod X A} && \Gamma \arrow["{\pi_{\cE},\langle X, A\rangle}"', from=1-1, to=3-1] \arrow["{\pi_{\cD}}", from=1-3, to=3-3] \arrow["{\pi_{\cD}}"', from=3-1, to=3-3] \arrow["{\pi_{\cE},\langle X, A\rangle}", from=1-1, to=1-3] \arrow["id", from=3-1, to=1-3] \end{tikzcd} ~~~
<a id="strong-comprehension-coproducts.β-strong-id"></a><a id="8460" href="Cat.Displayed.Comprehension.Coproduct.Strong.html#8460" data-type="(Pβ : Comprehension D)
(coprods : has-comprehension-coproducts D-fib E-fib Q) (strong :
strong-comprehension-coproducts Pβ coprods) β
strong-comprehension-coproducts.β-strong-elim Pβ coprods strong
(Comprehension.ΟαΆ D D-fib Pβ) ((D Comprehension.β¨ΎΛ’ D-fib) Pβ
(Comprehension.ΟαΆ E E-fib Q) (coprods
.has-comprehension-coproducts.β¨,β© x a)) refl β‘ Bβ
.Precategory.idβ class=βFunctionβ>β-strong-id
: β
{Ξ}
{x
:
E.Ob[
Ξ
]}
{a
:
D.Ob[
Ξ
Q.β¨Ύ
x
]}
β
β-strong-elim
P.ΟαΆ
(Q.ΟαΆ
P.β¨ΎΛ’
β¨
x
,
a
β©)
refl
β‘
id
β-strong-id
=
sym
(β-strong-Ξ·
refl
id
(idl
)
(idr
))