nLab bridge type

Redirected from "indexed heterogeneous bridge type".

This article contains a section on the notion of type universes being relativistic. For the notion of (the spacetime of) a universe in physics being relativistic, see special relativity.

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
propositional equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Contents

Idea

In dependent type theory, bridge types are a reflexive type family used in explicit parametricity. The elements of bridge types are called bridges.

Finitary bridge types

Finitary bridge types come in nn-ary forms, for any natural number nn. Examples include

Narya has nn-ary bridge types for 1n91 \leq n \leq 9.

Unlike identity types, binary bridge types do not have transport.

Infinitary bridge types

There are also bridge types which are not finitary. One such example of “infinitary” bridge types is the bridge types in the internal dependent type theory of the topos of trees.

Bridge types of arbitrary arity

More generally, one can consider bridge types of arbitrary arity. For an index type II, bridge types of arity II are parameterized by an II-indexed family of elements of AA; that is,

x¯:IABr I,A(x¯)type\overline{x}:I \to A \vdash \mathrm{Br}_{I, A}(\overline{x}) \; \mathrm{type}

The nn-ary bridge types are simply the case where the index type II is the standard finite type with nn elements Fin(n) m:m<n\mathrm{Fin}(n) \coloneqq \sum_{m:\mathbb{N}} m \lt n, due to the induction principle of the natural numbers type.

Properties

Reflexivity

Bridge types are reflexive in that for all elements x:Ax:A, there is an element

refl I,A(x):Br I,A(λt.x)\mathrm{refl}_{I, A}(x):\mathrm{Br}_{I, A}(\lambda t.x)

where λt.x:IA\lambda t.x:I \to A is the constant function which always returns xx.

For IboolI \equiv \mathrm{bool} the type of booleans, this yields the usual notion of reflexivity for binary bridge types Br A(x,y)\mathrm{Br}_A(x, y), since by the induction principle of the type of booleans, Br A,bool(rec bool,A(x,y))\mathrm{Br}_{A, \mathrm{bool}}(\mathrm{rec}_{\mathrm{bool}, A}(x, y)) is equivalent to Br A(x,y)\mathrm{Br}_A(x, y) and rec bool,A(x,x)λt.x\mathrm{rec}_{\mathrm{bool}, A}(x, x) \equiv \lambda t.x.

Function application

In the same way that functions preserve identifications via function application to identifications, functions preserve bridges via function application to bridges or the action on bridges. For all functions x¯:IA\overline{x}:I \to A and f:ABf:A \to B, and bridges p:Br I,A(x¯)p:\mathrm{Br}_{I, A}(\overline{x}), there is a bridge ap(f,x¯,p):Br I,A(fx¯)\mathrm{ap}(f, \overline{x}, p):\mathrm{Br}_{I, A}(f \circ \overline{x}):

f:AB,x¯:IA,p:Br I,A(x¯)ap(f,x¯,p):Br I,A(fx¯)f:A \to B, \overline{x}:I \to A, p:\mathrm{Br}_{I, A}(\overline{x}) \vdash \mathrm{ap}(f, \overline{x}, p):\mathrm{Br}_{I, A}(f \circ \overline{x})

For IboolI \equiv \mathrm{bool} the type of booleans and x¯rec bool,A(x,y)\overline{x} \equiv \mathrm{rec}_{\mathrm{bool}, A}(x, y), this yields the usual notion of the action on bridges on binary bridge types Br A(x,y)\mathrm{Br}_A(x, y), since by the induction principle of the type of booleans, Br A,bool(rec bool,A(x,y))\mathrm{Br}_{A, \mathrm{bool}}(\mathrm{rec}_{\mathrm{bool}, A}(x, y)) is equivalent to Br A(x,y)\mathrm{Br}_A(x, y).

Function application to bridges satisfy many of the same judgmental equalities as function application to identifications. These include, for f:ABf:A \to B, g:BCg:B \to C, x¯:IA\overline{x}:I \to A, and p:Br I,A(x¯)p:\mathrm{Br}_{I, A}(\overline{x}),

ap(λx.x,x¯,p)p:Br I,A(x¯)\mathrm{ap}(\lambda x.x, \overline{x}, p) \equiv p:\mathrm{Br}_{I, A}(\overline{x})
ap(λt.x,x¯,p)refl I,A(x):Br I,A(x¯)\mathrm{ap}(\lambda t.x, \overline{x}, p) \equiv \mathrm{refl}_{I, A}(x):\mathrm{Br}_{I, A}(\overline{x})
ap(gf,x¯,p)ap(g,fx¯,ap(f,x¯,p)):Br I,C(gfx¯)\mathrm{ap}(g \circ f, \overline{x}, p) \equiv \mathrm{ap}(g, f \circ \overline{x}, \mathrm{ap}(f, \overline{x}, p)):\mathrm{Br}_{I, C}(g \circ f \circ \overline{x})
ap(f,λt.x,refl I,A(x))refl I,B(f(x)):Br I,B(λt.f(x))\mathrm{ap}(f, \lambda t.x, \mathrm{refl}_{I, A}(x)) \equiv \mathrm{refl}_{I, B}(f(x)):\mathrm{Br}_{I, B}(\lambda t.f(x))

Heterogeneous bridge types

Similarly to heterogeneous identity types, there are heterogeneous versions of bridge types as well. Given a type AA and a type family (B(x)) x:A(B(x))_{x:A} and an index type II for the bridge types, the heterogeneous bridge type is a type family

x¯:IA,p:Br I,A(x¯),y¯: i:IB(x¯(i))hBr I,A,B(x¯,p,y¯)\overline{x}:I \to A, p:\mathrm{Br}_{I, A}(\overline{x}), \overline{y}:\prod_{i:I} B(\overline{x}(i)) \vdash \mathrm{hBr}_{I, A, B}(\overline{x}, p, \overline{y})

The usual version of a bridge type can be called homogeneous to contrast with heterogeneous bridge types.

For IboolI \equiv \mathrm{bool} the type of booleans, x¯rec bool,A(x 0,x 1)\overline{x} \equiv \mathrm{rec}_{\mathrm{bool}, A}(x_0, x_1), and y¯ind bool,λt.B(x¯(t))(y 0,y 1)\overline{y} \equiv \mathrm{ind}_{\mathrm{bool}, \lambda t.B(\overline{x}(t))}(y_0, y_1), this yields the usual notion of a heterogeneous bridge types hBr A,B(x 0,x 1,p,y 0,y 1)\mathrm{hBr}_{A, B}(x_0, x_1, p, y_0, y_1), since by the induction principle of the type of booleans, we have an equivalence of types

hBr bool,A,B(rec bool,A(x 0,x 1),p,ind bool,B(y 0,y 1))hBr A,B(x 0,x 1,p,y 0,y 1)\mathrm{hBr}_{\mathrm{bool}, A, B}(\mathrm{rec}_{\mathrm{bool}, A}(x_0, x_1), p, \mathrm{ind}_{\mathrm{bool}, B}(y_0, y_1)) \simeq \mathrm{hBr}_{A, B}(x_0, x_1, p, y_0, y_1)

Like heterogeneous identity types, there is also a version of the heterogeneous bridge type which can be defined as a dependent sum type

x¯:IA,y¯: i:IB(x¯(i))hBr I,A,B(x¯,y¯) p:Br I,A(x¯)hBr I,A,B(x¯,p,y¯)\overline{x}:I \to A, \overline{y}:\prod_{i:I} B(\overline{x}(i)) \vdash \mathrm{hBr}_{I, A, B}(\overline{x}, \overline{y}) \coloneqq \sum_{p:\mathrm{Br}_{I, A}(\overline{x})} \mathrm{hBr}_{I, A, B}(\overline{x}, p, \overline{y})

These heterogeneous bridge types can be called fibered heterogeneous bridge types, and the other kind can be called indexed heterogeneous bridge types, in parallel to heterogeneous identity types.

Relation to homogeneous bridge types

Let CC be a type. Then heterogeneous bridge types over the constant type family at CC are the same as homogeneous bridge types of CC.

hBr A,λt.C,I(x¯,p,y¯)Br I,C(y¯)\mathrm{hBr}_{A, \lambda t.C, I}(\overline{x}, p, \overline{y}) \equiv \mathrm{Br}_{I, C}(\overline{y})

Similarly, given an element x:Ax:A, heterogeneous bridge types over the constant function λt.x:IA\lambda t.x:I \to A and reflexivity refl I,A(x)\mathrm{refl}_{I, A}(x) are the same as homogeneous bridge types of B(x)B(x):

hBr I,A,B(λt.x,refl I,A(x),y¯)Br I,B(x)(y¯)\mathrm{hBr}_{I, A, B}(\lambda t.x, \mathrm{refl}_{I, A}(x), \overline{y}) \equiv \mathrm{Br}_{I, B(x)}(\overline{y})

Heterogeneous reflexivity

Given an element x:Ax:A and y:B(x)y:B(x), there is an element of the heterogeneous bridge type

hrefl I,A,B(x,y):hBr I,A,B(λt.x,refl I,A(x),λt.y)\mathrm{hrefl}_{I, A, B}(x, y):\mathrm{hBr}_{I, A, B}(\lambda t.x, \mathrm{refl}_{I, A}(x), \lambda t.y)

Since the heterogeneous bridge type hBr I,A,B(λt.x,refl I,A(x),λt.y)\mathrm{hBr}_{I, A, B}(\lambda t.x, \mathrm{refl}_{I, A}(x), \lambda t.y) is the same as the homogeneous bridge type Br I,B(x)(λt.y)\mathrm{Br}_{I, B(x)}(\lambda t.y), heterogeneous reflexivity is the same as the homogeneous reflexivity term

hrefl I,A,B(x,y)refl I,B(x)(y):Br I,B(x)(λt.y)\mathrm{hrefl}_{I, A, B}(x, y) \equiv \mathrm{refl}_{I, B(x)}(y):\mathrm{Br}_{I, B(x)}(\lambda t.y)

Dependent function application

In the same way that dependent functions preserve heterogeneous identifications via dependent function application to identifications, dependent functions preserve bridges via dependent function application to bridges or the dependent action on bridges. For all functions x¯:IA\overline{x}:I \to A and dependent functions f: x:AB(x)f:\prod_{x:A} B(x), and bridges p:Br I,A(x¯)p:\mathrm{Br}_{I, A}(\overline{x}), there is a heterogeneous bridge apd(f,x¯,p):hBr I,A,B(x¯,p,λt.f(x¯(t)))\mathrm{apd}(f, \overline{x}, p):\mathrm{hBr}_{I, A, B}(\overline{x}, p, \lambda t.f(\overline{x}(t))):

f: x:AB(x),x¯:IA,p:Br I,A(x¯)apd(f,x¯,p):hBr I,A,B(x¯,p,λt.f(x¯(t)))f:\prod_{x:A} B(x), \overline{x}:I \to A, p:\mathrm{Br}_{I, A}(\overline{x}) \vdash \mathrm{apd}(f, \overline{x}, p):\mathrm{hBr}_{I, A, B}(\overline{x}, p, \lambda t.f(\overline{x}(t)))

Dependent function application of bridges satisfies some of the same judgmental equalities as that of identifications. These include, for f: x:AB(x)f:\prod_{x:A} B(x) and x:Ax:A,

apd(f,λt.x,refl I,A(x))refl I,B(x)(f(x)):hBr I,A,B(λt.x,refl I,A(x),λt.f(x))\mathrm{apd}(f, \lambda t.x, \mathrm{refl}_{I, A}(x)) \equiv \mathrm{refl}_{I, B(x)}(f(x)):\mathrm{hBr}_{I, A, B}(\lambda t.x, \mathrm{refl}_{I, A}(x), \lambda t.f(x))

The walking bridge

Given a bridge type Br I,A(x¯)\mathrm{Br}_{I, A}(\overline{x}) indexed by functions x¯:IA\overline{x}:I \to A, the walking bridge type is a higher inductive type 𝕀 I\mathbb{I}_I generated by a function pts:I𝕀 I\mathrm{pts}:I \to \mathbb{I}_I and a bridge br:Br I,𝕀 I(pts)\mathrm{br}:\mathrm{Br}_{I, \mathbb{I}_I}(\mathrm{pts}).

The idea of the walking bridge is that every bridge in a bridge type Br I,A(x¯)\mathrm{Br}_{I, A}(\overline{x}) is given by a function IAI \to A that factors through 𝕀 I\mathbb{I}_I:

I𝕀 IAI \to \mathbb{I}_I \to A

in the same way that identifications are given by a function boolA\mathrm{bool} \to A that factors through the interval type (the walking identification).

Inference rules

The inference rules of the walking bridge are as follows:

Formation rules for the walking bridge:

ΓItypeΓ𝕀 Itype\frac{\Gamma \vdash I \; \mathrm{type}}{\Gamma \vdash \mathbb{I}_I \; \mathrm{type}}

Introduction rules for the walking bridge:

ΓItypeΓpts:I𝕀 IΓItypeΓbr I:Br I,𝕀 I(pts)\frac{\Gamma \vdash I \; \mathrm{type}}{\Gamma \vdash \mathrm{pts}:I \to \mathbb{I}_I} \qquad \frac{\Gamma \vdash I \; \mathrm{type}}{\Gamma \vdash \mathrm{br}_I:\mathrm{Br}_{I, \mathbb{I}_I}(\mathrm{pts})}

Elimination rules for the walking bridge:

ΓItypeΓ,x:𝕀 IC(x)typeΓc pts: i:IC(pts(i))Γc br:hBr I,𝕀 I,C(pts,br I,c pts)Γ,x:𝕀 Iind 𝕀 I C(c pts,c br,x):C(x)\frac{\Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:\mathbb{I}_I \vdash C(x) \; \mathrm{type} \quad \Gamma\vdash c_\mathrm{pts}:\prod_{i:I} C(\mathrm{pts}(i)) \quad \Gamma \vdash c_\mathrm{br}:\mathrm{hBr}_{I, \mathbb{I}_I, C}(\mathrm{pts}, \mathrm{br}_I, c_\mathrm{pts})}{\Gamma, x:\mathbb{I}_I \vdash \mathrm{ind}_{\mathbb{I}_I}^C(c_\mathrm{pts}, c_\mathrm{br}, x):C(x)}

Computation rules for the walking bridge:

ΓItypeΓ,x:𝕀 IC(x)typeΓc pts: i:IC(pts(i))Γc br:hBr I,𝕀 I,C(pts,br I,c pts)Γ,i:Iind 𝕀 C(c pts,c br,i)c(i):C(pts(i))\frac{\Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:\mathbb{I}_I \vdash C(x) \; \mathrm{type} \quad \Gamma\vdash c_\mathrm{pts}:\prod_{i:I} C(\mathrm{pts}(i)) \quad \Gamma \vdash c_\mathrm{br}:\mathrm{hBr}_{I, \mathbb{I}_I, C}(\mathrm{pts}, \mathrm{br}_I, c_\mathrm{pts})}{\Gamma, i:I \vdash \mathrm{ind}_\mathbb{I}^{C}(c_\mathrm{pts}, c_\mathrm{br}, i) \equiv c(i):C(\mathrm{pts}(i))}
ΓItypeΓ,x:𝕀 IC(x)typeΓc pts: i:IC(pts(i))Γc br:hBr I,𝕀 I,C(pts,br I,c pts)Γapd(ind 𝕀 C(c pts,c br),pts,br I)c br:Br I,𝕀 I(pts)\frac{\Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:\mathbb{I}_I \vdash C(x) \; \mathrm{type} \quad \Gamma\vdash c_\mathrm{pts}:\prod_{i:I} C(\mathrm{pts}(i)) \quad \Gamma \vdash c_\mathrm{br}:\mathrm{hBr}_{I, \mathbb{I}_I, C}(\mathrm{pts}, \mathrm{br}_I, c_\mathrm{pts})}{\Gamma \vdash \mathrm{apd}(\mathrm{ind}_\mathbb{I}^{C}(c_\mathrm{pts}, c_\mathrm{br}), \mathrm{pts}, \mathrm{br}_I) \equiv c_\mathrm{br}:\mathrm{Br}_{I, \mathbb{I}_I}(\mathrm{pts})}

Discrete types

Since bridge types are reflexive, we can define the diagonal as the function

Δ I,Aλx.(λt.x,refl I,A(x)):A x¯:IABr I,A(x¯)\Delta_{I, A} \coloneqq \lambda x.(\lambda t.x, \mathrm{refl}_{I, A}(x)):A \to \sum_{\overline{x}:I \to A} \mathrm{Br}_{I, A}(\overline{x})

Let Id I,A(x¯)\mathrm{Id}_{I, A}(\overline{x}), indexed by functions x¯:IA\overline{x}:I \to A, denote the identity type of arity II. Binary identity types are equivalent to the usual identity type Id A(x,y)\mathrm{Id}_A(x, y) by the recursion principle of the type of booleans.

A type AA is discrete if and only if one of the following equivalent conditions holds:

  • the diagonal Δ I,A\Delta_{I, A} is an equivalence of types.

  • the canonical function const A,𝕀 Iλa.λi.a\mathrm{const}_{A, \mathbb{I}_I} \coloneqq \lambda a.\lambda i.a which takes elements in AA to constant functions 𝕀 IA\mathbb{I}_I \to A out of the walking bridge is an equivalence of types.

  • the canonical inductively defined family of functions Id I,A(x¯)Br I,A(x¯)\mathrm{Id}_{I, A}(\overline{x}) \to \mathrm{Br}_{I, A}(\overline{x}) defined via identification elimination is an equivalence of types for all x¯:IA\overline{x}:I \to A.

The second condition is essentially saying that the localization L 𝕀 I(A)L_{\mathbb{I}_I}(A) at the walking bridge 𝕀 I\mathbb{I}_I is equivalent to AA itself.

In a spatial type theory with a flat modality and sharp modality, one can create a cohesive type theory by adding an axiom of cohesion for the walking bridge, that says that a type is discrete in the spatial sense AAA \simeq \flat A if and only if a type is discrete in the bridge sense. The shape modality of the cohesive type theory ʃL 𝕀 I\esh \coloneqq L_{\mathbb{I}_I} is then given by localization at the walking bridge.

The semantics of such a cohesive type theory for a finite type II with nn-elements is the cohesive (infinity,1)-topos of nn-ary cubical objects in a base (infinity,1)-topos of cubically discrete objects.

Relativity

There is an analogue of the univalence axiom for type universes called relativity (see Cavallo & Harper 2021), which uses bridge types instead of identity types and types of nn-ary type families instead of types of equivalences. A universe is called relativistic if it satisfies the axiom of relativity:

Definition

Given an index type II and bridge types Br I,A(x¯)\mathrm{Br}_{I, A}(\overline{x}), relativity for a type universe UU states that for all II-indexed type families X¯:IU\overline{X}:I \to U, there is an equivalence of types between the bridge type Br I,U(X¯)\mathrm{Br}_{I, U}(\overline{X}) and the type ( i:IX¯(i))U\left(\prod_{i:I} \overline{X}(i)\right) \to U of UU-small II-ary type families.

Special cases of relativity for when the index type IFin(n)I \equiv \mathrm{Fin}(n) is the finite type with n=0n = 0, n=1n = 1, and n=2n = 2 elements respectively:

  • Nullary relativity of a type universe UU, where II \equiv \emptyset the empty type, says that there is an equivalence of types between the bridge type Br U\mathrm{Br}_U and the type of types (unitU)U(\mathrm{unit} \to U) \simeq U, since the nullary product type is the unit type.

  • Unary relativity of a type universe UU, where IunitI \equiv \mathrm{unit} the unit type, says that there is an equivalence of types between the bridge type Br U(A)\mathrm{Br}_U(A) and the type of type families (Copy(A)U)(AU)(\mathrm{Copy}(A) \to U) \simeq (A \to U), since the unary product type is the copy type.

  • Binary relativity of a type universe UU, where IboolI \equiv \mathrm{bool} the type of booleans, says that there is an equivalence of types between the bridge type Br U(A,B)\mathrm{Br}_U(A, B) and the type of correspondences ((A×B)U)(ABU)((A \times B) \to U) \simeq (A \to B \to U).

References

The terminology “bridge” is first used in this sense in

Bridge types first appear in an unary form, written as xAx \in \llbracket A \rrbracket rather than Br A(x)\mathrm{Br}_A(x), in

  • Jean-Philippe Bernardy and Guilhem Moulin?. 2012. A Computational Interpretation of Parametricity. In Proceedings of the 27th Annual IEEE Symposium on Logic in Computer Science, LICS 2012, Dubrovnik, Croatia, June 25-28, 2012. IEEE Computer Society, 135–144. [doi:10.1109/LICS.2012.25]

An equivalent of univalence for unary bridge types appears (with inverse conditions given by the Pair-Pred and Surj-Typ equations) in

  • Jean-Philippe Bernardy, Thierry Coquand, and Guilhem Moulin?. 2015. A Presheaf Model of Parametric Type Theory. In The 31st Conference on the Mathematical Foundations of Programming Semantics, MFPS 2015, Nijmegen, The Netherlands, June 22-25, 2015 (Electronic Notes in Theoretical Computer Science, Vol. 319), Dan R. Ghica (Ed.). Elsevier, 67–82. [doi:10.1016/j.entcs.2015.12.006]

The equivalent of univalence for (binary) bridge types is called “relativity” in:

A unary bridge type called “display” and written as A d(x)A^d(x) instead of Br A(x)\mathrm{Br}_A(x) appears in

A fibered version of bridge types is defined in:

Bridge types in Narya:

  • Observational higher dimensions, Narya documentation. (web)

  • Parametricity, Narya documentation. (web)

Some discussion of bridge types occurs in

  • synthetic algebraic geometry vs continuation passing style, Category Theory Zulip, web.

Last revised on July 3, 2025 at 21:46:52. See the history of this page for a list of all contributions to it.