nLab !-modality

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 full linear logic [Girard 1987] and more generally in linear type theory there is assumed a (comonadic) modality traditionally denoted “!” whose role is to model the “underlying” classical (intuitionistic) type of a given linear type.

This is alternatively called the “exponential modality” (for good reasons discussed below), or “storage modality” (as it allows to duplicate and hence “store” otherwise linear data) and sometimes pronounced “of course” (intended alongside “necessarily” and “possibly” as used in modal logic) or even “bang” (just in reference to the symbol “!”).

In classical linear logic (meaning with involutive de Morgan duality), the de Morgan dual of “!” is denoted “?” and then sometimes pronounced “why not”.

Today it is understood (cf. Melliès 2009, p. 36) that the exponential modality is best and generally to be thought as as, first of all a comonad on linear types (Seely 1989 §2, dePaiva 1989, Benton, Bierman, de Paiva and Hyland 1992) which, secondly, is induced by an adjunction to classical (meaning here: non-linear intuitionistic) types with special monoidal properties (Seely 1989 §2, Bierman 1994 pp. 157, Benton 1995).

In a most elementary and illuminating example (which may not have received the attention it deserves, cf. the history at quantum logic):

  • classical intuitionistic types form (are interpreted in) the category of Sets

    ClaTypesSetClaTypes \,\coloneqq\, Set

  • linear types form (are interpreted in) the category of vector spaces (cf. Murfet 2014)

    LinTypesVect 𝕂LinTypes \,\coloneqq\, Vect_{\mathbb{K}}

and the adjoint functors in question are

  • forming the linear span of a set

    Set Q Vect W W𝟙 \array{ Set &\overset{\mathrm{Q}}{\longrightarrow}& Vect \\ W &\mapsto& \oplus_W \mathbb{1} }
  • forming the underlying set of a vector space:

    Vect C Set 𝒱 Hom(𝟙,𝒱) \array{ Vect &\overset{\mathrm{C}}{\longrightarrow}& Set \\ \mathscr{V} &\mapsto& Hom(\mathbb{1}, \, \mathscr{V}) }

in which case the exponential modality acts by sending a vector space to the linear span of its underlying set

Vect ! Vect 𝒱 𝒱𝟙. \array{ Vect &\overset{\;\; ! \;\;}{\longrightarrow}& Vect \\ \mathscr{V} &\mapsto& \underset{\mathscr{V}}{\bigoplus} \mathbb{1} \,. }

One sees that this construction takes (direct) sums to (tensor) products

!(𝒱𝒱)(!𝒱)(!𝒱) !(\mathscr{V} \oplus \mathscr{V}') \;\simeq\; (! \mathscr{V}) \otimes (! \mathscr{V}')

and zero (objects) to unit (objects)

!0𝟙 ! 0 \;\simeq\; \mathbb{1}

as expected of any exponential map, whence the name “exponential modality”.

This example is the 0-sector of the more famous stabilization ( \infty -)adjunction (Σ + Ω + )(\Sigma_+^\infty \dashv \Omega_+^\infty) between (the homotopy theory of) topological spaces and (the stable homotopy theory of) module spectra equipped with the symmetric smash product of spectra (given by forming suspension spectra XΣ + XX \mapsto \Sigma_+^\infty X), which points to a deeper origin of the “exponential modality”, see below and at linear homotopy type theory for more on this.

Categorical semantics

Following Seely 1989, dePaiva 1989, Benton, Bierman, de Paiva and Hyland 1992 it is common convention that “!” should be a comonad on the type system (and ? should be a monad, see also at monads in computer science), but there is some room in which further axioms to impose. The goal is to capture the syntactic rules allowing assumptions of the form !A!A to be duplicated and discarded.

Intuitionistic case

The definition from Seely, adapted to the intuitionistic case and modernized, is:

Definition

Let LinTypesLinTypes be

which in addition carries the structure of

A Seely comonad on LinTypesLinTypes is a comonad that is a strong monoidal as a functor from cartesian monoidal structure ×\times to the other monoidal structure \otimes:

(LinTypes,×)!(LinTypes,) (LinTypes, \times) \xrightarrow{ \; ! \; } (LinTypes, \otimes)

meaning that there are natural transformations of the form

(1)A,B:LinTypes!(A×B)(!A)(!B) A,\, B \colon LinTypes \;\;\;\;\;\;\; \vdash \;\;\;\;\;\;\; !(A \times B) \;\cong\; (!A) \otimes (!B)

and

!*𝟙. ! \ast \;\;\simeq\;\; \mathbb{1} \,.

(There is also an additional coherence axiom that should be imposed; see Melliès 2009, section 7.3.)

Remark

(the exponential condition)
In linear logic, the cartesian monoidal structure on linear types is often denoted “&\&” (“additive conjunction”), in which case the condition (1) reads

!(A&B)(!A)(!B). !(A \& B) \;\cong\; (!A) \otimes (!B) \,.

But in key examples of categories of (the multiplicative fragment of) linear logic (such as Vect, cf. Murfet 2014), the cartesian product is actually a biproduct, hence a direct sum, in which case the condition on the exponential modality is that

it takes (direct) sums to (tensor) products

!(AB)(!A)(!B) !(A \oplus B) \;\cong\; (!A) \otimes (!B)

it takes zero (objects) to unit (objects)

!0𝟙 ! 0 \;\cong\; \mathbb{1}

as befits any exponential map and may explain the choice of terminology here.

This condition implies that the Kleisli category of !! (i.e. the category of cofree !-coalgebras) is cartesian monoidal. If LinTypesLinTypes is closed symmetric monoidal then the Kleisli category of a cartesian closed category, which is a categorical version of the translation of intuitionistic logic into linear logic.

Of course, the above definition depends on the existence of the cartesian product. A different definition that doesn’t require the existence of ×\times was given by Benton, Bierman, de Paiva, and Hyland:

Definition

Let LinTypesLinTypes be a symmetric monoidal category; a linear exponential comonad on LinTypesLinTypes is a lax monoidal comonad such that every cofree !-coalgebra naturally carries the structure of a comonoid object in the category of coalgebras (i.e. the cofree-coalgebra functor lifts to the category of comonoids in the category of coalgebras).

It follows automatically that all !-coalgebras are comonoids, and therefore that the category of all !-coalgebras (not just the cofree ones) is cartesian monoidal. Note that for a comonad on a poset, every coalgebra is free; thus the world of pure propositional “logic” doesn’t tell us whether to consider the Kleisli category or the Eilenberg-Moore category for the translation.

A more even-handed approach is the following (see Benton (1995) and Melliès (2009)), based on the observation that both Kleisli and Eilenberg-Moore categories are instances of adjunctions.

Definition

A linear-nonlinear adjunction is a monoidal adjunction F:ClaTypesLinTypes:GF \colon ClaTypes \rightleftarrows LinTypes \colon G in which LinTypesLinTypes is symmetric monoidal and ClaTypesClaTypes is cartesian monoidal. The induced !-modality is the induced comonad FGF G on LinTypesLinTypes.

This includes both of the previous definitions where MM is taken respectively to be the Kleisli category or the Eilenberg-Moore category of !. Conversely, in any linear-nonlinear adjunction the induced comonad FGF G can be shown to be a linear exponential comonad. Moreover, if !! is a linear exponential comonad on a symmetric monoidal category LinTypesLinTypes with finite products, then the cofree !-coalgebra functor is a right adjoint and hence preserves cartesian products; but the cartesian products of coalgebras are the tensor products in CC, so we have !(A×B)!A!B!(A\times B) \cong !A \otimes !B, the Seely condition.

Classical case

For “classical” linear logic, we want LinTypesLinTypes to be not just (closed) symmetric monoidal but *\ast-autonomous. If an *\ast-autonomous category has a linear exponential comonad !! one can derive a ? from the ! by de Morgan duality, ?A=(!(A *)) *?A = \big(!(A^*)\big)^*. The resulting relationship between ! and ? was axiomatized in a way not requiring the de Morgan duality by Blute, Cockett & Seely (1996):

Definition

Let LinTypesLinTypes be a linearly distributive category with tensor product \otimes and cotensor product \parr. A (!,?)-modality on LinTypesLinTypes consists of:

  1. a \otimes-monoidal comonad ! and a \parr-comonoidal monad ?

  2. ? is a !-strong monad, and ! is a ?-strong comonad

  3. all free !-coalgebras are naturally commutative \otimes-comonoids, and all free ?-algebras are naturally commutative \parr-monoids.

Here a functor FF is strong with respect to a lax monoidal functor GG if there is a natural transformation of the form FAGBF(AGB)F A \otimes G B \to F(A\otimes G B) satisfying some natural axioms, and we similarly require compatibility of the monad and comonad structure transformations. BCS96 showed that if LinTypesLinTypes is in fact *\ast-autonomous, it follows from the above definition that ?A=(!(A *)) *?A = \big(!(A^*)\big)^*, as expected.

Examples

Relation to Chu construction

Theorem

Suppose F:MC:GF \colon M \rightleftarrows C : G is a linear-nonlinear adjunction (Def. ), where CC is closed symmetric monoidal with finite limits and colimits, and C\bot\in C is an object. Then there is an induced linear-nonlinear adjunction MChu(C,)M \rightleftarrows Chu(C,\bot) where Chu(C,)Chu(C,\bot) is the Chu construction Chu(C,)Chu(C,\bot), which is *\ast-autonomous with finite limits and colimits. Hence Chu(C,)Chu(C,\bot) admits a !-modality.

Proof

The embedding of CC in Chu(C,)Chu(C,\bot) as A(A,[A,],ev)A \mapsto (A, [A,\bot], ev) is coreflective: the coreflection of (B +,B ,e B)(B^+, B^-, e_B) is (B +,[B +,],ev)(B^+, [B^+,\bot], ev). Moreover, this subcategory is closed under the tensor product of Chu(C,)Chu(C,\bot), i.e. the embedding CChu(C,)C\hookrightarrow Chu(C,\bot) is strong monoidal, hence the adjunction is a monoidal adjunction. Therefore, the composite adjunction MCChu(C,)M \rightleftarrows C \rightleftarrows Chu(C,\bot) is again a linear-nonlinear-adjunction.

Note that this theorem is a direct consequence of the work of Yves Lafont and Thomas Streicher on game semantics using the Chu construction, together with Benton’s reformulation of linear logic in terms of monoidal adjunctions. Since a Chu construction is *\ast-autonomous, this !-modality implies a dual ?-modality.

Corollary

If CC is a cartesian closed category with finite limits and colimits and C\bot\in C is an object, then there is a linear-nonlinear adjunction CChu(C,)C \rightleftarrows Chu(C,\bot), and hence Chu(C,)Chu(C,\bot) admits a !-modality.

Proof

Apply the previous theorem to the identity adjunction CCC\rightleftarrows C.

Note that the !-modality obtained from the corollary is idempotent, while that obtained from the theorem is idempotent if and only if the original one was. Other ways of constructing !-modalities, such as by cofree coalgebras, may produce examples that are not idempotent.

Realization in linear homotopy type theory

In dependent linear homotopy type theory the “linear-nonlinear adjunction” is naturally identified (Ponto & Shulman (2012), Ex. 4.2, see also Schreiber (2014), Sec. 4.2) with the stabilization adjunction between homotopy types and stable homotopy types (Riley (2022), Prop. 2.1.31), whose left adjoint (forming suspension spectra Σ + \Sigma^\infty_+) is equivalently given (cf. Riley (2022), Rem. 2.4.13) by sending B:TypeB \,\colon\, Type to the linear dependent sum B𝟙(p B) !(p B) *𝟙\star_B \mathbb{1} \;\coloneqq\; (p_B)_! (p_B)^\ast \mathbb{1} over the monoidal unit in the context BB. In terms of quantum modal logic this is forming the “linear randomization” of the given classical homotopy type (its “motive”):

(2)

Curiously, this homotopy-theoretic realization of the exponential modality (beware the little subtlety of whether or not to reflect onto pointed homotopy types)

Σ Ω :SpectraSpectra \Sigma^\infty \circ \Omega^\infty \;\colon\; Spectra \to Spectra

has independently been argued to have properties of an exponential map in the context of Goodwillie calculus, see there.

Moreover Σ Ω \Sigma^\infty \dashv \Omega^\infty is a comonadic adjunction on simply connected homotopy types [Blomquist & Harper 2016 Thm. 1.8; Hess & Kedziorek 2017 Thm. 3.11], meaning that simply-connected classical (but pointed) homotopy types are identified with the Σ Ω \Sigma^\infty \Omega^\infty-modales among stable homotopy types.

Girard’s original presentation of linear logic involved rules that explicitly assumed the presence of !! on hypotheses or on entire contexts, such as dereliction, weakening and contraction:

Γ,ABΓ,!ABΓBΓ,!ABΓ,!A,!ABΓ,!AB\frac{\Gamma, A \vdash B}{\Gamma, !A \vdash B} \qquad \frac{\Gamma \vdash B}{\Gamma, !A\vdash B} \qquad \frac{\Gamma,!A,!A \vdash B}{\Gamma, !A\vdash B}

and “promotion”:

!ΓA!Γ!A \frac{!\Gamma \vdash A}{!\Gamma\vdash !A}

If this is translated into a natural deduction style term calculus, the resulting rules are more complicated than those of most type formers. This can be avoided using adjoint type theory with two context zones, one “nonlinear” one where contraction and weakening are permitted (and admissible) and one “linear” one where they are not, with !! as a modality relating the two zones.

Such a “modal” presentation of linear logic was first introduced by Girard 1993 and then developed by Plotkin 1993, Wadler 1993, Benton 1995, Barber 1996.

This presentation also generalizes naturally to dependent linear type theory, with the nonlinear type theory being dependent, and the linear types depending on the nonlinear ones but nothing depending on linear types. In this context, the !!-modality decomposes into “context extension” and a “dependent sum”.

\phantom{-}symbol\phantom{-}\phantom{-}in logic\phantom{-}
A\phantom{A}\inA\phantom{A}element relation
A\phantom{A}:\,:A\phantom{A}typing relation
A\phantom{A}==A\phantom{A}equality
A\phantom{A}\vdashA\phantom{A}A\phantom{A}entailment / sequentA\phantom{A}
A\phantom{A}\topA\phantom{A}A\phantom{A}true / topA\phantom{A}
A\phantom{A}\botA\phantom{A}A\phantom{A}false / bottomA\phantom{A}
A\phantom{A}\RightarrowA\phantom{A}implication
A\phantom{A}\LeftrightarrowA\phantom{A}logical equivalence
A\phantom{A}¬\notA\phantom{A}negation
A\phantom{A}\neqA\phantom{A}negation of equality / apartnessA\phantom{A}
A\phantom{A}\notinA\phantom{A}negation of element relation A\phantom{A}
A\phantom{A}¬¬\not \notA\phantom{A}negation of negationA\phantom{A}
A\phantom{A}\existsA\phantom{A}existential quantificationA\phantom{A}
A\phantom{A}\forallA\phantom{A}universal quantificationA\phantom{A}
A\phantom{A}\wedgeA\phantom{A}logical conjunction
A\phantom{A}\veeA\phantom{A}logical disjunction
symbolin type theory (propositions as types)
A\phantom{A}\toA\phantom{A}function type (implication)
A\phantom{A}×\timesA\phantom{A}product type (conjunction)
A\phantom{A}++A\phantom{A}sum type (disjunction)
A\phantom{A}00A\phantom{A}empty type (false)
A\phantom{A}11A\phantom{A}unit type (true)
A\phantom{A}==A\phantom{A}identity type (equality)
A\phantom{A}\simeqA\phantom{A}equivalence of types (logical equivalence)
A\phantom{A}\sumA\phantom{A}dependent sum type (existential quantifier)
A\phantom{A}\prodA\phantom{A}dependent product type (universal quantifier)
symbolin linear logic
A\phantom{A}\multimapA\phantom{A}A\phantom{A}linear implicationA\phantom{A}
A\phantom{A}\otimesA\phantom{A}A\phantom{A}multiplicative conjunctionA\phantom{A}
A\phantom{A}\oplusA\phantom{A}A\phantom{A}additive disjunctionA\phantom{A}
A\phantom{A}&\&A\phantom{A}A\phantom{A}additive conjunctionA\phantom{A}
A\phantom{A}\invampA\phantom{A}A\phantom{A}multiplicative disjunctionA\phantom{A}
A\phantom{A}!\;!A\phantom{A}A\phantom{A}exponential conjunctionA\phantom{A}

References

General

The notion of the exponential modality originates in linear logic with

A streamlined statement of the inference rules and the observation that these make the exponential a comonad is due to:

Review:

Brief survey in a context of computer science/linear type theory:

  • Daniel Mihályi, Valerie Novitzká, Section 2.2 of: What about Linear Logic in Computer Science?, Acta Polytechnica Hungarica 10 4 (2013) 147-160 [pdf, pdf]

Further on the semantics of exponential conjunction as a comonad:

and its resolution by a monoidal adjunction between the linear and a classical (intuitionistic) type system:

Review:

Construction of such comonads based on cofree comonoids:

  • Mellies and Tabareau and Tasson, An explicit formula for the free exponential modality of linear logic. Mathematical Structures in Computer Science, 28(7), 1253-1286. doi:10.1017/S0960129516000426

  • Sergey Slavnov, On Banach spaces of sequences and free linear logic exponential modality, Math. Struct. Comp. Sci. 29 (2019) 215-242, arXiv:1509.03853

The relation to Fock space is discussed in:

The interpretation of Ω Σ + \Omega^\infty \Sigma^\infty_+ as an exponential in the context of Goodwillie calculus is due to

  • Gregory Arone, Marja Kankaanrinta, The Goodwillie tower of the identity is a logarithm, 1995 (web)

based on

On the modal type theory-approach to a term calculus for the !!-modality:

A quantum programming language based on this linear/non-linear type theory adunction is QWIRE:

theoretical background:

applied to verified programming after implementation in Coq:

and using ambient homotopy type theory:

In dependent linear type theory

Discussion of the exponential modality via stabilization in dependent linear homotopy type theory:

The Ω Σ \Omega^\infty \Sigma^\infty comonadicity of simply connected pointed spaces over spectra:

category: logic

Last revised on February 8, 2024 at 18:19:24. See the history of this page for a list of all contributions to it.