Section 8.1 Equality A first-order theory is first-order predicate calculus applied to the formalization of some subject (i.e., decide on some axioms.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

1 Section 6.3 Formal Reasoning A formal proof (or derivation) is a sequence of wffs, where each wff is either a premise or the result of applying a proof.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Axiomatic systems and Incidence Geometry
Elementary Number Theory and Methods of Proof
1 Chapter Equivalence, Order, and Inductive Proof.
1 Chapter Facts about Functions. 2 Section 2.1 Functions: Definitions and Examples A function ƒ from A to B associates each element of A with exactly.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
For Friday, read chapter 6, section 2. As nongraded HW, do the problems on p Graded Homework #7 is due on Friday at the beginning of class.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
Copyright © Cengage Learning. All rights reserved.
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
1.3 – AXIOMS FOR THE REAL NUMBERS. Goals  SWBAT apply basic properties of real numbers  SWBAT simplify algebraic expressions.
1 Section 2.3 Properties of Functions Let ƒ : A  B be a function. There are three properties that ƒ might possess. Injective (also called one-to-one):
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Introduction to Proofs
1 Chapter Facts about Functions. 2 Section 2.3 Properties of Functions Let ƒ : A → B be a function. There are three properties that ƒ might possess.
Homework Review notes Complete Worksheet #1. Homework Let A = {a,b,c,d}, B = {a,b,c,d,e}, C = {a,d}, D = {b, c} Describe any subset relationships. 1.
Proofs1 Advanced Discrete Mathematics Jim Skon. Proofs2  Definition: A theorem is a valid logical assertion which can be proved using other theorems.
1 Section 7.2 Equivalent Formulas Two wffs A and B are equivalent, written A  B, if they have the same truth value for every interpretation. Property:
1 Section 2.1 Functions: Definitions and Examples A function ƒ from A to B associates each element of A with exactly one element of B. Write ƒ : A  B.
Functions1 Elementary Discrete Mathematics Jim Skon.
1 Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine. It is.
1 Section 12.3 Context-Free Parsing We know (via a theorem) that the context-free languages are exactly those languages that are accepted by PDAs. When.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
1 Section 8.3 Higher-Order Logic A logic is higher-order if it allows predicate names or function names to be quantified or to be arguments of a predicate.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
1 Section 4.2 Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST).
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
1 Outline Quantifiers and predicates Translation of English sentences Predicate formulas with single variable Predicate formulas involving multiple variables.
1 Section 8.2 Program Correctness (for imperative programs) A theory of program correctness needs wffs, axioms, and inference rules. Wffs (called Hoare.
1 Chapter Construction Techniques. 2 Section 3.1 Inductively Defined Sets To define a set S inductively is to do three things: Basis: Specify one.
1 Section 7.3 Formal Proofs in Predicate Calculus All proof rules for propositional calculus extend to predicate calculus. Example. … k.  x p(x) P k+1.
EXAMPLE 3 Write an indirect proof Write an indirect proof that an odd number is not divisible by 4. GIVEN : x is an odd number. PROVE : x is not divisible.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Section 2.2 Day 1. A) Algebraic Properties of Equality Let a, b, and c be real numbers: 1) Addition Property – If a = b, then a + c = b + c Use them 2)
Chapter 1 Logic and Proof.
Unit 2: Deductive Reasoning
Introduction to Logic for Artificial Intelligence Lecture 2
Reasoning in Algebra and Geometry
Direct Proof and Counterexample III: Divisibility
(State) Model-Based Approaches I Software Specification Lecture 35
Chapter 3 The Real Numbers.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Advanced Algorithms Analysis and Design
Chapter 3 The Real Numbers.
Chapter 3 The Real Numbers.
The Foundations: Logic and Proofs
Math 344 Winter 07 Group Theory Part 1: Basic definitions and Theorems
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Lesson 5 Relations, mappings, countable and uncountable sets
Systems Architecture I
Principles of proof calculi Natural deduction
A Brief Summary for Exam 1
First Order Logic Rosen Lecture 3: Sept 11, 12.
Copyright © Cengage Learning. All rights reserved.
Lesson 5 Relations, mappings, countable and uncountable sets
CS21 Decidability and Tractability
MA/CSSE 474 More Math Review Theory of Computation
DO NOW.
Computer Security: Art and Science, 2nd Edition
CSNB234 ARTIFICIAL INTELLIGENCE
Advanced Analysis of Algorithms
CS201: Data Structures and Discrete Mathematics I
Program correctness Axiomatic semantics
Appendix A: Numbers, Inequalities, and Absolute values
Presentation transcript:

Section 8.1 Equality A first-order theory is first-order predicate calculus applied to the formalization of some subject (i.e., decide on some axioms to define basic properties of the objects). How can we describe the idea of equality of expressions in a first-order theory? One way to start is to say the following wff is valid: x (x = x). The = symbol is just the infix form of an equality predicate. e.g., we could pick a predicate, say e, and let e(x, y) mean x equals y. To reason with equality we need some properties. Properties of Equality. The following properties hold for all terms t, u, and v. Equality Axiom (EA) t = t. Symmetric (t = u)  (u = t). Transitive (t = u)  (u = v)  (t = v). Equals for Equals (EE) (t = u)  ƒ(…, t, …) = ƒ(…, u, …). Extended Equals for Equals (EE) (t = u)  W(t) W(u), where t and u are free to replace x in W(x), W(t) is obtained from W(x) by replacing one or more free occurrences of x by t and W(u) is obtained from W(x) by replacing one or more free occurrences of x that were used to obtain W(t) by u. Example/Quiz (Arrays). Prove x ((a[x] = s)  (x = b[t]))  (a[b[t]] = s). Proof: 1. x ((a[x] = s)  (x = b[t])) P 2. (a[c] = s)  (c = b[t]) 1, EI 3. (c = b[t])  (a[c] = s) 2, T 4. (c = b[t])  (a[c] = s)  (a[b[t]] = s) EE, where W(c) is (a[c] = s) 5. a[b[t]] = s 3, 4, MP QED 1–5, CP.

Example/Quiz (Arrays). Prove the following wff is valid. (a[b[k]] = a[j])  x ((x = b[k])  (a[x] = a[j])). 1. a[b[k]] = a[j] P 2. x ((x ≠ b[k])  (a[x] ≠ a[j])) P [for IP], T 3. (b[k] ≠ b[k])  (a[b[k]] ≠ a[j])) 2, UI 4. b[k] ≠ b[k] 1, 3, DS 5. b[k] = b[k] EA 6. False 4, 5, Contr 7. x ((x = b[k])  (a[x] = a[j])) 2–6, IP QED 1, 7, CP. Example (odd and even). Let odd(x) = y (x = 2y + 1) and even(x) = y (x = 2y). Prove that x (odd(x)  even(x + 1)). 1. odd(x) P [for odd(x)  even(x + 1)] 2. y (x = 2y + 1) 1, T 3. x = 2c + 1 2, EI 4. (x = 2c + 1)  (x + 1 = 2c + 1 + 1) EE, where ƒ(t) = t + 1 and t = x + 1 5. x + 1 = 2c + 1 + 1 3, 4, MP 6. x + 1 = 2(c + 1 ) 5, T 7. y (x + 1= 2y) 6, EG, where t = c + 1 8. even(x + 1) 7, T 9. odd(x)  even(x + 1) 1–8, CP 10. x (odd(x)  even(x + 1)) 9, UG QED.

Quiz (On your own time). Give an IP proof of x (odd(x)  even(x + 1)) where the P for IP should be the negation of the entire wff. Example/Quiz. Recall that a fixed point for a function ƒ is an element x such that ƒ(x) = x. Formalize the sentence, “ƒ has a unique fixed point.” Answer: x ((ƒ(x) = x)  y (ƒ(y) = y)  (y = x)). Quiz. Prove that the preceding wff is invalid. Answer: For a countermodel, let the domain be {a, b} and let ƒ(x) = x for x  {a, b}. Example. Prove informally that if ƒ º g has a fixed point, then g º ƒ has a fixed point. Proof: Assume ƒ º g has a fixed point x. Then ƒ(g(x)) = x. Apply g to both sides to get g(ƒ(g(x)) = g(x). So g(x) is a fixed point of g º ƒ. QED. Quiz. Formalize the sentence, “If ƒ º g has a fixed point, then g º ƒ has a fixed point.” Answer: x (ƒ(g(x)) = x)  y (g(ƒ(y)) = y). Quiz. Give a direct (CP) formal proof of x (ƒ(g(x)) = x)  y (g(ƒ(y)) = y). Proof: 1. x (ƒ(g(x)) = x) P 2. ƒ(g(c)) = c 1, EI 3. (ƒ(g(c)) = c)  g(ƒ(g(c)) = g(c) EE, where t = ƒ(g(c)) 4. g(ƒ(g(c)) = g(c) 2, 3, MP 5. y (g(ƒ(y)) = y) 4, EG, where t = g(c) QED 1–5, CP. Quiz (On your own time). Give an IP proof of x (ƒ(g(x)) = x)  y (g(ƒ(y)) = y).

Example. Give a formal proof of the following formalization of “if ƒ and g are surjective, then ƒ º g is surjective.” x y (ƒ(y) = x)  x y (g(y) = x)  x y (ƒ(g(y)) = x). Proof: 1. x y (ƒ(y) = x) P 2. x y (g(y) = x) P 3. ƒ(c) = x 1, UI, EI 4. g(d) = c 2, UI, EI 5. ƒ(g(d)) = x 4, 3, EE: u = t  W(t)  W(u) 6. y (ƒ(g(y)) = x) 5, EG 7. Line1  line 2  y (ƒ(g(y)) = x) 1– 6, CP 8. x (Line1  line 2  y (ƒ(g(y)) = x) 7, UG: OK, since line 7 is CP 9. Wff to be proved 8, T: x (C  A(x))  (C  x A(x))) QED. Example/Quiz. Give a direct (CP) formal proof of the following formalization of “if ƒ and g are injective, then ƒ º g is injective.” x y (ƒ(x) = ƒ(y)  x = y)  x y (g(x) = g(y)  x = y)  x y (ƒ(g(x)) = ƒ(g(y))  x = y) Proof: 1. x y (ƒ(x) = ƒ(y)  x = y) P 2. x y (g(x) = g(y)  x = y) P 3. ƒ(g(x)) = ƒ(g(y)  g(x) = g(y) 1, UI, UI 4. g(x) = g(y)  x = y 2, UI, UI 5. ƒ(g(x)) = ƒ(g(y))  x = y 3, 4, HS 6. x y (ƒ(g(x)) = ƒ(g(y))  x = y) 5, UG, UG QED 1– 6, CP.

Quiz (On your own time). Give formal indirect proofs (IP) of the two statements on the previous slide. Example/Quiz. Show that the following wff is invalid. x (ƒ(ƒ(x)) = t)  x ( (x = ƒ(a))  (ƒ(x) = t)). Solution: Let I be the interpretation with domain D = {0, 1}, t = 0, a = 1, and ƒ(x) = x. Then the wff becomes x (x = 0)  x ((x = 1)  (x = 0)), which is false. So I is a countermodel for the wff. Example/Quiz. Show that the following wff is valid. x (ƒ(ƒ(x)) = t)  x y ((y = ƒ(x))  (ƒ(y) = t)). Proof: 1. x (ƒ(ƒ(x)) = t) P 2. x y ((y ≠ ƒ(x))  (ƒ(y) ≠ t)) P [for IP], T 3. ƒ(ƒ(x)) = t 1, UI 4. y ((y ≠ ƒ(x))  (ƒ(y) ≠ t)) 2, UI 5. (ƒ(x) ≠ ƒ(x))  (ƒ(ƒ(x)) ≠ t) 4, UI 6. ƒ(x) ≠ ƒ(x) 3, 5, DS 7. ƒ(x) = ƒ(x) EA 8. False 6, 7, Contr 9. x y ((y = ƒ(x))  (ƒ(y) = t) 2–8, IP QED 1, 9, CP.