nLab System F

Contents

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
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

System F, also known as the polymorphic lambda-calculus or second-order lambda-calculus, is an extension of simply typed lambda-calculus to include a type of impredicative universal quantification.

Semantics

Models of System F can be described as a form of hyperdoctrine:

  1. A category K of kinds with cartesian products.
  2. A functor P:K oCCCP \colon K^o \to CCC, i.e., a contravariant functor from KK to the category of cartesian closed categories and functors preserving the CC structure.
  3. A representing object UKU \in K, i.e., K(,U)P 0K(-,U) \cong P_0 where P 0:K oSetP_0 : K^o \to Set is the presheaf of objects of the corresponding CCC.
  4. Such that for any ΔK\Delta \in K, the functor P(π):P(Δ)P(Δ×U)P(\pi) \colon P(\Delta) \to P(\Delta \times U) induced from the projection π:Δ×UΔ\pi \colon \Delta \times U \to \Delta has a right adjoint :P(Δ×U)P(Δ)\forall \colon P(\Delta \times U) \to P(\Delta) satisfying a Beck-Chevalley condition.

Typically, the objects of the category of kinds are restricted to be generated by products of UU.

Note that this models the βη\beta\eta equivalence of System F only, not the more complex notion of relational parametricity?. A relationally parametric model of System F is

  1. A model of System F internal to the category of reflexive graphs
  2. Such that the functor (s,t):P e(Δ e)P v(s(Δ e))×P v(t(Δ e))(s,t) : P_e(\Delta_e) \to P_v(s(\Delta_e)) \times P_v(t(\Delta_e)) is a fibration.

Note that by taking the “vertex” component of such a model, we get an underlying ordinary “equational” model of System F, and so we can see a relatonally parametric model as an extension of an equational model. The internalization to reflexive graphs models the relational structures: the “edge” components are the relations, the source/target maps ensure that each relation lies over an ordinary structure, and the reflexive edge models the notion of an identity/equality relation. The fibration requirement then provides a rich supply of relations: given a relation R and morphisms f s:B ss(R)f_s : B_s \to s(R) and f t:B tt(R)f_t : B_t \to t(R), the fibration structure defines a “weakest pre-relation” R[f s,f t]R[f_s,f_t] with source and target B s,B tB_s,B_t. Notably, if RR is an identity relation and one of f s,f tf_s,f_t is the identity, this is a kind of graph relation of a morphism. Compare the definition of a virtual equipment, where the reflexive edges are analogous to the units and the fibration structure is analogous to the restrictions.

References

The calculus now called System F was developed independently in the following works:

  • Jean-Yves Girard, Interprétation functionelle et élimination des coupures dans l’arithmétique d’ordre supérieure, Ph.D. thesis, Université Paris VII (1972) [pdf, pdf]

  • John C. Reynolds, Towards a theory of type structure, Programming Symposium, 1974 (doi)

The hyperdoctrine-like notion of model:

  • R.A.G. Seely, Categorical Semantics for Higher Order Polymorphic Lambda Calculus, Journal of Symbolic Logic, Vol. 52, Issue 4, December 1987 (doi)

The reflexive graph/fibrational view of parametricity:

  • Brian Dunphy and Uday Reddy, Parametric Limits, Logic in Computer Science 1994 (doi)

Last revised on August 17, 2022 at 12:57:19. See the history of this page for a list of all contributions to it.