propositional logic structural induction
play

Propositional Logic: Structural Induction Alice Gao Lecture 3 CS - PowerPoint PPT Presentation

Propositional Logic: Structural Induction Alice Gao Lecture 3 CS 245 Logic and Computation Fall 2019 Alice Gao 1 / 25 Outline Learning goals Propositional language Structure of formulas Inductively defjned sets Revisiting the learning


  1. Propositional Logic: Structural Induction Alice Gao Lecture 3 CS 245 Logic and Computation Fall 2019 Alice Gao 1 / 25

  2. Outline Learning goals Propositional language Structure of formulas Inductively defjned sets Revisiting the learning goals CS 245 Logic and Computation Fall 2019 Alice Gao 2 / 25

  3. Learning goals By the end of the lecture, you should be able to structural induction. structural induction. CS 245 Logic and Computation Fall 2019 Alice Gao 3 / 25 β–Ά Prove properties of well-formed propositional formulas using β–Ά Prove properties of a recursively defjned concept using

  4. Propositional language 𝑀 π‘ž CS 245 Logic and Computation Fall 2019 Alice Gao 4 / 25 The propositional language 𝑀 π‘ž consists of three classes of symbols: β–Ά Propositional symbols: π‘ž , π‘Ÿ , 𝑠 , … . β–Ά Connective symbols: Β¬ , ∧ , ∨ , β†’ , ↔ . β–Ά Punctuation symbols: ( and ) .

  5. Well-formed propositional formulas Defjnition ( 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) ) follows from (1) - (3): 1. 𝐡𝑒𝑝𝑛(𝑀 π‘ž ) βŠ† 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . 2. If 𝐡 ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) , then (¬𝐡) ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . 3. If 𝐡, 𝐢 ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) , then (𝐡 βˆ— 𝐢) ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . CS 245 Logic and Computation Fall 2019 Alice Gao 5 / 25 An expression of 𝑀 π‘ž is a member of 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) ifg its being so

  6. Outline Learning goals Propositional language Structure of formulas Inductively defjned sets Revisiting the learning goals CS 245 Logic and Computation Fall 2019 Alice Gao 6 / 25

  7. Unique readability of well-formed formulas Does every well-formed formula have a unique meaning? Yes. Theorem: There is a unique way to construct each well-formed formula. CS 245 Logic and Computation Fall 2019 Alice Gao 7 / 25

  8. Properties of well-formed formulas We may want to prove other properties of well-formed formulas. variable. and closing brackets. brackets than closing brackets. CS 245 Logic and Computation Fall 2019 Alice Gao 8 / 25 β–Ά Every well-formed formula has at least one propositional β–Ά Every well-formed formula has an equal number of opening β–Ά Every proper prefjx of a well-formed formula has more opening β–Ά There is a unique way to construct every well-formed formula.

  9. Why should you care? Learning goals on structural induction: structural induction. structural induction. Learning goals for future courses: using induction. CS 245 Logic and Computation Fall 2019 Alice Gao 9 / 25 β–Ά Prove properties of well-formed propositional formulas using β–Ά Prove properties of a recursively defjned concept using β–Ά Prove the space and time effjciency of recursive algorithms

  10. Properties of well-formed formulas Theorem: For every well-formed propositional formula πœ’ , 𝑄(πœ’) is true. CS 245 Logic and Computation Fall 2019 Alice Gao 10 / 25

  11. Recursive structure in well-formed formulas Defjnition ( 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) ) follows from (1) - (3): 1. 𝐡𝑒𝑝𝑛(𝑀 π‘ž ) βŠ† 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . (Base case) 2. If 𝐡 ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) , then (¬𝐡) ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . (Inductive case) 3. If 𝐡, 𝐢 ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) , then (𝐡 βˆ— 𝐢) ∈ 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) . (Inductive case) CS 245 Logic and Computation Fall 2019 Alice Gao 11 / 25 An expression of 𝑀 π‘ž is a member of 𝐺𝑝𝑠𝑛(𝑀 π‘ž ) ifg its being so

  12. A structural induction template for well-formed formulas binary connective. Alice Gao Fall 2019 CS 245 Logic and Computation well-formed formula πœ’ . QED By the principle of structural induction, 𝑄(πœ’) holds for every We need to prove that 𝑄((𝑏 βˆ— 𝑐)) holds. Induction hypothesis: Assume that 𝑄(𝑏) and 𝑄(𝑐) hold. Case 2: πœ’ is (𝑏 βˆ— 𝑐) where 𝑏 and 𝑐 are well-formed and βˆ— is a Theorem: We need to prove that 𝑄((¬𝑏)) holds. Induction hypothesis: Assume that 𝑄(𝑏) holds. Case 1: πœ’ is (¬𝑏) , where 𝑏 is well-formed. Induction step: holds. Base case: πœ’ is a propositional symbol π‘Ÿ . Prove that 𝑄(π‘Ÿ) Proof by structural induction: For every well-formed formula πœ’ , 𝑄(πœ’) holds. 12 / 25

  13. Review questions about the structural induction template 2. To prove a property of well-formed formulas using structural induction, how many base cases and inductive cases are there in the proof? 3. In the base case, how do we prove the theorem? Does the proof rely on any additional assumption about the formula? 4. In an inductive case, how do we prove the theorem? Does the proof rely on any additional assumption about the formula? CS 245 Logic and Computation Fall 2019 Alice Gao 13 / 25 1. Why is the defjnition of a well-formed formula recursive?

  14. Structural induction problems Problem 1: Every well-formed formula has at least one propositional variable. Problem 2: Every well-formed formula has an equal number of opening and closing brackets. Problem 3: Every proper prefjx of a well-formed formula has more opening brackets than closing brackets. CS 245 Logic and Computation Fall 2019 Alice Gao 14 / 25

  15. Outline Learning goals Propositional language Structure of formulas Inductively defjned sets Revisiting the learning goals CS 245 Logic and Computation Fall 2019 Alice Gao 15 / 25

  16. Structural induction for other problems Structural induction is an important concept and it does not only apply to well-formed propositional formulas. Let’s look at some structural induction examples. CS 245 Logic and Computation Fall 2019 Alice Gao 16 / 25

  17. Ways of defjning a set the set. Example: the set of even integers. CS 245 Logic and Computation Fall 2019 Alice Gao 17 / 25 β–Ά List all the elements in the set. Example: 𝐡 = {1, 2, 3, 4} . β–Ά Characterize the set by some property of all the elements in β–Ά Defjne a set inductively.

  18. Inductively defjned sets An inductively defjnition of a set consists of three components: CS 245 Logic and Computation Fall 2019 Alice Gao 18 / 25 β–Ά A domain set π‘Œ β–Ά A core set 𝐷 β–Ά A set of operations 𝑄

  19. Closed and minimal set A set Y is closed under a set of operations P ifg applying any operation in P to elements in Y will always give us back an element in Y. CS 245 Logic and Computation Fall 2019 Alice Gao 19 / 25 A set Y is a minimal set with respect to a property R if β–Ά Y has property R, and β–Ά For every set Z that has property R, 𝑍 βŠ† π‘Ž .

  20. Defjning a set inductively Given a domain set π‘Œ , a core set 𝐷 and a set of operations 𝑄 , 𝐽(π‘Œ, 𝐷, 𝑄) is the minimal subset of π‘Œ that CS 245 Logic and Computation Fall 2019 Alice Gao 20 / 25 β–Ά contains 𝐷 , and β–Ά is closed under 𝑄 .

  21. Example 1: Inductively defjned sets Consider the domain set, the core set, and the set of operations defjned below. CQ: What set does this defjne? (A) The set of natural numbers {0, 1, 2, ...} . (B) The set of even natural numbers {0, 2, ...} . (C) The set of integers {..., βˆ’2, βˆ’1, 0, 1, 2, ...} . (D) The set of even integers {..., βˆ’2, 0, 2, ...} . (E) The set of real numbers. CS 245 Logic and Computation Fall 2019 Alice Gao 21 / 25 β–Ά The domain set X = ℝ (the set of real numbers) β–Ά The core set C = {0} . β–Ά The set of operations P = {𝑔(𝑦) = 𝑦 + 1}

  22. Example 2: Inductively defjned sets (B) The set of even natural numbers {0, 2, ...} . Alice Gao Fall 2019 CS 245 Logic and Computation (E) The set of real numbers. (D) The set of even integers {..., βˆ’2, 0, 2, ...} . (C) The set of integers {..., βˆ’2, βˆ’1, 0, 1, 2, ...} . (A) The set of natural numbers {0, 1, 2, ...} . Consider the domain set, the core set, and the set of operations CQ: What set does this defjne? {𝑔1(𝑦, 𝑧) = 𝑦 + 𝑧, 𝑔2(𝑦, 𝑧) = 𝑦 βˆ’ 𝑧} defjned below. 22 / 25 β–Ά The domain set X = ℝ (the set of real numbers) β–Ά The core set C = {0, 2} . β–Ά The set of operations P =

  23. Well-formed propositional formulas Defjne the set of well-formed propositional formulas inductively. where βˆ— is one of ∧, ∨, β†’, ↔ . CS 245 Logic and Computation Fall 2019 Alice Gao 23 / 25 β–Ά π‘Œ = the set of fjnite sequences of symbols in 𝑀 π‘ž . β–Ά 𝐷 = the set of propositional variables. β–Ά 𝑄 = {𝑔 1 (𝑦) = (¬𝑦), 𝑔 2 (𝑦, 𝑧) = (𝑦 βˆ— 𝑧)}

  24. Structural induction on 𝐽(π‘Œ, 𝐷, 𝑄) Claim: Every element of the set 𝐽(π‘Œ, 𝐷, 𝑄) has the property 𝑆 . Proof: set 𝐷 . 𝑆(𝑔(𝑧 1 , ..., 𝑧 𝑙 )) holds. CS 245 Logic and Computation Fall 2019 Alice Gao 24 / 25 β–Ά Base case: Prove that 𝑆 holds for every element in the core β–Ά Inductive case: Prove that for every operation 𝑔 ∈ 𝑄 of arity 𝑙 and any 𝑧 1 , ..., 𝑧 𝑙 ∈ 𝐽(π‘Œ, 𝐷, 𝑄) such that 𝑆(𝑧 1 ), ..., 𝑆(𝑧 𝑙 ) ,

  25. Revisiting the learning goals By the end of the lecture, you should be able to structural induction. structural induction. CS 245 Logic and Computation Fall 2019 Alice Gao 25 / 25 β–Ά Prove properties of well-formed propositional formulas using β–Ά Prove properties of a recursively defjned concept using

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend