{"id":77,"date":"2006-07-17T16:52:28","date_gmt":"2006-07-17T16:52:28","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2006\/07\/17\/a-brief-diversion-sequent-calculus\/"},"modified":"2006-07-17T16:52:28","modified_gmt":"2006-07-17T16:52:28","slug":"a-brief-diversion-sequent-calculus","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2006\/07\/17\/a-brief-diversion-sequent-calculus\/","title":{"rendered":"A Brief Diversion: Sequent Calculus"},"content":{"rendered":"<p>*(This post has been modified to correct some errors and add some clarifications in response to comments from alert readers. Thanks for the corrections!)*<br \/>\nToday, we&#8217;re going to take a brief diversion from category theory to play with<br \/>\nsome logic. There are some really neat connections between variant logics and category theory. I&#8217;m planning on showing a bit about the connections between category theory and one of those, called *linear logic* . But the easiest way to present things like linear logic is using a mechanism based on <b>sequent calculus<\/b>.<br \/>\nSequent calculus is a deduction system for performing reasoning in first order propositional logic. But it&#8217;s notation and general principles are useful for all sorts of reasoning systems, including many different logics, all sorts of type theories, etc.  The specific sequent calculus that I&#8217;m to talk about is sometimes called system-LK; the general category of things that use this basic kind of rules is called Gentzen systems.<br \/>\nThe sequent calculus consists of a set of rules called *sequents*, each of which is normally written like a fraction: the top of the fraction  is what you know before applying the sequent; the bottom is what you can conclude.  The statements in the sequents are always of the form:<\/p>\n<p>CONTEXTS, Predicates :- CONTEXTS, Predicates<\/p>\n<p>\nThe &#8220;CONTEXTS&#8221; are sets of predicates that you already know are true. The &#8220;:-&#8221; is read &#8220;entails&#8221;; it means that the *conjuction* of the statements and contexts to the left of it can prove the *disjunction* of the statements to the right of it. In predicate logic, the conjuction is logical and, and disjunction is logical or, so you can read the statements as if &#8220;,&#8221; is &#8220;&and;&#8221; on the left of the &#8220;:-&#8220;, and &#8220;&or;&#8221; on the right.  *(Note: this paragraph was modified to correct a dumb error that I made that was pointed out by commenter Canuckistani.)*<br \/>\nContexts are generally written using capital greek letters; predicates are generally written using uppercase english letters. We often put a name for an inference rule to the right of the separator line for the sequent.<br \/>\nFor example, look at the following sequent:<br \/>\n&Gamma; :- &Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;  Weakening-Left<br \/>\n&Gamma;,A :- &Delta;<br \/>\nThis sequent is named Weakening-left; the top says that &#8220;Given &Gamma; everything in &Delta; can be proved.&#8221;; and<br \/>\nthe bottom says &#8220;Using &Gamma; plus the fact that A is true, everything in &Delta; can be proved&#8221;. The full sequent basically says: if &Delta; is provable given &Gamma;, then it will still be provable when A is added to &Gamma;;in other words, adding a true fact won&#8217;t invalidate any proofs that were valid before the addition of A. *(Note: this paragraph was modified to correct an error pointed out by a commenter.)*<br \/>\nThe sequent calculus is nothing but a complete set of rules that you can use to perform any inference in predicate calculus. A few quick syntactic notes, and I&#8217;ll show you the full set of rules.<br \/>\n1. Uppercase greek letters are contexts.<br \/>\n2. Uppercase english letters are *statements*.<br \/>\n3. Lowercase english letters are *terms*; that is, the objects that predicates<br \/>\ncan reason about, or variables representing objects.<br \/>\n4. A[b] is a statement A that contains the term b in some way.<br \/>\n5. A[b\/c] means A with the term &#8220;b&#8221; replaced by the term &#8220;c&#8221;.<br \/>\n&#8212;&#8212;-<br \/>\nFirst, two very basic rules:<br \/>\n1. &nbsp;&nbsp;&nbsp;<br \/>\n&mdash;&mdash;&mdash;&mdash; (Identity)  <br \/>\nA :- A<br \/>\n2. &Gamma; :- A, &Delta; &nbsp;&nbsp;&nbsp; &Sigma;, A :- &Pi;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Cut) <br \/>\n&Gamma;,&Sigma; :- &Delta;, &Pi;<br \/>\nNow, there&#8217;s a bunch of rules that have right and left counterparts. They&#8217;re duals of each other &#8211; move terms across the &#8220;:-&#8221;  and switch from &and; to &or; or vice-versa.<br \/>\n3. &Gamma;, A :- &Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left And 1)<br \/>\n&Gamma;, A &and; B :- &Delta;<br \/>\n4. &Gamma; :- A, &Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; &mdash;&mdash;&mdash; (Right Or 1)<br \/>\n&Gamma;, :- A &or; B, &Delta;<br \/>\n5. &Gamma;, B :- &Delta; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; &mdash;&mdash;(Left And 2)<br \/>\n&Gamma;,A &and; B :- &Delta;<br \/>\n6. &Gamma; :- B, &Delta; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; &mdash;&mdash;&mdash; (Right Or 2)<br \/>\n&Gamma; :- A &and; B, &Delta;<br \/>\n7. &Gamma;, A :- &Delta; &nbsp;&nbsp; &Sigma;,B :- &Pi; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Or)<br \/>\n&Gamma;,&Sigma;, A &or; B :- &Delta;,&Pi;<br \/>\n8. &Gamma; :- A,&Delta;&nbsp;&nbsp; &Sigma; :- B,&Pi;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; &mdash;&mdash;(Right And)<br \/>\n&Gamma;,&Sigma; :- A &and; B, &Delta;,&Pi;<br \/>\n9. &Gamma; :- A,&Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash; &mdash;&mdash; (Left Not)<br \/>\n&Gamma;, &not;A :- &Delta;<br \/>\n10. &Gamma;,A  :- &Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Right Not)<br \/>\n&Gamma; :- &not;A, &Delta;<br \/>\n11. &Gamma; :- A,&Delta; &nbsp;&nbsp; &Sigma;,B :- &Pi;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Implies) <br \/>\n&Gamma;, &Sigma;, A &rarr; B :- &Delta;,&Pi;<br \/>\n12. &Gamma;,A[y] :- &Delta;    *(y bound)*<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Forall) <br \/>\n&Gamma;,&forall;x A[x\/y] :- &Delta;<br \/>\n13. &Gamma; :- A[y],&Delta;    *(y free)*<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Right Forall) <br \/>\n&Gamma; :- &forall;x A[x\/y],&Delta;<br \/>\n14. &Gamma;, A[y] :- &Delta;    *(y bound)*<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Exists)<br \/>\n&Gamma;,&exist;x A[x\/y] :- &Delta;<br \/>\n15. &Gamma;, :- A[y], &Delta;   *(y free)*<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;(Right Exists)<br \/>\n&Gamma; :- &exist;x A[x\/y], &Delta;<br \/>\n16. &Gamma; :- &Delta; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Weakening)<br \/>\n&Gamma;, A :- &Delta;<br \/>\n17. &Gamma; :- &Delta;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Right Weakening)<br \/>\n&Gamma; :- A, &Delta;<br \/>\n18. &Gamma;, A, A :- &Delta; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Contraction)<br \/>\n&Gamma;,A :- &Delta;<br \/>\n19. &Gamma; :- A, A, &Delta; <br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Right Contraction)<br \/>\n&Gamma; :- A, &Delta;<br \/>\n20. &Gamma;, A, B, &Delta; :- &Sigma;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Left Permutation)<br \/>\n&Gamma;,B, A, &Delta; :- &Sigma;<br \/>\n21. &Gamma; :- &Delta;, A, B, &Sigma;<br \/>\n&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; (Right Permutation)<br \/>\n&Gamma; :- &Delta; B, A, &Sigma;<br \/>\nHere&#8217;s an example of how we can use sequents to derive A &or; &not; A:<br \/>\n1. Context empty. Apply Identity.<br \/>\n2. A :- A. Apply Right Not.<br \/>\n3. empty :- &not; A, A. Apply Right And 2.<br \/>\n4. empty : A &or; &not;A, A. Apply Permute Right.<br \/>\n5. empty :- A, A &or; &not; A. Apply Right And 1.<br \/>\n6. empty :- A &or; &not; A, A &or; &not; A. Right Contraction.<br \/>\n7. empty :- A &or; &not; A<br \/>\nIf you look *carefully* at the rules, they actually make a lot of sense. The only ones that look a bit strange are the &#8220;forall&#8221; rules; and for those, you need to remember that the variable is *free* on the top of the sequent.<br \/>\nA lot of logics can be described using Gentzen systems; from type theory, to temporal logics, to all manner of other systems. They&#8217;re a very powerful tool for describing all manner of inference systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>*(This post has been modified to correct some errors and add some clarifications in response to comments from alert readers. Thanks for the corrections!)* Today, we&#8217;re going to take a brief diversion from category theory to play with some logic. There are some really neat connections between variant logics and category theory. I&#8217;m planning on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[76,24],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-category-theory","category-goodmath"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-1f","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}