Top Banner
Copyright © 2007 - 2015 Curt Hill Quantifiers
39

Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Jan 04, 2016

Download

Documents

Amice Preston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Quantifiers

Page 2: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Introduction

• What we have seen is called propositional logic

• It includes axioms and theorems concerning the operators of Boolean Algebra

• It lacks something• We want to strengthen this

into first order logic– AKA predicate calculus

Page 3: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Statement Categories• In mathematics, there are

three types of statements:– True– False– Open

• True statements are usually characterized by:– Statements with only constants

and a comparison such as = or > – A statement of fact – A tautology

Page 4: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

True Statements

• 5=2+3• 5>2• The United States won its

independence from England• They may include variables in

limited ways:– x+5 = 5+x pq pq q

Page 5: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

False statement

• False statements have a similar form but are false

• 5=4• 2>5• The United States won its

independence from Germany• They may also include variables:

– x (y z) x y x z– x = x + 1

Page 6: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Open statements• Open standards generally

cannot have a true or false value until a variable is given a value

• Almost all equations are open, the task of solving is finding a set of values that makes the statement true or determining that the set is empty

• 5x = 10 is neither true nor false• It is true if x = 2 and false

otherwise

Page 7: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Discussion

• Logic is two valued, we cannot allow true, false, and maybe

• Therefore, we have to find a way to make a statement that is open into one that is true or false

• One means of doing this is quantifiers

Page 8: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Predicates• Up to this point we have mostly dealt

with variables and operators• We may also use predicates• Predicate is a fancy name for a function

that returns a boolean value• It may have one or more arguments• The argument does not have to be a

boolean variable• This is not startling since any boolean

variable could hold the result of a predicate

Copyright © 2007 - 2015 Curt Hill

Page 9: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

An Example

• Let P(x) be the statement x>8• P(x) is still open• We may determine the truth value

of:– P(12)– P(2)

• If the predicate is arbitrary single letter names are sufficient

• We may have others as wellCopyright © 2007 - 2015 Curt Hill

Page 10: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Predicate Notation

• As always there are multiple ways to represent the same thing

• I prefer:predicate(parameter1, parameter2)– This matches programming notation

• Others use single letter predicates with subscript indicating parameter:Gx

• Thus P(x,y) or Px,y

Copyright © 2007 - 2015 Curt Hill

Page 11: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Open Statements

• In a real sense we have skirted the Open statement problem

• P(x) is just as open as x>0• Now we get back to the topic• We next need quantifiers to say

something useful about the possible values

Copyright © 2007 - 2015 Curt Hill

Page 12: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Quantifiers via familiar example

• You are probably familiar with summation notation– It gives us a compact way to

express an infinite sum or even a large finite sum

• This gives us a convenient way to denote the sum of a finite or infinite number of terms

• We also have a similar notation of products

Page 13: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Summation and Product

0

)12()1(4n

n n

n

i

in1

!

Page 14: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Generalization• This can be extended into

quantifiers with the following notation: (OP i:r:t)– This is not the only notation for

quantifiers

• OP is an operator which is symmetric, associative, and binary

•How many do we have?

• i is a list of dummies– Often just one but sometimes more

• r is the range• t is the term

Page 15: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Range• The range is a Boolean

expression that states the values that the dummies may assume– This corresponds to the summation

n

• A range of True indicates that the dummies may take on any or all values

• A range of False is an empty range

Page 16: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Term• The term corresponds to the

expression to the right of the summation

• It is evaluated for each acceptable dummy value

• These results are connected by the operator that starts the quantifier

• The term has the same type as the operator– This may be a Boolean or

arithmetic operator

Page 17: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Summation Example

• The summation example above would then become: = 4(+i : i i≥0 : (-1)i (2i+1))– + is the binary, symmetric,

associative operator– i is the dummy is the set of integers

• An alternative is: = 4(Σi : i i≥0 : (-1)i (2i+1))

Page 18: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Product Example

• The product example would then be:n! = (i : i 1 ≤ i ≤ n : i)– i is a dummy– n is a bound variable from

outside the quantifier

• An alternative is: n! = (Πi : i 1 ≤ i ≤ n : i)

Page 19: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Others• We can apply this notation to any

binary, symmetric, and associative operation such as– AND– OR– Equivalence– MAX– MIN

• MAX and MIN are the rare arithmetic functions that are idempotent

• They also have a unit and zero

Page 20: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Alternative notations• Two of these have their own

special symbols• And

– Pronounced For All – The universal quantifier

• Or – Pronounced There Exists – The existential quantifier

Page 21: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Open Questions Again• We now have a way to reduce an

open question into a true false proposition

• The open question:3x + 5 = 5x - 11

• Becomes( x : x : 3x + 5 = 5x - 11)

• This statement may be true only if a solution exists or false otherwise– No longer open

Copyright © 2007 - 2015 Curt Hill

Page 22: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Predicates• Up to this point we have mostly dealt

with variables and operators• We may also use predicates• Predicate is a fancy name for a

function that returns a boolean value• It may have one or more arguments• The argument does not have to be a

boolean variable• This is not startling since any

boolean variable could hold the result of a predicate

Page 23: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Predicate Examples

• prime(n)– The argument n is prime or not

• student(p)– A person p is a student or not

• odd(n) or even(n)• Predicate names generally are

single word• This word should indicate the

purpose

Page 24: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Predicate Notation

• As always there are multiple ways to represent the same thing

• I prefer:predicate(parameter)

• Others use single letter predicates with subscript indicating parameter:Gx

• Thus P(x) or Px

Copyright © 2007 - 2015 Curt Hill

Page 25: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

More on quantifiers

• Quantifiers allow us to state things that are not directly expressible with just predicates, variables and the operators

• In practice this should allow us to state almost any real world fact or supposition

• A predicate may be defined in terms of a quantifier

Page 26: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Variables• There are two types of variables in

a quantified expression: bound and free

• A bound variable is part of the quantifier– It ranges over some set of values as

part of quantification– These are often known as dummies

• A free variable exists outside the quantified expression

Page 27: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Variable Example• Consider:

n! = (Πi : i 1 ≤ i ≤ n : i)• The variable i is a bound variable• It may only have a certain set of

values determined by the quantifier

• The variable n is free– It may take on any value– Although in this expression we

intend it only to be a positive integer

– This indicates our expression is not as good as we would like

Page 28: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Variable Scope

• The scope of a variable is that part of the expression where it is known

• In any quantified expression the bound variables have a scope contained by the parentheses

• This occasionally gets messy when a quantified expression contains another quantified expression

Page 29: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Scope Expression

• ( i:i : pred1(i)(k:k : pred2(i,k)))

• There are two bound variables• i is known in entire range• k is known only in second quantifier• Both may be used in the second

quantifier• This may cause a problem if they

use the same names

Page 30: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Resulting Types

• A quantifier produces the same type of result as its operator

• Boolean operators produce booleans

• Numeric operators produce numbers

• We may nest quantified expressions in other quantified expressions

Page 31: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Alternate Notation• Most textbooks use a looser notation• This usually omits the range or

incorporates it in the term• The form is something like this:

p (pp)– This is a statement of reflexivity of

equivalence– Somewhat more parallel to summation

• There is no specific mention that p must be boolean– This is just understood

• Quantifiers with a numeric dummy usually assume integer or real and hope it is obvious

Page 32: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Naming• Logicians seldom have to consider

large real world problems• Thus they tend to use single letter

predicates to keep the notation easy• This is an area where we want to

describe these, so many variables or predicates may exist

• More descriptive names are then needed

• This also explains using parenthesis for arguments

Copyright © 2007 - 2015 Curt Hill

Page 33: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

A Formula• A formula may be defined

inductively• A formula is:

– Any proposition or predicate– If F is a formula then F is a formula– If F and G are formulas then F G

is a formula•Also any of our other connectives

– If F is a formula then (x: … :F) and ( x: … :F) are also formulas

Page 34: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Another Definition: Sentence• A sentence is a formula with no

free variables• Like a proposition, a sentence does

not have to be true, but it will be true or false– It may be our job to prove it true or

false

• Recall Gödel’s statement that there exists a sentence which is both true and unprovable under any system– That uses this definition of sentence

Page 35: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Example Sentences• For each of the following:

– Is it true?– What does it mean?

• 3<6• 2+4<5• (x:x: (y:yR:x<y))• (x:x: (y:yR:x<y))• (i:i : (j:j :i=j2))• (i:i : ( j:j :j=i2))

Page 36: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Some quantifier examples

• Some apples are rotten– (a:a Apples: rotten(a))

• All women are beautiful– (w : w Females: beautiful(w))

• Some integers are positive• All squares are rectangles• Not all rectangles are squares• Prime numbers exist in the

integers

Page 37: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Prime Definition• Can we define a prime number?• prime(n) =

(i : i i > 1 i ≠ n : 0 ≠ n-floor(ni)*i )

• floor truncates a real number to an integer

• i is a dummy variable that can range over all integers greater than 1 and not equal to n

Page 38: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Prime Definition Again• This time with nested quantifiers• prime(n) =

(i : i 1 < i < n : (j:jI: j=ni ))

• Negation of an existential gives a universal so:

• prime(n) =(i : i 1 < i < n : (j:jI: jni ))

Page 39: Copyright © 2007 - 2015 Curt Hill Quantifiers. Copyright © 2007 - 2015 Curt Hill Introduction What we have seen is called propositional logic It includes.

Copyright © 2007 - 2015 Curt Hill

Summary

• What was open before (that is not possible to assign to truth value to) is now closed– We may not always know the truth

value– We do know that one exists

• We should now be able to state in a concise form any proposition

• Another presentation gives some rules for manipulating quantifiers