Math 2.0

Computer science Definition

Linear type system

Builds on Simply typed lambda calculusType systemLinear logic

Definition

Take the types τ::=b∣τ⊸τ∣τ⊗τ\tau ::= b \mid \tau \multimap \tau \mid \tau \otimes \tau and the terms of the simply typed lambda calculus with pairs (t,u)(t, u) and the destructor 𝗅𝖾𝗍 (x,y)=t 𝗂𝗇 u\mathsf{let}\ (x, y) = t\ \mathsf{in}\ u. A context Γ\Gamma is a finite list of distinct typed variables, and Γ,Δ\Gamma, \Delta denotes the union of two contexts with no common variable. The linear type system is the least relation Γ⊢t:τ\Gamma \vdash t : \tau closed under these rules.

  1. Variable: x:τ⊢x:τx : \tau \vdash x : \tau, with exactly one variable in the context.
  2. Abstraction: if Γ,x:σ⊢t:τ\Gamma, x : \sigma \vdash t : \tau, then Γ⊢λx. t:σ⊸τ\Gamma \vdash \lambda x.\, t : \sigma \multimap \tau.
  3. Application: if Γ⊢t:σ⊸τ\Gamma \vdash t : \sigma \multimap \tau and Δ⊢u:σ\Delta \vdash u : \sigma, then Γ,Δ⊢t u:τ\Gamma, \Delta \vdash t\, u : \tau.
  4. Pairing: if Γ⊢t:σ\Gamma \vdash t : \sigma and Δ⊢u:τ\Delta \vdash u : \tau, then Γ,Δ⊢(t,u):σ⊗τ\Gamma, \Delta \vdash (t, u) : \sigma \otimes \tau.
  5. Unpairing: if Γ⊢t:σ⊗ρ\Gamma \vdash t : \sigma \otimes \rho and Δ,x:σ,y:ρ⊢u:τ\Delta, x : \sigma, y : \rho \vdash u : \tau, then Γ,Δ⊢𝗅𝖾𝗍 (x,y)=t 𝗂𝗇 u:τ\Gamma, \Delta \vdash \mathsf{let}\ (x, y) = t\ \mathsf{in}\ u : \tau.
  6. Exchange: the order of variables in a context does not matter.

The context is split between subterms, and the variable rule allows no extra variables. So every variable of Γ\Gamma occurs exactly once in tt whenever Γ⊢t:τ\Gamma \vdash t : \tau.

Remarks

Example: ⊢λp. 𝗅𝖾𝗍 (x,y)=p 𝗂𝗇 (y,x):σ⊗ρ⊸ρ⊗σ\vdash \lambda p.\, \mathsf{let}\ (x, y) = p\ \mathsf{in}\ (y, x) : \sigma \otimes \rho \multimap \rho \otimes \sigma. The check: rule 4 with the contexts y:ρy : \rho and x:σx : \sigma gives (y,x)(y, x) its type, rule 5 with Γ=p:σ⊗ρ\Gamma = p : \sigma \otimes \rho consumes pp, and rule 2 abstracts pp.

Non-example: λx. (x,x)\lambda x.\, (x, x) has no type. Rule 4 needs disjoint contexts for the two components, but both need xx; this is contraction, which the system lacks. Likewise λx. λy. x\lambda x.\, \lambda y.\, x has no type, since yy would stay unused at the variable rule; this is weakening.

The connectives ⊸\multimap and ⊗\otimes are linear implication and the multiplicative conjunction of linear logic. Adding weakening gives affine types, adding contraction gives relevant types, and adding both gives back the ordinary type system of the simply typed calculus.

Reading path

To understand this page from the ground up, read these 26 pages in order. The foundations come first.

Show the path as a graph
Element, definition, no evidence levelElementdefinitionIntuitionistic logic, concept, no evidence levelIntuitionistic logicconceptLambda calculus, concept, no evidence levelLambda calculusconceptLinear logic, concept, no evidence levelLinear logicconceptProposition, concept, no evidence levelPropositionconceptSet, concept, no evidence levelSetconceptType system, concept, no evidence levelType systemconceptSet, definition, no evidence levelSetdefinitionConjunction, definition, no evidence levelConjunctiondefinitionDisjunction, definition, no evidence levelDisjunctiondefinitionImplication, definition, no evidence levelImplicationdefinitionNegation, definition, no evidence levelNegationdefinitionBiconditional, definition, no evidence levelBiconditionaldefinitionTruth table, concept, no evidence levelTruth tableconceptModus ponens, concept, no evidence levelModus ponensconceptMathematical proof, concept, no evidence levelMathematical proofconceptPropositional logic, concept, no evidence levelPropositional logicconceptTautology, definition, no evidence levelTautologydefinitionLogical equivalence, definition, no evidence levelLogical equivalencedefinitionDouble negation law, statement, no evidence levelDouble negation lawstatementProof by contradiction, concept, no evidence levelProof by contradictionconceptRussell's paradox, statement, no evidence levelRussell's paradoxstatementType theory, concept, no evidence levelType theoryconceptCurry–Howard correspondence, concept, no evidence levelCurry–Howard correspo…conceptSimply typed lambda calculus, concept, no evidence levelSimply typed lambda c…conceptLinear type system, definition, no evidence levelLinear type systemdefinition
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Element definition
  2. Intuitionistic logic concept
  3. Lambda calculus concept
  4. Linear logic concept
  5. Proposition concept
  6. Set concept
  7. Type system concept
  8. Set definition
  9. Conjunction definition
  10. Disjunction definition
  11. Implication definition
  12. Negation definition
  13. Biconditional definition
  14. Truth table concept
  15. Modus ponens concept
  16. Mathematical proof concept
  17. Propositional logic concept
  18. Tautology definition
  19. Logical equivalence definition
  20. Double negation law statement
  21. Proof by contradiction concept
  22. Russell's paradox statement
  23. Type theory concept
  24. Curry–Howard correspondence concept
  25. Simply typed lambda calculus concept
  26. Linear type system definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Substructural_type_system
About this page
TagNTS9ZF3PHJ
URIm2://NTS9ZF3PHJ
Kinddefinition
WritingW0 stub
MSC68N15, 03B47, 68N18
DefinesLinear type system
UsesSimply typed lambda calculus, Type system, Linear logic
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.