Monday, October 3, 2011

Slicing and dicing validity: existing ideas

This is a story of modal logic and the judgmental methadology, a style of presenting and justifying logic that Pfenning and Davies [1] adapted from Martin Löf's Siena Lectures [2] and which was, in turn, adapted by Bernado Toninho and I [3]. My goal is to re-present some existing work: I changed the title from "old ideas" to "existing ideas" to remove any implicit negative connotation - my next step is to extend these existing ideas a bit, not to replace these old ideas with better ones.

The topic of this story is, at least at first, an account of modal logic that I have adapted from Pfenning and Davies's presentation [1]. I assume some familiarity with the background, this isn't a comprehensive introduction. Pfenning and Davies's topic was a presentation of modal logic as a logic where there are two categorial judgments, $$A~{\it true}$$ and $$A~{\it valid}$$; the intent is that validity captures unconditional truth, which is eventually related to modal necessity.

We collect the categorical judgments of the form $$A~{\it true}$$ into true contexts which are written as $$\Gamma$$ or $$\Psi$$, and we collect the categorical judgments of the form $$A~{\it valid}$$ into valid contexts which are written as $$\Delta$$. It is by use of contexts that categorical judgments give rise to hypothetical judgments, and Pfenning-Davies modal logic has two hypothetical judgments: $$\seq{\Delta}{A~{\it valid}}$$ and $$\seq{\Delta; \Gamma}{A~{\it true}}$$

In a system with hypothetical judgments, meaning is given by describing three kinds of principles: the weakening principles (expressing how the context works), the identity principles (expressing how assumptions are used), and the substitution principles (expressing how assumptions are discharged). We rely on these principles as we explain a logic, and we are required to tie the knot eventually, demonstrating that our logic's particular rules satisfy its defining principles. Here are the defining principles for Pfenning-Davies modal logic:

Weakening principles

• If $$\Delta \subseteq \Delta'$$ and $$\seq{\Delta}{A~{\it valid}}$$, then $$\seq{\Delta'}{A~{\it valid}}$$
• If $$\Delta \subseteq \Delta'$$, $$\Gamma \subseteq \Gamma'$$, and $$\seq{\Delta; \Gamma}{A~{\it true}}$$, then $$\seq{\Delta'; \Gamma'}{A~{\it true}}$$

Identity/hypothesis principles

• $$\seq{\Delta, A~{\it valid}}{A~{\it valid}}$$
• $$\seq{\Delta; \Gamma, A~{\it true}}{A~{\it true}}$$

Substitution principles

• If $$\seq{\Delta}{A~{\it valid}}$$ and $$\seq{\Delta, A~{\it valid}}{C~{\it valid}}$$, then $$\seq{\Delta}{C~{\it valid}}$$.
• If $$\seq{\Delta}{A~{\it valid}}$$ and $$\seq{\Delta, A~{\it valid}; \Gamma}{C~{\it true}}$$, then $$\seq{\Delta; \Gamma}{C~{\it true}}$$.
• If $$\seq{\Delta; \Gamma}{A~{\it true}}$$ and $$\seq{\Delta; \Gamma, A~{\it true}}{C~{\it true}}$$, then $$\seq{\Delta; \Gamma}{C~{\it true}}$$.

Two judgmental rules define the fundamental relationship between the vaildity and truth judgments; I'll call the first of these rules valid introduction and the second valid elimination; they capture the notion that validity is defined relative to truth, and that validity is truth in all contexts.

The fundamental relationship between truth and validity is set up by two rules, which express that validity is unconditional truth. This means that $$A~{\it valid}$$ should be entailed by $$A~{\it true}$$ in the absence of any conditions, and that proving $$A~{\it valid}$$ should entail $$A~{\it true}$$ in any conditions, where "conditions" are represented by the context $$\Gamma$$ of true hypotheses.The first rule is the introduction rule for validity: it shows how we verify the judgment $$A~{\it valid}$$. The second rule is the elimination rule for validity: it shows that, given a proof of $$A~{\it valid}$$, we can use it to show the truth of $$A$$ in any context $$\Gamma$$.

$\infer {\seq{\Delta}{A~{\it valid}}} {\seq{\Delta; \cdot}{A~{\it true}}} \qquad \infer {\seq{\Delta; \Gamma}{A~{\it true}}} {\seq{\Delta}{A~{\it valid}}}$

The validity judgment is made interesting by its use in defining modal necessity $$\Box A$$. Notice how similar the introduction rule for modal necessity is to the elimination rule for the validity judgment! The elimination rule, however, acts like a let- or case-expression; it is the kind of elimination rule known as a large elimination, which are associated with the positive connectives (if you're a fan of polarized logic).

$\infer {\seq{\Delta; \Gamma}{\Box A~{\it true}}} {\seq{\Delta}{A~{\it valid}}} \qquad \infer {\seq{\Delta; \Gamma}{C~{\it true}}} {\seq{\Delta; \Gamma}{\Box A~{\it true}} & \seq{\Delta, A~{\it valid}; \Gamma}{C~{\it true}}}$

A truth-oriented justification of logic

This story above is (I believe) broadly compatible with the story from Pfenning and Davies' original paper; certainly what I called the introduction and elimination rules for validity are just the result of writing down the "Definition of Validity" at the beginning of Section 4 of their paper. However, Pfenning and Davies banish the second half of the definition of validity, what I called the elimination rule, from their actual formal system. In its place, they give a valid hypothesis rule, variously written as $$uhyp$$ or $$hyp^*$$.

$\infer {\seq{\Delta, A~{\it valid}; \Gamma}{A~{\it true}}} {}$

With this change, the introduction rule for validity now only appears in the conclusion of the validity introduction rule and the premise of the $$\Box$$ introduction rule, and the two can be collapsed together. The introduction rule for validity is what is called invertible - the conclusion implies the premise - so we don't fundamentally change the $$\Box$$ introduction rule if we replace the premise $$\seq{\Delta}{A~{\it valid}}$$ with the equivalent premise $$\seq{\Delta; \cdot}{A~{\it true}}$$.

$\infer {\seq{\Delta; \Gamma}{\Box A~{\it true}}} {\seq{\Delta; \cdot}{A~{\it true}}}$

These changes to the logical system, write Pfenning and Davies, are sound with respect to the initial definitions I gave (the $$uhyp$$ rule, in particular, is derivable by a combination of the valid hypothesis principle and the elimination rule for validity). However, the resulting system is incomplete with respect to the categorical judgment $$A~{\it valid}$$. This necessitates that we give up on the one hypothesis principle and one substitution principle that deal exclusively with validity, and also edit the substitution principle with a premise $$\seq{\Delta}{A~{\it valid}}$$ to have the premise $$\seq{\Delta; \cdot}{A~{\it true}}$$ instead.

These changes flow naturally out of the intentional goal of explaining the meaning of the logical connectives entirely through the lens of the categorical judgment $$A~{\it true}$$. This is a perfectly fine way of explaining S4 modal logic, but I don't see it as a fundamental part of the character of judgmental presentations of logic. For instance, there are plenty of situations, (Hybrid LF, Simpson's IK, Constructive Provability Logic) where there is no single categorical judgement for truth, but rather a whole family of indexed judgments, and it's possible to prove things at each of the judgments. This suggests a different story, a different presentation of the same system above. This presentation is one that I've adapted from Jason Reed [4].

Another story

If one is perhaps less interested in the correspondence to modal logic, it's possible to take the judgmental setup that we started with and tease apart the notion of modal necessity just a bit. We do this by introducing two connectives, $$\unicode{x25F8}A$$ and $$\unicode{x25FF}A$$, with the intentional visual pun that $$\unicode{x25F8}\!\!\!\!\unicode{x25FF} A = \Box A$$. The introduction and elimination rules for validity are now properly understood as introduction and elimination rules for $$\unicode{x25FF}$$, whereas the introduction and elimination rules for $$\Box$$ are now understood as introduction and elimination rules for $$\unicode{x25F8}$$.

$\infer {\seq{\Delta}{\unicode{x25FF}A~{\it valid}}} {\seq{\Delta; \cdot}{A~{\it true}}} \qquad \infer {\seq{\Delta; \Gamma}{A~{\it true}}} {\seq{\Delta}{\unicode{x25FF}A~{\it valid}}}$ $\infer {\seq{\Delta; \Gamma}{\unicode{x25F8}A~{\it true}}} {\seq{\Delta}{A~{\it valid}}} \qquad \infer {\seq{\Delta; \Gamma}{C~{\it true}}} {\seq{\Delta; \Gamma}{\unicode{x25F8}A~{\it true}} & \seq{\Delta, A~{\it valid}; \Gamma}{C~{\it true}}}$

Now, if these rules are really the only ones that deal with validity — if all the "regular" connectives like implication are defined the traditional way based only on truth...

$\infer {\seq{\Delta; \Gamma}{A \supset B~{\it true}}} {\seq{\Delta; \Gamma, A~{\it true}}{B~{\it true}}} \qquad \infer {\seq{\Delta; \Gamma}{B~{\it true}}} {\seq{\Delta; \Gamma}{A \supset B~{\it true}} & \seq{\Delta; \Gamma}{A~{\it true}}}$

...then it is possible to observe that this way in which we have teased apart box into two parts actually syntactically differentiates the propositions judged by the two categorical judgments: if we're starting from truth, we'll only introduce propositions that live under a $$\unicode{x25F8}$$, and we can only meaningfully use valid propositions that have $$\unicode{x25FF}$$ as their outermost connective. This observation, which I picked up from by Jason Reed, makes it possible to talk about true propositions - those propositions judged as true $$(A ::= \unicode{x25F8}P \mid A \supset B \mid a )$$ separately from valid propositions - those propositions judged valid $$(P ::= \unicode{x25FF}A)$$ [4]. The rules that we have set up essentially enforce this syntactic separation already, however; there's no particular requirement that we enforce it on our own.

In fact, one thing we can do is put another version of implication "up at validity," like this:

$\infer {\seq{\Delta}{A \supset B~{\it valid}}} {\seq{\Delta, A~{\it valid}}{B~{\it valid}}} \qquad \infer {\seq{\Delta}{B~{\it valid}}} {\seq{\Delta}{A \supset B~{\it valid}} & \seq{\Delta}{A~{\it valid}}}$

It's not terribly obvious why you'd want to do this, but as Neel points out to me in the comments, this was first done in the context of linear logic by Wadler and Benton, where it turns out to be quite useful for programming [5,6]. I was previously unaware of that work (doh). Reed used the idea of putting implication up at validity in order to describe both the necessity modality and the lax-logic circle (the "monad") as fragments of the same logic, which is where I got this notion from. If you ignore the "valid" implication, you get modal logic with $$\Box A = \unicode{x25F8}\!\!\!\!\unicode{x25FF} A$$, but if you ignore the "true" implication and instead reason at "validity" (at which point it's definitely not quite right to call the old "validity" validity anymore), you get lax logic with $$\bigcirc A = \unicode{x25FF} \unicode{x25F8} A$$. That observation is essentially the same one made by the two translations in Figure 6 of Wander and Benton's paper, though again Wadler and Benton's "truth" judgment was linear, the one I've presented here was persistent, and Reed considered both variants [6].

To reiterate, this isn't a very useful story if one is interested in giving a fundamental account of modal logic, but I believe that "teasing apart" the modal operator, and even opening up the possibility of inserting other propositions in the space of "valid propositions" that such a teasing apart naturally create, raises interesting possibilities. Hopefully in the next post I'll say about about that in the context of contextual modal type theory (CMTT).

[1] Frank Pfenning and Rowan Davies, "A Judgmental Reconstruction of Modal Logic," 1999 (published 2001)
[2] Per Martin-Löf, "On the Meanings of the Logical Constants and the Justifications of the Logical Laws" a.k.a. "The Siena Lectures," 1983 (published 1996)
[3] Robert J. Simmons and Bernardo Toninho, "Principles of Constructive Provability Logic," CMU Tech Report 2010.
[4] Jason Reed, "A Judgmental Deconstruction of Modal Logic," unpublished 2009.
[5] Nick Benton, "A Mixed Linear and Non-Linear Logic: Proofs, Terms and Models," CSL 1995.
[6] Nick Benton and Phil Wadler, "Linear Logic, Monads and the Lambda Calculus," LICS 1996.

1. Hi Rob,

Take a look at Phil Wadler and Nick Benton's 1996 LICS paper, "Linear logic, monads, and the lambda calculus". This paper has two connectives making precisely the distinction you make, in order to allow the unrestricted context to use intuitionistic connectives while still retaining linear connectives for the linear context.

I used it in my ICFP paper, and besides having a good proof theory, it's a fantastically nice way of doing linear programming languages.

2. Thanks muchly, Neel! I've added a discussion of this to the post, I was unaware of that work and should not have been unaware of that work - it's good to know about older discovery and presentation of what is absolutely recognizable the same idea.

(P.S. Also I've been caught red-handed - I still need to read your ICFP paper!)

3. The Wadler-Benton paper is the "earlier work on an adjoint calculus" I mentioned recently at the whiteboard, but forgot to send you the actual reference - apologies.

I really like the new "half-box" notation, particularly because it properly reflects that the lax modality is fundamentally a possibility (diamond) modality - but stretched a bit to to "validity" instead of "truth".

(I've never liked the use of circle for "lax" - circle already has a standard meaning in logic!)

Related to this: Frank and I argue that lax logic can be considered a natural fragment of modal logic with both necessity and possibility. I think this can be extended to the logic you give with box deconstructed - e.g., valid implication A ⊃ B can be considered an abbreviation for □A -> □B (with -> truth implication). I'm still thinking about what's gained by giving direct rules instead of such an embedding.