Wednesday, 15 February 2012

soft question - Community experiences writing Lamport's structured proofs

From a proof-theoretic point of view, Lamport essentially suggests is writing proofs in natural deduction style, along with a system of conventions to structure proofs by the relevant level of detail. (It would be very interesting to study how to formalize this kind of convention -- it's something common in mathematical practice missing from proof theory.)



I have written proofs in this style, and once taught it to students. I find that this system -- or indeed any variant of natural deduction -- is extremely valuable for teaching proof to students, because it associates to each logical connective the exact mathematical language needed to use it and to construct it. This is particularly helpful when you are teaching students how to manipulate quantifiers, and how to use the axiom of induction.



When doing proofs myself, I find that this kind of structured proof works fantastically well, except when working with quotients -- i.e., modulo an equivalence relation. The reason for this is that the natural deduction rules for quotient types are rather awkward. Introducing elements of a set modulo an equivalence relation is quite natural:



$$
frac{Gamma vdash e in A qquad R ;mathrm{equivalence;relation}}
{Gamma vdash [e]_R in A/R}
$$



That is, we just need to produce an element of $A$, and then say we're talking about the equivalence class of which it is a member.



But using this fact is rather painful:



$$
frac{Gamma vdash e in A/R qquad Gamma, xin A vdash t in B qquad Gamma vdash forall y,z:A, (y,z) in R.;t[y/x] = t[z/x]}{Gamma vdash mbox{choose};[x]_R;mbox{from};e;mbox{in};t in B}
$$



This rule says that if you know that



  • $e$ is an element of $A/R$, and

  • $t$ is some element of $B$ with a free variable $x$ in set $A$, and

  • if you can show that for any $x$ and $y$ in $R$, that $t(y) = t(z)$ (ie, $t$ doesn't distinguish between elements of the same equivalence class)

Then you can form an element of $B$ by picking an element of the equivalence class and substituting it for $x$. (This works because $t$ doesn't care about the specific choice of representative.)



What makes this rule so ungainly is the equality premise -- it requires proving something about the whole subderivation which uses the member of the quotient set. It's so painful that I tend to avoid structured proofs when working with quotients, even though this is when I need them the most (since it's so easy to forget to work mod the equivalence relation in one little corner of the proof).



I would pay money for a better elimination rule for quotients, and I'm not sure I mean this as a figure of speech, either.

No comments:

Post a Comment