Predicate Logic: Peano Arithmetic Alice Gao Lecture 20 CS 245 Logic and Computation Fall 2019 1 / 22
Outline The Learning Goals Properties of Equality Using Logic to Model Number Theory Revisiting the Learning Goals CS 245 Logic and Computation Fall 2019 2 / 22
Learning goals By the end of this lecture, you should be able to: numbers using formal deduction rules and Peano axioms. CS 245 Logic and Computation Fall 2019 3 / 22 ▶ Write a formal deduction proof using rules for equality. ▶ Write a formal deduction proof for properties of natural
Formal Deduction Rules for Equality (≈ −) If Σ ⊢ 𝐵(𝑢 1 ) and Σ ⊢ Σ ⊢ 𝐵 ′ (𝑢 2 ) , where 𝐵 ′ (𝑢 2 ) results from 𝐵(𝑢 1 ) by replacing some (not necessarily all) occurrences (≈ +) ∅ ⊢ 𝑣 ≈ 𝑣. CS 245 Logic and Computation Fall 2019 4 / 22 𝑢 1 ≈ 𝑢 2 then of 𝑢 1 by 𝑢 2 .
Proving Properties of Equality (Refmexivity) ∀𝑦 (𝑦 ≈ 𝑦) (Symmetry) ∀𝑦 ∀𝑧 ((𝑦 ≈ 𝑧) → (𝑧 ≈ 𝑦)) (Transitivity) ∀𝑦 ∀𝑧 ∀𝑨 ((𝑦 ≈ 𝑧) ∧ (𝑧 ≈ 𝑨) → (𝑦 ≈ 𝑨)) CS 245 Logic and Computation Fall 2019 5 / 22
Proving Refmexivity Refmexivity: ∅ ⊢ ∀𝑦(𝑦 ≈ 𝑦) CS 245 Logic and Computation Fall 2019 6 / 22
Proving Symmetry Symmetry: ∅ ⊢ ∀𝑦 ∀𝑧 (𝑦 ≈ 𝑧) → (𝑧 ≈ 𝑦) CS 245 Logic and Computation Fall 2019 7 / 22
Proving Transitivity Transitivity: ∅ ⊢ ∀𝑦 ∀𝑧 ∀𝑨 (𝑦 ≈ 𝑧) ∧ (𝑧 ≈ 𝑨) → (𝑦 ≈ 𝑨) CS 245 Logic and Computation Fall 2019 8 / 22
Outline The Learning Goals Properties of Equality Using Logic to Model Number Theory Revisiting the Learning Goals CS 245 Logic and Computation Fall 2019 9 / 22
Using Logic to Model Mathematics We want to use predicate logic to model mathematics. For each domain, and individuals/constants. CS 245 Logic and Computation Fall 2019 10 / 22 ▶ Number theory, with 0 , + , and ⋅ ▶ Set theory, with ∈ and ∅ ▶ Group theory ▶ Graph theory ▶ Geometry ▶ Defjne axioms that describe the functions, predicates/relations ▶ Prove theorems in that domain using predicate logic.
Number Theory We would like to formalize the properties of natural numbers. The axioms should be a small set of true statements from which we can derive theorems about natural numbers. CS 245 Logic and Computation Fall 2019 11 / 22 ▶ The domain is the set of natural numbers, 0, 1, 2, 3, … . ▶ Functions: addition + and multiplication ⋅ . ▶ Relations: ordering < .
Symbols for Number Theory addition + multiplication ⋅ successor 𝑡(𝑦) CS 245 Logic and Computation Fall 2019 12 / 22 ▶ Individual/constant: 0 ▶ Functions:
Peano Axioms (1/2) Axioms for successor PA1 Zero is not a successor of any natural number. PA2 If two numbers are the same, they must have the same predecessor. Axioms for addition PA3 Adding zero to any number yields the same number. PA4 Adding the successor of a number yields the successor of adding the number. CS 245 Logic and Computation Fall 2019 13 / 22
Peano Axioms (2/2) Axioms for multiplication PA5 Multiplying a number by zero yields zero. PA6 Multiplying one number and the successor of another number equals the product of the two numbers plus the fjrst number. CS 245 Logic and Computation Fall 2019 14 / 22
Axiom for Induction For 𝑜 ∈ ℕ , let 𝑄(𝑜) denote that 𝑜 has the property 𝑄 . Prove that 𝑄(0) is true. Assume that 𝑄(𝑙) is true for some 𝑙 ∈ ℕ . Prove that 𝑄(𝑙 + 1) is true. By the principle of mathematical induction, 𝑄(𝑜) is true for every 𝑜 ∈ ℕ . Expressing this in predicate logic: (𝑄(0) ∧ ∀𝑦 (𝑄(𝑦) → 𝑄(𝑡(𝑦)))) → ∀𝑦 𝑄(𝑦) CS 245 Logic and Computation Fall 2019 15 / 22 ▶ (Base Case) ▶ (Inductive Step)
Axiom for Induction Axiom for induction PA7 For each predicate formula 𝐵(𝑦) with free variable 𝑦 [𝐵(0) ∧ ∀𝑦(𝐵(𝑦) → 𝐵(𝑡(𝑦))] → ∀𝑦𝐵(𝑦) CS 245 Logic and Computation Fall 2019 16 / 22
Example 1: Every number is not equal to its successor Every natural number is not equal to its successor. Prove that ∀𝑦 (¬(𝑡(𝑦) ≈ 𝑦)) . Which Peano Axiom can we use to prove this? Consider some 𝑙 ∈ ℕ . Assume that ¬(𝑡(𝑙) ≈ 𝑙) . Prove that ¬(𝑡(𝑡(𝑙)) ≈ 𝑡(𝑙)) . Which Peano Axiom can we use to prove this? CS 245 Logic and Computation Fall 2019 17 / 22 ▶ Base Case: Prove that ¬(𝑡(0) ≈ 0) ▶ Induction Step:
Example 1: Every number is not equal to its successor 7.¬(𝑡(𝑣) ≈ 𝑣), 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) ⊢ 𝑡(𝑣) ≈ 𝑣 (→ −, 6, 3) Fall 2019 CS 245 Logic and Computation 11.∅ ⊢ ∀𝑦(¬(𝑡(𝑣) ≈ 𝑣) → ¬(𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣))) (10, ∀+, no 𝑣 elsewhere ) 10.∅ ⊢ ¬(𝑡(𝑣) ≈ 𝑣) → ¬(𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣)) (→ +, 9) 9.¬(𝑡(𝑣) ≈ 𝑣) ⊢ ¬(𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣)) (¬+, 7, 8) 8.¬(𝑡(𝑣) ≈ 𝑣), 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) ⊢ ¬(𝑡(𝑣) ≈ 𝑣) (∈) 6.¬(𝑡(𝑣) ≈ 𝑣), 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) ⊢ 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) → 𝑡(𝑣) ≈ 𝑣 (+, 5) Every natural number is not equal to its successor. 5.∅ ⊢ 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) → 𝑡(𝑣) ≈ 𝑣 (∀−, 4) 4.∅ ⊢ ∀𝑦 ∀𝑧 (𝑡(𝑦) ≈ 𝑡(𝑧) → 𝑦 ≈ 𝑧) (𝑄𝐵2) 3.¬(𝑡(𝑣) ≈ 𝑣), 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) ⊢ 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣) (∈) 2.∅ ⊢ ¬(𝑡(0) ≈ 0) (∀−, 1) 1.∅ ⊢ ∀𝑦 ¬(𝑡(𝑦) ≈ 0) (𝑄𝐵1) Prove that ∀𝑦 (¬(𝑡(𝑦) ≈ 𝑦)) . 18 / 22
Example 1: Every number is not equal to its successor Every natural number is not equal to its successor. Prove that ∀𝑦(¬(𝑡(𝑦) ≈ 𝑦)) . (continued) 12.∅ ⊢ ¬(𝑡(𝑣) ≈ 𝑣) ∧ ∀𝑦(¬(𝑡(𝑣) ≈ 𝑣) → ¬(𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣))) (∧+, 2, 11) 13.∅ ⊢ ¬(𝑡(𝑣) ≈ 𝑣) ∧ ∀𝑦(¬(𝑡(𝑣) ≈ 𝑣) → ¬(𝑡(𝑡(𝑣)) ≈ 𝑡(𝑣))) 14.∅ ⊢ ∀𝑦 ¬(𝑡(𝑦) ≈ 𝑦) (→ −, 12, 13) CS 245 Logic and Computation Fall 2019 19 / 22 → ∀𝑦 ¬(𝑡(𝑦) ≈ 𝑦) (𝑄𝐵7, with 𝐵(𝑦) ∶ ‶ ¬(𝑡(𝑦) ≈ 𝑦) ″ )
Example 2: Every non-zero natural number 4.∅ ⊢ 𝑡(𝑙) ≈ 𝑡(𝑙) ( prove separately using (≈ +)) Fall 2019 CS 245 Logic and Computation 8.𝑙 ≈ 0 ⊢ (𝑡(𝑙) ≈ 0) ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) (∨+, 8) 7.𝑙 ≈ 0 ⊢ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) ((∃+), 6) 5.𝑙 ≈ 0 ⊢ 𝑡(𝑙) ≈ 𝑡(𝑙) (+, 4) 3.𝑙 ≈ 0 ⊢ 𝑙 ≈ 0 (∈) has a predecessor Induction step: 2.∅ ⊢ 0 ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 0) (∨+, 1) 1.∅ ⊢ 0 ≈ 0 (≈ +) Base case: Prove that ∀𝑦(𝑦 ≈ 0 ∨ ∃𝑧 (𝑡(𝑧) ≈ 𝑦)) Every non-zero natural number has a predecessor. 20 / 22 6.𝑙 ≈ 0 ⊢ 𝑡(0) ≈ 𝑡(𝑙) (≈ −) with 𝐵(𝑦) ∶ ‶ 𝑡(𝑦) ≈ 𝑡(𝑙) ″
Example 2: 17.∅ ⊢ 𝑙 ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑙) → 𝑡(𝑙) ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙))(16, → Fall 2019 CS 245 Logic and Computation 21.∅ ⊢ ∀𝑦(𝑦 ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑦)) (20, 19, → −) 20.∅ ⊢ 𝑄(0) ∧ ∀𝑦(𝑄(𝑦) → 𝑄(𝑡(𝑦))) → ∀𝑦𝑄(𝑦) (𝑄𝐵7) 19.∅ ⊢ 𝑄(0) ∧ ∀𝑦(𝑄(𝑦) → 𝑄(𝑡(𝑦))) (18, 2, ∧+) 18.∅ ⊢ ∀𝑦(𝑄(𝑦) → 𝑄(𝑡(𝑦))) (17, ∀+, no 𝑙 elsewhere ) +) 16.𝑙 ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑙) ⊢ 𝑡(𝑙) ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) (8, 15, ∨−) Inductive step, second case of (∨−) no 𝑣 elsewhere ) 15.∃𝑧(𝑡(𝑧) ≈ 𝑙) ⊢ 𝑡(𝑙) ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) (14, ∃−), 14.𝑡(𝑣) ≈ 𝑙 ⊢ 𝑡(𝑙) ≈ 0 ∨ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) (13, ∨+) 13.𝑡(𝑣) ≈ 𝑙 ⊢ ∃𝑧(𝑡(𝑧) ≈ 𝑡(𝑙)) (12, ∃+) 12.𝑡(𝑣) ≈ 𝑙 ⊢ 𝑡(𝑡(𝑣)) ≈ 𝑡(𝑙) (11, 10, (≈ −), 𝐵(𝑦) ∶ 𝑡(𝑦) ≈ 𝑡(𝑙)) 11.𝑡(𝑣) ≈ 𝑙 ⊢ 𝑡(𝑙) ≈ 𝑡(𝑙) (4, +) 10.𝑡(𝑣) ≈ 𝑙 ⊢ 𝑙 ≈ 𝑡(𝑣) (9, symmetry of ≈) 9.𝑡(𝑣) ≈ 𝑙 ⊢ 𝑡(𝑣) ≈ 𝑙 (∈) 21 / 22
Revisiting the learning goals By the end of this lecture, you should be able to: numbers using formal deduction rules and Peano axioms. CS 245 Logic and Computation Fall 2019 22 / 22 ▶ Write a formal deduction proof using rules for equality. ▶ Write a formal deduction proof for properties of natural
Recommend
More recommend