Chapter 16: Linear Logic and Resources — Each Assumption Used Only Once
Classical logic assumes resources are unlimited. This is a lie, and an expensive one.
Chapter 15 left us with an unsettling conclusion: so long as a system is sufficiently strong, there must exist true propositions it cannot prove; the system itself also cannot guarantee its own consistency. This is Gödel's gift — or rather, his curse.
But what does "sufficiently strong" mean? Where does the strength lie?
A formal system is powerful partly because its assumptions can be arbitrarily reused. You know
This rule seems like common sense. But it is open to question.
In 1987, Jean-Yves Girard asked a simple question: what happens if you remove the contraction rule?
What happened went far beyond what he initially expected. What he obtained was not merely a weakened version of classical logic, but a completely new logic — linear logic — that precisely describes a world where resources are consumed.
16.0 The Disposable Kitchen Game: Each Resource Can Be Used Only Once
Classical logic is like a strange kitchen: you have one egg, yet you can fry a hundred omelets simultaneously. Because in classical logic, assumptions are not consumed. You use
So we switch kitchens.
On the table are several ingredient cards: egg
meaning: consume one copy of
This is the game-feel of linear logic: reasoning is no longer just "deriving truth from truth," but "completing transformations under resource conservation."
The formal skeleton of this game
- State space: resource multisets, e.g.,
. The repeated appearance of means two real resources, not one symbol written twice. - Legal actions: consume resources according to linear rules and generate new resources; only
can be copied or discarded. - Transition rules: if the recipe
exists, then the state can transition to . - Victory condition: construct the target resource
using finite resources. - Failure mode: the target seems derivable, but you secretly reused an already-consumed assumption along the way.
This game forces the reader to see what classical logic hides: reasoning sometimes has a physical cost. In programs, memory is not infinite; in communication protocols, a message sent cannot simultaneously remain in place; in quantum systems, an unknown quantum state cannot be arbitrarily cloned.
Linear logic is not a bizarre variant of classical logic. It is reminding us: classical logic defaults to a ridiculously rich world, where resources can be freely copied. The real world is not this generous.
The rules of the disposable kitchen game are simple: used means used. Many abstract logics, when they land in reality, collide with this sentence. You cannot use one five-dollar bill to buy two cups of coffee, nor can you use one pool of video memory to hold two mutually non-releasing models. Classical logic forgot this; linear logic handed the bill back.
16.1 What Contraction Is Doing
Recall the form of the contraction rule:
Above the line: the context has two copies of
What this rule says is: you know
In classical logic, this is perfectly reasonable. Knowledge is not material; you know "
But not all "premises" in the world are knowledge.
Consider this sentence: "I have one five-dollar bill, and I can buy one cup of coffee."
This is a completely legal propositional inference: having five dollars
But if you apply contraction to this proposition, you get: having one five-dollar bill, you can buy two cups of coffee. This is obviously wrong. That bill was used up.
Classical logic is helpless against this kind of error, because it does not distinguish at all between "knowledge that can be reused" and "resources that are consumed upon use." The starting point of linear logic is precisely: these two kinds of things are fundamentally different, and require different symbols and different rules.
Classical logic handles knowledge; linear logic handles resources — this distinction is real, not fancy philosophy. When you write programs, memory runs out; quantum states cannot be cloned; messages in a protocol disappear once sent. Classical logic's modeling of these scenarios was wrong from the very beginning. Not approximately wrong, but fundamentally wrong.
Here there is a philosophical divergence worth pausing to consider. Some would say: logic is not describing resource consumption; it is talking about truth values, and truth values are not "used up" or exhausted. This view is not wrong — classical logic is indeed about truth values.
But linear logic has chosen another stance: logic is regulating the legality of inference, and inference takes place in a world that has costs. Not every "known" can be freely reused. If you want to use a resource, you must pay for it. This is not a denial of classical logic, but its generalization — classical logic is the degenerate version of linear logic after adding the special assumption that "resources can be arbitrarily copied."
16.2 The Symbol System of Linear Logic
Remove contraction, and the structure of logic changes. The most obvious change is: you can no longer casually "merge" two assumptions, because their counts begin to matter.
Linear logic introduces a set of connectives that run parallel to classical logic but have different meanings.
Multiplicative connective
Additive connective
Multiplicative disjunction ⅋ (par): the dual connective of linear logic, corresponding to the negated form of multiplicative conjunction.
Additive disjunction
The four connectives of linear logic: understood through "ordering food" (prior work: Girard, 1987)
The extra connectives in linear logic are clearest when analogized to ordering food at a restaurant:
| Symbol | Reading | Analogy | Meaning |
|---|---|---|---|
| tensor | Combo meal: burger and fries, both given | Simultaneously possess two resources; both must be consumed | |
| with | Today's special: burger or salad, choose one, up to you | Possess the right to choose, but can only pick one | |
| plus | Chef randomly gives you burger or salad; you don't know which | Possess one of them, but don't know which | |
| linear implication | Use one | Resource transformation, not knowledge derivation |
Why distinguish
These four connectives form two sets of symmetric pairings; behind them lies a deep duality structure: multiplicative connectives concern the concurrent existence of resources, additive connectives concern the selectability of resources.
Classical logic needs only two basic connectives (e.g.,
16.3 The Exclamation Mark: Resources That Can Be Reused
But if all assumptions can only be used once, we cannot talk about genuine knowledge — those facts that can indeed be repeatedly referenced. Linear logic solves this problem with a special symbol: the exclamation mark
The meaning of
Formally,
- Weakening:
( can be discarded — you don't need to use it) - Contraction:
( can be copied — you can use it twice) - Promotion: if
, then (conclusions derived from infinite resources are also infinitely available)
With the exclamation mark, linear logic can restore the simulation of classical reasoning: if all assumptions carry
Many people at this point will say "OK,
16.4 The Meaning of Implication Has Changed
After removing contraction, implication
Linear implication
This is not the transmission of knowledge, but the transformation of resources. Five dollars
By contrast,
This distinction reveals the essential difference between "knowledge" and "resource": knowledge is of the
16.5 Three Real-World Correspondences
Linear logic is not a pure thought experiment of logicians. It precisely corresponds to three important realities.
Memory management. In program design, memory is a resource: allocate a block of memory, must release it after use, or else it leaks. Classical logic's intuition about memory is wrong — it assumes you "know" a block of memory and can reference it infinitely, but memory, after being freed, no longer exists. The core of linear type systems (such as Rust's ownership system) is precisely linear logic: each variable is owned exactly once; transferring ownership is consuming one copy of an assumption; borrowing is using a temporary view modified by
Quantum computing. Quantum mechanics has a famous prohibition: the no-cloning theorem. An unknown quantum state cannot be perfectly copied. In the language of logic, this is precisely "contraction is not allowed" — quantum bits are linear resources; you cannot produce two copies of
Concurrent protocols. Communication protocols between two processes can be precisely encoded as linear logic propositions. The protocol's "one side sends, the other side receives" is exactly linear implication: resources transfer from one side to the other, uncopyable, undiscardable. Session Types are precisely the engineering realization of this correspondence; they allow compilers to verify protocol correctness at the type-checking stage — logic guarantees that the protocol will not deadlock and will not miss messages.
Chapter 14 mentioned that proofs and programs are structurally isomorphic (this correspondence will be formally unfolded in Chapter 22). Linear logic pushes this correspondence one step further: linear proofs correspond to linear programs — programs where each variable is used exactly once. This is not an accidental coincidence, but because linear logic was designed precisely to capture the intuition that "computation is a process of consuming resources." Girard initially discovered linear logic while analyzing the proof structure of System F (polymorphic λ-calculus) — he found traces of resources in the depths of logic.
16.6 Two Kinds of Truth: Possession and Choice
Linear logic also prompts a more fundamental philosophical shift: "truth" no longer has only one meaning.
In classical logic,
In linear logic, "possessing
- Tensor-style possession:
— you simultaneously possess and as two independent resources. - Additive-style possession:
— you possess two options and can decide which one to use.
These two kinds of "possession" have completely different values in resource economics. I have one apple and one pear — this is not equal to my having "the ability to choose apple or pear" — the former is two resources, the latter is one resource plus a right to choose.
Classical logic conflates these two situations, because at the level of truth values, "
This distinction will reappear in Chapter 17 in a completely unexpected way: when truth values themselves become a continuous interval
16.7 Transition: Before Truth Values Become Continuous — Three-Valued Logic as Warm-up
Chapter 17 is going to do something radical: expand truth values from
The Polish logician Łukasiewicz proposed three-valued logic in 1920. The truth value set is
Negation:
Conjunction:
Disjunction:
Implication:
(The rule for implication is the most counter-intuitive part of three-valued logic; look at it a few more times. When
Exercise: Using the rules above, compute the values of the following propositions under all three truth-value assignment combinations. Let
(the contrapositive) (the law of excluded middle)
The third question is the most interesting: in classical logic,
The law of excluded middle, in three-valued logic, is no longer a tautology.
This is not a technical detail. It means: when you expand "truth values," you are implicitly modifying the inference rules you are willing to accept. Three-valued logic rejects the law of excluded middle; classical logic accepts it. This is not about which one is more "correct," but about two different choices corresponding to different understandings of the legality of inference.
Returning to the disposable kitchen game, what this chapter really changes is not the names of recipes, but the physical laws of the kitchen. The kitchen of classical logic defaults to ingredients being infinitely copyable; linear logic turns ingredients back into things that are consumed; three-valued logic further hints that even binary judgments like "cooked/not cooked" can be interrupted by a third state. Each change to the state space changes the legal actions.
What Chapter 17 is going to do is push this direction to the extreme: truth values are not three points, but a continuous interval over
Unresolved
What is "truth" in linear logic? In classical logic, semantics is very clear: a proposition is either true or false; truth tables give everything. In linear logic, what is the "semantics" of resources? How does one define a model such that "
To what extent is "resource" a precise mathematical concept? Linear logic gives us a formal framework, but "resource" itself remains an intuitive word. What is one copy of a resource? When is the copying of resources legal? These questions have different answers in different application domains, and linear logic provides a framework that can accommodate these different answers, not a single answer.
What happens if we remove the exchange rule? Chapter 14 listed three structural rules: weakening, contraction, exchange. Linear logic removes contraction (and sometimes also weakening). If we further remove the exchange rule — making the order of assumptions matter — we obtain ordered logic, which corresponds to resource use with temporal ordering, such as communication protocols where messages must be sent and received in order. This direction is still unfolding.
If "truth" itself is a degree, how should inference rules change? Linear logic, through resource counting, opens up one dimension of the
Exercises
★ Warm-up
Using the resource intuition of linear logic, judge whether the following inferences hold. No need to write formal proofs; just use resource examples like "five dollars buys coffee" to explain clearly why each is correct or wrong.
(simultaneously possessing and , can one separately derive ?) (possessing "the right to choose or ," can one derive ?) (infinitely available , can one take out one copy of ?) (one copy of , can it become infinitely available ?)
The contrast between 1 and 2 is the most important distinction in this chapter. 4 is the inference that directly fails once the contraction rule is removed.
★★ Derivation
Consider the following three inferences. Judge whether they hold in linear logic, and write out the reasons.
(two copies of the ability " becomes ," can they be merged into one?) (infinitely available transformation rule, plus infinitely available input, can produce infinitely available output?) (consuming and to produce , is it equivalent to first consuming , then consuming to produce ?)
The first involves contraction. The second involves the promotion rule of the exclamation mark. The third is the linear logic version of currying — think about whether it genuinely holds in terms of resources.
★★★ Challenge
Rust's ownership system implements linear types: each value has exactly one owner; transferring ownership is consuming one copy of an assumption; borrowing corresponds to using a temporary view modified by
Try using the symbols of linear logic to write, for each of the following Rust operations, a corresponding linear logic inference formula:
- Moving ownership of variable
xto functionf(move semantics) - Passing an immutable reference of variable
xto functiong(immutable borrow) - Function returning a value (consuming input, producing output)
Complete precision is not required, but clearly state: which operations correspond to consumptive inference (linear implication
