Is it a workable strategy to define a Gel type as a pushout of copies of an internalized parametricity interval, rather than postulate its existence, or otherwise bake it into the type theory one is working in?The agda code is part of an attempt at convincing myself the answer might be "yes", but it's not a complete answer. If anyone knows if the literature already has a "yes" or "no" answer, I'd love to hear!
So let's take a look at what's going on in Interval/Axioms.agda.
We first postulate the interval type itself. I'm writing it a binary operator that takes two Set arguments. The argument $S$ is its "shape". We can take $S = 2$ as a running example. In this case the interval is the "walking binary relation". It has two points, and some kind of cohesion between them. The argument $D$ is a notion of color in the sense of Bernardy-Moulin's "Type Theory in Color". We have as many colors as there are types.
postulate -- D ▻ S is an interval type of "direction" D and "shape S" _▻_ : {ℓ1 ℓ2 : Level} (D : Set ℓ1) (S : Set ℓ2) → Set (ℓ-max ℓ1 ℓ2)Next we abbreviate $T = D \triangleright S$ and postulate that the endpoints of the interval are included in the interval itself.
module _ {ℓ1 ℓ2 : Level} {D : Set ℓ1} {S : Set ℓ2} where private ℓ = ℓ-max ℓ1 ℓ2 T = D ▻ S postulate end : S → TIn the running example of $S = 2$, we can picture this as:
endIsEmbed : isEmbedding end endNonTriv : ¬ (isEquiv end)Next we suppose that the type $D$ really is discrete for $T$. This is defined as meaning the constant map $D \to (T \to D)$ is an equivalence.
▻Discrete : bridgeDiscrete T D
pushMap : {k1 k2 k3 : Level} {A : T → Type k1} {B : T → Type k2} {C : T → Type k3} (f : {t : T} → C t → A t) (g : {t : T} → C t → B t) (p : Push (λ k (t' : T) → f (k t')) (λ k → g ∘ k)) (t : T) → Push (f {t}) (g {t}) pushMap f g (pinl a) t = pinl (a t) pushMap f g (pinr b) t = pinr (b t) pushMap f g (ppath c i) t = ppath (c t) i ▻Commute : {k1 k2 k3 : Level} {A : T → Type k1} {B : T → Type k2} {C : T → Type k3} (Adisc : (t : T) → bridgeDiscrete T (A t)) (Bdisc : (t : T) → bridgeDiscrete T (B t)) (Cdisc : (t : T) → bridgeDiscrete T (C t)) (f : {t : T} → C t → A t) (g : {t : T} → C t → B t) → isEquiv (pushMap {A = A} f g)This is expressing something about the fact that the interval should be a "tiny object". I'm vaguely aware that this can't be fully captured internally without using modalities, but I'm curious whether this special case is acceptable.
What this postulate is saying is the following. If we have three types $A, B, C$ indexed over $T$, and some maps \[f : (t : T) \to C\ t \to A\ t\] \[g : (t : T) \to C\ t \to B\ t\] then there definitely at least exists a map (called pushMap above) from the pushout of global elements of these types to the global elements of the pushout of these types. That is, in the below diagram, there is a map \[P \to (t : T) \to Q\ t\] which comes directly from the pushout UMP.
This is because the Gel type being a pushout lets us do case analysis to any term of it. By the pushout UMP, we know that \[(t : T) \to \mathsf{Gel}_{R_1}\ t \to \mathsf{Gel}_{R_2}\ t \tag{\dag}\] is the same thing as a pair of maps, one living in \[(t : T) \to R_1 \to \mathsf{Gel}_{R_2}\ t \tag{*}\] and one living in \[(t : T) \to ((e : E\ t) \x A_1\ t\ e) \to \mathsf{Gel}_{R_2}\ t \tag{**}\] satisfying a compatibility condition. But (*) is equivalent to \[ R_1 \to (t : T) \to \mathsf{Gel}_{R_2}\ t \] and therefore also to \[ R_1 \to R_2 \tag{*'}\] and (**) is equivalent to \[(t : T) (e : E\ t) (a : A_1\ t\ e) \to \mathsf{Gel}_{R_2}\ t \] and therefore also to \[(t : T) (e : E\ t) (a : A_1\ t\ e) \to A_2\ t\ e \tag{**'}\] So a uniform map $(\dag)$ is the same thing as a map $(*')$ between relations, with a map $(**')$ saying how it behaves on endpoints, which are suitably compatible, i.e. a relation homomorphism. This is proved in Interval/Functoriality.agda.