<<

looking back on propositional

I propositional statements are built from atomic propositions, using propositional connectives I propositional formulas are built from boolean variables, using propositional functions (“connectives”) I key notion: valid inference I α1, α2, . . . , αn |= β I equivalently: the formula (α1 ∧ α2 ∧ · · · ∧ αn) −→ β is a tautology I several methods of checking whether an inference is valid (a formula is a tautology, resp. satisfiable, unsatisfiable).

Tibor Beke predicate logic what’s missing:

I Can we formalize the language of the sciences and higher mathematics (e.g. calculus, analysis, abstract algebra, combinatorics, geometry, number theory)? I We’ve been using truth tables, divide-and-conquer, boolean polynomials, Venn diagrams. But can we formalize proofs the way they occur in mathematics?

Tibor Beke predicate logic where we’re going

I Introduce a much richer version of logic, called predicate logic (also “first order predicate logic” or just “first order logic”). I Introduce a formalism of proofs. Think of a symbolic proof as a game with formulas, somewhat similar to “rearranging equations”. Proofs play the same role for first order logic as truth tables or boolean polynomials do for propositional logic.

Tibor Beke predicate logic first order statements: examples

“Every positive number has a square root.”

“There are some people who like people who don’t like them.”

“Every natural number can be written as the sum of four squares.”

Tibor Beke predicate logic first order logic: new features

I Every positive number has a square root. I There are some people who like people who don’t like them. I Every natural number can be written as the sum of four squares of natural numbers. From the viewpoint of propositional logic, the above statements are ‘atomic’. (They don’t contain any propositional connective such as and, or, not, if-then.) From the viewpoint of first order logic, these statements can be broken into smaller parts. quantifier relation (binary predicate) unary predicate function symbol

Tibor Beke predicate logic domain of discourse

I Every positive number has a square root. I There are some people who like people who don’t like them. I Every natural number can be written as the sum of four squares of natural numbers.

Each of these statements refers to a collection of entities: I in the first sentence, ‘number’ must mean ‘real number’ I in the second sentence, some unspecified group of people I in the third sentence, the N of natural numbers. The collection the sentence refers to is said to be its or domain of discourse. A first order sentence cannot be interpreted without knowing it. Logical formulas will have variables ranging over the domain.

Tibor Beke predicate logic predicates and relations

Once the domain of discourse is fixed (say: the real numbers; the set of 2×2 matrices; the set of people living in the US), one can start to talk about properties of objects: • A unary predicate takes as argument a single element of the domain, and returns True or False. Examples: ‘positive’; ‘diagonalizable’; ‘female’. • A binary predicate is a relation: takes an ordered pair of elements, and returns True or False. Examples: ‘x < y’; ‘the matrices A and B commute’; ‘person X likes person Y ’. • There could also be predicates (relation symbols) with more than two arguments.

Tibor Beke predicate logic functions and constants

• There can be functions defined on the domain. Examples: multiplication, addition (of numbers resp. matrices). ‘Mother of’ could be considered as a function from the set of (all) people to the set of (all) people.

• There can be constants (specific, named elements) in the domain. Examples: 0, 1, π, e, Barack Obama.

Tibor Beke predicate logic connectives and quantifiers

Relations between elements of the domain are linked using I propositional connectives ∧ ∨ −→ q O ←→ ↑ ↓ I and quantifiers I ∀ “(for) every” “(for) each” “all” (the universal quantifier) I ∃ “(for) some” “there exists” (the existential quantifier).

Tibor Beke predicate logic “ For every x > 0 there exists a y such that x = y 2.”

“ For every x, if x > 0, then there exists a y such that x = y 2.”

“ ∀xx > 0 −→ ∃y(x = y 2) ”

from language to logic

The domain of discourse is the set of real numbers.

“ Every positive number has a square root. ”

Tibor Beke predicate logic “ For every x, if x > 0, then there exists a y such that x = y 2.”

“ ∀xx > 0 −→ ∃y(x = y 2) ”

from language to logic

The domain of discourse is the set of real numbers.

“ Every positive number has a square root. ”

“ For every x > 0 there exists a y such that x = y 2.”

Tibor Beke predicate logic “ ∀xx > 0 −→ ∃y(x = y 2) ”

from language to logic

The domain of discourse is the set of real numbers.

“ Every positive number has a square root. ”

“ For every x > 0 there exists a y such that x = y 2.”

“ For every x, if x > 0, then there exists a y such that x = y 2.”

Tibor Beke predicate logic from language to logic

The domain of discourse is the set of real numbers.

“ Every positive number has a square root. ”

“ For every x > 0 there exists a y such that x = y 2.”

“ For every x, if x > 0, then there exists a y such that x = y 2.”

“ ∀xx > 0 −→ ∃y(x = y 2) ”

Tibor Beke predicate logic fully formalized in first order predicate logic!

∀xx>0−→∃y(x=y 2)

I universal quantifier I existential quantifier I variables I binary predicates I function symbol I constant symbol I propositional connective.

Tibor Beke predicate logic ∀x(x < 0 ∨ x = 0 ∨ x > 0)

“ Any positive number has two distinct square roots. ”

  ∀x x > 0 −→ ∃r∃sx = r 2 ∧ x = s2 ∧ r 6= s

r 6= s is just a typographical variant of q(r = s): “ it is not the case that r = s ”.

from language to logic

“ A number is negative, or zero, or positive. ”

Tibor Beke predicate logic “ Any positive number has two distinct square roots. ”

  ∀x x > 0 −→ ∃r∃sx = r 2 ∧ x = s2 ∧ r 6= s

r 6= s is just a typographical variant of q(r = s): “ it is not the case that r = s ”.

from language to logic

“ A number is negative, or zero, or positive. ”

∀x(x < 0 ∨ x = 0 ∨ x > 0)

Tibor Beke predicate logic   ∀x x > 0 −→ ∃r∃sx = r 2 ∧ x = s2 ∧ r 6= s

r 6= s is just a typographical variant of q(r = s): “ it is not the case that r = s ”.

from language to logic

“ A number is negative, or zero, or positive. ”

∀x(x < 0 ∨ x = 0 ∨ x > 0)

“ Any positive number has two distinct square roots. ”

Tibor Beke predicate logic from language to logic

“ A number is negative, or zero, or positive. ”

∀x(x < 0 ∨ x = 0 ∨ x > 0)

“ Any positive number has two distinct square roots. ”

  ∀x x > 0 −→ ∃r∃sx = r 2 ∧ x = s2 ∧ r 6= s

r 6= s is just a typographical variant of q(r = s): “ it is not the case that r = s ”.

Tibor Beke predicate logic 2  ∀x x < 0 ←→ q ∃r(x = r ) could also be phrased

∀xx < 0 ←→ ∀r(x 6= r 2)

from language to logic

“ A number is negative if and only if it has no square roots. ”

Tibor Beke predicate logic could also be phrased

∀xx < 0 ←→ ∀r(x 6= r 2)

from language to logic

“ A number is negative if and only if it has no square roots. ”

2  ∀x x < 0 ←→ q ∃r(x = r )

Tibor Beke predicate logic ∀xx < 0 ←→ ∀r(x 6= r 2)

from language to logic

“ A number is negative if and only if it has no square roots. ”

2  ∀x x < 0 ←→ q ∃r(x = r ) could also be phrased

Tibor Beke predicate logic from language to logic

“ A number is negative if and only if it has no square roots. ”

2  ∀x x < 0 ←→ q ∃r(x = r ) could also be phrased

∀xx < 0 ←→ ∀r(x 6= r 2)

Tibor Beke predicate logic first order statements: examples

∀xx < 0 ←→ ∀rx 6= r 2)

I So far, we have written these formulas instinctively. There are rules about the interaction of ∀ and ∃ with the variables and parentheses, called the syntax of first-order logic. (Soon!) I First order logic only uses the quantifiers ∀ (“for every”) and ∃ (“there exists”). Expressing concepts like most, infinitely 1 many, with probability at least 2 , is sometimes possible in specific contexts. Higher order logic (not treated in this course) deals with these so-called ‘generalized quantifiers’. I The main concepts of propositional logic — inference, tautology, satisfiability — can all be extended to the context of first order logic, and many new ideas come up too. (Soon!)

Tibor Beke predicate logic first order statements outside mathematics

Let the domain of discourse be human beings. Variables x, y, z,... will range over people.

Let F (x) mean “x is female” and let M(x) mean “x is male”.

F (−) and M(−) are examples of predicates (unary predicates, since they take one argument).

Let P(x, y) mean “x is a parent of y”. P(−, −) is a binary predicate, i.e. two-place relation symbol.

Tibor Beke predicate logic “For every person y, there is an x who’s a parent of y, and is female” that is, “Everyone has a mother”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z)

“There’s a man x out there who’s got children y and z”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z) ∧ y 6= z

“There’s a man out there who’s got (at least) two children”

first order statements outside mathematics

F (x): x is female M(x): x is male P(x, y): x is a parent of y

∀y∃xP(x, y) ∧ F (x)

Tibor Beke predicate logic ∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z)

“There’s a man x out there who’s got children y and z”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z) ∧ y 6= z

“There’s a man out there who’s got (at least) two children”

first order statements outside mathematics

F (x): x is female M(x): x is male P(x, y): x is a parent of y

∀y∃xP(x, y) ∧ F (x)

“For every person y, there is an x who’s a parent of y, and is female” that is, “Everyone has a mother”

Tibor Beke predicate logic “There’s a man x out there who’s got children y and z”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z) ∧ y 6= z

“There’s a man out there who’s got (at least) two children”

first order statements outside mathematics

F (x): x is female M(x): x is male P(x, y): x is a parent of y

∀y∃xP(x, y) ∧ F (x)

“For every person y, there is an x who’s a parent of y, and is female” that is, “Everyone has a mother”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z)

Tibor Beke predicate logic ∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z) ∧ y 6= z

“There’s a man out there who’s got (at least) two children”

first order statements outside mathematics

F (x): x is female M(x): x is male P(x, y): x is a parent of y

∀y∃xP(x, y) ∧ F (x)

“For every person y, there is an x who’s a parent of y, and is female” that is, “Everyone has a mother”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z)

“There’s a man x out there who’s got children y and z”

Tibor Beke predicate logic first order statements outside mathematics

F (x): x is female M(x): x is male P(x, y): x is a parent of y

∀y∃xP(x, y) ∧ F (x)

“For every person y, there is an x who’s a parent of y, and is female” that is, “Everyone has a mother”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z)

“There’s a man x out there who’s got children y and z”

∃x∃y∃zM(x) ∧ P(x, y) ∧ P(x, z) ∧ y 6= z

“There’s a man out there who’s got (at least) two children”

Tibor Beke predicate logic references

I Your textbook, pages 180 – 205. Note: the textbook only mentions the universal quantifier ∀. I The first edition of your textbook (currently out of print) has a nice description of first order logic, posted on the course website. In that text, the notation (x) is used for ∀x, the universal quantifier.

Tibor Beke predicate logic Homework Problem 17

See the course web page for a brain teaser written by Lewis Carroll, logician and author of Alice in Wonderland.

(a) What is the domain of discourse of this brain teaser? That is to say, what is the set or collection it is about? (b) What are the predicates or properties involved? List them and introduce your own notation for them. You can use P(−), Q(−) etc or your own favorite letters. (c) Take a look at the clues numbered (1) through (5). Translate those clues into formulas of first order logic. Do not worry about the rest of the clues, and do not worry about solving the puzzle (just yet!). Due Tue, Oct 30, in class.

Tibor Beke predicate logic Homework Problem 18

Consider the sentence

There are some people who like people who don’t like them.

Formalize this sentence in first order predicate logic. You need to say what your domain of discourse and predicates are. If you think the sentence cannot be so formalized, or can be understood and formalized in different ways, explain why.

Due Tue, Oct 30, in class.

Tibor Beke predicate logic