nLab modal type

Redirected from "modal types".
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

Modalities, Closure and Reflection

Contents

Idea

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

Definition

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

  • the unit η:XX\eta \colon X \to \Diamond X

  • or the counit ϵ:XX\epsilon \colon \Box X \to X

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.

Examples

Last revised on August 13, 2023 at 13:30:26. See the history of this page for a list of all contributions to it.