Logic: Lecture 12, 10 September 2015 ------------------------------------ (For details, see the chaper by Barwise, pp 37-40) A "sequent" G |- D consists of two list of formulas G = {g1,g2,...,gm} and D = {d1,d2,...,dn}. The intention is that if assume all of the formulas in G, we can prove at least one of the formulas in D. And_i g_i |= Or_j d_j A formal system in the Sequent Calculus has very few axioms and many rules, unlike Hilbert style systems that have many axioms and few rules. Sequent Calculus for propositional logic: Axiom: G, phi |- D, phi (And |-) (|- And) G, phi, psi |- D G |- D, phi G |- D, psi ------------------- -------------------------- G, phi and psi |- D G |- D, phi and psi (Or |-) (|- Or) G, phi |- D G, psi |- D G |- D, phi, psi --------------------------- ------------------ G, phi or psi |- D G |- D, phi or psi (Not |-) (|- Not) G |- D, phi G, phi |- D ------------- ------------ G, ~phi |- D G |- D, ~phi (Implies |-) (|- Implies) G |- D, phi G, psi |- D G, phi |- D, psi --------------------------- ------------------ G, phi -> psi |- D G |- D, phi -> psi Derivations: An inverted tree, where the formula to prove is the root (at the bottom), each leaf (top) is an axiom, and every branching node corresponds to a valid rule. Example: phi, ~psi |- phi, psi (Axiom) ------------------------ phi and ~psi |- phi, psi (And !-) phi |- phi, theta (Axiom) -------------------------- ------------------- phi and ~psi |- phi or psi (|- Or) phi |- phi or theta (|- Or) ---------------------------------------------------------- ((phi and ~psi) or theta |- (phi or theta) (Or !-) Soundess: For each rule, verify that if And_i g_i |= Or_j d_j holds for the sequent above, it also holds for the sequent below Completeness: Suppose G = {g1,g2,...,gm} and D = {d1,d2,...,dn} such that And_i g_i |= Or_j d_j. Construct a derivation for G |- D as follows. Apply rule for top level connective in G or D. (Choose any formula in G or D to simplify. Top level connective is unique. Exactly one rule applies). This process stops when each leaf node looks like {p1,p2,..,pk} |- {q1,q2,...,ql} where each pi, qj is an atomic proposition. If each leaf node has some intersection between left and right list, we have a valid proof. If not, define a valuation v such that v(pi) = tt for all i and v(qj) = ff for all j. Verify that each rule preserves this property: at every level in the derivation, if the v(g'i) = tt and v(d'j) = ff for the sequent G' |- D' above, then v(g"i) = tt and v(d"j) = ff for the sequent G" |- D" below. This means that for the root node, v(gi) = tt for all gi in G and v(dj) = ff for all dj in G, which contradicts the assumption that And_i g_i |= Or_j d_j. Sequent Calculus for first order logic: Add the following: (Equality axioms) G |- D, (t = t) where t is any term (Equality rule) G, phi(t1) |- D, phi(t1) where E is (t1 = t2) or (t2 = t1) --------------------------- G, E, phi(t2) |- D, phi(t2) (A |-) (|- A) G, phi(t) |- D G |- D, phi(v) v not ------------------- --------------- free in G, Av phi(v) |- D G |- D, Av phi(v) G, D (E |-) (|- E) G, phi(v) |- D v not G |- D, phi(t) ------------------- free in --------------- G, Ev phi(v) |- D G, D G |- D, Ev phi(v) (Cut) G, phi |- D G |- D, phi -------------------------- G |- D Cut is the equivalent of Modus Ponens. Note that we did not need Cut in our sequent calculus rules for propositional logic. Completeness for first order logic: Proof structure is similar to the Hilbert style completeness proof. - Suppose X |= phi. Then, propositionally, X U phi_E U phi_Q U phi_H |= phi - Hence Y U {~phi} is not satisfiable for some finite subset Y of lhs - Split Y as {a_i} coming from X U phi_E U phi_Q and {b_j} coming from phi_H - Replace all Henkin constants by fresh variables to get {a'_i} and {b'_j}. Note that phi' = phi, and a'_i = a_i for a_i in X. - By assumption, |= a'_1 -> (a'_1 -> ... -> (a'_k -> (b'_1 -> ... -> (b'_l -> phi)...) - Need to derive |- a'_1 -> (a'_1 -> ... -> (a'_k -> (b'_1 -> ... -> (b'_l -> phi)...) - Formalas a'_i are directly derivable. Apply Cut repeatedly to eliminate them. - Derive the following using the proof system above If G, (psi -> theta) |- D then G |- D, psi and G, theta |- D Use Cut repeately to eliminate the b'_j Cut elimination: Note that the completness proof for propositional logic does not use Cut. However, the completeness proof for first order logic, via a reduction to propositional logic, uses Cut heavily. Is Cut really needed? Theorem (Gentzen): Any proof using Cut can be effectively transformed to one that does not use Cut (Proof is beyond the scope of this course.) The "cut elimination" theorem is probably the earliest non-trivial example of a result in "proof theory" --- a direct statement about the structure and transformation of proofs. Cut elimination is analogous to substituting a lemma every time it is used by the proof of the lemma directly, so proofs blow up in size. ----------------------------------------------------------------------