<<

Cutback Hilbert calculi Cutback Natural deduction Hilbert calculi Semantic equivalence and normal forms

α β if wα = wβ for all w From syllogism to : ≡ atourthroughthelogicallandscape Replacement : if α α￿ then ϕ[α￿/α] ϕ, ≡ ≡ i.e., if a subformula α of ϕ is replaced by α α in ϕ, ￿ ≡ Propositional 3 then the resulting formula is equivalent to ϕ

Negation normal form (NNF) is established by Mehul Bhatt Oliver Kutz Thomas Schneider “pulling negation inwards”, interchanging and ∧ ∨ Disjunctive normal form (DNF) of fct f is established by 8 December 2011 describing all lines with value 1 in Conjunctive normal form (CNF): analogous, dual

Thomas Schneider Propositional logic 3 Thomas Schneider Propositional logic 3

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Functional completeness and duality Tautologies etc.

α is a if w = α (wα = 1) for all w | Signature S is functional complete: α is satisfiable if w = α for some w every Boolean fct is represented by some fma in S | α α Examples: , , , , , 0 , , is a contradiction if is not satisfiable {¬ ∧} {¬ ∨} {→ } {↑} {↓} Counterexample: , , {→ ∧ ∨} Satisfiability can be decided in nondeterministic polynomial time (NP) and is NP-hard. Dual formula: interchange and ∧ ∨ Analogous for tautology : coNP-complete Dual function: negate and function value α is a of X (X = α) δ δ | Duality theorem: If α represents f ,thenα represents f . if w(w = X w = α) ∀ | ⇒ | = enjoys certain general properties |

Thomas Schneider Propositional logic 3 Thomas Schneider Propositional logic 3 22 1 Propositional Logic

Cutback Natural deduction Hilbert calculi Cutback1.4 A Calculus of NaturalNatural deduction Deduction Hilbert calculi

And now . . . What’sWe will in now this define section? a derivability relation by means of a calculus op- ￿ erating solely with some structural rules. turns out to be identical to ￿ the consequence relation .Thecalculus is of the so-called Gentzen ￿ ￿ typeWe and want its to rules . . . are given with respect to pairs (X, α) of formulas X and formulas α.Anothercalculusfor￿,oftheHilberttype,willbecon- sideredfind in 1.6 a means.Indistinctionto[ to “compute”Ge],= wesyntactically do not require: that X be finite; 1 What happened last time? | our particular goals here make such a restriction dispensable. If applies ￿ to thedefine pair (X, a derivabilityα) then we relation write X byα meansand say of that a calculusα is derivable or ￿￿ provablethatfrom operatesX (made solely precise on the below); structure otherwise of formulas we write X ￿ α. 2 A calculus of natural deduction Followingprove [ thatKl1], Gentzen’sand = are name identical for (X, α), Sequenz,istranslatedas sequent.Thecalculusisformulatedintermsof￿ | , and encompasses the ∧ ¬ six rules below, called the basic rules.Howtooperatewiththeseruleswill 3 Hilbert calculi be explained afterwards. The choice of , as the logical signature is The calculus is of the Gentzen type{ ∧ ¬} amatterofconvenienceandjustifiedbyitsfunctionalcompleteness.The￿ other(Gerhard standard Gentzen, connectives 1909–1945, are German introduced mathematician/logician, by the definitions GÖ, Prague) α β := ( α β), α β := (α β), α β := (α β) (β α). ∨ ¬ ¬ ∧ ¬ → ¬ ∧ ¬ ↔ → ∧ → , are defined as on page 5.Ofcourse,onecouldchooseanyother ￿ ⊥ Thomas Schneider Propositional logic 3 52 functionalThomas Schneider complete signaturePropositional and adapt logic the 3 basic rules correspondingly. 53 But it should be observed that a complete calculus in , , , , say, ¬ ∧ ∨ → must also include basic rules concerning and ,whichmakesinduction ∨ → arguments on the basic rules of the calculus more lengthy. Each of the basic rules below has certain and a conclusion. Only (IS) has no premises. It allows the derivation of all sequents α α. ￿ Cutback Natural deduction Hilbert calculi CutbackThese are called the initial sequents,Natural deduction because each derivation mustHilbert start calculi Basic notation Thewith basic these. rules (MR), the monotonicity rule,couldbeweakened.Itbecomes even provable if all pairs (X, α) with α X are called initial sequents. ∈ X α (IS) (initial sequent) (MR) ￿ (X X), α α X α ￿ ⊇ ￿ ￿ ￿ X α, β X α β Again, use α for formulas and X for sets thereof ( 1) ￿ ( 2) ￿ ∧ ∧ X α β ∧ X α, β Write X α to denote: “α is derivable from X” ￿ ∧ ￿ ￿ X α, α X, α β X, α β ( 1) ￿ ¬ ( 2) ￿ ¬ ￿ Gentzen called the pairs (X, α) in the -relation sequents ¬ X β ¬ X β ￿ ￿ ￿ consists of 6 basic rules (for , ) From W. Rautenberg: A Concise Introduction to , Springer, 2010. {∧ ¬} of the form use convenience notation as for =, see Slide 48 (last week) | conclusion (IS) has no premises; initial sequences start derivations (MR): monotonicity rule ( 1), ( 1), ( 2) have two premises; ∧ ¬ ¬ ( 2) has two conclusions ❀ is actually 2 rules ∧ Thomas Schneider Propositional logic 3 54 Thomas Schneider Propositional logic 3 55 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Using the calculus Examples

1 α α (IS) ￿ 2 α, β α (MR) 1 ￿ Derivation = finite sequence S ,...,S of sequents 3 β β (IS) 0 n ￿ where every S is either 4 α, β β (MR) 3 i ￿ 5 α, β α β ( 1) 2, 4 α, β α β an initial sequent or ￿ ∧ ∧ ⇒ { } ￿ ∧ is obtained by applying some basic rule to elements from S0,...,Si 1 − 1 p p p p (IS) ∧ ¬ ￿ ∧ ¬ 2 p p p ( 2) 1 α is derivable from X,writtenX α, ∧ ¬ ￿ ∧ ￿ 3 p p p ( 2) 1 if there is a derivation with Sn = X α. ∧ ¬ ￿ ¬ ∧ ￿ 4 p p (p p) ( 1) 2, 3 ∧ ¬ ￿ ¬ ∧ ¬ ¬ 5 (p p) (p p) (IS) ¬ ∧ ¬ ￿ ¬ ∧ ¬ 6 (p p) ( 2) 4, 5 ∅￿¬ ∧ ¬ ¬ ⇒￿￿

Thomas Schneider Propositional logic 3 56 Thomas Schneider Propositional logic 3 57

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Derivable rules Further derivable rules

Derivations can be long (see exercise sheet) X α X, α β ￿ | ￿ cut rule Use derivable rules as “shortcuts” X β for frequently occurring patterns in derivations ￿

Examples: X α β ￿ → -elimination 1 α α (IS) X, α β → X, α α ￿ ￿ ¬ ￿ 2 X, α α (MR) 1 X α ￿ ￿ 3 X, α α supposition ¬ ￿ X, α β -elimination 4 X α ( 2) ￿ -introduction syntactic deduction theorem ¬ ￿ ¬ X α β → ￿ →

X, α β, β 1 X, α β, β supposition ¬ ￿ ¬ ¬ ￿ ¬ X α, α β X α 2 X, α α ( 1) ￿ → detachment rule syntactic ￿ ¬ ￿ ¬ X β 3 X α -elimination 2 ￿ reductio ad ￿ ¬ absurdum

Thomas Schneider Propositional logic 3 58 Thomas Schneider Propositional logic 3 59 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Relation between and = is the easier direction ... ￿ | Theorem (Soundness of ) ￿ is semantically sound, i.e., X, α : X α X = α ￿ ∀ ￿ ⇒ | Goal: show = = ,i.e., X α iff X = α for all X, α ￿ | ￿ | Proof. Let X α. valid derivation S1,...,Sn with Sn = X α. Direction or : (semantical) soundness of ￿ ⇒∃ ￿ ⊆ ⇒ ￿ Induction on n. (each fma derivable from X is a semantic consequence of X) n = 1. S = α α,andα = α obviously holds. ⇒ 1 ￿ | Direction or : (semantical) completeness of n ❀ n + 1. Consider Sn+1 in S1,...,Sn+1. ⊇ ⇐ ￿ (each semantic consequence of X can be derived from X) Either S = α α (then argue as for n = 1) n+1 ￿ Si = X ￿ α￿ or Sn+1 is obtained by applying some rule, e.g., ￿ S = X α n+1 ￿ induction hypothesis: X ￿ = α￿ | since rules preserve the consequence relation (see exercise), we can conclude X = α | ✷ Thomas Schneider Propositional logic 3 60 Thomas Schneider Propositional logic 3 61

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Finiteness Formal consistency

. . . is a property crucial to the completeness proof Another property that can be proven using induction on derivation length: ... will turn out to be the -equivalent of satisfiability ￿ Definition: Theorem (Finiteness theorem for ) ￿ X of fmas is inconsistent if X α for all fmas α, If X α,thenthereisafinitesubsetX X with X α. ￿ ￿ 0 ⊆ 0 ￿ consistent otherwise. X is maximally consistent Intuitive justification: if X is consistent but each Y X is inconsistent ⊇ Every derivation has finite length Observations: Only finitely many formulas can “accumulate” in X X inconsistent iff X ⇒ ￿⊥ during a derivation (for “ ” use = (p p) and rules ( 2), ( 1)) ⇐ ⊥ ∧ ¬ ∧ ¬ ❀ X maximally consistent iff α : either α X or α X ∀ ∈ ¬ ∈

Thomas Schneider Propositional logic 3 62 Thomas Schneider Propositional logic 3 63 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Helpful properties of Consistent sets are satisfiable (I) ￿

Lemma Lemma (Lindenbaum’s lemma) The derivability relation has the following properties. ￿ + Every consistent set X C : X α iff X, α C− : X α iff X, α ⊆ F ￿ ¬ ￿⊥ ￿ ¬ ￿⊥ can be extended to a maximally consistent set X ￿ X. ⊇ Proof: Exercise. (Adolf Lindenbaum, 1904–1941, Polish logician/mathematician, Warsaw) Proof sketch: This lemma helps with our goal of showing = : | ⊆￿ Enumerate all formulas α , α ,... “= ”iff X, α : X α X = α 0 1 | ⊆￿ ∀ ￿￿ ⇒ ￿| + For every i = 0, 1,...: By C , X α iff X ￿ := X α is consistent ￿￿ ∪ {¬ } if X α is consistent, then add α to X. ∪ { i } i By definition of =, X = α iff X ￿ satisfiable | ￿| X ￿ is the limit of this extension procedure Suffices to show: consistent sets are satisfiable ⇒

Thomas Schneider Propositional logic 3 64 Thomas Schneider Propositional logic 3 65

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Consistent sets are satisfiable (II) Consistent sets are satisfiable (III)

Lemma Lemma ( ) Every maximally consistent set X is satisfiable. ¬ For every maximally consistent set X and every α : Proof. Define valuation w by: w = p iff X p ⊆ F ∈ F | ￿ Show by induction α : X α iff w = α. α α ∀ ￿ | X iff X ( ) (This implies w = X, which completes the proof.) ￿ ¬ ￿￿ ¬ | Base case (α = p) follows from definition of w. Proof. Induction step for , : “ ” Due to consistency of X. ∧ ¬ ⇒ X α β X α, β (rules ( 1), ( 2)) “ ” If X α,thenX, α is consistent due to C+. ￿ ∧ ⇔ ￿ ∧ ∧ ⇐ ￿￿ ¬ w = α, β (induction hypothesis) Since X is max. consistent, this implies α X. ⇔ | ¬ ∈ w = α β (definition =) Hence X α. ⇔ | ∧ | ￿ ¬ X α X α (lemma ( )) ✷ ￿ ¬ ⇔ ￿￿ ¬ w = α (induction hypothesis) ⇔ ￿| w = α (definition =) ⇔ | ¬ | ✷ Thomas Schneider Propositional logic 3 66 Thomas Schneider Propositional logic 3 67 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Completeness! Interesting consequences of soundness + completeness

Theorem (Completeness of ) ￿ is semantically complete, i.e., X, α : X = α X α Theorem (Finiteness theorem for =) ￿ ∀ | ⇒ ￿ | If X = α,thenthereisafinitesubsetX X with X = α. | 0 ⊆ 0 | Proof. Via contraposition. Follows directly from finiteness theorem for Assume X α. ￿ ￿￿ and soundness + completeness of . Then X, α is consistent. ￿ ¬ Due to Lindenbaum’s lemma: Theorem (Propositional compactness theorem) there is maximally consistent extension Y of X, α. ¬ X is satisfiable iff each finite of X is satisfiable. Due to previous lemma: Y satisfiable ⊆ F Hence X, α satisfiable. Follows directly from finiteness theorem for with the observation ￿ ¬ that X unsatisfiable iff X = . Therefore X = α. | ⊥ ￿| ✷

Thomas Schneider Propositional logic 3 68 Thomas Schneider Propositional logic 3 69

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi And now . . .

1 What happened last time?

And so, Arthur and Bedevere and Sir Robin set out on their search to find the enchanter of whom the old man had spoken in scene twenty-four. Beyond the 2 A calculus of natural deduction forest, they met Launcelot and Galahad, and there was much rejoicing. In the frozen land of Nador, they were forced to eat Robin’s minstrels. And there was much rejoicing. 3 Hilbert calculi A year passed. Winter changed into Spring. Spring changed into Summer. Summer changed back into Winter, and Winter gave Spring and Summer a miss and went straight on into Autumn. Until one day . . . (from “Monty Python and the Holy Grail”, 1975) Thomas Schneider Propositional logic 3 70 Thomas Schneider Propositional logic 3 71 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Hilbert calculi . . . A standard Hilbert calculus

Logical signature: , ¬ ∧ (use α β as abbreviation for (α β)) → ¬ ∧ ¬ are very simple logical calculi Set Λ of : (5 schemes =ˆ infinitely many axioms)

are based on arbitrary choice of logical tautologies as axioms Λ1 (α β γ) (α β) α γ → → → → → → Λ2 α (β α β) use rules of to prove other tautologies from the → → ∧ Λ3 (α β) α axioms ∧ → (α β) β ∧ → lead to more intuitive proofs than sequent calculi Λ4 (α β) β α → ¬ → → ¬

(David Hilbert, 1862–1943, German mathematician, Königsberg, GÖ) Only one inference rule! Modus ponens: X α, α β MP |∼ → X |∼ β (whenever α and α β are provable from X,thensoisβ) →

Thomas Schneider Propositional logic 3 72 Thomas Schneider Propositional logic 3 73

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Using the calculus Example

Proof of X = p, q p q { } |∼ ∧ 1 p X 2 q X Proof from X = finite sequence ϕ0,...,ϕn of formulas 3 p (q p q) Λ2 where every ϕi is either → → ∧ 4 q p q MP 1, 3 → ∧ from X Λ or 5 p q MP 2, 4 ∪ ∧ is obtained by applying MP to two elements from ϕ0,...,ϕi 1 − Proof of α (β α) |∼ → → α is provable from X,writtenX |∼ α, ϕ = α 1 β α α Λ3 if there is a proof from X with n . ∧ ¬ → ¬ 2 (β α α) (α (β α)) Λ4 ∧ ¬ → ¬ → → ¬ ∧ ¬ 3 α (β α) MP 1, 2 → ¬ ∧ ¬ β α → ￿ ￿￿ ￿

Thomas Schneider Propositional logic 3 74 Thomas Schneider Propositional logic 3 75 Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Soundness Completeness

Theorem (Completeness of |∼)

|∼ is semantically complete, i.e., X, α : X = α X |∼ α Theorem (Soundness of |∼) ∀ | ⇒ is semantically sound, i.e., X, α : X α X = α |∼ ∀ |∼ ⇒ | Proof uses the completeness of : ￿ This is immediate to see: satisfies all basic rules of |∼ ￿ X α β X α β All axioms in Λ are tautologies (use truth tables). e.g., ( 2) ￿ ∧ also holds for : |∼ ∧ ∧ X α, β |∼ X α, β ￿ |∼ MP preserves tautologies, i.e.: (to see this, use Λ3 and MP) if α and α β are tautologies, then so is β. → Therefore, |∼ Hence every formula generated in a proof is a tautology. ￿⊆ Since = =, we obtain = ￿ | | ⊆ |∼ Hence every formula generated in a proof is a tautology.

Thomas Schneider Propositional logic 3 76 Thomas Schneider Propositional logic 3 77

Cutback Natural deduction Hilbert calculi Cutback Natural deduction Hilbert calculi Summary and outlook Literature

Prop. logic (PL) relies on the principles of Contents is taken from Chapter 1 of bivalence and . W. Rautenberg: PL formulas represent exactly the Boolean functions. A Concise Introduction to Mathematical Logic, Springer, 2010. This issue at Universitext: DOI 10.1007/978-1-4419-1221-3_1 Logical and consequence are defined German version of 2008: DOI 10.1007/978-3-8348-9530-1 via the = relation, based on valuations. | PDF of Chapter 1 available in StudIP under “Dateien” Natural deduction (Gentzen-type sequent calculi) and Hilbert calculi both calculate the = relation syntactically. | Thank you. We haven’t captured other types of calculi, such as tableau calculi or the calculus.

Thomas Schneider Propositional logic 3 78 Thomas Schneider Propositional logic 3 79