modal type


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

logiccategory theorytype theory
trueterminal object/(-2)-truncated objecth-level 0-type/unit type
falseinitial objectempty type
proposition(-1)-truncated objecth-proposition, mere proposition
proofgeneralized elementprogram
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
cut elimination for implicationcounit for hom-tensor adjunctionbeta reduction
introduction rule for implicationunit for hom-tensor adjunctioneta conversion
logical conjunctionproductproduct type
disjunctioncoproduct ((-1)-truncation of)sum type (bracket type of)
implicationinternal homfunction type
negationinternal hom into initial objectfunction type into empty type
universal quantificationdependent productdependent product type
existential quantificationdependent sum ((-1)-truncation of)dependent sum type (bracket type of)
equivalencepath space objectidentity type/path type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
completely presented setdiscrete object/0-truncated objecth-level 2-type/preset/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
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


Modalities, Closure and Reflection



In modal logic a modality expresses a “way of being true” and a modal proposition (or stable proposition) is a proposition which is indeed true in the given way (for instance being necessarily true or possibly true, in S4 modal logic ).

As one passes from logic to (homotopy) type theory and hence from modal logic to modal type theory, then being true is just the lowest stage of a hierarchy of truncated types (“h-level”). Hence for a general type/homotopy type then a modality expresses just a “way of being”.

For instance if CC is a discrete finite type (h-set) thought of as a type of “colors” and one term g:Cg \colon C of it is thought of as the color “green”, then the CC-dependent types may be thought of as colored types; and so there is a modal operator whose modal types are those which are unicolored in green. Hence here the “way of being” expressed by the modality is “being green”. (Formally, g:1Cg: 1 \to C induces g *:H/CHg^{\ast}: \mathbf{H}/C \to \mathbf{H} selecting the gg-fiber of a CC-colored type. Then composition with its left adjoint, dependent sum, g:HH/C\sum_g: \mathbf{H} \to \mathbf{H}/C, yields the comonadic modal operator, gg *\sum_g \cdot g^{\ast}, on H/C\mathbf{H}/C, which acts on a colored type to filter out non-green entities.)

More practical examples arise for instance in cohesive homotopy type theory, where for instance the flat modality expresses the “way of being geometrically discrete” and the sharp modality expresses the “way of being codiscrete”.

If one also regards non-idempotent (co-)monads as modal operators then the “way of being” expressed by them may involve structure and not just property. For instance the modal types of the maybe monad are the pointed objects and hence the maybe modality expresses the “way of being pointed”.


Given a modal type theory, hence type theory equipped with a closure operator modality \Diamond (idempotent monadic) or \Box (idempotent comonadic), a type XX is modal with respect to \Diamond/\Box if

is an equivalence.

The collection of modal types forms the closure of the given closure operator.

Under propositions as types a proposition that is modal is also called a stable proposition.

By the discussion at idempotent monad – Properties – Eilenberg-Moore category of algebra the modal types over an idempotent (co-)modality are precisely the types which are (co-)algebras over the given (co-)monad. Hence more generally it makes sense to regard a not-necessarily idempotent (co-)monad as a modal operator and regard its algebras as the corresponding modal types.