Docsity

Introduction to Propositional Logic: Statements and Connectives - Prof. Margaret M. Fleck, Study notes of Discrete Structures and Graph Theory

Toggle sidebar
bg1
Propositional Logic
Margaret M. Fleck
25 August 2008
This lecture introduces propositional logic. It closely follows section 1.1
of Rosen, through about p. 12. (We don’t cover bitwise operations.)
1 Announcements
A reasonable set of office hours are now posted (show web page). These
should get us through the next week or two and will be adjusted as needed.
There have been a couple drops, so if anyone is trying to get into the class
and failed, try the computer system again.
If you have disabilities or other special circumstances (e.g. live out of
town, small kids) please tell us, either now or when it looks like it might be
impacting your class experience. We can usually do things to help.
Reminder to get yourself onto the class newsgroup.
2 A bit about style
Writing mathematics requires two things. You need to get the logical flow
of ideas correct. And you also need to express yourself in standard style.
Mathematical style is best taught by example and is similar to what happens
in English classes.
Mathematical writing uses a combination of equations and parts that
look superficially like English. Mathematical English is almost like normal
English, but differs in some crucial ways. You are probably familiar with the
fact that physicists use terms like “force” differently from everyone else. Or
the fact that people from England think that “paraffin” is a liquid whereas
1
pf3
pf4
pf5

Partial preview of the text

Download Introduction to Propositional Logic: Statements and Connectives - Prof. Margaret M. Fleck and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

Propositional Logic

Margaret M. Fleck

25 August 2008

This lecture introduces propositional logic. It closely follows section 1. of Rosen, through about p. 12. (We don’t cover bitwise operations.)

1 Announcements

A reasonable set of office hours are now posted (show web page). These should get us through the next week or two and will be adjusted as needed. There have been a couple drops, so if anyone is trying to get into the class and failed, try the computer system again. If you have disabilities or other special circumstances (e.g. live out of town, small kids) please tell us, either now or when it looks like it might be impacting your class experience. We can usually do things to help. Reminder to get yourself onto the class newsgroup.

2 A bit about style

Writing mathematics requires two things. You need to get the logical flow of ideas correct. And you also need to express yourself in standard style. Mathematical style is best taught by example and is similar to what happens in English classes. Mathematical writing uses a combination of equations and parts that look superficially like English. Mathematical English is almost like normal English, but differs in some crucial ways. You are probably familiar with the fact that physicists use terms like “force” differently from everyone else. Or the fact that people from England think that “paraffin” is a liquid whereas

that word refers to a solid substance in the US. We will try to highlight the places where mathematical English isn’t like normal English. You will also learn how to make the right choice between an equation and an equivalent piece of mathematical English. For example, ∧ is a shorthand symbol for “and.” The shorthand equations are used when we want to look at a complex structure all at once, e.g. discuss the logical structure of a proof. When writing the proof itself, it’s usually better to use the longer English equivalents, because the result is easier to read. There is no hard-and-fast line here, but we’ll help make sure you don’t go too far in either direction.

3 Propositions

Two systems of logic are commonly used in mathematics: propositional logic and predicate logic. We’ll start by covering propositional logic. A proposition is a statement which is true or false (but never both!). For example, “Urbana is in Illinois” or 2 ≤ 15. It can’t be a question. It also can’t contain variables, e.g. x ≤ 9 isn’t a proposition. The lack of variables prevents propositional logic from being useful for very much, though it has some applications in circuit analysis, databases, and artificial intelligence. Predicate logic is an upgrade that adds variables. We will mostly be using predicate logic in this course. We just use propositional logic to get started.

4 Complex propositions

Statements can be joined together to make more complex statements. For example, “Urbana is in Illinois and Margaret was born in Wisconsin.” To talk about complex sequences of statements without making everything too long, we represent each simple statement by a variable. E.g. if p is “Urbana is in Illinois” and q is “Margaret was born in”, then the whole long statement would be “p and q”. Or, using shorthand notation p ∧ q. The statement p ∧ q is true when both p and q are true. We can express this with a “truth table”:

The shorthand for this conditional is p → q and its truth table is p q p → q T T T T F F F T T F F T For example, “If Bush is president, then Bush lives in the White House” is true. But “if Bush is president, then 2 > 4 is false. All the examples tend to be a bit artificial, because we don’t have variables yet. The easiest way to remember the right output values for this operation is to remember that the value is false in exactly one case: when p is true and q is false. Notice that propositional logic is timeless. Mathematical proofs normally discuss a world that is static. It has a cast of characters (e.g. variables, sets, functions) with a fixed set of properties, and we are just reasoning about what those properties are. Only very occasionally do we talk about taking an object and modifying it. Normal English requires that conditional sentences have some sort of causal connection between the two propositions, and there is frequently also a flow of time involved. E.g. “If Helen learns to write C++, she will get a good job.” But it would seem odd if we said “If Urbana is in Illinois, then Margaret was born in Wisconsin.” because there’s no reason why one follows from the other. In mathematical English, this statement is just fine: there doesn’t have to be any causal connection. In normal English, we tend not to use conditionals in which the “if” part is false. E.g. “If Bush was never president, then Urbana is in Illinois.” In mathematical English, such statements occur more often. And, worse, they are always considered true, no matter whether the “then” part is true or false. For example, this statement is true: “If Bush was never president, then 2 > 4.” In computer programming, we often see things that look like conditional statements, e.g. “if x > 0, then increment y”. But these are commands for the computer to do something, changing its little world. whereas the similar-looking mathematical statements are timeless.

6 Converse, contrapositive, biconditional

The converse of p → q is q → p. The two statements are not equivalent. To see this, compare the previous truth table with this one: p q q → p T T T T F T F T F F F T The converse mostly occurs in two contexts. First, getting the direction of implication backwards is a common bug in writing proofs. That is, using the converse rather than the original statement. Second, the phrase “p implies q, and conversely” means that p and q are true under exactly the same conditions. The shorthand for this is the biconditional operator p ↔ q. The contrapositive of p → q is formed by swapping the roles of p and q and negating both of them to get ¬q → ¬p. The contrapositive is equivalent to the original statement. Here’s a truth table showing why: p q ¬p ¬q ¬q → ¬p T T F F T T F F T F F T T F T F F T T T To figure out the last column of the table, recall that ¬q → ¬p will be false in only one case: when the if part (¬q) is true and the consequent (¬p) is false.

7 Precedence rules

When you try to read a complex set of propositions all glued together with connectives, there are conventions about which parts to group together first. In particular, you apply the “not” operators first, then the “and” and “or”. Then you take the results and do the implication operations. Use parentheses if you intend the reader to group things differently. This is basically similar to the rules in (say) high-school algebra. Look at the examples in Rosen. Rosen points out that there are conventions about applying “and” before “or.” However, in math it is traditional to use parentheses rather than relying