Directed type theory, with a twist

Directed type theory, with a twist
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

In recent years, Homotopy Type Theory (HoTT) has had great success both as a foundation of mathematics and as internal language to reason about $\infty$-groupoids (a.k.a. spaces). However, in many areas of mathematics and computer science, it is often the case that it is categories, not groupoids, which are the more important structures to consider. For this reason, multiple directed type theories have been proposed, i.e., theories whose semantics are based on categories. In this paper, we present a new such type theory, Twisted Type Theory (TTT). It features a novel ``twisting’’ operation on types: given a type that depends both contravariantly and covariantly on some variables, its twist is a new type that depends only covariantly on the same variables. To provide the semantics of this operation, we introduce the notion of dependent 2-sided fibrations (D2SFibs), which generalize Street’s notion of 2-sided fibrations. We develop the basic theory of D2SFibs, as well as characterize them through a straightening-unstraightening theorem. With these results in hand, we introduce a new elimination rule for Hom-types. We argue that our syntax and semantics satisfy key features that allow reasoning in a HoTT-like style, which allows us to mimic the proof techniques of that setting. We end the paper by exemplifying this, and use TTT to reason about categories, giving a syntactic proof of Yoneda’s lemma.


💡 Research Summary

The paper introduces Twisted Type Theory (TTT), a new directed type theory designed to bring the synthetic power of Homotopy Type Theory (HoTT) to the realm of categories. The authors begin by recalling the success of HoTT as a foundation for mathematics and as an internal language for ∞‑groupoids, and they argue that many areas of mathematics and computer science require a focus on categories rather than groupoids. Consequently, they formulate three desiderata that a directed type theory should satisfy: (1) types in the empty context should be categories, (2) there should be a primitive Hom‑type providing a directed equality structure that can be iterated to encode higher cells, and (3) the introduction rule for Hom‑type should correspond to the factorisation of the diagonal map through the arrow category, thereby giving a notion of “trivial directed equality” via directed path objects.

To meet these goals, the authors build on North’s category model of Martin‑Löf Type Theory, where contexts are interpreted as categories and types as indexed categories. They observe that the usual op‑fibration semantics (obtained via the straightening‑unstraightening equivalence for op‑fibrations) cannot represent the arrow category A→ because the projection ⟨dom, cod⟩ : A→ → A×A is not an op‑fibration. To overcome this limitation they introduce a new class of “displayed types” that correspond to arbitrary functors over a base category, using a straightening‑unstraightening result for displayed categories (Bénabou’s theorem).

The central semantic innovation is the notion of Dependent 2‑Sided Fibrations (D2SFibs), a generalisation of Street’s 2‑sided fibrations that allows simultaneous covariant and contravariant dependence on variables. The authors develop the basic theory of D2SFibs and prove a straightening‑unstraightening theorem that characterises D2SFibs as equivalent to a category of “displayed categories” together with a suitable fibration. This theorem provides the semantic foundation for the new “twist” operation on types: given a type A that depends both contravariantly and covariantly on a variable x, its twist A⁺ depends only covariantly on x, and the interpretation of A⁺ is precisely the arrow category of A. In other words, twisting implements the unstraightening part of the D2SFib equivalence.

With the semantics in place, the syntax of TTT is presented as an extension of North’s type theory. In addition to the usual Σ‑, Π‑, and universe rules, TTT adds (i) a formation rule for twisted types, (ii) a modified Hom‑type formation, introduction, elimination, and computation rules, and (iii) auxiliary constructs such as opposite contexts and discrete universes. The new Hom‑introduction rule mirrors the Id‑introduction rule of HoTT but, thanks to the twist, its interpretation yields the arrow category factorisation A → A → A×A, satisfying desideratum (3). The elimination rule is designed so that natural transformations between functors can be expressed as terms of a Hom‑type, and the computation rule ensures the expected β‑reduction behaviour.

The expressive power of TTT is demonstrated by a fully formalised proof of Yoneda’s lemma within the type theory. The proof follows the familiar HoTT style: one defines the Yoneda embedding as a term, constructs the natural transformation using the Hom‑elimination rule, and shows the required equivalence by path induction on the Hom‑type. This example illustrates that TTT can reproduce classic categorical arguments while retaining the synthetic, proof‑assistant‑friendly methodology of HoTT.

The paper concludes by acknowledging that the current development is limited to a 1‑categorical (i.e., ordinary category) setting and that extending the framework to ∞‑categories is a promising direction for future work. The authors also discuss how D2SFibs and the twist operation might be incorporated into other directed type theories, such as Simplicial Type Theory or theories based on virtual double categories, potentially unifying disparate approaches under a common semantic umbrella.

In summary, Twisted Type Theory provides a coherent system where (1) every type is a category, (2) Hom‑types give a built‑in directed equality structure, and (3) the twist operation supplies the arrow category needed for a natural “path‑object” interpretation. By coupling these ingredients with a straightening‑unstraightening characterisation of dependent 2‑sided fibrations, the authors achieve a HoTT‑like synthetic framework capable of reasoning about categories and natural transformations directly inside the type theory.


Comments & Academic Discussion

Loading comments...

Leave a Comment