MATH20302 Propositional Logic. Mike Prest School of Mathematics Alan Turing Building Room

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "MATH20302 Propositional Logic. Mike Prest School of Mathematics Alan Turing Building Room"

Transcription

1 MATH20302 Propositional Logic Mike Prest School of Mathematics Alan Turing Building Room April 10, 2015

2 Contents I Propositional Logic 3 1 Propositional languages Propositional terms Valuations Beth trees Normal forms Adequate sets of connectives Interpolation Deductive systems A Hilbert-style system for propositional logic Soundness Completeness A natural deduction system for propositional logic II Predicate Logic 32 3 A brief introduction to predicate logic: languages and structures Predicate languages The basic language Enriching the language L-structures Some basic examples Definable Sets If you come across any typos or errors, here or in the examples/solutions, please let me know of them. 1

3 Introduction: The domain of logic By logic I mean either propositional logic (the logic of combining statements) or first-order predicate logic (a logic which can be used for constructing statements). This course is mostly about the former; we will, however, spend some time on predicate logic in the later part of the course. In any case, propositional logic is a part of predicate logic so we must begin with it. Predicate Logic is dealt with thoroughly in the 3rd/4th-year course by that title; other natural follow-on courses from this one are Model Theory and Non-Standard Logics. Propositional logic can be seen as expressing the most basic laws of thought which are used not just in mathematics but also in everyday discourse. Predicate logic, which can also be thought of as the logic of quantifiers, is strong enough to express essentially all formal mathematical argument. Most of the examples that we will use are taken from mathematics but we do use natural language examples to illustrate some of the basic ideas. The natural language examples will be rather bare, reflecting the fact that these formal languages can capture only a small part of the meanings and nuances of ordinary language. There are logics which capture more of natural language (modality, uncertainty, etc.) though these have had little impact within mathematics itself (as opposed to within philosophy and computer science), because predicate logic is already enough for expressing the results of mathematical thinking. 1 1 One should be clear on the distinction between the formal expression of mathematics (which is as precise and as formal as one wishes it to be) and the process of mathematical thinking and informal communication of mathematics (which uses mental imagery and all the usual devices of human communication). 2

4 Part I Propositional Logic 3

5 Chapter 1 Propositional languages 1.1 Propositional terms Propositional logic is the logic of combining already formed statements. It begins with careful and completely unambiguous descriptions of how to use the propositional connectives which are and, or, not, implies. But first we should be clear on what is meant by a statement (the words assertion and proposition will be used interchangably with statement ). The distinguishing feature of a statement is that it is either true or false. The moon is made of cheese is a (false) statement and = 2 is a (true, essentially by definition) statement. Fortunately, in order to deal with the logic of statements, we do not need to know whether a given statement is true or false: it might not be immediately obvious whether = is true or false but certainly it is a statement. A more interesting example is There are infinitely many prime pairs. where by a prime pair we mean a pair, p, p + 2, of numbers, two apart, where both are prime (for instance 3 and 5 form a prime pair, as do 17 and 19 but not 19 and 21). It is a remarkable fact that, to date, no-one has been able to determine whether this statement is true or false. Yet it is surely 1 either false (after some large enough number there are no more prime pairs) or true (given any prime pair there is always a larger prime pair somewhere out there). On the other hand, the following are not statements. Is 7 a prime number? Add 1 and 1. The first is a question, the second a command. What about x is a prime number. : is this a statement? The answer is, It depends. : if the context is such that x already has been given a value then it will be a statement (since then either x is a prime number or it is not) but otherwise, if no value (or other sufficient information) has been assigned to x then it is not a statement. Here s a silly example (where we can t tell whether something is a statement or not). Set x = 7 if there are infinitely many prime pairs but leave the value of 1 There are some issues there but they are more philosophical than mathematical. 4

6 x unassigned if there are not. Is x is a prime number a statement? Answer: (to date) we can t tell! But this example is silly (the context we have set up is highly artifical) and quite off the path of what we will be doing. When we discuss mathematical properties of, for instance, numbers, we use variables, x, y to stand for these numbers. This allows us to make general assertions. So we can say for all integers x, y we have x + y = y + x instead of listing all the examples of this assertion:..., = 1 + 0, = 1 + 1,..., = 5 + 2,... (not that we could list all the assertions covered by this general assertion, since there are infinitely many of them). In the same way, although we will use particular statements as examples, most of the time we use variables p, q, r, s, t to stand for statements in order that we may make general assertions. 2 As indicated already, propositional logic is the logic of and, or, not, implies (as well as iff and other combinations of the connectives). The words in quotes are propositional connectives: they operate on propositions (and propositional variables) to give new propositions. Initially we define these connectives somewhat informally in order to emphasise their intuitive meaning. Then we give their exact definition after we have been more precise about the context and have introduced the idea of (truth) valuation. First, notation: we write for and ; for or, for not, for implies and for iff. So if p is the proposition the moon is made of cheese and q is the proposition mice like cheese then p q, p q, p, p q, p q respectively may be read as the moon is made of cheese and mice like cheese, the moon is made of cheese or mice like cheese, the moon is not made of cheese, if the moon is made of cheese then mice like cheese and the moon is made of cheese iff mice like cheese. A crucial observation is that the truth value (true or false) of a statement obtained by using these connectives only depends on the truth values of the component propositions. Check through the examples given to see if you agree (you might have some doubts about the last two examples: we could discuss these). For another example, you may not know whether or not the following are true statements: the third homology group of the torus is trivial, every artinian unital ring is noetherian but you know that the combined statement the third homology group of the torus is trivial and every artinian unital ring is noetherian is true exactly if each of the separate statements is true. That is why it makes sense to apply these propositional connectives to propositional variables as well as to propositions. So now the formal definition. We start with a collection, p, q, r, p 0, p 1,... of symbols which we call propositional variables. Then we define, by induction, the propositional terms by the following clauses: 2 You might notice that in this paragraph I assigned different uses to the words assertion and statement (although earlier I said that I would use these interchangably). This is because I was making statements about statements. That can be confusing, so I used assertion for the first (more general, meta, higher ) type of use and statement for the second type of use. In logic we make statements about statements (and even statements about statements which are themselves statements about statements...). 5

7 (0) every propositional variable is a propositional term; (i) if s and t are propositional terms then so are: s t, s t, s, s t, s t; (ii) that s it (more formally, there are no propositional terms other than those which are so by virtue of the first two clauses). The terms seen in (i) are respectively called the conjunction (s t), disjunction (s t), of s and t, s is the negation of s, s t is an implication and s t a biimplication. Remark: Following the usual convention in mathematics we will use symbols such as p, q, respectively s, t, not just for individual propositional variables, respectively propositional terms, but also as variables ranging over propositional variables, resp. propositional terms, (as we did just above). The definition above is an inductive one, with (0) being the base case and (i) the inductions step(s) but it s a more complicated inductive structure than that which uses the natural numbers as indexing structure. For there are many base cases (any propositional variable), not just one (0 in ordinary induction) and there are (as given) five types of inductive step, not just one ( add 1 in ordinary induction). Example Start with propositional variables p, q, r; these are propositional terms by clause (0) and then, by clause (i), so are p p, p q, q, q p for instance. Then, by clause (i) again, (p p) p, (p q) r, (q p) (q p) are further propositional terms. Further applications of clause (i) allow us to build up more and more complicated propositional terms. So you can see that these little clauses have large consequences. The last clause (ii) simply says that every propositional term has to be built up in this way. Notice how we have to use parentheses to write propositional terms. This is just like the use in arithmetic and algebra: without parentheses the expression ( 3 + 5) 4 would read and the latter is ambiguous. At least, it would be if we had not become used to the hierarchy of arithmetical symbols by which binds more closely than and, and those bind more closely than + and. Of course parentheses are still needed but such a hierarchy reduces the number needed and leads to easier readability. A similar hierarchy is used for propositional terms, by which binds more closely than and, which bind more closely than and (at least those are my conventions, but they are not universal). Therefore p q r means (( p) q) r rather than (p q) r or ( p) (q r) or (p (q r)) (at least it does to me; if in doubt, put in more parentheses). You will recall that in order to prove results about things which are defined by induction (on the natural numbers) it is often necessary to use proof by induction. The same is true here: one deals with the base case (propositional variables) then the inductive steps. In this case there are five different types of inductive step but we ll see later than some of the propositional connectives can be defined in terms of the others. For instance using and (or using and ) we can define all the others. Having made that observation, we then need only prove the inductive steps for and (or for and ). Proofs of assertions about propositional terms which follow their inductive construction are often called proofs by induction on complexity (of terms). If we wish to be more precise about the set of propositional variables that we 6

8 are using then we will let L ( L for language ) denote the set of propositional variables. We also introduce notation for the set of propositional terms built up from these, namely, set S 0 L = L and, having inductively (on n) defined the set S n L we define S n+1 L to be the set of all propositional terms which may be built from S n L using a single propositional connective and, so as to make this process cumulative, we also include S n L in S n+1 L. More formally: S n+1 L = S n L {(s t), (s t), ( s), (s t), (s t) : s, t S n L}. We also set SL = n 0 S nl to be the union of all these - the set of all propositional terms (sometime called sentences, hence the S in SL ) which can be built up from the chosen base set, L = S 0 L, of propositional variables. 3 Notice that we place parentheses around all the propositional terms we build; we discussed already that leaving these out could give rise to ambiguity in reading them: was s t u - a term in S 2 L - built up by applying to s, t u S 1 L or by applying to s t, u S 1 L, that is, should it be read as s (t u) or as (s t) u? In practice we can omit some pairs of parentheses without losing unique readability but, formally, those pairs are there. In fact, although intuitively it might at first seem obvious that if we look at a propositional term in SL, then we can figure out how it was constructed - that is, there is a unique way of reading it - a bit more thought reveals that there is an issue: how do we detect the last connective in its construction? Clearly, if we can do that then we can proceed inductively to reconstruct its construction tree. We have been precise in setting things up so we should be able to prove unique readability (if it is true - which it is, as we show now). Theorem Let s SL be any propositional term. Then exactly one of the following is the case: (a) s is a propositional variable; (b) s has the form (t u) for some t, u SL; (c) s has the form (t u) for some t, u SL; (d) s has the form ( t) for some t SL; (e) s has the form (t u) for some t, u SL; (f) s has the form (t u) for some t, u SL. Proof. Every propositional term s does have at least one of the listed forms: because s SL it must be that s S n L for some n and then, just by the definitions of S 0 L and S n+1 L, s does have such a form. We have to show that it has a unique such form. For this we introduce two lemmas and the following definitions: if s SL then by l(s) we denote the number of left parentheses, (, occurring in s and by r(s) we denote the number of right parentheses, ), occurring in s (for purposes of this definition we count all the parentheses that should be there). Lemma For every propositional term s we have l(s) = r(s). Proof. This is an example of a proof by induction on complexity/construction of terms. 3 A word about notation: I will tend to use p, q, r for propositional variables, s, t, u for propositional terms (which might or might not be propositional variables) and v for valuations (see later). That rather squeezes that part of the alphabet so I will sometimes use other parts and/or the Greek alphabet for propositional variables and terms. 7

9 If s S 0 L then l(s) = 0 = r(s) so the result is true if s S 0 L. For the induction step, suppose that for every s S n L we have l(s) = r(s). Let s S n+1 L; then either there is t S n L such that s = ( t) or there are t, u S n L such that s = (t u) or (t u) or (t u) or (t u). Since t, u S n L, we have l(t) = r(t) and l(u) = r(u) by the inductive assumption. In the first case, s = ( t), it follows that l(s) = 1+l(t) = 1+r(t) = r(s), as required. In the second case, s = (t u), we have, on counting parentheses, l(s) = 1 + l(t) + l(u) and r(s) = r(t) + r(u) + 1, and so l(s) = r(s), as required. The other three cases are similar and so we see that in all cases, l(s) = r(s). Thus the inductive step is proved and so is the lemma. Digression on proof by induction on complexity. At the start of the proof of above I said that the proof would be by induction on complexity of terms but you might have felt that the proof was shaped as a proof by induction on the natural numbers N = {0, 1, 2,... }. That s true; we used the sets S n L to structure the proof, and the proof by induction on complexity of terms was reflected in the various subcases that were considered when going from S n L to S n+1 L. But the proof could have been given without reference to the sets S n L. The argument - the various subcases - would be essentially the same; the hitherto missing ingredient is the statement of the appropriate Principle of Induction. Recall that, for N that takes the form Given a statement P (n), depending on n N, if P (0) is true and if from P (n) we can prove P (n + 1), then P (n) is true for every n N. 4 The corresponding statement for our construction tree for propositional terms is: Given a statement P (s), depending on s SL, if P (p) is true for every propositional variable p and if, whenever P (s) and P (t) are true so are P (s t), P (s t), P ( s), P (s t) and P (s t), then P (s) is true for every s SL. Before the next lemma, notice that every propositional term can be thought of simply as a string of symbols which, individually, are either: propositional variables (p, q etc.), connectives (,,,, ), or parentheses (left, right). Then the statement that s, as a string, is, for instance, xyz will mean that x, y, z are strings and, if we place them next to each other in the given order, then we get s. For instance if s is (s (t u)) then we could write s as xyz where x, y, z are the strings x =, y = (s, z = (t u)); we could even write s = xyzw with x, y, z as before and w the empty string (which we allow). We define the length, lng(x), of any string x to be the number of occurrences of symbols in it. We extend the notations l(x) and r(x) to count the numbers of left parentheses, right parentheses in any string x. If the string x has the form yz then we say that y is a left subword of x, a proper subword if z ; similarly z is a right subword of x, proper if y is not the empty string. (We will use the terms string and word interchangably.) Proposition For every propositional term s, either s is a propositional variable or there is just one way of writing s in either of the forms s = ( t) for some propositional term t or s = (t u) for some propositional terms t, u where is one of the binary propositional connectives. Proof. We can suppose that s is not a propositional variable. Note that if s has the form ( t) then the leftmost symbols of s are (, whereas if s has the 4 I follow the convention that 0 is a natural number; not followed by everyone but standard in mathematical logic. 8

10 form (t u) then its leftmost symbols are (( or (p where p is a propositional variable, so we can treat these two cases entirely separately. In the first case, s = ( t), this is the only possible way of writing it in this form because t is determined by s. Therefore, since, as we observed above, it cannot be written in the form (t u), there is no other way of writing s as a propositional term. In the second case, we argue by contradiction and suppose that we can write s = (t u) = (t u ) where t, u, t, u are propositional terms and, are propositional connectives and, for the contradiction, that these are not identical ways of writing s, hence that either t is a proper left subword of t or t is a proper left subword of t. A contradiction will follow immediately once we have proved the following lemma. Lemma If s is a propositional term and if s is a proper left subword of s then either s = or l(s ) r(s ) > 0; in particular s is not a propositional term. Similarly, if s is a proper right subword of s then either s = or r(s ) l(s ) > 0, and s is not a propositional term. Proof. We know that s has the form ( t) or (t u). In the first case, s has one of the forms, ( or ( t where t is a left subword (possibly empty) of t. By induction on lengths of propositional terms we can assume that t = or l(t ) r(t ) 0 ( > if t is a proper left subword of t, = by in the case t = t) and so, in each case, it follows that l(s ) r(s ) > 0. In the second case, s has one of the forms, (, (t where t is a left subword of t, (t u where u is a left subword of u. Again by induction on lengths of propositional terms we can assume that l(t ) r(t ) 0 and l(u ) r(u ) 0; checking each case, it follows that l(s ) r(s ) > 0. By we deduce that s is not a propositional term. Similarly for the assertion about right subwords. 1.2 Valuations Now for the key idea of a (truth) valuation. Fix some set L = S 0 L of propositional variables, and hence the corresponding set SL of propositional terms. A valuation on the set of propositional terms is a function v : SL {T, F} to the 2-element set 5 {T, F} which satisfies the following conditions. 6 For all propositional terms s, t we have v(s t) = T iff v(s) = T and v(t) = T; v(s t) = T iff v(s) = T or v(t) = T; v( s) = T iff v(s) = F; v(s t) = T iff v(s) = F or v(t) = T; v(s t) = T iff the values of v(s) and v(t) are the same: v(s) = v(t). 5 really, the two-element boolean algebra 6 Of course, T represents true and F false. Often the 2-element set {1, 0} is used instead, normally with 1 representing true and 0 representing false. 9

11 There s quite a lot to say about this definition. We start with a key point. Namely, because all propositional terms are built up from the propositional variables using the propositional connectives, any valuation is completely determined by its values on the propositional variables (this, see 1.2.1((b) below, is the formal statement of the point we made (the crucial observation ) when discussing mice, cheese and homology groups). For instance if v(p) = v(q) = T and v(r) = F then we have, since v is a valuation, v(p r) = T and hence v( (p r)) = F. Similarly, for any propositional term, t, built from p, q and r, the value v(t) is determined by the above choices of v(p), v(q), v(r). That does actually need proof. There is the, rather obvious and easily proved by induction, point that this process works (in the sense that it gives a value), but there s also the more subtle point that if there were more than one way of building up a propositional term then, conceivably, one construction route might lead to the valuation T and the other to F. But we have seen already in that this does not, in fact, happen: every propositional term has a unique construction tree. Therefore if v 0 is an function from the set, S 0 L, of propositional variables to the set {F, T} then this extends to a unique valuation v on SL. In particular, if there are n propositional variables there will be 2 n valuations on the propositional terms built from them. We state this formally. Proposition Let L be a set of propositional variables. (a) If v 0 : L {F, T} is any function then there is a valuation v : SL {F, T} on propositional terms in L such that v(p) = v 0 (p) for every p L. (b) If v and w are valuations on SL and if v(p) = w(p) for all p L then v = w (so the valuation in part (a) is unique). (c) If t is a propositional term and if v and w are valuations which agree on all propositional variables occurring in t then v(t) = w(t). The proof of part (c), which is a slight strengthening of (b), is left as an exercise. In order to prove it we could prove the following statement first (by induction on complexity of terms): if L L are sets of propositional variables then for every n, SL n S n L; furthermore, if v is a valuation on SL and v is a valuation on SL such that v(p) = v (p) for every p L then v(t) = v (t) for every t SL. From that, part (c) follows easily (take L to be the set of propositional terms actually occurring in t). (You might have noticed that I didn t actually define what I mean by a propositional variable occurring in a propositional term; I hope the meaning is clear but it is easy to give a definition by, what else, induction on complexity of terms.) Truth tables are tables showing evaluation of valuations on propositional terms. They can also be used to show the effect of the propositional connectives on truth values. Note that or is used in the inclusive sense ( one or the other or both ) rather than the exclusive sense ( one or the other but not both ). p q p q T T T T F F F T F F F F p q p q T T T T F T F T T F F F 10

12 p q p q T T T T F F F T T F F T p p T F F T p q p q T T T T F F F T F F F T You might feel that the truth table for does not capture what you consider to be the meaning of implies but, if we are to regard it as a function on truth values (whatever the material connection or lack thereof between its input propositions) then the definition given is surely the right one. Or just regard p q as an abbreviation for p q (not-p) or q, since they have the same truth tables. The following example might make the reading of p q as meaning p q reasonable: let p be n = 1 and let q be (n 1)(n 2) = 0, so p q reads n = 1 implies (n 1)(n 2) = 0 or If n = 1 then (n 1)(n 2) = 0 and then consider setting n = 1, 2, 3,... in turn and think about the truth values of p, q and p q. You will have seen examples of truth tables in the first year Sets, Numbers and Functions course. Recall that they can be used to determine whether a propositional term t is a tautology, meaning that v(t) = T for every valuation v. The opposite notion is: if v(t) = F for every valuation v; then we say that t is unsatisfiable (also called a contradiction though that s not good terminology to use when we ll be drawing the distinction between syntax and semantics). Notice that the use of truth tables implicitly assumes part (c) of We say that two propositional terms, s and t, are logically equivalent, and write s t, if v(s) = v(t) for every valuation v. It is equivalent to say that s t is a tautology. Let s prove that. Suppose s t so, if v is any valuation, then v(s) = v(t) so, from the definition of valuation, v(s t) = T. This is so for every valuation so, by the definition of tautology, s t is a tautology. For the converse, suppose that s t is a tautology and let v be any valuation. Then v(s t) = T and so (again, by the definition of valuation) v(s) = v(t). Thus, by definition of equivalence, s and t are logically equivalent. We see that the proof was just an easy exercise from the definitions. Now for the semantic notion of entailment; we contrast semantics ( meaning or, at least, notions of being true and false) with syntax (construction and manipulation of strings of symbols). If S is a set of propositional terms and t is a propositional term then we write S = t if for every valuation v with v(s) = T, by which we mean v(s) = T for every s S, we have v(t) = T: whenever S is true so is t. Extending the above notions we say that a set S of propositional terms is tautologous if v(s) = T for every valuation v and S is unsatisfiable if for every valuation v there is some s S with v(s) = F - in other words, if no valuation makes all the terms in S true. We also say that S is satisfiable if there is at least one valuation v with v(s) = T. So note: tautologous means every valuation makes all terms in S true; satisfiable means that some valuation makes all terms in S true; unsatisfiable means that no valuation makes all terms in S true. Lemma Let S be a set of propositional terms and let t, t, u be proposi- 11

13 tional terms. (a) S = t iff S { t} is unsatisfiable (b) S {t} = u iff S = t u (c) S {t, t } = u iff S {t t } = u Proof. These are all simple consequences of the definitions. Before we begin, we introduce a standard and slightly shorter notation: instead of writing S {t 1,..., t k } = u we write S, t 1,..., t k = u. (a) S { t} is unsatisfiable iff for all valuations v, we have v(s) = F for some s S or v( t) = F iff for all valuations v, if v(s) = T for all s S then v( t) = F iff for all valuations v, if v(s) = T for all s S then v(t) = T iff S = t. (b) S {t} = u iff for every valuation v, if v(s) = T for all s S and v(t) = T then v(u) = T iff for every valuation v with v(s) = T for all s S then, if v(t) = T then v(u) = T iff for every valuation v with v(s) = T for all s S then v(t u) = T (by the truth table for ) iff S = t u. (c) S {t t } = u iff for every valuation v with v(s) = T for all s S and v(t t ) = T we have v(u) = T iff (by the truth table for ) for every valuation v with v(s) = T for all s S and v(t) = T and v(t ) = T, we have v(u) = T iff S {t, t } = u. We can use truth tables to determine whether or not S = u (assuming S is a finite (and, in practice, not very large) set) but this can take a long time: if there are n propositional variables appearing then we need to compute a truth table with 2 n rows. The next section describes a method which sometimes is more efficient. 1.3 Beth trees Beth trees provide a method, often more efficient than and perhaps more interesting than, truth tables, of testing whether a collection of propositional terms is satisfiable or not (and, if it is satisfiable, of giving a valuation demonstrating this). Note that this includes testing whether a propositional term is a tautology, whether one term implies another, whether S = t, et cetera. The input to the method consists of two sets S, T of propositional terms; to distinguish between these we will write the typical input as S T. The output will, if we carry the method to its conclusion (which for some purposes will be more than we need to do), be all valuations with v(s) = T and v(t ) = F. So if the output is nonempty then we know that S { t : t T } is satisfiable. For instance, t is a tautology if the output from the pair {t} is empty (which often will be easier than checking whether the output of {t} is all valuations). The actual computation has the form of a tree (as usual in mathematics, trees grow downwards) and, at each node of the tree, there will be a pair of the 12

14 form S T. A node (of a fully or partially-computed Beth tree) is terminal if it has no node beneath it. A node is a leaf if all the propositional terms at it are propositional variables. Directly underneath each non-terminal node is either a branch segment with another node at its end, or two branch segments with a node at the end of each. A key feature of the tree is that if a node lies under another then the lower one contains fewer propositional connectives. That means that if the initial data contains k propositional connectives then no branch can contain more than k+1 nodes. And that means that the computation of the tree will terminate. Before we describe how to compute such trees here, in order to anchor ideas, is an example. Example We determine whether or not p, (p q) r = r (q p). We will build a tree beginning with the input p, (p q) r r (q p) since there will be a valuation satisfying this condition exactly if p, (p q) r = r (q p) does not hold. p, (p q) r r (q p) (p q) r p, r (q p) r, (p q) r p, q p r, q, (p q) r p, p q, (p q) r r, p q r, p, p q q, r r, p q q, r, p q r, p The property ( ) below implies that a valuation v satisfies the input conditions (making both p and (p q) r true but making r (q p) false) iff it satisfies at least one of the leaves. But we can see immediately that the only leaf satisfied by any valuation is q r, p, which is satisfied by the valuation v with v(q) = T, v(r) = F, v(p) = F. So there is a valuation making both p and (p q) r true but making r (q p) false. That is r (q p) does not follow from p and (p q) r. We will list the allowable rules for generating the nodes directly under a given node. To make sense of these, we first explain the idea. The property that we want is the following: ( ) If, at any stage of the construction of the tree with initial node S T, the currently terminal nodes are S 1 T 1,...,S k T k then, for every valuation v, we have v(s) = T and v(t ) = F iff v(s i ) = T and v(t i ) = F for some i. 13

15 For this section, when I write v(t ) = F I mean v(t) = F for every t T. This is a convenient, but bad (because easily misinterpreted), notation. In order for this property to hold it is enough to have the following two: ( 1 ) if a node S T is immediately followed by a single node S 1 T 1 then, for every valuation v we have v(s ) = T and v(t ) = F iff v(s 1 ) = T and v(t 1 ) = F; ( 2 ) if a node S T is immediately followed by the nodes S 1 T 1 and S 2 T 2 then, for every valuation v we have: v(s ) = T and v(t ) = F iff [v(s 1 ) = T and v(t 1 ) = F] or [v(s 2 ) = T and v(t 2 ) = F]. (The fact that these are enough can be proved by an inductive argument.) In the pair S T you can think of the left hand side as the positive statements and those on the right as the negative ones. Each rule involves either moving one term between the positive and negative sides (with appropriate change to the term) or splitting one pair into two. Here are the allowable rules. S, t T S, t, T S t, T S, t T S, s t T S, s, t T S, s t, T S s, T S t, T S, s t T S, s T S, t T S s t, T S s, t, T S, s t T S s, T S, t T S s t, T S, s t, T In lectures we will explain a few of these but you should think through why each one is valid (that is, satisfies ( 1 ) or ( 2 ), as appropriate). You should also note that they cover all the cases - together they allow a single pair to be input and will output a tree where every terminal node is a leaf. When constructing a Beth tree there may well be some nodes where there is a choice as to which rule to apply but no choice of applicable rule is wrong (though some choices might lead to a shorter computation). Example We use Beth trees to show that p q p is a tautology. We already suggested that it might be easier to do the equivalent thing of showing that (p q p) is unsatisfiable; here s the computation for that. 14

16 p q p p q p p, q p - and clearly no valuation can make both p, q true but make p false; we conclude that p q p is a tautology. For comparison here is the direct check that p q p is a tautology. p q p p q p p q Now note that every valuation satisfies the condition expressed by at least one of the leaves, so p q p is indeed a tautology. 1.4 Normal forms First, we look at some more basic properties of logical equivalence where, recall, two propositional terms s, t are said to be logically equivalent, s t, if v(s) = v(t) for every valuation v (and by 1.2.1(c) it is enough to check for valuations on just the propositional variables actually occurring in s or t). Lemma If s, t are propositional terms then: (i) s t iff (ii) s = t and t = s iff (iii) = s t iff (iv) s t is a tautology. Proof. All this is immediate from the definitions. For instance, to prove (iv) (i) let v be any valuation; then, assuming (iv), v(s t) = T and by definition of valuation, we see this can happen only if v(s) = v(t), as required. Note that this is an equivalence relation on SL; that is, it is reflexive (s s), symmetric (s t implies t s) and transitive (s t and t u together imply s u). Here are some, easily checked, basic logical equivalences. For any propositional terms s, t, u: s t t s; s t t s; (s t) s t; (s t) s t; s s; 15

17 s t s t; (s t) u s (t u), so we can write s t u without ambiguity; (s t) u s (t u), so we can write s t u without ambiguity; (s t) u (s u) (t u); (s t) u (s u) (t u); s s s; s s s. Proposition Suppose that s s and t t are propositional terms. Then: (i) s s ; (ii) s t s t ; (iii) s t s t ; (iv) s t s t. Proof. To prove (ii): suppose v(s t) = T. Then by the truth table for, both v(s) = T and v(t) = T; so v(s ) = T and v(t ) = T and hence v(s t ) = T. The other parts are equally easy. We introduce notations for multiple conjunctions and disjunctions; they are completely analogous to the use of for repeated +. Given propositional terms s 1,..., s n we define n i=1 s i by induction: 1 i=1 = s 1, k+1 i=1 s i = k i=1 s i s k+1. Similarly we define n i=1 s i. Because of associativity and commutativity of, respectively of, if we permute the terms in such a repeated conjunction or disjunction, then we obtain an equivalent propositional term. Indeed, we have the following (the proofs of which are left as exercises). Proposition If s 1,..., s n are propositional terms and v is a valuation then: (i) v( n i=1 s i) = T iff v(s i ) = T for all i = 1,..., n; (ii) v( n (iii) n i=1 s i) = T iff v(s i ) = T for some i {1,..., n}; i=1 s i n i=1 s i; (iv) n i=1 s i n i=1 s i; Proposition Suppose that s 1,..., s n and t 1,..., t m are sequences of propositional terms such that {s 1,..., s n } = {t 1,..., t m } (thus the sequences differ only in the order of their terms and possible repetitions). Then n i=1 s i = m j=1 t j and n i=1 s i = m j=1 t j. If S = {s 1,..., s n } is a finite set of propositional terms then we write S for n i=1 s i and S for n i=1 s i. What if S =? Since, roughly, the more conjuncts there are in S the harder it is to be true, it makes some sense to define to be any tautology (i.e. always true). Dually we define to be any unsatisfiable term (so false under every valuation). (Because we are only interested in the truth values of and it doesn t matter which tautology and which contradiction are chosen.) A little more terminology: given a set L of propositional variables, we refer to any propositional variable p, or any negation, p, of a propositional variable as a literal. We are going to show that every propositional term is equivalent to one which is in a special form (indeed, there are two special forms: disjunctive and conjunctive). 16

18 A propositional term is in disjunctive normal form if it has the form n i=1 mi j=1 g ij where each g ij is a literal. Proposition (Disjunctive Normal Form Theorem) If t SL then there is a propositional term s SL which is in disjunctive normal form and such that s t. If {p 1,..., p k } are the propositional variables appearing in t then we may suppose that s has the form n i=1 n 2 k. mi j=1 g ij with each m i k and with Proof. Let v 1,..., v n be the distinct valuations v on {p { 1,..., p k } such that pj if v v(t) = T. For each i = 1,..., n and j = 1,..., k, set g ij = i (p j ) = T p j if v i (p j ) = F. Note that v i ( k j=1 g ij) = T and that if v v i is any other valuation on {p 1,..., p k } then v ( k j=1 g ij) = F. It follows that if w is any valuation on {p 1,..., p k } then w( n k i=1 j=1 g ij) = T iff w is one of v 1,..., v n. Therefore for any valuation v, v( n k i=1 j=1 g ij) = v(t), so t and n mi i=1 j=1 g ij are logically equivalent, as required. For the final statement, note that there are 2 k distinct valuations on {p 1,..., p k }. The proof shows how to go about actually constructing an equivalent propositional term in disjunctive normal form, using either truth tables or, the proof slightly modified, Beth trees. Example Consider the propositional term t = (p q) ( p r). If we construct its truth table then we find 7 rows/valuations on {p, q, r} which make it true. For each of these we form the corresponding g ij. For instance, the valuation v 1 (p) = v 1 (q) = v 1 (r) = T is one of those making t true and the corresponding term is p q r. Another row where t is true is that where p is true and q and r are false, so the corresponding term is p q r. Et cetera, giving the disjunctive normal form term (p q r) (p q r) (p q r) ( p q r) ( p q r) ( p q r) ( p q r) equivalent to t. Normal forms are, however, not unique and you might note that, for example, the last four disjuncts can be replaced by the logically equivalent term p. From this point of view, Beth trees are more efficient, as we can illustrate with this example. If we construct a Beth tree starting with p q p r then very quickly we reach the single leaf p, q r, which corresponds to the single valuation making (p q) ( p r) false. That corresponds to the term p q r, so t is equivalent to the negation of this, namely (p q r), which is equivalent to p q r - a much simpler disjunctive normal form. You might instead construct a Beth tree starting from (p q) ( p r). Taking an obvious sequence of steps leads to a completed tree with the leaves p, q and r. These correspond to the (conjunctions of) literals: p, q, r respectively. Therefore this also leads to the form p q r. The dual form is as follows: A propositional term is in conjunctive normal form if it has the form n mi i=1 j=1 g ij where each g ij is a literal. 17

19 Proposition If t SL then there is a propositional term s SL which is in conjunctive normal form and such that s t. If {p 1,..., p k } are the propositional variables appearing in s then we may suppose that s has the form n mi i=1 j=1 g ij with each m i k and with n 2 k. Proof. The term t is logically equivalent to t and, by 1.4.5, t is equivalent to some term of the form n mi i=1 j=1 g ij. So t is equivalent to n mi i=1 j=1 g ij which, using DeMorgan s laws (the third and fourth on the list of identities after 1.4.1), is in turn equivalent to n mi i=1 j=1 g ij. Since each g ij is a literal (at least once we cancel double negations), the result follows. 1.5 Adequate sets of connectives The proof of actually shows that every truth table on a set, p 1,..., p k, of propositional variables can be generated from them by using the propositional connectives,,. More precisely, every propositional term t in p 1,..., p k defines a function, evaluation-at-t, from the set Val p1,...,p k of valuations v on p 1,..., p k, to {T, F}. Conversely, given any function e : Val p1,...,p k {T, F}, one may construct, using, and, a propositional term t such that e is just evaluation at t. If we change the set of propositional connectives that we are allowed to use then we can ask the same question. For instance, using just and can we construct every truth table/build a term inducing any given evaluation e? What if we use and? And other such questions (the five we have introduced are not the only possible connectives, indeed not even the only ones which occur in nature, or at least in Computer Science, where one also sees NAND=Sheffer stroke, NOR, XOR). 7 We say that a set, S, of propositional connectives is adequate if for every propositional term t (in any number of propositional variables) there is a term t constructed using just the connectives in S such that t and t are logically equivalent. 8 By logically equivalent we mean that they have the same truth tables or, a bit more precisely, they define the same function from Val p1,...,p n to {T, F}. Example The set {, } is adequate. We have already commented that {,, } is adequate so we need only note that s t ( s t). Example The NAND gate/operator or Sheffer stroke is a binary (i.e. has two inputs) propositional connective whose effect is as shown in the truth table below. p q p q T T F T F T F T T F F T 7 We won t formulate the general question because then we would have to give a general definition of (n-ary) propositional connective and would be hard-pressed to distinguish these from propositional terms. 8 Notice that if S includes some new propositional connectives then we have to extend our definitions of propositional term etc. to allow these. That s why I used quotation marks just then. 18

20 You can see from this that p q is logically equivalent to (p q), hence the name NAND. If we take our set of connectives to be just S = { } then we have to re-define propositional term by saying: every propositional variable is a propositional term; if s, t are propositional terms then so is s t. We can refer to these as (propositional) terms build using (only) and can write S (L) for the set of such terms. It is easy to show that { } is adequate. All we have to do is to show that, given propositional variables p, q we can find terms using only which are equivalent to p and p q - because we know that {, } is an adequate set of connectives. Indeed, it is easy to check see that p p is equivalent to p and hence that (p q) (p q) is equivalent to p q. Showing that a given set S of connectives is not adequate can take more thought: how can one show that some propositional terms do not have equivalents built only using connectives from S? Example One might feel that, intuitively, and together are not adequate since they are both positive. How can one turn that intuition into a proof? One would like to show, for instance, that no term built only using and can be logically equivalent to p but, even using only the single propositional variable p, there are infinitely many propositional terms to check. That might suggest trying some sort of inductive proof. But a proof of what statement? What we can do is to prove by induction on complexity/length of a term that: if t is any term built only from and then for every valuation v such that all the propositional variables appearing in t are assigned the value T by v, we also have v(t) = T. Once that is done, we can deduce, in particular, that no term built only using and can be equivalent to p. 1.6 Interpolation Suppose that s and t are propositional terms and that s = t, equivalently s t is a tautology. This could be for the trivial reasons that either s is always false (unsatisfiable) or that t is always true (a tautology). But if that s not the case then the interpolation theorem guarantees that there is some propositional term u which involves only the propositional variables appearing in both s and t such that s = u and u = t. Such a u is referred to as an interpolant between s and t. Theorem (Interpolation Theorem) Suppose that s S(L 1 ) and t S(L 2 ) are such that s = t. Then either s is unsatisfiable or t is a tautology or there is u S(L 3 ), where L 3 = L 1 L 2, such that s = u and u = t. Proof. We suppose that s is satisfiable and that t is not a tautology; we must produce a suitable u. Since s is satisfiable there is some valuation v 1 on L 1 such that v 1 (s) = T and since t is not a tautology there is some valuation v 2 on L 2 such that v 2 (t) = F. First we show that L 3. If this were not so, that is, if L 1 and L 2 had no propositional variables in common, then we could { define a valuation v 3 on v1 (p) if p L S(L 1 L 2 ) by setting, for p L 1 L 2, v 3 (p) = 1. Then, v 2 (p) if p L 2 19

21 by 1.2.1(c), we would have v 3 (s) = v 1 (s) = T and v 3 (t) = v 2 (t) = F, which contradicts the assumption that s = t. Now choose, by 1.4.7, a formula of S(L 1 ) in disjunctive normal form which is equivalent to s, say n i=1 ( l i j=1 g ij m i k=1 h ik) where we have separated out the literals into two groups: the g ij - those belonging to S(L 1 ) \ S(L 3 ); the h ik - those belonging to S(L 3 ). (We allow that some of these conjuncts might be empty.) We can assume that each disjunct is satisfiable (we can drop any which are not). Define u to be n mi i=1 k=1 h ik. Clearly u S(L 3 ) and, if v is a valuation on S(L 1 ) then, if v(s) = T, it must be that v( l i j=1 g ij m i k=1 h ik) = T for some i (by 1.4.3) and hence 9 v( m i k=1 h ik) = T and hence v(u) = T. Thus s = u and we have just seen that u is satisfiable. It remains to prove that u = t. So let v be a valuation on S(L 2 ) such that v(u) = T. Then there must be some i 0 such that v( m i0 k=1 h i 0k) = T. We define a valuation w on S(L 1 L 2 ) by setting, for p L 1 L 2, v(p) if p L 2 T if p = g i0k for some k w(p) = F if p = g i0k for some k T, say if p L 1 \ L 2 and is not already assigned a value, that is, if p does not occur in the i 0 th disjunct. Note that w( l i0 j=1 g i 0j m i0 k=1 h i 0k) = T by construction and hence w(s) = T. But we assumed that s = t and so w(t) = T. But w and v agree on all propositional variables in L 2 ; hence v(t) = T. We conclude that u = t, which was what had remained to be proved. The proof gives an effective procedure for computing interpolants. Example Given that (p ( r s)) (p (r s)) = ((s r) t) ( t (r s)), how do we find an interpolant involving r and s only? (Note that, in the notation of the proof, L 1 = {p, r, s}, L 2 = {r, s, t}, L 3 = {r, s}. We find a term in disjunctive normal form which is logically equivalent to (p ( r s)) (p (r s)); one such is (p s r) ( p r s). Following the procedure in the proof, we obtain the interpolant u which is (s r) (r s). 9 You might reasonably ask what happens if, for this value of i, there are no h ik conjuncts. That could happen but there must be at least one such value of i (that is, with v making the ith conjunct true) such that there is an h ik. Otherwise, arguing as before, we could adjust the valuation v, keeping the same values on propositional variables in S(L 1 )\S(L 3 ) but adjusting it on those belonging to S(L 3 ), so as to make t false, while keeping s true, contradicting that s = t. 20

22 Chapter 2 Deductive systems The design of the following treatise is to investigate the fundamental laws of those operations of the mind by which reasoning is performed; to give expression to them in the symbolical language of a Calculus, and upon this foundation to establish the science of Logic and construct its method; to make that method itself the basis of a general method for the application of the mathematical doctrine of Probabilities; and, finally, to collect from the various elements of truth brought to view in the course of these inquiries some probable intimations concerning the nature and constitution of the human mind. Thus begins Chapter 1 of George Boole s An Investigation of the Laws of Thought (on which are founded the Mathematical Theories of Logic and Probabilities) (1854) We have already seen the symbolical language (though not the way Boole wrote it) and what Boole meant by a Calculus (or Algebra). Now we discuss proof/deductive systems further. Given a propositional term, we may test whether or not it is a tautology by, for example, constructing its truth table. This is regarded as a semantic test because it is in terms of valuations. The test is recursive in the sense that we have a procedure which, after a finite amount of time, is guaranteed to tell us whether or not the term is a tautology. More generally, suppose that S is a finite set of propositional terms and that t is a propositional term. Recall that we write S = t to mean that every valuation which makes everything in S true also makes t true. Checking whether or not this is true also is a recursive procedure. In the case of predicate logic, however, it turns out that there is no corresponding algorithm for determining whether or not a propositional term ( sentence in that context) is a tautology or whether the truth of a finite set of propositions implies the truth of another proposition. 1 The best we can do is to produce a method of generating all tautologies or, more generally of starting with a set, S, of sentences/statements/propositions which we treat as axioms and then generating all consequences of those axioms. Such a method of 1 In fact the set of tautologies of predicate logic is recursively enumerable but not recursive. Saying that the set is recursively enumerable means that there is an algorithm which will output only tautologies and such that any tautology eventually will be output; but we can t predict when. 21

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

DISCRETE MATHEMATICS W W L CHEN

DISCRETE MATHEMATICS W W L CHEN DISCRETE MATHEMATICS W W L CHEN c W W L Chen, 1982, 2008. This chapter originates from material used by the author at Imperial College, University of London, between 1981 and 1990. It is available free

More information

Fundamentals of Mathematics Lecture 6: Propositional Logic

Fundamentals of Mathematics Lecture 6: Propositional Logic Fundamentals of Mathematics Lecture 6: Propositional Logic Guan-Shieng Huang National Chi Nan University, Taiwan Spring, 2008 1 / 39 Connectives Propositional Connectives I 1 Negation: (not A) A A T F

More information

MAT2400 Analysis I. A brief introduction to proofs, sets, and functions

MAT2400 Analysis I. A brief introduction to proofs, sets, and functions MAT2400 Analysis I A brief introduction to proofs, sets, and functions In Analysis I there is a lot of manipulations with sets and functions. It is probably also the first course where you have to take

More information

A set is a Many that allows itself to be thought of as a One. (Georg Cantor)

A set is a Many that allows itself to be thought of as a One. (Georg Cantor) Chapter 4 Set Theory A set is a Many that allows itself to be thought of as a One. (Georg Cantor) In the previous chapters, we have often encountered sets, for example, prime numbers form a set, domains

More information

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

More information

Mathematical Induction

Mathematical Induction Mathematical Induction In logic, we often want to prove that every member of an infinite set has some feature. E.g., we would like to show: N 1 : is a number 1 : has the feature Φ ( x)(n 1 x! 1 x) How

More information

MATHS 315 Mathematical Logic

MATHS 315 Mathematical Logic MATHS 315 Mathematical Logic Second Semester, 2006 Contents 2 Formal Statement Logic 1 2.1 Post production systems................................. 1 2.2 The system L.......................................

More information

(Refer Slide Time: 1:41)

(Refer Slide Time: 1:41) Discrete Mathematical Structures Dr. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture # 10 Sets Today we shall learn about sets. You must

More information

Chapter 1 LOGIC AND PROOF

Chapter 1 LOGIC AND PROOF Chapter 1 LOGIC AND PROOF To be able to understand mathematics and mathematical arguments, it is necessary to have a solid understanding of logic and the way in which known facts can be combined to prove

More information

CSE 191, Class Note 01 Propositional Logic Computer Sci & Eng Dept SUNY Buffalo

CSE 191, Class Note 01 Propositional Logic Computer Sci & Eng Dept SUNY Buffalo Propositional Logic CSE 191, Class Note 01 Propositional Logic Computer Sci & Eng Dept SUNY Buffalo c Xin He (University at Buffalo) CSE 191 Discrete Structures 1 / 37 Discrete Mathematics What is Discrete

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

Chapter 1. Logic and Proof

Chapter 1. Logic and Proof Chapter 1. Logic and Proof 1.1 Remark: A little over 100 years ago, it was found that some mathematical proofs contained paradoxes, and these paradoxes could be used to prove statements that were known

More information

31 is a prime number is a mathematical statement (which happens to be true).

31 is a prime number is a mathematical statement (which happens to be true). Chapter 1 Mathematical Logic In its most basic form, Mathematics is the practice of assigning truth to welldefined statements. In this course, we will develop the skills to use known true statements to

More information

(Refer Slide Time: 05:02)

(Refer Slide Time: 05:02) Discrete Mathematical Structures Dr. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 1 Propositional Logic This course is about discrete

More information

Handout #1: Mathematical Reasoning

Handout #1: Mathematical Reasoning Math 101 Rumbos Spring 2010 1 Handout #1: Mathematical Reasoning 1 Propositional Logic A proposition is a mathematical statement that it is either true or false; that is, a statement whose certainty or

More information

Reading 7 : Program Correctness

Reading 7 : Program Correctness CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Instructors: Beck Hasti, Gautam Prakriya Reading 7 : Program Correctness 7.1 Program Correctness Showing that a program is correct means that

More information

Logic, Sets, and Proofs

Logic, Sets, and Proofs Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Statements. A logical statement is a mathematical statement that is either true or false. Here we denote logical

More information

Definition 10. A proposition is a statement either true or false, but not both.

Definition 10. A proposition is a statement either true or false, but not both. Chapter 2 Propositional Logic Contrariwise, continued Tweedledee, if it was so, it might be; and if it were so, it would be; but as it isn t, it ain t. That s logic. (Lewis Carroll, Alice s Adventures

More information

Section 1. Statements and Truth Tables. Definition 1.1: A mathematical statement is a declarative sentence that is true or false, but not both.

Section 1. Statements and Truth Tables. Definition 1.1: A mathematical statement is a declarative sentence that is true or false, but not both. M3210 Supplemental Notes: Basic Logic Concepts In this course we will examine statements about mathematical concepts and relationships between these concepts (definitions, theorems). We will also consider

More information

1. R In this and the next section we are going to study the properties of sequences of real numbers.

1. R In this and the next section we are going to study the properties of sequences of real numbers. +a 1. R In this and the next section we are going to study the properties of sequences of real numbers. Definition 1.1. (Sequence) A sequence is a function with domain N. Example 1.2. A sequence of real

More information

Applications of Methods of Proof

Applications of Methods of Proof CHAPTER 4 Applications of Methods of Proof 1. Set Operations 1.1. Set Operations. The set-theoretic operations, intersection, union, and complementation, defined in Chapter 1.1 Introduction to Sets are

More information

Chapter 6 Finite sets and infinite sets. Copyright 2013, 2005, 2001 Pearson Education, Inc. Section 3.1, Slide 1

Chapter 6 Finite sets and infinite sets. Copyright 2013, 2005, 2001 Pearson Education, Inc. Section 3.1, Slide 1 Chapter 6 Finite sets and infinite sets Copyright 013, 005, 001 Pearson Education, Inc. Section 3.1, Slide 1 Section 6. PROPERTIES OF THE NATURE NUMBERS 013 Pearson Education, Inc.1 Slide Recall that denotes

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

More information

Logic in Computer Science: Logic Gates

Logic in Computer Science: Logic Gates Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers

More information

Chapter I Logic and Proofs

Chapter I Logic and Proofs MATH 1130 1 Discrete Structures Chapter I Logic and Proofs Propositions A proposition is a statement that is either true (T) or false (F), but or both. s Propositions: 1. I am a man.. I am taller than

More information

CHAPTER 3 Numbers and Numeral Systems

CHAPTER 3 Numbers and Numeral Systems CHAPTER 3 Numbers and Numeral Systems Numbers play an important role in almost all areas of mathematics, not least in calculus. Virtually all calculus books contain a thorough description of the natural,

More information

ALGEBRA HANDOUT 2: IDEALS AND QUOTIENTS. 1. Ideals in Commutative Rings In this section all groups and rings will be commutative.

ALGEBRA HANDOUT 2: IDEALS AND QUOTIENTS. 1. Ideals in Commutative Rings In this section all groups and rings will be commutative. ALGEBRA HANDOUT 2: IDEALS AND QUOTIENTS PETE L. CLARK 1. Ideals in Commutative Rings In this section all groups and rings will be commutative. 1.1. Basic definitions and examples. Let R be a (commutative!)

More information

2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try.

2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. 2. METHODS OF PROOF 69 2. Methods of Proof 2.1. Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. Trivial Proof: If we know q is true then

More information

Math 3000 Running Glossary

Math 3000 Running Glossary Math 3000 Running Glossary Last Updated on: July 15, 2014 The definition of items marked with a must be known precisely. Chapter 1: 1. A set: A collection of objects called elements. 2. The empty set (

More information

To formulate more complex mathematical statements, we use the quantifiers there exists, written, and for all, written. If P(x) is a predicate, then

To formulate more complex mathematical statements, we use the quantifiers there exists, written, and for all, written. If P(x) is a predicate, then Discrete Math in CS CS 280 Fall 2005 (Kleinberg) Quantifiers 1 Quantifiers To formulate more complex mathematical statements, we use the quantifiers there exists, written, and for all, written. If P(x)

More information

Sets and Cardinality Notes for C. F. Miller

Sets and Cardinality Notes for C. F. Miller Sets and Cardinality Notes for 620-111 C. F. Miller Semester 1, 2000 Abstract These lecture notes were compiled in the Department of Mathematics and Statistics in the University of Melbourne for the use

More information

So let us begin our quest to find the holy grail of real analysis.

So let us begin our quest to find the holy grail of real analysis. 1 Section 5.2 The Complete Ordered Field: Purpose of Section We present an axiomatic description of the real numbers as a complete ordered field. The axioms which describe the arithmetic of the real numbers

More information

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements. 3. Axioms of Set theory Before presenting the axioms of set theory, we first make a few basic comments about the relevant first order logic. We will give a somewhat more detailed discussion later, but

More information

Propositional Logic and Methods of Inference SEEM

Propositional Logic and Methods of Inference SEEM Propositional Logic and Methods of Inference SEEM 5750 1 Logic Knowledge can also be represented by the symbols of logic, which is the study of the rules of exact reasoning. Logic is also of primary importance

More information

Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing

More information

Basic Category Theory for Models of Syntax (Preliminary Version)

Basic Category Theory for Models of Syntax (Preliminary Version) Basic Category Theory for Models of Syntax (Preliminary Version) R. L. Crole ( ) Department of Mathematics and Computer Science, University of Leicester, Leicester, LE1 7RH, U.K. Abstract. These notes

More information

Truth Conditional Meaning of Sentences. Ling324 Reading: Meaning and Grammar, pg

Truth Conditional Meaning of Sentences. Ling324 Reading: Meaning and Grammar, pg Truth Conditional Meaning of Sentences Ling324 Reading: Meaning and Grammar, pg. 69-87 Meaning of Sentences A sentence can be true or false in a given situation or circumstance. (1) The pope talked to

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard, Bernhard Nebel and Martin Riedmiller Albert-Ludwigs-Universität Freiburg Contents 1 Agents

More information

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r. CHAPTER 2 Logic 1. Logic Definitions 1.1. Propositions. Definition 1.1.1. A proposition is a declarative sentence that is either true (denoted either T or 1) or false (denoted either F or 0). Notation:

More information

Introduction to mathematical arguments

Introduction to mathematical arguments Introduction to mathematical arguments (background handout for courses requiring proofs) by Michael Hutchings A mathematical proof is an argument which convinces other people that something is true. Math

More information

Mathematical Logic. Tableaux Reasoning for Propositional Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

Mathematical Logic. Tableaux Reasoning for Propositional Logic. Chiara Ghidini. FBK-IRST, Trento, Italy Tableaux Reasoning for Propositional Logic FBK-IRST, Trento, Italy Outline of this lecture An introduction to Automated Reasoning with Analytic Tableaux; Today we will be looking into tableau methods for

More information

Gödel s Theorem: An Incomplete Guide to Its Use and Abuse

Gödel s Theorem: An Incomplete Guide to Its Use and Abuse Gödel s Theorem: An Incomplete Guide to Its Use and Abuse by Torkel Franzén Summary by Xavier Noria August 2006 fxn@hashref.com This unique exposition of Kurt Gödel s stunning incompleteness theorems for

More information

Students in their first advanced mathematics classes are often surprised

Students in their first advanced mathematics classes are often surprised CHAPTER 8 Proofs Involving Sets Students in their first advanced mathematics classes are often surprised by the extensive role that sets play and by the fact that most of the proofs they encounter are

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 1

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 1 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 1 Course Outline CS70 is a course on Discrete Mathematics and Probability for EECS Students. The purpose of the course

More information

For the purposes of this course, the natural numbers are the positive integers. We denote by N, the set of natural numbers.

For the purposes of this course, the natural numbers are the positive integers. We denote by N, the set of natural numbers. Lecture 1: Induction and the Natural numbers Math 1a is a somewhat unusual course. It is a proof-based treatment of Calculus, for all of you who have already demonstrated a strong grounding in Calculus

More information

The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs The Foundations: Logic and Proofs Chapter 1, Part III: Proofs Rules of Inference Section 1.6 Section Summary Valid Arguments Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments

More information

Sets and functions. {x R : x > 0}.

Sets and functions. {x R : x > 0}. Sets and functions 1 Sets The language of sets and functions pervades mathematics, and most of the important operations in mathematics turn out to be functions or to be expressible in terms of functions.

More information

2. Propositional Equivalences

2. Propositional Equivalences 2. PROPOSITIONAL EQUIVALENCES 33 2. Propositional Equivalences 2.1. Tautology/Contradiction/Contingency. Definition 2.1.1. A tautology is a proposition that is always true. Example 2.1.1. p p Definition

More information

3. Recurrence Recursive Definitions. To construct a recursively defined function:

3. Recurrence Recursive Definitions. To construct a recursively defined function: 3. RECURRENCE 10 3. Recurrence 3.1. Recursive Definitions. To construct a recursively defined function: 1. Initial Condition(s) (or basis): Prescribe initial value(s) of the function.. Recursion: Use a

More information

If f is a 1-1 correspondence between A and B then it has an inverse, and f 1 isa 1-1 correspondence between B and A.

If f is a 1-1 correspondence between A and B then it has an inverse, and f 1 isa 1-1 correspondence between B and A. Chapter 5 Cardinality of sets 51 1-1 Correspondences A 1-1 correspondence between sets A and B is another name for a function f : A B that is 1-1 and onto If f is a 1-1 correspondence between A and B,

More information

Mathematical Induction

Mathematical Induction Mathematical Induction (Handout March 8, 01) The Principle of Mathematical Induction provides a means to prove infinitely many statements all at once The principle is logical rather than strictly mathematical,

More information

Lecture 3. Mathematical Induction

Lecture 3. Mathematical Induction Lecture 3 Mathematical Induction Induction is a fundamental reasoning process in which general conclusion is based on particular cases It contrasts with deduction, the reasoning process in which conclusion

More information

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Likewise, we have contradictions: formulas that can only be false, e.g. (p p). CHAPTER 4. STATEMENT LOGIC 59 The rightmost column of this truth table contains instances of T and instances of F. Notice that there are no degrees of contingency. If both values are possible, the formula

More information

Oh Yeah? Well, Prove It.

Oh Yeah? Well, Prove It. Oh Yeah? Well, Prove It. MT 43A - Abstract Algebra Fall 009 A large part of mathematics consists of building up a theoretical framework that allows us to solve problems. This theoretical framework is built

More information

Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

Elementary Number Theory We begin with a bit of elementary number theory, which is concerned CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

More information

2.1.1 Examples of Sets and their Elements

2.1.1 Examples of Sets and their Elements Chapter 2 Set Theory 2.1 Sets The most basic object in Mathematics is called a set. As rudimentary as it is, the exact, formal definition of a set is highly complex. For our purposes, we will simply define

More information

Correspondence analysis for strong three-valued logic

Correspondence analysis for strong three-valued logic Correspondence analysis for strong three-valued logic A. Tamminga abstract. I apply Kooi and Tamminga s (2012) idea of correspondence analysis for many-valued logics to strong three-valued logic (K 3 ).

More information

CS510 Software Engineering

CS510 Software Engineering CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se

More information

Math 223 Abstract Algebra Lecture Notes

Math 223 Abstract Algebra Lecture Notes Math 223 Abstract Algebra Lecture Notes Steven Tschantz Spring 2001 (Apr. 23 version) Preamble These notes are intended to supplement the lectures and make up for the lack of a textbook for the course

More information

COMP 250 Fall Mathematical induction Sept. 26, (n 1) + n = n + (n 1)

COMP 250 Fall Mathematical induction Sept. 26, (n 1) + n = n + (n 1) COMP 50 Fall 016 9 - Mathematical induction Sept 6, 016 You will see many examples in this course and upcoming courses of algorithms for solving various problems It many cases, it will be obvious that

More information

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

1.3 Induction and Other Proof Techniques

1.3 Induction and Other Proof Techniques 4CHAPTER 1. INTRODUCTORY MATERIAL: SETS, FUNCTIONS AND MATHEMATICAL INDU 1.3 Induction and Other Proof Techniques The purpose of this section is to study the proof technique known as mathematical induction.

More information

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

A Few Basics of Probability

A Few Basics of Probability A Few Basics of Probability Philosophy 57 Spring, 2004 1 Introduction This handout distinguishes between inductive and deductive logic, and then introduces probability, a concept essential to the study

More information

7.1 An Axiomatic Approach to Mathematics

7.1 An Axiomatic Approach to Mathematics Chapter 7 The Peano Axioms 7.1 An Axiomatic Approach to Mathematics In our previous chapters, we were very careful when proving our various propositions and theorems to only use results we knew to be true.

More information

INCIDENCE-BETWEENNESS GEOMETRY

INCIDENCE-BETWEENNESS GEOMETRY INCIDENCE-BETWEENNESS GEOMETRY MATH 410, CSUSM. SPRING 2008. PROFESSOR AITKEN This document covers the geometry that can be developed with just the axioms related to incidence and betweenness. The full

More information

Computability Theory

Computability Theory CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

More information

Fractions and Decimals

Fractions and Decimals Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first

More information

4. FIRST-ORDER LOGIC

4. FIRST-ORDER LOGIC 4. FIRST-ORDER LOGIC Contents 4.1: Splitting the atom: names, predicates and relations 4.2: Structures 4.3: Quantification:, 4.4: Syntax 4.5: Semantics 4.6: De Morgan s laws for and 4.7: Truth trees for

More information

FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 22

FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 22 FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 22 RAVI VAKIL CONTENTS 1. Discrete valuation rings: Dimension 1 Noetherian regular local rings 1 Last day, we discussed the Zariski tangent space, and saw that it

More information

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs CHAPTER 3 Methods of Proofs 1. Logical Arguments and Formal Proofs 1.1. Basic Terminology. An axiom is a statement that is given to be true. A rule of inference is a logical rule that is used to deduce

More information

MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.

MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction. MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on

More information

WUCT121. Discrete Mathematics. Logic

WUCT121. Discrete Mathematics. Logic WUCT121 Discrete Mathematics Logic 1. Logic 2. Predicate Logic 3. Proofs 4. Set Theory 5. Relations and Functions WUCT121 Logic 1 Section 1. Logic 1.1. Introduction. In developing a mathematical theory,

More information

22C:19 Discrete Math. So. What is it? Why discrete math? Fall 2009 Hantao Zhang

22C:19 Discrete Math. So. What is it? Why discrete math? Fall 2009 Hantao Zhang 22C:19 Discrete Math Fall 2009 Hantao Zhang So. What is it? Discrete mathematics is the study of mathematical structures that are fundamentally discrete, in the sense of not supporting or requiring the

More information

We now explore a third method of proof: proof by contradiction.

We now explore a third method of proof: proof by contradiction. CHAPTER 6 Proof by Contradiction We now explore a third method of proof: proof by contradiction. This method is not limited to proving just conditional statements it can be used to prove any kind of statement

More information

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees University of Ostrava Institute for Research and Applications of Fuzzy Modeling Reasoning in Description Logic with Semantic Tableau Binary Trees Alena Lukasová Research report No. 63 2005 Submitted/to

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

[Refer Slide Time: 05:10]

[Refer Slide Time: 05:10] Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

More information

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.080/6.089 GITCS Feb 12, 2008. Lecture 3 6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

More information

1.2 Truth and Sentential Logic

1.2 Truth and Sentential Logic Chapter 1 Mathematical Logic 13 69. Assume that B has m left parentheses and m right parentheses and that C has n left parentheses and n right parentheses. How many left parentheses appear in (B C)? How

More information

Satisfiability of Boolean Expressions

Satisfiability of Boolean Expressions Satisfiability of Boolean Expressions In the previous section, we have analysed in great detail one particular problem reachability in directed graphs. The reason for the attention devoted to this one

More information

Automated Theorem Proving - summary of lecture 1

Automated Theorem Proving - summary of lecture 1 Automated Theorem Proving - summary of lecture 1 1 Introduction Automated Theorem Proving (ATP) deals with the development of computer programs that show that some statement is a logical consequence of

More information

Outline. Database Theory. Perfect Query Optimization. Turing Machines. Question. Definition VU , SS Trakhtenbrot s Theorem

Outline. Database Theory. Perfect Query Optimization. Turing Machines. Question. Definition VU , SS Trakhtenbrot s Theorem Database Theory Database Theory Outline Database Theory VU 181.140, SS 2016 4. Trakhtenbrot s Theorem Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 4.

More information

It is not immediately obvious that this should even give an integer. Since 1 < 1 5

It is not immediately obvious that this should even give an integer. Since 1 < 1 5 Math 163 - Introductory Seminar Lehigh University Spring 8 Notes on Fibonacci numbers, binomial coefficients and mathematical induction These are mostly notes from a previous class and thus include some

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 20

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 20 CS 70 Discrete Mathematics and Probability Theory Fall 009 Satish Rao, David Tse Note 0 Infinity and Countability Consider a function (or mapping) f that maps elements of a set A (called the domain of

More information

3. Predicates and Quantifiers

3. Predicates and Quantifiers 3. PREDICATES AND QUANTIFIERS 45 3. Predicates and Quantifiers 3.1. Predicates and Quantifiers. Definition 3.1.1. A predicate or propositional function is a description of the property (or properties)

More information

Notes on Modal Logic

Notes on Modal Logic Notes on Modal Logic Notes for Philosophy 151 Eric Pacuit January 28, 2009 These short notes are intended to supplement the lectures and text ntroduce some of the basic concepts of Modal Logic. The primary

More information

Full and Complete Binary Trees

Full and Complete Binary Trees Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full

More information

An Innocent Investigation

An Innocent Investigation An Innocent Investigation D. Joyce, Clark University January 2006 The beginning. Have you ever wondered why every number is either even or odd? I don t mean to ask if you ever wondered whether every number

More information

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS. Christopher Heil Georgia Institute of Technology WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

More information

Free groups. Contents. 1 Free groups. 1.1 Definitions and notations

Free groups. Contents. 1 Free groups. 1.1 Definitions and notations Free groups Contents 1 Free groups 1 1.1 Definitions and notations..................... 1 1.2 Construction of a free group with basis X........... 2 1.3 The universal property of free groups...............

More information

4 Domain Relational Calculus

4 Domain Relational Calculus 4 Domain Relational Calculus We now present two relational calculi that we will compare to RA. First, what is the difference between an algebra and a calculus? The usual story is that the algebra RA is

More information

CONTENTS 1. Peter Kahn. Spring 2007

CONTENTS 1. Peter Kahn. Spring 2007 CONTENTS 1 MATH 304: CONSTRUCTING THE REAL NUMBERS Peter Kahn Spring 2007 Contents 2 The Integers 1 2.1 The basic construction.......................... 1 2.2 Adding integers..............................

More information

-123- A Three-Valued Interpretation for a Relevance Logic. In thi.s paper an entailment relation which holds between certain

-123- A Three-Valued Interpretation for a Relevance Logic. In thi.s paper an entailment relation which holds between certain Dr. Frederick A. Johnson Department of Philosophy Colorado State University Fort Collins, Colorado 80523-23- A Three-Valued Interpretation for a Relevance Logic In thi.s paper an entailment relation which

More information

Sets and Logic. Chapter Sets

Sets and Logic. Chapter Sets Chapter 2 Sets and Logic This chapter introduces sets. In it we study the structure on subsets of a set, operations on subsets, the relations of inclusion and equality on sets, and the close connection

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

Section 7.1 First-Order Predicate Calculus predicate Existential Quantifier Universal Quantifier.

Section 7.1 First-Order Predicate Calculus predicate Existential Quantifier Universal Quantifier. Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially or universally. A predicate describes a

More information