* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download psychology - NIILM University
Survey
Document related concepts
List of first-order theories wikipedia , lookup
Large numbers wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Big O notation wikipedia , lookup
Fundamental theorem of algebra wikipedia , lookup
Abuse of notation wikipedia , lookup
Structure (mathematical logic) wikipedia , lookup
Functional decomposition wikipedia , lookup
Fundamental theorem of calculus wikipedia , lookup
Laws of Form wikipedia , lookup
Function (mathematics) wikipedia , lookup
Non-standard calculus wikipedia , lookup
History of the function concept wikipedia , lookup
Birkhoff's representation theorem wikipedia , lookup
Elementary mathematics wikipedia , lookup
Transcript
ENGINEERING ART CHEMISTRY MECHANICS PHYSICS history psychology Discrete Maths LANGUAGE BIOTECHNOLOGY E C O L O G Y MUSIC EDUCATION GEOGRAPHY agriculture law DESIGN mathematics MEDIA management HEALTH Subject: DISCRETE MATHS Credits: 4 SYLLABUS Elementary Logic Boolean Algebra and Circuits, Methods of Proof, Propositional Calculus Basic Combinatorics More about Counting, Partitions and Distributions, Combinatorics - An Introduction Recurrence Solving Recurrences, Generating Functions, Recurrence Relations Introduction to Graph Theory Graph Colourings and Planar Graphs, Eulerian and Hamiltonian Graphs, Special Graphs, Basic Properties of Graphs Suggested Readings: 1. Discrete Mathematical Structures; Tremblay and Manohar; Tata McGraw Hill 2. Discrete Mathematics; Maggard, Thomson 3. Discrete Mathematics; Semyour Lipschutz, Varsha Patil; 2nd Edition Schaum’s Series TMH 4. Discrete Mathematical Structures; Kolman, Busby and Ross; Prentice Hall India, Edition 3rd PROPOSITIONAL LOGIC 1. Introduction The propositional calculus (PC) is a formal language that adequately represents the set of valid (truth preserving) inferences which depend on coordinate expressions such as and, or, not, if…then…, if and only if. From the optic of PC, we are only interested in those inferences whose validity depends on the role of these expressions. Hence, we abstract away from what particular sentences mean. Here is a simple example: (1)a. Man U have won the European Cup and Liverpool have won the European Cup. b. Therefore, Man U have won the European Cup. (1) is clearly valid - it is not possible for b. to be false and for a. to be true; alternatively, if a. is true, then b. must be true. But the validity of (1) doesn‘t depend on the fact that we are talking about Man U, Liverpool, and who has won the European Cup. We could substitute any (declarative) sentences into (1) and we would still have a valid inference. Hence, we can replace the particular sentences of (1) for variables which range over all sentences. So revised, (1) is depicted as (2) P & Q P Q PC is able to represent only those inferences such (2) - those whose validity just depends on the logical constants. Logical constants = expressions whose meaning is constant, i.e., not variable. Truth functions = the constants express functions from truth values to truth values. The language of PC thus includes variables which range over sentences (P, Q, R, S,…) and logical constants. The standard logical constants of PC = ¬ = not & = and v = or → = if…, then… ↔ = if and only if (iff) (i) The identifications here will later be questioned, but, pro tem, think of the constants as expressing the corresponding English terms. (ii) We shall see later that the five constants mark a redundancy. It is easy to show that we can express the remaining three constants by using either (i) ‗¬‘ and ‗&‘ or (ii) ‗¬‘ and ‗v‘ or (iii) ‗¬‘ and ‗→‘. In fact, we only need one of two logical constants here not listed: ‗↓‘ (dagger) and ‗|‘ (stroke). Such joys are to come. Sentences of PC include all and only those symbol strings which are lawful combinations of constants and variables. For example: (3)a. ¬P (‗Bill isn‘t tall‘) b. P → (Q & ¬R) (‗If Harry is short, then Bill is tall and Mary isn‘t blonde‘) c. (P ↔ Q) → ((P → Q) & (Q → P)) (‗If Harry is tall iff Sarah is blonde, then if Harry is tall, then Sarah is blonde, and if Sarah is blonde, then Harry is tall‘) Etc. An excursus on scope The use of brackets in PC is to avoid scope ambiguities. English, as we saw, is rife with ambiguity, but in PC, we rigorously avoid it - brackets serve this end, as they could do in a regimented version of English. (3)a. Mad dogs and Englishmen go out in the mid-day sun. b. [Mad [dogs and Englishmen]] go out in the mid-day sun. c. [[Mad dogs] and Englishmen] go out in the mid-day sun. Here is an example from PC (4)a. P → P & Q b. (P → P) & Q c. P → (P & Q) The latter two formulae are quite distinct: b. is a conjunction which ‗says‘ two things are the case (if P, then P and Q); c. is a conditional which ‗says‘ if something (P) is the case, then something else (P & Q) is the case. More formally, b. is stronger, c. is weaker. Strong = takes more for it to be false. Weak = takes less for it to be true. Think of it this way: a formula which ‗says‘ more is more likely to be false; it makes a greater demand on the world, as it were - saying more equals strength. A formula which says little, places a weak demand on the world - saying little equals weakness. In general, a conditional is always weaker than a conjunction. If we were just faced with a., the convention is to read it as if it were c., i.e., we take the weaker constant to be the main constant - the constant which defines the kind of formula we have. Main constant = constant with widest possible scope. Scope = the scope of an expression is the smallest formula of which it is a part. It follows that the constant with widest possible scope has the whole containing formula in its scope. For example, in b., ‗→‘ scopes just over ‗P → P‘, for that is the smallest formula it is a part of. On the other hand, the smallest formula which contains ‗&‘ is the whole of b. The case is reversed for c. Explicit marking of scope via brackets removes ambiguity. Our definition of scope presupposes that we can be precise about what is and is not a formula of PC. 2. Syntax of PC The syntax of a natural language such as English must be discovered. When we are dealing with formal languages, we can stipulate the syntax, for the languages are our own creations. Of course, this doesn‘t mean that we can stipulate anything we please, for we want the language to do a ‗job‘ and an acceptable formula should reflect that objective. In the present case, we want PC to codify valid inferences which turn on the constants. Syntax (for formal languages) = a definition of ‗formula of the language‘ Here is an adequate definition for ‗formula of PC‘. (Df-PC) (i) P, Q, R,… are formulae of PC. (ii) If X is a formula of PC, then ¬X, X & X, X v X, X→X, and X↔X are formulae of PC. (iii) These are all the formulae of PC. (‗X‘ is a meta-variable which ranges over formulae of PC - it is not a part of PC itself.) (Df-PC) is recursive, which means that we can cycle through (ii) to generate all the formulae of PC. In other words, the definition provides us with a finite implicit definition of the infinite set of formulae of PC. Q1: In (i), we appear to commit ourselves to an indefinite number of variables, and so, if we tried to write out the definition in full, it would no longer be finite, i.e., we couldn‘t write it out. Can you see a way of complicating the definition to avoid this problem? (Hint: we just need to discriminate between an infinity of variables, we don‘t actually need an infinity of variables.) Q2: Is (iii) required? What job is it doing? 3. Semantics of PC (Truth Tables) The semantics for a formal language tell us what the formulae mean, i.e., truth conditions. Since we have abstracted away from the meaning of particular sentences, we simply assume that that any given variable can take the value of True (T) or False (F). We work out the truth conditions of all further formulae, following the syntax, as a function of the meaning of the logical constants, which compositionally form complex formulae from, ultimately, Ps and Qs. We define the meaning of each constant via a basic truth table, with the a truth table for each further formulae being provided as a function of the basic truth tables. We say that a constant expresses a truth function: it takes truth values as argument and produces truth values as values. Let ‗A‘ and ‗B‘ be meta-variables which range over PC formulae of arbitrary complexity. For example, the truth table for ‗A & B‘ applies to any formulae whose main constant is ‗&‘. ¬ & ¬ A A v & B A v B → ↔ A → B A ↔ B F T T T T T T T T T T T T T T F T F F T T F T F F T F F T F T T F T T F F T F F F F F T F F T F F F F F (i) ‗¬A‘ is true iff ‗A‘ is false. (ii) ‗A & B‘ is true iff ‗A‘ is true and ‗B‘ is true. (iii) ‗A v B‘ is true iff either ‗A‘ is true or ‗B‘ is true. (iv) ‗A → B‘ is true iff it‘s not the case that ‗A‘ is true and ‗B‘ is false. (v) ‗A ↔ B‘ is true iff either ‗A‘ is true and ‗B‘ is true, or ‗A‘ is false and ‗B‘ is false. Each truth table details all possible ways in which the given formula could be assigned the value T or F. That is, a truth table exhausts the values a truth function can have, given all possible arguments. In general, for a formula of n variables, its table will contain 2n rows, each specifying a way the ‗world‘ could be such that the formula receives a value. So, with ‗¬P‘ we have 21 = 2; with two variable formulae, we have 22 = 4. For the formula, ‗P → (Q → R)‘, we have 23 = 8. And so on. The above tables provide you with all the information you require to specify a truth table for any formula of PC. An Excursus on the Material Conditional The conditional can cause problems. First we need some definitions: Sufficient condition = A is a sufficient condition for B iff A alone, regardless of anything else, is enough - suffices - for B. Necessary condition = A is a necessary condition for B iff without A, then no B. For example: (i) A‘s being a sister is a sufficient condition for A‘s being a sibling; it is not a necessary condition, for if A were a brother, A would still be a sibling. (ii) A‘s being female is a necessary condition for A‘s being a sister; it is not a sufficient condition, for A need not have any siblings at all. (iii) A‘s being a female sibling is a necessary and sufficient condition for A‘s being a sister. A conditional ‗A → B‘, expresses a sufficient condition from A to B, and a necessary condition from B to A. In English, there are different formulations of these relations: (i) If A, then B (A sufficient for B) (ii) A, if B (B sufficient for A) (iii) Only if A, B (B sufficient for A) (iv) A, only if B (A is sufficient for B) Definitions Tautology (logical truth) = a formula whose main column is all Ts, i.e., a function whose only value is T. E.g., A v ¬A TT FT TT FT FT TF FT TF Inconsistency (contradiction, logical falsehood) = a formula whose main column is all Fs, i.e., a function whose only value is F. E.g., A&¬A T FFT T FFT F FTF F FTF Contingency = a formula whose main column features both Ts and Fs, i.e., a function whose value can be both T and F. Examples are provided by our basic truth tables. (i) The negation of a tautology is an inconsistency. (ii) The negation of an inconsistency is a tautology. (iii) The negation of a contingency is a contingency. 3.1. Definitions - Reducing the Constants As mentioned above, our five constants signal a redundancy. We can easily show that we only need two constants: either (i) ‗¬‘ and ‗&‘ or (ii) ‗¬‘ and ‗v‘ or (iii) ‗¬‘ and ‗→‘. That is to say, we can contextually define the remaining three truth functions in terms of a given two truth functions. Remember, a truth table defines a constant, so if we can express the truth table for constant ‗$‘ without using ‗$‘, then we have adequately defined the function expressed by ‗$‘. Such definitions allow us to eliminate redundant constants; equally, they allow us to introduce constants. Here are the definitions if we take ‗¬‘ and ‗&‘ as given, where ‗↔df‘ means ‗logically equivalent by definition‘: (i) A v B ↔df ¬(¬A & ¬B) (ii) A → B ↔df ¬(A & ¬B) (iii) A↔ B ↔df ¬(A & ¬B) & ¬(B & ¬A) Here are the definitions if we take ‗¬‘ and ‗v‘ as given: (iv) A & B ↔df ¬(¬A v ¬B) (v) A → B ↔df ¬A v B (vi) A↔ B ↔df ¬(¬(¬A v B) v ¬(¬B v A)) Here are the definitions if we take ‗¬‘ and ‗→‘ as given: (vii) A & B ↔df ¬(B → ¬A) (viii) A v B ↔df ¬B→ A (ix) A↔ B ↔df ¬((A→ B) → ¬(B→ A)) Q: To check the correctness of these definitions, provide truth tables for (i)-(ix) using ‗↔df‘ as the main constant. (The subscript is merely notational, and may be happily deleted.) 3.2. Stroke and Dagger It was mentioned above that we can express every truth function via either of two constants: ‗|‘ (stroke) and ‗↓‘(dagger). Stroke (‗Sheffer‘s Stroke‘ or NAND) Stroke is a function of two arguments. Its truth table is: A | B T F T TT F FT T FT F which is equivalent to the table for ‗¬(P & Q).‘ ‗A | B‘ is true iff it‘s not the case that both ‗A‘ is true and ‗B‘ is true. The stroke definitions of the five main logical constants are as follows: (i) ¬A ↔df A | A (ii) A & B ↔ df (A | B) | (A | B) (iii) A v B ↔ df (A | A) | (B | B) (iv) A → B ↔ df ((A | A) | (B | B)) | (B | B) (v) A ↔ B ↔ df [(((A | A) | (B | B)) | (B | B)) | (((B | B) | (A | A)) | (A | A))] | [(((A | A) | (B | B)) | (B | B)) | (((B | B) | (A | A)) | (A | A))] Q: To check the correctness of the definitions, provide truth tables for the stroke formulae. Dagger (‗Pierce‘s Dagger‘ or NOR) Dagger is a function of two arguments. Its truth table is: A↓ B T F T T F F F F T F T F ‗A ↓ B‘ is true iff neither ‗A‘ is true nor ‗B‘ is true iff ‗A‘ is false and ‗B‘ is false. So, the truth table above is the same as that for ‗¬(A v B)‘ and ‗¬A & ¬ B‘. The dagger definitions of the five main constants are as follows: (i) ¬A ↔df A ↓ A (ii) A & B ↔df (A ↓ A) ↓(B ↓ B) (iii) A v B ↔ df (A ↓ B) ↓ (A ↓ B) (iv) A → B ↔ df [(((A ↓ A) ↓ (B ↓ B)) ↓(A↓A))] ↓ [(((A ↓ A) ↓ (B ↓ B)) ↓ (A ↓ A))] (v) A ↔ B ↔ df [(((A ↓ A) ↓ (A ↓ A)) ↓ (B ↓ B))] ↓ [(((A ↓ A) ↓ (A ↓ A)) ↓ (B ↓ B))] Q: To check the definitions, provide truth tables for the dagger formulae. Duality (i) A | B ↔ df [(A ↓ A) ↓ (B ↓ B)] ↓ [(A ↓ A) ↓ (B ↓ B)] (i.e., negation of dagger &) (ii) A ↓B ↔ df [(A | A) | (B | B)] | [(A | A) | (B | B)] (i.e., negation of stroke v) Q: To check the correctness of the definitions, provide truth tables for the formulae treating ‗↔ df‘ as the main constant. (Again, delete the notational subscript.) 4. Checking for Validity via Truth Tables We take an argument to be any collection of assumptions from which a conclusion is drawn, where it is understood that if the assumptions are true, then the conclusion must also be true equivalently it is not possible for the conclusion to be false and the premises all to be true. From the definition of ‗→‘, we see that any argument can be expressed by a conditional, where the assumptions are the antecedent (if there is more that one assumption, then the antecedent will be the conjunction of them) and the conclusion will be the consequent. Can we check the truth table for a conditional to see whether the corresponding argument is valid? Yes. If the conditionalisation of an argument is a tautology, then the corresponding argument is valid. Why? Because a conditional is false exactly when its antecedent is true and its consequent is false. This is precisely the conditions under which the corresponding argument would be invalid. Therefore, if this case doesn‘t arise, then the argument isn‘t invalid, i.e., it‘s valid; or, equivalently, the main column of the truth table for the conditional will not feature a F, i.e., the conditional will be a tautology. Thus, a necessary and sufficient condition for an argument to be valid is that its conditionalisation is a tautology. An Example (i)Argument P P→Q Q (ii) Conditionalisation and Truth Table (P & (P → Q)) → Q T T T T T T T T F T F T F F F F F T T T T F F F T T F F Note: A conditionalisation whose truth table marks it as contingent is not a ‗sometimes‘ valid argument - there is no such notion; e.g., ‗¬P & (P → Q) → Q‘. A Non-Truth Table Method to Check for Validity (an algorithm) (i) Conditionalise the argument. (ii) Assume the conditional is false, i.e., put a F under the main constant. (iii) On the assumption of (ii), the antecedent of the conditional is true and the consequent false. Therefore, put a T under the main constant of the antecedent and put a F under the main constant of the consequent. (iv) Proceed, guided by the basic truth tables, to put a T or F under each variable and constant of the conditional. (v) If each variable and constant of the conditional can be assigned a T or F, then the conditional is not a tautology, for the assignment constitutes a row of the complete truth table under which the conditional is false, i.e., the conditional is not a tautology, i.e., the corresponding argument is not valid. (vi) If a complete assignment can‘t be made (i.e., if a basic truth table is contradicted), then the assumption of (ii) is false, i.e., the complete truth table for the conditional doesn‘t contain a F in its main column, i.e., the conditional is a tautology, i.e., the corresponding argument is valid. Two examples (i) (P & (P → Q)) → Q T T T T F F F 4 2 1 3 6 5 7 X (ii) ¬ P & (P → Q) → Q T F T FT F F F 4 5 2 7 6 8 1 3 No contradiction Q: The method tells us whether a conditional formula is a tautology. Does it tell us whether a formula is (i) an inconsistency or (ii) a contingency? Give reasons. 5. Rules of Inference and Proof Theory for PC Rule of inference = a rule which allows us to transform or combine formulae under the preservation of validity (truth), i.e., if the input to the rule is true, then its output is also true. A formal proof = a finite sequence of PC formulae such that each member is either an assumption or a transformation or combination of preceding formulae according to the rules of inference. The last member of the sequence is the conclusion and is such that the conjunction of its negation and and the assumptions upon which it rests is a contradiction. Rules of inference (i) Rule of Assumption (A) Insert any formula at any stage into a proof. The assumed formula rests upon the assumption of itself. (ii) Double Negation (DN) a. ¬¬A A b. A ¬¬A (‗Two negations cancel each other out‘.) The derived formula rests upon the assumptions upon which the transformed formula rests. (ii) &-Introduction (&I) A B A&B (‗One can derive the conjunction of any two preceding formulae‘) The derived formula rests upon the assumptions upon which the individual conjoined formulae rest. (iii) &-Elimination (&E) A&B A B (‗One can derive either conjunct form a preceding conjunction‘) Either of the derived formulae rest upon the assumptions upon which the conjunction rests. (iv) v-Introduction (vI) A___ AvB (‗One can derive a disjunction which has a disjunct as any preceding formula‘) The derived formula rests upon the assumptions upon which the given disjunct rests. (v) v-Elimination (vE) AvB A B C C C (‗One can derive a formula from a disjunction so long as one can derive the formula from both disjuncts of the initial disjunction‘) The derived formula rests upon the assumptions of (i) the initial disjunction, (ii) each disjunct as assumption, and (iii) each conclusion from each disjunct assumption, minus assumptions upon which rest two or more formula on which the rule operates. (vii) Modus Ponendo Ponens (MPP) A A→B B (‗One can derive the consequent of a conditional if the antecedent of the conditional is also given‘) The derived formula rests upon the assumptions upon which the conditional and its antecedent rest. (viii) Conditional Proof (CP) A B A→ B (‗One can derive a conditional from the assumption of its antecedent if one can derive the conditional‘s consequent from the assumption‘) The derived formula rests upon the assumptions upon which the assumption and its derived formula rest, minus any assumptions upon which both rest. (ix) Reductio ad Absurdum (RAA) A____ ¬A & A ¬A (‗One can derive the negation of an assumption if, from that assumption, one can derive a contradiction‘) The derived formula rests upon the assumptions upon which the initial assumption and the contradiction rest, ninus any assumptions upon which both rest. (x) Equivalence definition (↔df) a. A ↔ B_______ b. A→ B & B →A A→ B & B →A A↔B (‗One can rewrite a bi-conditional as a conjunction of conditionals, from right to left and left to right, and vice versa.) The derived formula rests upon the assumptions upon which the given formula rests. A simple sample derivation P & Q ├ P & (P v Q) (‗A ├ B‘ means ‗B is derivable from A via rules of inference‘.) 1(1) P & Q A 1(2) 1&E Q 1(3) P v Q 2vI 1(4) P 1&E 1(5) P & (P v Q) 3,4&I Explanation, from left to right (i) The first numbers indicate assumptions upon which the corresponding formula rests. In this example, all formulae rest just on the first and only assumption. (ii) The bracketed number is the number of the line. (iii) In the middle, we have the derivation itself. (iv) On the right, we have the rules and the line numbers to which they apply. So, look at line (5). This tells us that the formula is the result of the rule &-introduction applied to lines (3) and (4). We can apply our algorithm to check that the derivation is valid. P & Q → P & (P v Q) T T T F T F TT T 4 2 5 1 6 3 X A more complex example We know that A v B ↔df ¬(¬A & ¬B). So, if our rules are adequate, we should be able to derive ‗P v Q‘ from ‗¬(¬P & ¬Q)‘, and vice versa. P v Q ├ ¬(¬P & ¬Q) (a) 1 (1) P v Q A (The initial assumption) 2 (2) ¬P & ¬Q A (Assumption for RAA) 3 (3) P A (The first assumption for vE) 2 (4) ¬P 2&E (Derivation for the purposes of forming a contradiction) 2,3 (5) P & ¬P 3,4&I (A contradiction) 3 (6) ¬(¬P & ¬Q) 2,5RAA (The application of RAA) 7 (7) Q A (The second assumption of vE) 2 (8) ¬Q 2&E (Derivation for the purposes of forming a contradiction) 2,7 (9) Q & ¬Q 7,8&I (A contradiction) 7 (10) ¬(¬P & ¬Q) 2,9RAA (The application of RAA) 1 (11) ¬(¬P & ¬Q) 1,3,6,7,10vE (The application of vE - end of proof) Q1: Prove ¬(¬P & ¬Q) ├ P v Q. (Hint: begin by assuming ‗¬P v Q‘ for the purposes of RAA. For those who are stuck, a proof is given in Lemmon, p.38.) Q2: Prove that the remainder of our definitions hold (Lemmon doesn‘t contain the proofs): (i) P → Q ├ ¬(P & ¬Q) (ii) P↔ Q ├ ¬(P & ¬Q) & ¬(Q & ¬P) (ii) P & Q ├ ¬(¬P v ¬Q) (iv) P → Q ├ ¬P v Q (v) P↔ Q ├ ¬(¬(¬P v Q) v ¬(¬Q v P)) (vi) P & Q ├ ¬(Q → ¬P) (vii) P v Q ├ ¬Q→ P (viii) P↔ Q ├ ¬((P→ Q) → ¬(Q→ P)) Hints for proving (i) If the formula to be proved is a conditional, then assume its antecedent, and from that prove its consequent. Then by CP, one will have proved the formula. (ii) If the formula to be proved is a negation (i.e., its main constant is ‗¬‘), then assume the formula negated. Generate a contradiction from your assumption, then by RAA, negate the assumption to leave you with the formula that was to be proved. (iii) If you start with an equivalence, then immediately break it up via ‗↔df‘. The proof shere tend to be longer, but no more complex. (iv) The more interesting proofs require you to make unobvious assumptions. Always think about what is to be proved. If, say, its main constant is a negation, then you will probably require RAA. If you can‘t see how to get a contradiction, then work backwards. (v) Again, the more interesting proofs will involve embedded arguments - RAAs within RAAs within vEs. With practice, you will enjoy the challenge. Elegance Given that a conditional is true if its consequent is true, we should be able to prove Q├P→Q 1 (1) Q 2 (2) A P A 1,2(3) Q & P 1,2&I 1,2(4) Q 3&E 1 (5) P → Q 2,4CP Similarly, if the antecedent of a conditional is false, then the conditional is true; hence, we should be able to prove ¬P ├ P → Q 1 (1) ¬P A 2 (2) P A 3 (3) ¬Q A 1,3 (4) ¬P & ¬Q 1,3&I 1,3 (5) ¬P 4&E 1,2,3(6) P & ¬P 2,5&I 1,2 (7) ¬¬Q 3,6RAA 1,2 (8) 7DN 1 Q (9) P→ Q 2,8CP Theorems A theorem is a formula that can be proved resting upon no assumptions. If our system is adequate, all and only tautologies should be theorems. From any given proof, we can prove a theorem by CP. Taking the example from just above, ├ Q → (P → Q) 1 (1) Q 2 (2) A P 1,2(3) Q & P A 1,2&I 1,2(4) Q 3&E 1 (5) P → Q 2,4CP (6) Q → (P → Q) 1,5CP Not all theorems have a conditional form; thus, we can‘t employ CP to prove all theorems: ├ ¬(P & ¬ P) 1(1) P & ¬P (2) ¬(P & ¬ P) A 1,1RAA 5.1. Truth Tables and Completeness of PC PC is complete (and consistent) iff all and only tautologies are provable as theorems. Lemmon (chp.5) provides a meta-theoretic proof. For our purposes, a simpler way of showing that PC is complete is to derive the properties of the basic truth tables. The truth tables provide an adequate test for a formula being a tautology. Thus, if our proof theory (rules of inference) can derive all of the basic truth tables, then we would have shown that we can derive every tautology. Can we show that we can only derive tautologies as theorems? Yes, on the assumption that our proof theory is consistent. Explanatory excursus We derive a conditional for each row of each basic truth table. The antecedent of each conditional is a conjunction: if ‗P/Q‘ is true in a row, we have ‗P/Q‘ as a conjunct; if ‗P/Q‘ is false in a row, we have ‗¬P/¬Q‘ as a conjunct. The consequent of each conditional is a formula of the type whose truth table we are deriving. If the row renders the formula true, our consequent is the formula; if the row renders the formula false, our consequent is the negation of the formula. (Lemmon doesn‘t contain the proofs to follow.) Derivation of the truth function of Negation: (i) ├ ¬¬P → P (ii) ├ P → ¬¬P (1) ¬¬P A (1) P A (2) 1DN (2) ¬¬P 1DN P (3) ¬¬P → P 1,2CP (3) P → ¬¬P 1,2CP Derivation of the Truth Function of Conjunction (i) ├ P & Q → P & Q (First row: T T T) 1(1) P & Q (2) P & Q → P & Q A 1,1CP (ii) ├ P & ¬Q → ¬(P & Q) (second row: T F F) 1 (1) P & ¬Q A 2 (2) P & Q A 2 (3) Q 2&E 1 (4) ¬Q 1&E 1,2(5) Q & ¬Q 3,4&I 1 (6) ¬(P & Q) 2,5RAA (7) P & ¬Q → ¬(P & Q) 1,6CP The derivations for the remaining two rows follow the same pattern as (ii) (iii) ├ ¬P & Q → ¬(P & Q) (Third row: F F T) (iv) ├ ¬P & ¬Q → ¬(P & Q) (Fourth row: F F F) Q: Prove (iii) and (iv) Derivation of the Truth Function of Disjunction (i) ├ P & Q → P v Q (First row: T T T) 1(1) P & Q A 1(2) P 1&E 1(3) P V Q 2vI (4) P & Q → P v Q 1,1CP The derivations for the second and third rows follow the same pattern; the fourth row is more tricky. (ii) ├ P & ¬Q → P v Q (Second row: T T F) (iii) ├ ¬P & Q → P v Q (Third row: F T T) (iv) ├ ¬P & ¬Q → ¬(P v Q) (Fourth row: F F F) Q: Prove (ii)-(iv) Derivation of the Truth Function of Material Implication (i) ├ P & Q → P → Q (First row: T T T) 1 (1) P & Q A 2 (2) P A 1 (3) Q 1&E 1,2(4) P & Q 2,3&I 1,2(5) 4&E Q 1 (6) P → Q (7) P & Q → P → Q 2,5CP 1,6CP (ii) ├ ¬Q → ¬(P → Q) (Second row: T F F) 1 (1) P & ¬Q A 2 (2) P → Q A 1 (3) P 1&E 1,2(4) Q 1 (5) ¬Q 2,3MPP 1&E 1,2(6) Q & ¬Q 4,5&I 1 (7) ¬(P → Q) 2,6RAA (8) P & ¬Q → ¬(P → Q) 1,7CP The remaining two derivations are (iii) ├ ¬P & Q → P → Q (Third row: F T T) (iv) ├ ¬P & ¬Q → P → Q (Fourth row: F T F) Q: Prove (iii)-(iv). Derivation of the Truth Function of Material Equivalence (i) ├ Q → P ↔ Q (First row: T T T) 1 (1) P & Q A 2 (2) P A 1 (3) Q 1&E 1,2 (4) P & Q 2,3&I 1,2 (5) 4&E Q 1 (6) P → Q 2,5CP 7 (7) Q A 1 (8) P 1&E 1,7 (9) P & Q 7,8&I 1,7 (10) P 9&E 1 (11) Q → P 1 (12) P → Q & Q → P 6,11&I 1 (13) P ↔ Q 7,10CP 12 ↔ df (14) P & Q → P ↔ Q 1,13CP (ii) ├ P & ¬Q → ¬(P ↔ Q) (Second row: T F F) 1 (1) P & ¬Q A 2 (2) P ↔ Q A 2 (3) P → Q & Q → P 2 ↔ df 2 (4) P → Q 3&E 1 (5) P 1&E 1,2(6) Q 1 (7) ¬Q 1,2(8) 4,5MPP 1&E Q & ¬Q 6,7&I 1 (9) ¬(P ↔ Q) 2,8RAA (10) P & ¬Q → ¬(P ↔ Q) 1,9CP The remaining two derivations, following the same pattern, are (iii) ├ ¬P & Q → ¬(P ↔ Q) (Second row: F F T) (iv) ├ ¬P & ¬Q → P ↔ Q (Second row: F T F) Q: Prove (iii)-(iv). De Morgan Laws Proposition Let and be two propositions. Then the two following properties hold: (i) is logically equivalent to (ii) is logically equivalent to . . Proof. We use truth tables. (i) T T T F F F F T F T F F T F F T T F T F F F F F T T T T T T T F F F F T F F T F T T F T F T T F T F F F T T T T (ii) In each truth table, the fourth column is identical to the last one, therefore the claim is true. Example The negation of the sentence ``This morning, Dany ate an apple and an ornage'' is ``This morning, either Dany did not eat an apple or he did not eat an orange''. The negation of the sentence ``Theses seats are made either with leather or with velvet'' is ``These seats are made neither with leather nor with velvet.'' Tautologies and contradictions Definition: A propositional expression is a tautology if and only if for all possible assignments of truth values to its variables its truth value is T Example: P V ¬ P P ¬P PV¬P --------------------T F T F T T Definition: A propositional expression is a contradiction if and only if for all possible assignments of truth values to its variables its truth value is F Example: P Λ ¬ P P ¬P PΛ¬P --------------------T F F F T F Usage of tautologies and contradictions - in proving the validity of arguments; for rewriting expressions using only the basic connectives. VARIOUS NORMAL FORMS In this section you will know about four kinds of normal forms i.e. Disjunctive, Conjunctive, principal Disjunctive & Principal Conjunctive normal forms. 3.2.1 Disjunctive Normal Forms We shall use the words 'product' and 'sum' in place of the logical connectives 'conjunction' and 'disjuncdon' respectively. Before defining what is called 'disjunctive normal forms' we first introduce some other concepts needed in the sequel. In a formula, a product of the variables and their negations is called an elementary product. Similarly a sum of the variables and their negations is called an elementary sum. Let P and Q be any two variables. Then P., ù P Ù Q, ù Q Ù P Ù ù P, P Ù ù P, Q Ù ù P are some examples of elementary products; and P, ù P Ú Q, ù Q Ú P Ú ù P, P Ú ù P , Q Ú ù P are examples of elementary sums of two variables. A part of the elementary sum or product which is itself an elementary sum Or product is called a factor of the Original sum Or Product The elementary sums or products satisfy the following properties. We only state them without proof. 1. An elementary product is identically false if and only if it contains at least one pair of factors in which one is the negation of the other. 2. An elementary sum is identically true if and only if it contains atleast one pair of factors in which one is the negation of the other. We now discuss some examples. It should be noted that the disjunctive normal form of a given formula is not unique. For example, consider P Ú ( Q Ù R ). This is already in disjunctive normal form. We can write PÚ(QÙR) Û(PÚQ)Ù(PÚR) Û(PÙP)Ú(PÙQ)Ú(PÙR)Ú(QÙP) and this is another equivalent normal form. In subsequent sections we introduce the concepts of Principal normal forms which give unique normal form of a given formula. 3.2.2 Conjunctive Normal Forms A formula which consists of a product of elementary sums and is equivalent to a given formula is called a conjunctive normal form of the given formula. Principal Disjunctive Normal Forms For two Statement variables P and Q, construct all possible formulas which consist of Conjunctions of P or its negation and conjunctions of Q or its negation such that none of the formulas contain both a variable and its negation. Note that any formula which is obtained by commuting the formulas in the conduction should not be included in the list because any such formula will be equivalent to one included in the list. For example, any one of P Ù Q or Q Ù P is included in the list, but not the both. For two variables P and Q, there are 2 2 = 4 formulas included in the list these are given by P Ù Q, P Ù ù Q, ù P Ù Q, ù P Ù ù Q. These formulas are called minterms. One can construct truth table and observe that no two minterms are equivalent. The truth table is given below : P QP Ù Q PÙùQ ùPÙQ ùPÙùQ TTT F F F TF F T F F FTF F T F FFF F F T Given one formula, an equivalent formula, consisting of disjunctions of minterrns only is known as its Principal Disjunctive normal, form or sum-of-products canonical form. Principal Conjunctive Normal Forms Given a number of variables, maxterm of these variables is a formula which consists of disjunctions in which each variable or its negation but not both appear only once. Observe that the maxterms are the duals of minterms. Note that each of the minterms has the truth value T for exactly one combination of the truth values of the variables and this fact can be seen from truth table. Therefore each of the maxterms has the truth value F for exactly one combination of the truth values of the variables. This fact can be derived from the duality principle (using the properties of minterms) or can be directly obtained from truth table. For a given formula, an equivalent formula consisting of conductions of the maxterms only is known as its principal conjunctive normal form or the product-of-sums canonical form. Validity of arguments(mh) Most of the arguments philosophers concern themselves with are--or purport to be-deductive arguments. Mathematical proofs are a good example of deductive argument. Most of the arguments we employ in everyday life are not deductive arguments but rather inductive arguments. Inductive arguments are arguments which do not attempt to establish a thesis conclusively. Rather, they cite evidence which makes the conclusion somewhat reasonable to believe. The methods Sherlock Holmes employed to catch criminals (and which Holmes misleadingly called "deduction") were examples of inductive argument. Other examples of inductive argument include: concluding that it won't snow on June 1st this year, because it hasn't snowed on June 1st for any of the last 100 years; concluding that your friend is jealous because that's the best explanation you can come up with of his behavior, and so on. It's a controversial and difficult question what qualities make an argument a good inductive argument. Fortunately, we don't need to concern ourselves with that question here. In this class, we're concerned only withdeductive arguments. Philosophers use the following words to describe the qualities that make an argument a good deductive argument: Valid Arguments We call an argument deductively valid (or, for short, just "valid") when the conclusion is entailed by, or logically follows from, the premises. Validity is a property of the argument's form. It doesn't matter what the premises and the conclusion actually say. It just matters whether the argument has the right form. So, in particular, a valid argument need not have true premises, nor need it have a true conclusion. The following is a valid argument: 1. All cats are reptiles. 2. Bugs Bunny is a cat. 3. So Bugs Bunny is a reptile. Neither of the premises of this argument is true. Nor is the conclusion. But the premises are of such a form that if they were both true, then the conclusion would also have to be true. Hence the argument is valid. To tell whether an argument is valid, figure out what the form of the argument is, and then try to think of some other argument of that same form and having true premises but a false conclusion. If you succeed, then every argument of that form must be invalid. A valid form of argument can never lead you from true premises to a false conclusion. For instance, consider the argument: 1. If Socrates was a philosopher, then he wasn't a historian. 2. Socrates wasn't a historian. 3. So Socrates was a philosopher. This argument is of the form "If P then Q. Q. So P." (If you like, you could say the form is: "If P then not-Q. not-Q. So P." For present purposes, it doesn't matter.) The conclusion of the argument is true. But is it a valid form of argument? It is not. How can you tell? Because the following argument is of the same form, and it has true premises but a false conclusion: 1. If Socrates was a horse (this corresponds to P), then Socrates was warm-blooded (this corresponds to Q). 2. Socrates was warm-blooded (Q). 3. So Socrates was a horse (P). Since this second argument has true premises and a false conclusion, it must be invalid. And since the first argument has the same form as the second argument (both are of the form "If P then Q. Q. So P."), both arguments must be invalid. Here are some more examples of invalid arguments: The Argument Its Form If there is a hedgehog in my gas tank, then my car will not start. If P then Q. My car will not start. Q. Hence, there must be a hedgehog in my gas tank. So P. If I publicly insult my mother-in-law, then my wife will be angry at me. If P then Q. I will not insult my mother-in-law. not-P. Hence, my wife will never be angry at me. So not-Q. Either Athens is in Greece or it is in Turkey. Either P or Q. Athens is in Greece. P. Therefore, Athens is in Turkey. So Q. If I move my knight, Christian will take If I move my queen, Christian will take Therefore, if I move my knight, then I move my queen. my my knight. If P then Q. knight. If R then Q. So if P then R. Invalid arguments give us no reason to believe their conclusions. But be careful: The fact that an argument is invalid doesn't mean that the argument's conclusion is false. The conclusion might be true. It's just that the invalid argument doesn't give us any good reason to believe that the conclusion is true. If you take a class in Formal Logic, you'll study which forms of argument are valid and which are invalid. We won't devote much time to that study in this class. I only want you to learn what the terms "valid" and "invalid" mean, and to be able to recognize a few clear cases of valid and invalid arguments when you see them. Your high idle is caused either by a problem with the transmission, or by too little oil, or both. You have too little oil in your car. Therefore, your transmission is fine. If the moon is made of green cheese, then cows jump over it. The moon is made of green cheese. Therefore, cows jump over the moon. Either Colonel Mustard or Miss Scarlet is the culprit. Miss Scarlet is not the culprit. Hence, Colonel Mustard is the culprit. All engineers enjoy ballet. Therefore, some males enjoy ballet. Sometimes an author will not explicitly state all the premises of his argument. This will render his argument invalid as it is written. In such cases we can often "fix up" the argument by supplying the missing premise, assuming that the author meant it all along. For instance, as it stands, the argument: 1. All engineers enjoy ballet. 2. Therefore, some males enjoy ballet. is invalid. But it's clear how to fix it up. We just need to supply the hidden premise: 1. All engineers enjoy ballet. 2. Some engineers are male. 3. Therefore, some males enjoy ballet. You should become adept at filling in such missing premises, so that you can see the underlying form of an argument more clearly. Example If you keep driving your car with a faulty carburetor, it will eventually explode. Therefore, if you keep driving your car with a faulty carburetor, you will eventually get hurt. Abortion is morally wrong.Abortion is not a constitutional right. Therefore, abortion ought to be against the law Sometimes a premise is left out because it is taken to be obvious, as in the engineer argument, and in the exploding car argument. But sometimes the missing premise is very contentious, as in the abortion argument. Sound Arguments An argument is sound just in case it's valid and all its premises are true. The argument: 1. If the moon is made of green cheese, then cows jump over it. 2. The moon is made of green cheese. 3. Therefore, cows jump over the moon. is an example of a valid argument which is not sound. We said above that a valid argument can never take you from true premises to a false conclusion. So, if you have a sound argument for a given conclusion, then, since the argument has true premises, and since the argument is valid, and valid arguments can never take you from true premises to a false conclusion, the argument's conclusion must be true. Sound arguments always have true conclusions. This means that if you read Philosopher X's argument and you disagree with his conclusion, then you're committed to the claim that his argument is unsound. Either X's conclusion does not actually follow from his premises--there is a problem with his reasoning or logic--or at least one of X's premises is false. When you're doing philosophy, it is never enough simply to say that you disagree with someone's conclusion, or that his conclusion is wrong. If your opponent's conclusion is wrong, then there must be something wrong with his argument, and you need to say what it is. I. If Socrates is a man, then Socrates is mortal. Socrates is a man. So, Socrates is mortal. II. If Socrates is a horse, then Socrates is mortal. Socrates is a horse. So, Socrates is mortal. III. If Socrates is a horse, then Socrates has four legs. Socrates is a horse. So, Socrates has four legs. IV. If Socrates is a horse, then Socrates has four legs. Socrates doesn't have four legs. So, Socrates is not a horse. V. If Socrates is a man, then he's a mammal. Socrates is not a mammal. So Socrates is not a man. VI. If Socrates is a horse, then he's warm-blooded. Socrates is warm-blooded. So Socrates is a horse. VII. If Socrates was a philosopher then he wasn't a historian. Socrates wasn't a historian. So, Socrates was a philosopher. Persuasive Arguments Unfortunately, merely having a sound argument is not yet enough to have the persuasive force of reason on your side. For it might be that your premises are true, but it's hard to recognize that they're true. Consider the following two arguments: Argument A Argument B 1. Either God exists, or 2+2=5. 1. Either God does not exist, or 2+2=5. 2. 2+2 does not equal 5. 2. 2+2 does not equal 5. 3. So God exists. 3. So God does not exist. Both of these arguments have the form "P or Q. not-Q. So P." That's a valid form of argument. So both of these arguments are valid. What's more, at least one of the arguments is sound. If God exists, then all the premises of Argument A are true, and since Argument A is valid, it must also be sound. If God does not exist, then all the premises of Argument B are true, and since Argument B is valid, it must also be sound. Either way, one of the arguments is sound. But we can't tell which of these arguments is sound and which is not. Hence neither argument is very persuasive. In general, when you're engaging in philosophical debate, you don't just want valid arguments from premises that happen to be true. You want valid arguments from premises that are recognizable as true, or already accepted as true, by all parties to your debate. Hence, we can introduce a third notion: A persuasive argument is a valid argument with plausible, or obviously true, or antecedently accepted premises. These are the sorts of arguments you should try to offer. Conditionals A claim of the form "If P then Q" is known as a conditional. P is called the antecedent of the conditional, and Q is called the consequent of the conditional. In this class, you can take all of the following to be variant ways of saying the same thing: If P then Q P implies Q P -> Q P is sufficient (or: a sufficient condition) for Q If you've got P you must have Q A necessary condition for having P is that you have Q Q is necessary for having P It's only the case that P if it's also the case that Q P only if Q Note the terms sufficient condition and necessary condition. To say that one fact is a sufficient condition for a second fact means that, so long as the first fact obtains, that's enough to guarantee that the second fact obtains, too. For example, if you have ten children, that is sufficient for you to be a parent. To say that one fact is a necessary condition for a second fact means that, in order for the second fact to be true, it's required that the first fact also be true. For example, in order for you to be a father, it's necessary that you be male. You can't be a father unless you're male. So being male is a necessary condition for being a father. When P entails Q, then P is a sufficient condition for Q (if P is true, that guarantees that Q is true, too); and Q is a necessary condition for P (in order for P to be true, Q also has to be true). Consider the following pairs and say whether one provides sufficient and/or necessary conditions for the other. 1. a valid argument, a sound argument 2. knowing that it will rain, believing that it will rain Now, just because P entails Q, it doesn't follow that Q entails P. However, sometimes it's both the case that P entails Q and also the case that Q entails P. When so, we write it as follows (again, all of these are variant ways of saying the same thing): P if and only if Q P iff Q P just in case Q P <-> Q if P then Q, and if Q then P P is both sufficient and necessary for Q P is a necessary and sufficient condition for Q For example, being a male parent is both necessary and sufficient for being a father. If you're a father, it's required that you be a male parent. And if you're a male parent, that suffices for you to be father. So we can say that someone is a father if and only if he's a male parent. Consistency When a set of propositions cannot all be simultaneously true, we say that the propositions are inconsistent. Here is an example of two inconsistent propositions: 1. Oswald acted alone when he shot Kennedy. 2. Oswald did not act alone when he shot Kennedy. When a set of propositions is not inconsistent, then they're consistent. Note that consistency is no guarantee of truth. It's possible for a set of propositions to be consistent, and yet for some or all of them to be false. Sometimes we say that a proposition P is incompatible with another proposition Q. This is just another way of saying that the two propositions are inconsistent with each other. A contradiction is a proposition that's inconsistent with itself, like "P and not-P." Sometimes it's tricky to see that a set of propositions is inconsistent, or to determine which of them you ought to give up. For instance, the following three propositions all seem somewhat plausible, yet they cannot all three be true, for they're inconsistent with each other: 1. If a person promises to do something, then he's obliged to do it. 2. No one is obliged to do things which it's impossible for him to do. 3. People sometimes promise to do things it's impossible for them to do. Problem 1 Represent as propositional expressions: Tom is a math major but not computer science major P: Tom is Q: Tom is a computer science major a math major Use De Morgan's Laws to write the negation of the expression, and translate the negation in English Problem 2 Let P = Q = R = "John is wise" "John "John is is healthy" wealthy" Represent: John is healthy and wealthy but not wise: John is not wealthy but he is healthy and wise: John is neither healthy nor wealthy nor wise: Problem 3 Translate the sentences into propositional expressions: "Neither the fox nor the lynx can catch the hare if the hare is alert and quick." Solution Let P: Q: The The fox lynx can can catch catch the the hare hare. R: The S: The hare is quick hare is alert Translation into logic: Problem 4 "You can either (stay at the hotel and watch TV ) or (you can go to the museum and spend some time there)". The parentheses are used to avoid ambiguity concerning the priority of the logical connectives. Problem 5 . Given a conditional statement in English, a. translate the sentence into a logical expression b. write the negation of the logical expression and translate the negation into English c. write the converse of the logical expression and translate the converse into English d. write the inverse of the logical expression and translate the inverse into English e. write the contrapositive of the logical expression and translate the contrapositive into English "If we are on vacation we go fishing." Problem 6 Write the contrapositive, P → Q, ~P → Q, Q → ~P converse and inverse of the expressions: Problem 7 Determine whether the following arguments are valid or invalid: Premises: a. If I read the newspaper in the kitchen, my glasses would be on the kitchen table. b. I did not read the newspaper in the kitchen. Conclusion : My glasses are not on the kitchen table. Problem 8 Premises: c. If I don't study hard, I will not pass this course d. If I don't pass this course I cannot graduate this year. Conclusion: If I don't study hard, I won't graduate this year. Problem 9 Premises: e. You will get an extra credit if you write a paper or if you solve the test problems. f. You don‘t write a paper, however you get an extra credit. Conclusion: You have solved the test problems. Problem 10 Premises: g. You will get an extra credit if you write a paper or if you solve the test problems. h. You don‘t write a paper and you don't get an extra credit. Conclusion: You have not solved the test problems. PREDICATE CALCULUS Introduction to Predicate Logic The propositional logic is not powerful enough to represent all types of assertions that are used in computer science and mathematics, or to express certain types of relationship between propositions such as equivalence. For example, the assertion "x is greater than 1", where x is a variable, is not a proposition because you cannot tell whether it is true or false unless you know the value of x. Thus the propositional logic cannot deal with such sentences. However, such assertions appear quite often in mathematics and we want to do inferencing on those assertions. Also the pattern involved in the following logical equivalences cannot be captured by the propositional logic: "Not all birds fly" is equivalent to "Some birds don't fly". "Not all integers are even" is equivalent to "Some integers are not even". "Not all cars are expensive" is equivalent to "Some cars are not expensive", ... . Each of those propositions is treated independently of the others in propositional logic. For example, if P represents "Not all birds fly" and Q represents "Some integers are not even", then there is no mechanism inpropositional logic to find out whether or not P is equivalent to Q. Hence to be used in inferencing, each of these equivalences must be listed individually rather than dealing with a general formula that covers all these equivalences collectively and instantiating it as they become necessary, if only propositional logic is used. Thus we need more powerful logic to deal with these and other problems. The predicate logic is one of such logic and it addresses these issues among others. A predicate is a verb phrase template that describes a property of objects, or a relationship among objects represented by the variables. For example, the sentences "The car Tom is driving is blue", "The sky is blue", and "The cover of this book is blue" come from the template "is blue" by placing an appropriate noun/noun phrase in front of it. The phrase "is blue" is a predicate and it describes the property of being blue. Predicates are often given a name. For example any of "is_blue", "Blue" or "B" can be used to represent the predicate "is blue" among others. If we adopt B as the name for the predicate "is_blue", sentences that assert an object is blue can be represented as "B(x)", where x represents an arbitrary object. B(x) reads as "x is blue". Similarly the sentences "John gives the book to Mary", "Jim gives a loaf of bread to Tom", and "Jane gives a lecture to Mary" are obtained by substituting an appropriate object for variables x, y, and z in the sentence "xgives y to z". The template "... gives ... to ..." is a predicate and it describes a relationship among three objects. This predicate can be represented by Give( x, y, z ) or G( x, y, z ), for example. Note: The sentence "John gives the book to Mary" can also be represented by another predicate such as "gives a book to". Thus if we use B( x, y ) to denote this predicate, "John gives the book to Mary" becomes B( John, Mary ). In that case, the other sentences, "Jim gives a loaf of bread to Tom", and "Jane gives a lecture to Mary", must be expressed with other predicates. A predicate with variables is not a proposition. For example, the statement x > 1 with variable x over the universe of real numbers is neither true nor false since we don't know what x is. It can be true or false depending on the value of x. For x > 1 to be a proposition either we substitute a specific number for x or change it to something like "There is a number x for which x > 1 holds", or "For every number x, x > 1 holds". More generally, a predicate with variables (called an atomic formula) can be made a proposition by applying one of the following two operations to each of its variables: 1. assign a value to the variable 2. quantify the variable using a quantifier (see below). For example, x > 1 becomes 3 > 1 if 3 is assigned to x, and it becomes a true statement, hence a proposition. In general, a quantification is performed on formulas of predicate logic (called wff ), such as x > 1 or P(x), by using quantifiers on variables. There are two types of quantifiers: universal quantifier and existential quantifier. The universal quantifier turns, for example, the statement x > 1 to "for every object x in the universe, x > 1", which is expressed as " x x > 1". This new statement is true or false in the universe of discourse. Hence it is a proposition once the universe is specified. Similarly the existential quantifier turns, for example, the statement x > 1 to "for some object x in the universe, x > 1", which is expressed as " x x > 1." Again, it is true or false in the universe of discourse, and hence it is a proposition once the universe is specified. Universe of Discourse The universe of discourse, also called universe, is the set of objects of interest. The propositions in the predicate logic are statements on objects of a universe. The universe is thus the domain of the (individual) variables. It can be the set of real numbers, the set of integers, the set of all cars on a parking lot, the set of all students in a classroom etc. The universe is often left implicit in practice. But it should be obvious from the context. The Universal Quantifier The expression: x P(x), denotes the universal quantification of the atomic formula P(x). Translated into the English language, the expression is understood as: "For all x, P(x) holds", "for each x, P(x) holds" or "for every x, P(x) holds". is called the universal quantifier, and x means all the objects x in the universe. If this is followed by P(x) then the meaning is that P(x) is true for every object x in the universe. For example, "All cars have wheels" could be transformed into the propositional form, x P(x), where: P(x) is the predicate denoting: x has wheels, and the universe of discourse is only populated by cars. Universal Quantifier and Connective AND If all the elements in the universe of discourse can be listed then the universal quantification x P(x) is equivalent to theconjunction: P(x1)) P(x2) P(x3) ... P(xn) . For example, in the above example of x P(x), if we knew that there were only 4 cars in our universe of discourse (c1, c2, c3 and c4) then we could also translate the statement as: P(c1) P(c2) P(c3) P(c4) The Existential Quantifier The expression: xP(x), denotes the existential quantification of P(x). Translated into the English language, the expression could also be understood as: "There exists an x such that P(x)" or "There is at least one x such that P(x)" is called the existential quantifier, and x means at least one object x in the universe. If this is followed by P(x) then the meaning is that P(x) is true for at least one object x of the universe. For example, "Someone loves you" could be transformed into the propositional form, x P(x), where: P(x) is the predicate meaning: x loves you, The universe of discourse contains (but is not limited to) all living creatures. Existential Quantifier and Connective OR If all the elements in the universe of discourse can be listed, then the existential quantification xP(x) is equivalent to the disjunction: P(x1) P(x2) P(x3) ... P(xn). For example, in the above example of x P(x), if we knew that there were only 5 living creatures in our universe of discourse (say: me, he, she, rex and fluff), then we could also write the statement as: P(me) P(he) P(she) P(rex) P(fluff) An appearance of a variable in a wff is said to be bound if either a specific value is assigned to it or it is quantified. If an appearance of a variable is not bound, it is called free. The extent of the application(effect) of a quantifier, called the scope of the quantifier, is indicated by square brackets [ ]. If there are no square brackets, then the scope is understood to be the smallest wff following the quantification. For example, in x P(x, y), the variable x is bound while y is free. In x [ y P(x, y) Q(x, y) ] , x and the y in P(x, y) are bound, while y in Q(x, y) is free, because the scope of y is P(x, y). The scope of x is [ y P(x, y) Q(x, y) ] . How to read quantified formulas When reading quantified formulas in English, read them from left to right. x can be read as "for every object x in the universe the following holds" and x can be read as "there erxists an object x in the universe which satisfies the following" or "for some object x in the universe the following holds". Those do not necessarily give us good English expressions. But they are where we can start. Get the correct reading first then polish your English without changing the truth values. For example, let the universe be the set of airplanes and let F(x, y) denote "x flies faster than y". Then x y F(x, y) can be translated initially as "For every airplane x the following holds: x is faster than every (any) airplane y". In simpler English it means "Every airplane is faster than every airplane (including itself !)". x y F(x, y) can be read initially as "For every airplane x the following holds: for some airplane y, x is faster than y". In simpler English it means "Every airplane is faster than some airplane". x y F(x, y) represents "There exist an airplane x which satisfies the following: (or such that) for every airplane y, x is faster than y". In simpler English it says "There is an airplane which is faster than every airplane" or "Some airplane is faster than every airplane". x y F(x, y) reads "For some airplane x there exists an airplane y such that x is faster than y", which means "Some airplane is faster than some airplane". Order of Application of Quantifiers When more than one variables are quantified in a wff such as y x P( x, y ), they are applied from the inside, that is, the one closest to the atomic formula is applied first. Thus y x P( x, y ) reads y [ x P( x, y ) ] ,and we say "there exists an y such that for every x, P( x, y ) holds" or "for some y, P( x, y ) holds for every x". The positions of the same type of quantifiers can be switched without affecting the truth value as long as there are no quantifiers of the other type between the ones to be interchanged. For example x y z P(x, y , z) is equivalent to y x z P(x, y , z), z y x P(x, y , z), etc. It is the same for the universal quantifier. However, the positions of different types of quantifiers can not be switched. For example x y P( x, y ) is not equivalent to y x P( x, y ). For let P( x, y ) represent x < y for the set of numbers as the universe, for example. Then x y P( x, y ) reads "for every number x, there is a number ythat is greater than x", which is true, while y x P( x, y ) reads "there is a number that is greater than every (any) number", which is not true. Not all strings can represent propositions of the predicate logic. Those which produce a proposition when their symbols are interpreted must follow the rules given below, and they are called wffs(well-formed formulas) of the first order predicate logic. Rules for constructing Wffs A predicate name followed by a list of variables such as P(x, y), where P is a predicate name, and x and y are variables, is called an atomic formula. Wffs are constructed using the following rules: 1. True and False are wffs. 2. Each propositional constant (i.e. specific proposition), and each propositional variable (i.e. a variable representing propositions) are wffs. 3. Each atomic formula (i.e. a specific predicate with variables) is a wff. 4. If A, B, and C are wffs, then so are A, (A B), (A B), (A B), and (A B). 5. If x is a variable (representing objects of the universe of discourse), and A is a wff, then so are x A and x A . (Note : More generally, arguments of predicates are something called a term. Also variables representing predicate names (called predicate variables) with a list of variables can form atomic formulas. But we do not get into that here. For example, "The capital of Virginia is Richmond." is a specific proposition. Hence it is a wff by Rule 2. Let B be a predicate name representing "being blue" and let x be a variable. Then B(x) is an atomic formula meaning "x is blue". Thus it is a wff by Rule 3. above. By applying Rule 5. to B(x), xB(x) is a wff and so is xB(x). Then by applying Rule 4. to them x B(x) x B(x) is seen to be a wff. Similarly if R is a predicate name representing "being round". Then R(x) is an atomic formula. Hence it is a wff. By applying Rule 4 to B(x)and R(x), a wff B(x) R(x) is obtained. Note, however, that strings that cannot be constructed by using those rules are not wffs. For example, xB(x)R(x), and B( x ) are NOT wffs, NOR are B( R(x) ), and B( x R(x) ) . One way to check whether or not an expression is a wff is to try to state it in English. If you can translate it into a correct English sentence, then it is a wff. More examples: To express the fact that Tom is taller than John, we can use the atomic formula taller(Tom, John), which is a wff. This wff can also be part of some compound statement such as taller(Tom, John) taller(John, Tom), which is also a wff. If x is a variable representing people in the world, then taller(x,Tom), taller(x,Tom), x y taller(x,y) are all wffs among others. However, taller( x,John) and taller(Tom x taller(x,Tom), x Mary, Jim), for example, are NOT wffs. Interpretation A wff is, in general, not a proposition. For example, consider the wff x P(x). Assume that P(x) means that x is non-negative (greater than or equal to 0). This wff is true if the universe is the set {1, 3, 5}, the set {2, 4, 6} or the set of natural numbers, for example, but it is not true if the universe is the set {-1, 3, 5}, or the set of integers, for example. Further more the wff x Q(x, y), where Q(x, y) means x is greater than y, for the universe {1, 3, 5} may be true or false depending on the value of y. As one can see from these examples, the truth value of a wff is determined by the universe, specific predicates assigned to the predicate variables such as P and Q, and the values assigned to the free variables. The specification of the universe and predicates, and an assignment of a value to each free variable in a wff is called an interpretation for the wff. For example, specifying the set {1, 3, 5} as the universe and assigning 0 to the variable y, for example, is an interpretation for the wff x Q(x, y), where Q(x, y) means x is greater than y. x Q(x, y) with that interpretation reads, for example, "Every number in the set {1, 3, 5} is greater than 0". As can be seen from the above example, a wff becomes a proposition when it is given an interpretation. There are, however, wffs which are always true or always false under any interpretation. Those and related concepts are discussed below. Satisfiable, Unsatisfiable and Valid Wffs A wff is said to be satisfiable if there exists an interpretation that makes it true, that is if there are a universe, specific predicates assigned to the predicate variables, and an assignment of values to the free variables that make the wff true. For example, x N(x), where N(x) means that x is non-negative, is satisfiable. For if the universe is the set of natural numbers, the assertion x N(x) is true, because all natural numbers are non-negative. Similarly x N(x)is also satisfiable. However, x [N(x) N(x)] is not satisfiable because it can never be true. A wff is called invalid or unsatisfiable, if there is no interpretation that makes it true. A wff is valid if it is true for every interpretation*. For example, the wff x P(x) P(x) is valid for any predicate name P , because x P(x) is the negation of x P(x). However, the wff x x N(x) is satisfiable but not valid. Note that a wff is not valid iff it is unsatisfiable for a valid wff is equivalent to true. Hence its negation is false. Equivalence Two wffs W1 and W2 are equivalent if and only if W1 W2 is valid, that is if and only if W1 W2 is true for all interpretations. For example x P(x) and x P(x) are equivalent for any predicate name P . So are x [ P(x) Q(x) ] and [ x P(x) x Q(x) ] for any predicate names P and Q . English sentences appearing in logical reasoning can be expressed as a wff. This makes the expressions compact and precise. It thus eliminates possibilities of misinterpretation of sentences. The use of symbolic logic also makes reasoning formal and mechanical, contributing to the simplification of the reasoning and making it less prone to errors. Transcribing English sentences into wffs is sometimes a non-trivial task. In this course we are concerned with the transcription using given predicate symbols and the universe. To transcribe a proposition stated in English using a given set of predicate symbols, first restate in English the proposition using the predicates, connectives, and quantifiers. Then replace the English phrases with the corresponding symbols. Example: Given the sentence "Not every integer is even", the predicate "E(x)" meaning x is even, and that the universe is the set of integers, first restate it as "It is not the case that every integer is even" or "It is not the case that for every object x in the universe, x is even." Then "it is not the case" can be represented by the connective " ", "every object x in the universe" by " x", and "x is even" by E(x). Thus altogether wff becomes x E(x). This given sentence can also be interpreted as "Some integers are not even". Then it can be restated as "For some object x in the universe, x is not even". Then it becomes x E(x). More examples: A few more sentences with corresponding wffs are given below. The universe is assumed to be the set of integers, E(x) represents x is even, and O(x), x is odd. "Some integers are even and some are odd" can be translated as "No integer is even" can go to x x E(x) x O(x) E(x) "If an integer is not even, then it is odd" becomes x[ E(x) O(x)] "2 is even" is E(2) More difficult translation: In these translations, properties and relationships are mentioned for certain type of elements in the universe such as relationships between integers in the universe of numbers rather than the universe of integers. In such a case the element type is specified as a precondition using if_then construct. Examples: In the examples that follow the universe is the set of numbers including real numbers, and complex numbers. I(x), E(x) and O(x) representing "x is an integer", "x is even", and "x is odd", respectively. "All integers are even" is transcribed as x [ I(x) E(x)] It is first restated as "For every object in the universe (meaning for every numnber in this case) if it is integer, then it is even". Here we are interested in not any arbitrary object(number) but a specific type of objects, that is integers. But if we write x it means "for any object in the universe". So we must say "For any object, if it is integer .." to narrow it down to integers. "Some integers are odd" can be restated as "There are objects that are integers and odd", which is expressed as x [ I(x) O(x)] "A number is even only if it is integer" becomes x [ E(x) I(x)] "Only integers are even" is equivalent to "If it is even, then it is integer". Thus it is translated to x [ E(x) I(x)] Predicate logic is more powerful than propositional logic. It allows one to reason about properties and relationships of individual objects. In predicate logic, one can use some additional inference rules, which are discussed below, as well as those for propositional logic such as the equivalences, implications and inference rules. The following four rules describe when and how the universal and existential quantifiers can be added to or deleted from an assertion. 1. Universal Instantiation: x P(x) ------- P(c) where c is some arbitrary element of the universe. Universal Generalization: P(c) ---------- x P(x) where P(c) holds for every element c of the universe of discourse. Existential Instantiation: x P(x) ------P(c) where c is some element of the universe of discourse. It is not arbitrary but must be one for which P(c) is true. 2. Existential Generalization: P(c) ---------x P(x)where c is an element of the universe. Negation of Quantified Statement Another important inference rule is the following: x P(x) x P(x) This, for example, shows that if P(x) represnts x is happy and the universe is the set of people, then "There does not exist a person who is happy" is equivalent to "Everyone is not happy". Thus the left side can be substituted for the right side whenever necessary in reasoning and vice versa. Example: As an example of inference using these rules, let us consider the following reasoning: A check is void if it has not been cashed for 30 days. This check has not been cashed for 30 days. Therefore this check is void. You can not cash a check which is void. Therefore you can not cash this check. We now have a check which can not be cashed. This can be put into symbolic form using the following predicates assuming the universe is the set of all objects: C(x): x is a check. T(x): x has been cashed within 30 days. V(x): x is void. S(x): x can be cashed. This_check represents a specific object in the universe which corresponds to "this check". x [ [ C(x) T(x) ] V(x) ] T( This_check ) ----------------------------------V( This_check ) x [ [ C(x) V(x) ] S(x) ] ----------------------------------------------S( This_check ) ----------------------------------------------x [ C(x) S(x) ] . Here the reasoning proceeds as follows: From x [ [ C(x) [[ C( This_check ) T(x) ] V(x) ] by Universal Instantiation T( This_check )] Since This_check is a check and V( This_check )] T( This_check ) , [ C( This_check ) T( This_check )] holds. Hence [[ C( This_check ) T( This_check )] V( This_check )] [ C( This_check ) T( This_check )] --------------------------------------------------------V( This_check ) by Modus Ponens. Then from x [ [ C(x) V(x) [[ C( This_check ) V( This_check )] ] S(x) ] by S( This_check )] Universal Instantiation, Since V( This_check ) ,and C( This_check ), [[ C( This_check ) V( This_check )] S( This_check )] [ C( This_check ) V( This_check )] ---------------------------------------------------S( This_check ) by Modus Ponens. Since C( This_check ) also holds, S( This_check ) C( This_check ) ---------------------------------------------------C( This_check ) S( This_check ) Then by Existential Generalization x [ C( x ) S(x) ] . Free and bound variables In the entry first-order language, I have mentioned the use of variables without mentioning what variables really are. A variable is a symbol that is supposed torange over the universe of discourse. Unlike a constant, it has no fixed value. There are two ways in which a variable can occur in a formula: free or bound. Informally, a variable is said to occur free in a formula φ if and only if it is not within the ―scope‖ of a quantifier. For instance, x occurs free in φ if and only if it occurs in it as a symbol, and no subformula of φ is of the form ∃x.ψ. Here the xafter the ∃ is to be taken literally : it is x and no other symbol. Variables in Terms To formally define free (resp. bound) variables in a formula, we start by defining variables occurring in terms, which can be easily done inductively: let t be a term (in a firstorder language), then Var(t) is o if t is a variable v, then Var(t) is {v} o if t is f(t1,…,tn), where f is a function symbol of arity n, and each ti is a term, then Var(t) is the union of all the Var(ti). Free Variables Now, let φ be a formula. Then the set FV(φ) of free variables of φ is now defined inductively as follows: o if φ is t1=t2, then FV(φ) is Var(t1)∪Var(t2), o if φ is R(t1,…,tn), then FV(φ) is Var(t1)∪⋯∪Var(tn) o if φ is ¬ψ, then FV(φ) is FV(ψ) o if φ is ψ∨σ, then FV(φ) is FV(ψ)∪FV(σ), and o if φ is ∃xψ, then FV(φ) is FV(ψ)−{x}. If FV(φ)≠∅, it is customary to write φ as φ(x1,…,xn), in order to stress the fact that there are some free variables left in φ, and that those free variables are among x1,…,xn. When x1,…,xn appear free in φ, then they are considered as place-holders, and it is understood that we will have to supply ―values‖ for them, when we want to determine the truth of φ. If FV(φ)=∅, then φ is called a sentence. Another name for a sentence is a closed formula. A formula that is notclosed is said to be open. Bound Variables Bound variables in formulas are inductively defined as well: let φ be a formula. Then the set BV(φ) of bound variables of φ o if φ is an atomic formula, then BV(φ) is ∅, the empty set, o if φ is ¬ψ, then BV(φ) is BV(ψ) o if φ is ψ∨σ, then BV(φ) is BV(ψ)∪BV(σ), and o if φ is ∃xψ, then BV(φ) is BV(ψ)∪{x}. Thus, a variable x is bound in φ if and only if ∃xψ is a subformula of φ for some formula ψ. The set of all variables occurring in a formula φ is denoted Var(φ), and is FV(φ)∪BV(φ). Note that it is possible for a variable to be both free and bound. In other words, FV(φ) and BV(φ) are not necessarily disjoint. For example, consider the following formula φ of the lenguage {+,⋅,0,1} of ring theory : x+1=0∧∃x(x+y=1) Then FV(φ)={x,y} and BV(φ)={x}: the variable x occurs both free and bound. However, the following lemma tells us that we can always avoid this situation : Lemma 1. It is possible to rename the bound variables without affecting the truth of a formula. In other words, if φ=∃x(ψ), or ∀x(ψ), and z is a variable not occurring in ψ, then ⊢φ⇔∃z(ψ[z/x]), where ψ[z/x] is the formula obtained from ψ by replacing every free occurrence of x by z. As a result of the lemma above, we see that every formula is logically equivalentto a formula φ such that FV(φ)∩BV(φ)=∅. Theory of Inference for the Predicate Calculus(mh) The method of derivation involving predicate formulas uses the rules of inference given for the statement calculus and also certain additional rules which are required to deal with the formulas involving quantifiers. Using of rules P and T remain the same. If the conclusion is given in the form of a conditional, we shall use the rule of conditional proof called CP. In order to use the equivalences and implications, we need some rules on how to eliminate quantifiers during the course of derivation. This elimination is done by the rules of specification, called rules US and ES. Once the quantifiers are eliminated and the conclusion is reached. It may happen that the desired conclusion is quantified. In this case we need rules of generalization called rules UG and EG which can be used to attach a quantifier. Rule US (Universal Specification) : From (x)A(x) one can conclude A(y). Rule ES (Existential Specification) : From ($x)A(x) one can conclude A(y) provided that y is not free in any given premise and also not free in any prior step of the derivation. These requirements can easily be met by choosing a new variable each time ES is used. Rule EG (Existential Generalization) : From A(x) one can conclude ($ y)A(y). Rule UG (Universal Generalization) :From A(x) one can conclude (y)A(y) provided that x is not free in any of the given premises and provided that if x is free in a prior step which resulted from use of ES, then no variables introduced by that use of ES appear free in A(x). Example1: Show that (x) (H(x)® M(x)) Ù H(s)Þ M(s). This is a well - known argument known as the "Socrates argument" which is given by All men are mortal.Socrates is a man.Therefore Socrates is mortal.If we denote H(x) : x is a man, M(x) : x is a mortal and s : Socrates, we can put the argument in the above form. Solution: {1} (1) (x)(H(x)® M(x)) Rule P {1} (2) H(s)® M(s) Rule US, (1) {3} (3) H(s) RuleP {1, 3} (4) M(s) Rule T, (2), (3), I11 Example 2: Show that (x)(P(x)® Q(x)) Ù (x)(Q(x)® R(x)) Þ (x)(P(x)® R(x)). Solution: {1} (1) (x)(P(x)® Q(x)) Rule P {1} (2) P(y)® Q(y) Rule US, (1) {3} (3) (x)(Q(x)® R(x)) Rule P {4} (4) Q(y)® R(y) Rule US, (3) {1,3} (5) P(y)® R(y) Rule T, (2), (4), I13 {1, 3} (6) (x)(P(x)® R(x)) Rule UG, (5) Example 3: Show that ($ x)M(x) follows logically from the premises (x)(H(x)® M(x)) and ($x)H(x). Solution: {1} (1) (x)(H(x)® M(x)) Rule P {1} (2) H(y)® M(y) Rule US, (1) {3} (3) ($ x)H(x) Rule P {3} (4) H(y) Rule ES, (3) {1, 3} (5) M(y) Rule T, (2), (4), I11 {1, 3} (6) ($ x)M(x) Rule EG, (5) Example 4: Prove that ($ x)(P(x) Ù Q(x)) Þ ($ x)P(x) Ù ($ x)Q(x). Solution: {1} (1) ($ x)(P(x)Ù Q(x)) Rule {1} (2) P(y) Ù Q(y) Rule ES, (1), y fixed {1} (3) P(y) Rule T, (2), I1 {1} (4) Q(y) Rule T, (2), I2 {1} (5) ($ x)P(x) Rule EG, (3) {1} (6) ($ x)Q(x) Rule EG, (4) {1} (7) ($ x)P(x) Ù ( $ x)Q(x) Rule T, (4), (5), I9 Example 5: Show that from a. ($ x)(F(x) Ù S(x)) ® (y)(M(y)® W(y)) b. ($ y)(M(y) Ù ùW(y)) the conclusion (x)(F(X) ® ùS(x)) follows. Solution: {1} (1) ($ y)(M(y) Ù ùW(y)) Rule P {1} (2) M(z) Ù ùW(z) Rule ES, (1) {1} (3) ù(M(z)® W(z)) Rule T, (2), E17 {1} (4) ($ y)ù(M(y)® W(y)) Rule EG, (3) {1} (5) ù(y)(M(y)® W(y)) E26, (4) {6} (6) ($ x)(F(x) Ù S(x))® (y)(M(y)® W(y)) Rule P {1, 6} (7) ù($ x)(F(x) Ù S(x)) Rule T, (5), (6), I12 {1, 6} (8) (x)ù(F(x) Ù S(x)) Rule T,(7), E25 {1, 6} (9) ù(F(x) Ù S(x)) Rule US, (8) {1, 6} (10) F(x)® ùS(x) Rule T, (9), E9, E16, E17 {1, 6} (11) (x)(F(x)® ùS(x)) Rule UG, (10) Example 6: Show that (x)(P(x) Ú Q(x)) Þ (x)P(x) Ú ($ x)Q(x). Solution: We shall use the indirect method of proof by assuming ù((x)P(x)Ú ($ x)Q(x)) as an additional premises. {1} (1) ù((x)P(x)Ú( $ x)Q(x)) Rule P(assumed) {1} (2) ù(x)P(x) Ù ù($ x)Q(x) Rule T, (1), E9 {1} (3) ù(x)P(x) Rule T, (2), I1 {1} (4) ($ x)ùP(x) Rule T, (3), E26 {1} (5) ù($ x)Q(x) Rule T, (2), I2 {1} (6) (x)ùQ(x) Rule T, (5), E25 {1} (7) ùP(y) Rule ES, (4) {1} (8) ùQ(y) Rule US, (6) {1} (9) ùP(y) Ù ùQ(y) Rule T, (7), (8), I9 {1} (10) ù(P(y)ÚQ(y)) Rule T, (9), E9 {11} (11) (x)(P(x)ÚQ(x)) Rule P {11} (12) ù(P(y)ÚQ(y)) Ù (P(y)Ú Q(y)) Rule T, (10), (12), I9Contradiction. Rule of Universal Specification This is a fairly obvious rule, but one that is important: If an open statement is true for all possible replacements in the designated universe, then that open statement is true for each specific individual member in that universe. Symbolically speaking, we have: If x p(x) is true, then we know that p(a) is true, for each a in the universe for x. Here is a simple example using this rule. Consider the following premises: 1) Each actor/actress on the TV show Friends is a millionaire. 2) Jennifer Aniston is an actress on the TV show Friends. Therefore, Jennifer Aniston is a millionaire. Symbolically, consider setting up these three statements: p(x): x is an actor/actress on Friends. q(x): x is a millionaire. Now, the given information is x [p(x) q(x)] If we wish to determine the financial status of Jennifer Aniston, we add into our premise the statement p(Jennifer Aniston) as being true. Using the Rule of Universal Specification, and Rule of Detachment, we can conclude that q(Jennifer Aniston) is true; that is Jennifer Aniston is a millionaire. Let‘s go ahead and look at another example in greater detail. Consider each of these open statements for the next example: p(x): x is a show on prime-time TV q(x): x is a show on late-night TV r(x): x is a soap opera Now, consider the following argument: No soap opera is on prime-time TV or late-night TV All My Children is a soap opera. Therefore, All My Children is not on prime-time TV. (Note: Let A stand for ―All My Children‖) 1) x [p(x) q(x) r(x)] Premise 2) r(A) 3) p(A) 4) Premise q(A) r(A) r(A) (p(A) 5) r(A) (p(A) 6) r(A) ( p(A) 7) p(A) q(A) Step 1 & Rule of Univ. Spec. q(A)) Contrapositive q(A)) Law of Double Negation q(A)) Step 5 & De Morgan‘s Law Steps 2 & 6 & Rule of Detachment (Modus Ponens) 8) p(A) Step 7 & Rule of Conjunctive Simplification The Rule of Universal Generalization If an open statement p(x) is proved to be true when x is replaced by any arbitrarily chosen element c from our universe, then the universally qualified statement x p(x) is true. (This rule also extends beyond one variable.) We can use this to formally show that IF x [p(x) q(x)] AND x [q(x) r(x)] THEN x [p(x) r(x)]. 1) x [p(x) 2) p(c) q(x)] Premise q(c) Step 1 & Rule of Universal Specification 3) x [q(x) 4) q(c) r(x)] Premise r(c) Step 3 & Rule of Universal Specification 5) p(c) r(c) Steps 2 & 4 and Law of Syllogism 6) x [p(x) r(x)] Step 5 and the Rule of Universal Generalization Now, consider the following assumptions x p(x) AND x [p(x) q(x) r(x)] And use those to prove: x [ r(x) 1) x p(x) 2) p(c) q(x)]. Premise Step 1 & Rule of Universal Specification 3) x [p(x) 4) p(c) q(x) q(c) r(x)] r(c) Premise Step 3 & Rule of Universal Specification 5) T q(c) 6) q(c) Substitution from Step 2 r(c) 7) r(c) 8) r(c) Identity Law q(c) x [ r(x) Contrapositive q(x)] Step 7 & Rule of Universal Generalization To make this example more concrete, consider the following open statements for p(x), q(x) and r(x) Let the universe x be of all 4 sided polygons. p(x): x is a quadrilateral. q(x): x has four equal angles. r(x): x is a rectangle. Using basic geometry definitions, we find that x p(x) (All 4 sided polygons are quadrilaterals.) x [p(x) q(x) r(x)] (All 4 sided polygons that are quadrilaterals and have four equal angles are rectangles.) Therefore, all 4 sided polygons that are not rectangles do not have four equal angles, OR x [ r(x) q(x)] Examples illustrating proof techniques We will use these definitions in the following problems: An integer n is even if and only if there exists another integer r such that n = 2*r. An integer n is odd if and only if there exists another integer r such that n = (2*r) + 1 If y | x, which is read as ―x is divisible by y‖, or ―y divides evenly into x‖, then x = yc, for some integer c. Remember in this definition, y must be non-zero. The square of an even number k is divisible by 4. Since we know k is even, we have k=2*r for some integer r. Now, we can compute k2. k2 = (2*r)2 = 4*r2, which is divisible by 4 since r2 is an integer. Also, the square of an odd number k leaves a remainder of 1 when divided by 4. Since we know that k is odd, we have k=2*r+1 for some integer r. Now, we can compute k2. k2 = (2*r+1)2 = 4*r2+4*r+1 = 4(r2+r) + 1, which leaves a remainder of 1 when divided by 4 since 4 divides evenly into 4(r2+r). (Because r2+r must be an integer...) In both of these examples, we used the Universal Rule of Generalization because we proved the result for arbitrary odd and even integers, and that implies that the general statement is true for all of them. Prove that if n is an integer then n2+n is an even integer Proof #1: direct proof by method of exhaustion using cases. All integers are even or odd. (I have not formally proved this, but you can use this fact throughout the class...) Thus, we have two different possibilities for n: n is even: Then there is an integer r such that n=2r, then we have n2+n = (2r)2 + 2r = 4r2 + 2r = 2(2r2 + r), since this value is divisible by 2, it is even. n is odd: Then there is an integer r such that n=2r+1, then we have n2+n = (2r+1)2 + (2r+1) = 4r2 + 4r + 1 + 2r + 1 = 4r2 + 6r + 2 = 2(2r2 + 3r + 1), and this value is also divisible by 2, thus it is even. One way to analyze how and why this proof is sufficient is to break it down into a logical argument. Let p(n), q(n), and r(n) be the following open statements: p(n): n is an even number. q(n): n is an odd number. r(n): n2+n is even. Since all integers are either even or odd, our goal is to prove (p(n) q(n)) r(n). Logically, we can show this is equivalent to: (p(n) r(n)) (q(n) r(n)) The first part of our proof showed that (p(n) r(n)) is true, while the second part of our proof showed that (q(n) r(n)) is true as well. Thus, together, these parts prove the original claim. Proof #2: Contradiction For contradiction‘s sake, assume that n2+n is odd. We have the following: n2+n = n(n+1) We know that for the product of two integers to be odd, both of them have to be. (Part of this is shown in the book...) However, it is impossible for both n and n+1 to be odd. (This is something you would have to prove also.) Thus, the way contradiction works is that you assume that the result is false. Then use algebra and other rules to show that the premise must be false as well, or that something impossible occurs if the incorrect result is assumed. The reason is that you came to an incorrect conclusion. You must have arrived at it by making an incorrect step. The ONLY possible incorrect step that could have been taken was the assumption made in the beginning. Hence, that is wrong, which implies the truth of what you are trying to prove. In this class, you will often be given statements that may or may not be true. Your job will be to determine which is the case, and give proof of your answer. Typically, disproving an assertion is easier than proving one. Here are a couple examples illustrating how to disprove an assertion: 1) For all prime numbers greater than 100, the sum of their digits is greater than 4. This is not true. We can verify that 101 is prime by showing that 2, 3, 5, and 7 do not divide into it evenly. Furthermore, we can see the sum of the digits in this number is 2, which is less than or equal to 4. Thus, by finding one prime number greater than 100 that has digits that sum to 2, we have disproved the claim. Thus, to disprove a ―for all‖ statement, all we had to do was find one value for which the statement did not hold. Here is another example of method of exhaustion: All integers in between 10 and 20 are either prime or have 2 or 3 as a factor. Proof: 10 = 2*5 11 is prime 12 = 3*4 13 is prime 14 = 2*7 15 = 3*5 16 = 2*8 17 is prime 18 = 2*9 19 is prime 20 = 2*10 Here is an example where we prove a statement by proving its contrapositive: If x + y is odd, then exactly one of x and y is odd. The contrapositive of this statement is: If either neither or both of x and y is odd, then x+y is even. If we prove this statement, we have proven the original. Thus, we can split the problem up into two cases: Case 1: Neither of x and y is odd, thus both are even. Let x = 2a and y = 2b for some integers a and b. Then, x + y = 2a + 2b = 2(a+b). At this point we can conclude that x+y is even since it is divisible by 2. (We know this because a+b must be an integer.) Case 2: Both of x and y are odd. Let x = 2a+1, y=2b+1, for some integers a and b. Then, x+y = 2a+1+2b+1 = 2a+2b+2 = 2(a+b+1) As before, we can conclude that x+y is even since it is a multiple of 2. Validity of Arguments in Predicate Logic, Completeness and Soundness(mh) Given a formula A, and a model M we know that we write M|= A, to denote that the formula A is true in model M. We also say that A is valid with respect to M. Now let‘s return to the informal argument that we considered in lecture at the beginning of our discussion of predicate logic. We restate it below. • If ―All women are mortal‖, • and ―Mary is a woman‖, • then ―Mary is Mortal‖. We now realize that this argument is easy to state in a first-order language that has two unary predicates (W and M) and a constant (Mary). The model we have in mind consists of the universe of discourse that contains all of the people on earth. The predicate W(x) means ―x is a women‖ and the predicate M(x) means ―x is a mortal‖. The constant Mary refers to a women named Mary. Call such a model M. Below, we restate the argument in our first-order language. 8x(Woman(x) ! Mortal (x)) Woman(Mary) −−−−−−−−−−−−−−−−− Mortal (Mary) Note that we‘ve also seen how to prove such arguments using natural deduction in our Fitch style proof system. Now, in order for this argument to be valid in a model, M, we need to say that if the two statements in the argument are true in the model, 8x(Woman(x) ! Mortal (x)) and Woman(Mary), then the conclusion, Mortal (Mary), must also be true in the model. In other words we need to show that M|= (8x(Woman(x) ! Mortal (x)) ^ Woman(Mary)) ! Mortal (Mary). In natural deduction in our to prove the conclusion followed from the premises, we would need to prove that (8x(Woman(x) ! Mortal (x)) ^ Woman(Mary)) ` Mortal (Mary). What‘s the difference between these two statements? We‘ll explore this notion. In general, if we have a logical argument in a first-order language as follows, S1 ... Sn −−−−− C where S1, .., Sn and C are well-formed formulas, then it is valid in a model M if M|= (S1 ^ · · · ^ Sn) ! C. However, we often want to say an argument is valid if and only if in any model where the premises are true the conclusion is true. That is we want the statementM|= (S1^· · ·^Sn) ! C to hold for every possible model M. This notion is called Universal Validity. Perhaps a quick example. Suppose I gave the following argument ―I have a ball. I don‘t have a red ball. Therefore, I have a purple ball.‖ This argument would be valid relative to a model that only had two balls, one of which was purple and one of which was red. However, it is not true that in general you can conclude that if you have a ball, and it is not red, then it is purple. For instance, the model where there are red balls, green balls and purple balls makes the premises true, but the conclusion false. The notion that in general you can conclude a certain statement is true, independent of the model under consideration is useful. We call this universal validity. Universal Validity We know that for a formula A in a first-order language and a model M that the formula A may or may not be valid relative to the modelM. This is similar to the notion that given an arbitrary propositional formula f, some truth assignments may satisfy it and others may not. However, we have a special class of formulas in propositional logic called tautologies, that have the property that they are satisfied (made true) by every possible truth assignment. Similarly, there is a corresponding notion in first-order languages. If a well-formed formula A in a first-order language is true relative to every possible model then we say that A is Universally Valid. To denote that a formula is universally valid we write |= A. Some examples of universally valid statements: • |= 8x(8yP(x, y)) $ 8y(8xP(x, y)) |= ¬(8xQ(x)) $ 9x(¬Q(x)) • |= ¬(9xQ(x)) $ 8x(¬Q(x)) • |= ¬(Q(x) ^ R(x)) $ (¬Q(x) _ ¬R(x)) Note that many of these equivalences are statements you have seen before in prior lecture notes. Previously, we have just claimed that all of the equivalences held, the notion of universal validity formalizes what we meant at that time. Soundness and Completeness Let us now relate models to the FOL natural deduction proof system we‘ve been discussing in previous lectures. We would like to say that an argument S1 ... Sn −−−−− C is valid in every possible model. That is, for every possible model M, it is the case that M|= (S1 ^· · ·^Sn) −! C, or alternatively, as we‘ve just seen that |= (S1 ^· · ·^Sn) −! C. It turns out to be the case that is true, if and only if S1, ..., Sn ` C in our system of Natural Deduction. Note, this is really what we you‘ve probably been implicitly assuming this whole time. However, it should be noted that this needs to be proved and was only done rather recently by Kurt G¨‘oedel in 1929 for his doctoral dissertation. I say recent, as when you consider the history of the study of logic it stretches back millennia. Formally, he proved two theorems of the following form. The proofs of these theorems is normally covered in a second course on logic, and is beyond the scope of this course. However, we‘ll state informal versions of the two theorems that are needed to prove the above statement here. The first states that you cannot prove false theorems in Natural Deduction. Namely, if you have a correct proof that a conclusion C follows from a set of premises S1, ..., Sn, then it is necessarily the case that the corresponding argument (S1 ^ · · · ^ Sn) −! C is universally valid. Theorem 1 (Soundness) If in our natural deduction proof system it is the case that S1, ..., Sn ` C has a correct proof, then |= (S1 ^ · · · ^ Sn) −! C is true. The second states that an argument is universally valid, then you can necessarily find a proof. Theorem 2 (Completeness) If |= (S1 ^ · · · ^ Sn) −! C is true, then there is a correct proof in our natural deduction proof system that shows S1, ..., Sn ` C. Induction We‘ll begin the subject of induction with an analogy. We know that if we set up a sequence of dominos on edge, and properly spaced, then we can knock down all of the dominos by tipping over the first one, which will tip over the second domino, which will tip over the third domino, etc... until all of the dominos are knocked down. In fact, if you could somehow set up an infinite sequence of dominos you would believe that if you tipped over the first, then given any domino in the sequence, it would eventually tip over. The process just described is very similar to induction. With induction, if we would like to prove that a particular predicate statement P(n) is true for every value n 2 N, then we do two things. • First, we prove that P(1) is true, and then we show that if P(i) is true for an arbitrary i 2 N, then P(i + 1) is true (or in logical notation P(i) ! P(i + 1)). We call proving that P(1) is true to be notion of proving the base case, and in our dominos analogy it corresponds to the notion of pushing over the first domino in the sequence. • Similarly, we call proving that if P(i) is true for an arbitrary i 2 N, then P(i+1) is true, the inductive step, and in our dominos analogy it corresponds to the notion that if any domino falls down then the next domino will fall down. • Now, by the principle of induction once we prove the base case, and the inductive step, then we can conclude that for for every n 2 N that P(n) is true. This is similar to the notion, that once you have pushed down the first domino, and realize that if any domino falls, then so does the next, then necessarily all of the dominos will fall. More formally, we notice that by proving the inductive step P(i) ! P(i + 1) for an arbitrary i 2 N, then what we have proven is the following set of statements: P(1) ! P(2) P(2) ! P(3) P(3) ! P(4) P(4) ! P(5) ... P(j) ! P(j + 1) ... However, as you know from your studies in logic, that this doesn‘t yet mean that there is any value k, where P(k) is true, because all of the statements are conditional. It is only when we combine the proof of the inductive step with the proof of the base case P(1), that we know that P(i) is true for every i 2 N. For once we know P(1), and P(1) ! P(2), then we know that P(2) is true. However, we know now that P(2) and P(2) ! P(3), so P(3) is true. However, we know now that P(3) and P(3) ! P(4), so P(4) is true. However, we know now that P(4) and P(4) ! P(5), so P(5) is true, etc...... Let‘s see an example: We would like to show that for every n: 1 + 2 + 3 + 4 + · · · + n = n(n + 1)/2 If we wanted to rephrase it in terms of a predicate we would say that P(n) is true iff 1 + 2 + 3 + 4 + · · · + n = n(n+1)/2 . Now in order to prove this by induction we need to do 2 things, we need to prove the base case, P(1), and prove the inductive step, P(i) ! P(i + 1) for an arbitrary value i. We prove these two things next. Base Case : We need to prove P(1), that is 1 = 1(1+1) 2 . However, 1(1+1) 2=2 2 = 1, so the statement P(1) is true, and this proves the base case. Inductive Step: We need to prove that P(i) ! P(i + 1). In order to do this we assume that P(i) is true. This assumption is called the inductive hypothesis (IH). Now, assuming that the inductive hypothesis is true, we need to prove P(i + 1). So, for our problem we assume the inductive hypothesis 1+2+3+4+· · ·+i = i(i+1) 2 . Next, we attempt to prove P(i + 1), by using our inductive hypothesis, which we do as follows: 1 + 2 + 3 + 4 + · · · + (i + 1) = (1 + 2 + 3 + 4 + · · · + i) + (i + 1) (1) = i(i + 1)2+ (i + 1) (2) =i(i + 1)/2+ 1 · (i + 1) (3) =i(i + 1)/2+2(i + 1)/2 (4) =i(i + 1)/2+2(i + 1)/2 (5) = i(i + 1) + 2(i + 1)2 (6) =(i + 2)(i + 1) /2 (7) =(i + 1)(i + 2)/2 (8) =(i + 1)((i + 1) + 1)/2 (9) We note that line (2) follows, because we apply the inductive hypothesis which states that 1+2+3+· · ·+i = i(i+1)2 . The remaining lines follow from the application of highschool algebra. However, note that the whole proof shows that 1 + 2 + · · · + (i + 1) =(i+1)((i+1)+1)2 , and this is exactly the statement of P(i + 1). Therefore, if P(i) is true, then P(i + 1) is true, and this means that we have proved P(i) ! P(i + 1). Therefore, because we proved the base case and the inductive step, by the principle of induction P(n) is true for every n 2 N. That is, for every n 2 N we know it is true that 1 + 2 + 3 + 4 + · · · + n =n(n + 1)/2 Another Example Let‘s consider an other example. We would like to prove by induction that for every n 2 N that the sum of the first n odd numbers is equal to n2. That is 1 + 3 + 5 + · · · + 2n − 1 = n2. If we wanted to rephrase it in terms of a predicate we would say that P(n) is true iff 1 + 3 + 5 + · · · + 2n − 1 = n2. Now in order to prove this inductively, we need to prove: 1. The base case P(1) 2. The inductive step P(i) ! P(i + 1) for arbitrary i Here is the proof: Base Case P(1): We need to prove that 1 = 12. We know that 12 = 1·1 = 1, and therefore P(1) is true. Inductive Step: We need to prove that P(i) ! P(i + 1). In order to do this we assume that P(i) is true. Again, this assumption is called the inductive hypothesis (IH). Now, assuming that the inductive hypothesis is true, we need to prove P(i+1). So, for our problem we assume the inductive hypothesis 1+3+5+· · ·+2i−1 = i2. Next, we attempt to prove P(i+1), which says that 1+3+5+· · ·+(2(i+1)−1) = (i+1)2, by using our inductive hypothesis, which we do as follows: 1 + 3 + · · · + (2(i + 1) − 1) = (1 + 3 + 5 + · · · + (2i − 1)) + (2(i + 1) − 1) (10) = i2 + 2(i + 1) − 1 (11) = i2 + 2i + 2 − 1 (12) = i2 + 2i + 1 (13) = (i + 1)(i + 1) (14) = (i + 1)2 (15) We note that line (11) follows, because we apply the inductive hypothesis which states that 1+3+· · ·+(2i−1) = i2. The remaining lines follow from the application of high-school algebra. However, note that the whole proof shows that 1 + 3 + · · · + (2(i+1)−1) = (i+1)2, and this is exactly the statement of P(i+1). Therefore, if P(i) is true, then P(i + 1) is true, and this means that we have proved P(i) ! P(i + 1). Therefore, because we proved the base case and the inductive step, by the principle of induction P(n) is true for every n 2 N. That is, for every n 2 N we know it is true that 1 + 3 + · · · + 2i − 1 = i2. Problem 1 Translate the sentences in quantified expressions of predicate logic, write down the negated expression and then translate the negated expression in English. The predicates to be used are given in parentheses. 2 Some problems are difficult. All students that study discrete math are good at logic. 3 No students are allowed to carry guns. 4 International students are not eligible for federal loans. 5 Let p, q, and r be the following propositions: p: You get an A on the final exam q: You do every exercise in the book. r: You get an A in this class. 6 Express the following arguments / statements as sentences of predicate logic: (a) Every irreflexive and transitive binary relation is asymmetric. (b) There is someone who is going to pay for all the breakages. Therefore, each of the breakages is going to be paid for by someone. (c) All the female chimpanzees can solve every problem. There exists at least one problem. Any chimpanzee who can solve a problem will get a banana. Chica is a female chimpanzee. Therefore, Chica will get a banana. (d) Sultan and Chica can solve exactly the same problems. If Sultan can solve any of the problems, then he will get a banana. Sultan will not get a banana. Therefore, Chica cannot solve any of the problems. (e) Everyone loves somebody and no one loves everybody, or somebody loves everybody and someone loves nobody. (f) Some people are witty only if they are drunk. x yP x ,y 7 Consider the formula and the following interpretation I : Let the universe of discourse be the non-negative integers, and let P be assigned the ―less than‖ relation <. Show y xP x ,y that I is a model of the formula. Explain why I is not a model of the formula 8 Let T xP x P f x . Find a model of T. Show that T is not valid. T xP x ,x , x y P x ,y P y ,x , x y z P x ,y P y ,z P x ,z 9 Let two distinct models of T. Briefly explain any connection between the models. . Give 10 For the following well-formed formula give their meaning in English under the proposed interpretation and state whether they are true or false. The interpretation I is defined as follows: The domain of discourse is the set of non-negative integers, PI is =, f I is +, gI is , aI is 0 and bI is 1. (i) (ii) (iii) x y P x , f y ,y x y P g x , y ,a P x , f f y , y ,b P x ,a P y ,a y P f y , y ,b 11 Represent the following statements in predicate logic: (i) If a brick is on another brick, it is not on the table. (ii) Every brick is on the table or on another brick. (iii) No brick is on a brick which is also on a brick. SET THEORY INTRODUCTION The concept of set is fundamental to mathematics and computer science. Everything mathematical starts with sets. For example, relationships between two objects are represented as a set of ordered pairs of objects, the concept of ordered pair is defined using sets, natural numbers, which are the basis of other numbers, are also defined using sets, the concept of function, being a special type of relation, is based on sets, and graphs and digraphs consisting of lines and points are described as an ordered pair of sets. Though the concept of set is fundamental to mathematics, it is not defined rigorously here. Instead we rely on everyone's notion of "set" as a collection of objects or a container of objects. In that sense "set" is an undefined concept here. Similarly we say an object "belongs to " or "is a member of" a set without rigorously defining what it means. "An object(element) x belongs to a set A" is symbolically represented by "x A" . It is also assumed that sets have certain (obvious) properties usually asssociated with a collection of objects such as the union of sets exists, for any pair of sets there is a set that contains them etc. This approach to set theory is called "naive set theory " as opposed to more rigorous "axiomatic set theory". It was first developed by the German mathematician Georg Cantor at the end of the 19th century. Naive Set Theory vs Axiomatic Set Theory The concept of set is not defined rigorously in the naive set thoery which was originated by Georg Cantor. There we rely on everyone's notion of "set" as a collection of objects or a container of objects. In that sense "set " is an undefined concept. Similarly we say an object "belongs to " or "is a member of" a set without rigorously defining what it means. It is also assumed that sets have certain (obvious) properties usually asssociated with a collection of objects such as the union of sets exists, for any pair of sets there is a set that contains them etc. For example, P. Halmos lists those properties as axioms in his book "Naive Set Theory" as follows: 1. Axiom of extension Two sets are equal if and only if they have the same elements. For example {1, 2} = {1, 2, 1} because every element of {1, 2} is in {1, 2, 1} and vice versa. 2. Axiom of specification For every set S and every proposition P, there is a set which contains those elements of S which satisfy P and nothing else. For example let S be the set of natural numbers and let P be the proposition that states for every object x that x is an even number. Then this axiom states that there is a set that contains all the even natural numbers. 3. Axiom of pairs For any two sets there is a set which contain both of them and nothing else. For example for sets {1} and {1,2} there is a set that contains both of them. For example {{1}, {1,2}} is such a set in fact that is the only such set. 4. Axiom of union For every collection of sets, there is a set that contains all the elements and only those that belong to at least one set in the collection. For example for every natural number i let Ai = {20, 21 , 22, ..., 2i}. Then there is a set that contains all the powers of 2 and only those, that is {20, 21 , 22, ..., 2i, ...}. 5. Axiom of powers. For each set A there is a collection of sets that contains all the subsets of the set A and nothing else. For example a set that contains all the subsets of the set of natural numbers exists, that is there is a set that contains all the sets of natural numbers. 6. Axiom of infinity There is a set containing 0 and the successor of each of its elements. Here 0 is defined to be the empty set and the successor of an element x , denoted by x+, is the set obtained by adding element x to the set x i.e. x+ = x + {0} which is denoted as 1. Then 1 = 1 + denoted as 2. 2 = 2 as 3 etc. {2} = {0, 1} {x}.Therefore 0+ = 0 {1} = {0, 1} = {0} {0} = {{0}} = {0, {0}} which is {2} = {0, 1, 2} = {0, {0}, {0, {0}}}, which is dented Thus a set containing 0 and the successor of each of its elements contains 0, 1, 2, 3, ... and possibly some more. Such sets can be employed to rigorously describe the concept of infinity. The smallest of such set is defined to be the set of natural numbers and an element of that set is a natural number. 7. Axiom of choice The Cartesian product of a non-empty indexed collection of non-empty sets is non-empty. In other words if {Ai} is a collection of non-empty sets indexed by a non-empty set I, then there is an indexed collection {xi} such that xi is an element of Ai for each i in I. For example for every natural number i let Ai = {20, 21 , 22, ..., 2i}. Then {A0, A1, A2, ...} is a collection of infinitely many non-empty sets. The axiom of choice guarantees that we can choose an element from each of these Ai 's simultaneously. This axim guarantees simultaneous choice of elements from an infinite as well as finite collection of sets. Using those properties a naive set theory develops concepts of ordered pair, relation, and function, and discusses their properties, which are basically followed in the course material for this course. It further discusses numbers, cardinals, ordinals, their arithmetics, and finally different kinds of infinity, in particular uncountability of the set of real numbers. In the naive set theory originated by Cantor the concept of set was not defined. In particular no attention was paid to the nature of elements of sets. Since a set is understood to be a collection of objects, it was assumed that any object can be a member of a set. However, Russell's paradox showed that that was not the case, that is, not every object can be a member of a set. The paradox proceeds as follows: Let S = { x : x is set and x ≠ x }. Then since anything can be in a set, S is a set. Hence S ≠ S or S €≠S. If S ≠ S, then by the definition of S, S € S, which is a contradiction. Thus S € S. However, then again by the definition of S, S ≠ S, which is also a contradiction. Thus S cannot be a set. That is, there are objects which can not be in a set. A set can be described in a number of different ways. The simplest is to list up all of its members if that is possible. For example {1, 2, 3} is the set of three numbers 1, 2, and 3. { indicates the beginning of the set, and }its end. Every object between them separated by commas is a member of the set. Thus {{1, 2}, {{3}, 2}, 2}, {1 } } is the set of the elements {1, 2}, {{3}, 2} and {1}. REPRESENTATION OF SETS A set can also be described by listing the properties that its members must satisfy. For example, { x| ≤ x ≤ 2 and x is a real number. } represents the set of real numbers between 1 and 2, and { x| x is the square of an integer and x ≤ 100 } represents the set { 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 }. A third way to describe a set is to give a procedure to generate the members of the set. In this representation, first, basic elements of the set are presented. Then a method is given to generate elements of the set from known elements of the set. Thirdly a statement is given that excludes undesirable elements (which may be included in the set otherwise) from the set. for example the set of natural numbers N can be defined recursively as the set that satisfies the following (1), (2), and (3): (1) 0 € N (2) For any number x if x € N, then x + 1 € N. (3) Nothing is in N unless it is obtained from (1) and (2). Following this definition, the set of natural numbers N can be obtained as follows: First by (1), 0 is put into N. Then by (2), since 0 is in N, 0 + 1 (= 1) is in N. Then by (2) Again, 1 + 1 (= 2) is in N. Proceeding in this manner all the natural numbers are put into N. Note that if we don't have (3), 0.5, 1.5, 2.5, ... can be included in N, which is not what we want as the set of natural numbers. EQALITY OF SETS Definition (Equality of sets): Two sets are equal if and only if they have the same elements. More formally, for any sets A and B, A = B if and only if x[xϵ A xϵ B] . Thus for example {1, 2, 3} = {3, 2, 1} , that is the order of elements does not matter, and {1, 2, 3} = {3, 2, 1, 1}, that is duplications do not make any difference for sets. Definition (Subset): A set A is a subset of a set B if and only if everything in A is also in B. More formally, for any sets A and B, A is a subset of B, and denoted by A ⊆ B, if and only if x[x A x ϵ B ] . If A ⊆ B, and A ≠ B, then A is said to be a proper subset of B and it is denoted by A ⊂ B . For example {1, 2} ⊆ {3, 2, 1} . Also {1, 2} ⊂ {3, 2, 1} . Definition(Cardinality): If a set S has n distinct elements for some natural number n, n is the cardinality (size) of S and S is a finite set. The cardinality of S is denoted by |S|. For example the cardinality of the set {3, 1, 2} is 3. Definition(Empty set): A set which has no elements is called an empty set. More formally, an empty set, denoted by ∅, is a set that satisfies the following: x x ∉ ∅ , where ∉ means "is not in" or "is not a member of". Note that ∅ and {∅} are different sets. {∅} has one element namely ∅ in it. So {∅} is not empty. But ∅ has nothing in it. Definition(Universal set): A set which has all the elements in the universe of discourse is called a universal set. More formally, a universal set, denoted by U , is a set that satisfies the following: x xϵ U. Three subset relationships involving empty set and universal set are listed below as theorems without proof. Note that the set A in the next four theorems are arbitrary. So A can be an empty set or universal set. Theorem 1: For an arbitrary set A A ⊆ U . Theorem 2: For an arbitrary set A ∅ ⊆ A . Theorem 3: For an arbitrary set A A ⊆ A . Definition(Power set): The set of all subsets of a set A is called the power set of A and denoted by 2A or (A) . For example for A = {1, 2}, (A) = { ∅, {1}, {2}, {1, 2} } . For B = {{1, 2}, {{1}, 2}, ∅ } , (B) = { ∅, {{1, 2}}, {{{1}, 2}}, {∅}, { {1, 2}, {{1}, 2 }}, {{1,2}, ∅ }, { {{1}, 2}, ∅ }, {{1, 2}, {{1}, 2}, ∅ } } . Also (∅) = {∅} and ({∅}) = {∅, {∅}}. Theorem 4: For an arbitrary set A, the number of subsets of A is 2|A| . Set Operations union of sets intersection of sets difference of sets complement of set ordered pair, ordered n-tuple equality of ordered n-tuples Cartesian product of sets Contents Sets can be combined in a number of different ways to produce another set. Here four basic operations are introduced and their properties are discussed. Definition (Union): The union of sets A and B, denoted by A A B={x|xϵ A B , is the set defined as xϵ B} Example 1: If A = {1, 2, 3} and B = {4, 5} , then A B = {1, 2, 3, 4, 5} . Example 2: If A = {1, 2, 3} and B = {1, 2, 4, 5} , then A B = {1, 2, 3, 4, 5} . Note that elements are not repeated in a set. Definition (Intersection): The intersection of sets A and B, denoted by A defined as A B = { x | x ϵ A x ϵ B } Example 3: If A = {1, 2, 3} and B = {1, 2, 4, 5} , then A Example 4: If A = {1, 2, 3} and B = {4, 5} , then A B , is the set B = {1, 2} . B=∅. Definition (Difference): The difference of sets A from B , denoted by A - B , is the set defined as A-B={x|xϵ A x∉ B} Example 5: If A = {1, 2, 3} and B = {1, 2, 4, 5} , then A - B = {3} . Example 6: If A = {1, 2, 3} and B = {4, 5} , then A - B = {1, 2, 3} . Note that in general A - B ≠B - A Definition (Complement): For a set A, the difference U - A , where U is the universe, is called the complement of A and it is denoted by Thus . is the set of everything that is not in A. The fourth set operation is the Cartesian product We first define an ordered pair and Cartesian product of two sets using it. Then the Cartesian product of multiple sets is defined using the concept of n-tuple. Definition (ordered pair): An ordered pair is a pair of objects with an order associated If objects are represented by x and y, then we write the ordered pair as <x, y>. with them. Two ordered pairs <a, b> and <c, d> are equal if and only if a = c and b = d. For example the ordered pair <1, 2> is not equal to the ordered pair <2, 1>. Definition (Cartesian product): The set of all ordered pairs <a, b>, where a is an element of A and b is an element of B, is called the Cartesian product of A and B and is denoted by A × B. Example 1: Let A = {1, 2, 3} and B = {a, b}. Then A × B = {<1, a>, <1, b>, <2, a>, <2, b>, <3, a>, <3, b>} . Example 2: For the same A and B as in Example 1, B × A = {<a, 1>, <a, 2>, <a, 3>, <b, 1>, <b, 2>, <b, 3>} . As you can see in these examples, in general, A × B ≠ B × A unless A = ∅ , B = ∅ or A = B. Note that A × ∅ = ∅ × A = ∅ because there is no element in ∅ to form ordered pairs with elements of A. The concept of Cartesian product can be extended to that of more than two sets. First we are going to define the concept of ordered n-tuple. Definition (ordered n-tuple): An ordered n-tuple is a set of n objects with an order associated with them (rigorous definition to be filled in). If n objects are represented by x1, x2, ..., xn, then we write the ordered n-tuple as <x1, x2, ..., xn> . Definition (Cartesian product): Let A1, ..., An be n sets. Then the set of all ordered n tuples <x1, ..., xn> , where xi € Ai for all i, 1 ≤ i ≤ n , is called the Cartesian product of A1, ..., An, and is denoted by A1 ×... × An . Example 3: Let A = {1, 2}, B = {a, b} and C = {5, 6}. Then A × B × C = {<1, a, 5>, <1, a, 6>, <1, b, 5>, <1, b, 6>, <2, a, 5>, <2, a, 6>, <2, b, 5>, <2, b, 6>} . Definition (equality of n-tuples): Two ordered n-tuples <x1, ..., xn> and <y1, ..., yn> are equal if and only if xi = yi for all i, 1 ≤i ≤ n . For example the ordered 3-tuple <1, 2, 3> is not equal to the ordered n-tuple <2, 3, 1>. Operations in Sets (A) Union of two sets : The union of two sets A and B is the set which consists of all the elements of A and all the elements of B. Let A = { 3, 4, 6, 7 } and B = { 4, 7, 9, 10 } then A È B = { 3, 4, 6, 7, 9, 10 } Read A È B as A union B Thus A È B = { x | x Î A or x Î B or both } or A È B = { x | x belong to at least one of the sets A and B } The shaded region in the above figure shows A È B.We can easily see that AÈB = BÈ A. Obviously, for any set A, A È A = A and A È f = A (B) Intersection of two sets : The intersection of two sets A and B is the set of common elements of A and B. We write such a set as A Ç B and read it as A intersection B. Symbolically, A Ç B = { x | x ÎA and x Î B } For example A = { 1, 2, 3, 4 } and B = { 2, 3, 4, 5, 6, 7 } Then A Ç B = { 2, 3, 4 } We can easily see that for any two sets, A and B AÇB=BÇA Also note that for any set A, A Ç A = A and A Ç f = f The sets A and B are such that (see above figure) A Ç B = f, then A and B are called as disjoint sets. Example Show the following sets with the help of Venn diagrams. 1. A is a set of first four alphabets. 2. B = { x | x is an even number and x < 10 } 3. C = { c | c Î N and 3 < c < 10 } Solution : 1) A = { a, b, c, d } 2) B = { 2, 4, 6, 8 } 3) C = { 4, 5, 6, 7, 8, 9 } Subsets : A set obtained by taking some or all the elements of the given set is called a subset of the given set. If set A and B are two sets such that every element of set B is the element of the set A, then B is said to be the subset of set A. Symbolically it is written as B Ì A. Now if B is a part of A i.e. B contains at least one element less than A then B is called the proper subset of A and show by B ÌA. But if A and B have exactly the same elements i.e. A = B then B is called the improper subset of A and it is written as B Í A or A Í B 1. Thus every set is a subset of itself . 2. Every set has an empty set as its subset. For example 1) A = { 1, Then B ⊆ A 2, 3, 4, 5, 6, 7 2) B = { x | x2 -3x Then E ⊆ B or B⊆E⬄ B = E + 2 = } and 0 } B and = { E 1, = 4, { 5, 1, 7 2 } } Universal set : Suppose A, B and C are given sets. Then any set of which A, B and C are subsets is called the universal set. Note that an universal set is the main set or a set of totality of elements of all sets under consideration under a particular discussion. In the universal set once fixed cannot be changed during that discussion. Thus the universal set cannot be unique but changes from problem to problem. The universal set is usually denoted by È or X. For example , A = { All books of Algebra in your library } B = { All books of Geometry in your library } C = { All books in your library } Here, the set C is taken as the universal set . Complement of a set : Let be the universal set and set A B. The complement of the set A with respect to the universal set is denoted by A is defined as Aor = { x | x but x A } For example = { 1, 2, 3, 4, . then A= { 2, 4, 6, 8, . . . } . . } and A = { 1, 3, 5, 7, . . . } Equivalent sets : Two sets are equivalent if and only if, a 1 - 1 correspondence exists between them. For example a. If A = { 1, 2, 3 }, B = {a, b, c } then A and B are 1-1. equivalent, since the correspondence between them is b. If A = { x | x N, x < 5} B = { x | x is a set of the word Dear }, then A and B are equivalent. Note : If two sets are equal, then they must be equivalent. But two equivalent sets need not be equal. Power set : The set of all subsets of a set A is the power set of the set A. It is denoted by p(A) For example A The power set of A is p(A) = {{1}, {2}, {1,2}, { }} = {1, 2}. Note : The number of elements are 2 and number of subsets are 4. Then 4 = 22 if there are 'n' number of elements in any set, the number of its subsets is given by 2n . Cardinal Number of a set : The cardinal number of a finite set 'A' is the number of elements of the set A. It is denoted by n (A). For example, If A = { 1, 2, 3 } , B = {a, b, c} then n (A) = 3 and n (B) = 3. Thus n (A) = n (B) but n (A) = n (B) does not imply that A = B. Also n () = 0. Difference between two set : The set of all elements belonging to a set A but not belonging to a set B. It is written as A - B. Example If U = {3, 6, 7, 12, 17, 35, 36 }, A = {odd numbers }, B = {Numbers divisible by 7 }, C = {prime numbers > 3 } List the elements of 1) Aand B 2) The subset of C 3) The power set of C Solution : 1) A = { 3, 7, 17, 35 } A = { 6, 12, 36 } B = {7, 35 } B= {3, 6, 12, 17, 36 } 2) C = {7,17 } Subset of C = {7}, {17}, {7,17}, 3) The power set {{7}, {17}, {7,17}, C = the set of all subsets Example If A = { 2, 4, 6, 8, 10, 12 }, B = {4, 8, 12 }. 1) A - B 2) B - A 3) How many subsets can be formed from the set A ? 4) How many proper subsets can be formed from B ? Solution : 1) A - B = { 2, 6, 10 } 2) B - A = { } 3) The set A contains 6 elements The number of subsets = 4) n (B) = 3 23 = 8 The number of proper subsets = 23 - 1 = 8 - 1 = 7 Example 26 = 64 of C = If U = { } 1) List the elements of the following sets. a) A = { x | -1 x < 4 } b) B = { x | x < 0 and x = n/2 }, n I 2) Are sets A and B disjoint ? Give reason. Solution : 1) (a) A = { -3/2, 4/3, 2, 1, 0, } (b) B = { -3/2, -3, -4 } 2) Yes, negative numbers, which are multiples of 1/2 A Example A = { 1, 121, 12321, 1234321 } B = { 11112 , 1112, 112, 12 } State whether A B or B A or A = B Solution : Now 12 = 1} B = {11112 = 1234321, 1112 = 12321, 112 = 121, A=B Example P = {1(1 + 1), 2 (2 + 1), 3 (3 + 1), . . . . . . . 8 (8 + 1)} Q = { 92 - 9, 82 - 8, 72- 7, . . . . . . . . . 22 - 2 } State whether P Q or Q P or P = Q Solution : P = {2, 6, 12, . . . . . . .72} , Q = { 72, 56, 42, . . . . ..2} P = Q Example If A = {2, 4, 8, 12 }, B = {3, 4, 5, 8 } and U = { x | x N and x < 13 }, find A; B , (A B) and verify (A B) = A B Solution : A= U - A = { 1, 3, 5, 6, 7, 9, 10, 11 } B = U - B = { 1, 2, 6, 7, 9, 10, 11, 12 } Now A B = { 4, 8 } ( A B)= U- ( A B )={1, 2, 3, 5, 6, 7, 9, 10, 11, 12} Also AU B = { 1, 2, 3, 5, 6, 7, 9, 10, 11, 12 } . . . (II) ( A B) = A B. . . (from (I) and (II) ) Example If U = { x | x 8, x W}, A = { x | 2x -1 8 ; x W}, B = { x | 5x - 1 14 ; x N } Find (1) A and B (2) (A B)(3) A B (4) Hence show that ( A B )= A B Solution : (1) A = { x | 2x -1 8; x W} Now 2x -1 8 2x - 1 8 x 9/2 A = { x | x 9/2 , x W} = { 0, 1, 2, 3, 4 } and B = { x | 5x - 1 14, x N } Now 5x - 1 14 5x 15 x 3 B = { x | x 3, x N } = { 1, 2, 3 } (2) A B = { 0, 1, 2, 3, 4 } { 1, 2, 3 }={0, 1, 2, 3, 4 } (3) A= U - A = { 5, 6, 7, 8 } and B= U - B = { 0, 4, 5, 6, 7, 8 } AB = { 5, 6, 7, 8 } . . . (I) and (A B) = U - ( A B ) = { 5, 6, 7, 8 } . . . (II) (4) From (I) and (II) we get ( A B ) = AB Example Given U = { x | x 10 , x N }, A = { 2, 4, 6 }, B = { 1, 3, 5, 7 }and C = {3, 4, 5 } Prove that (a) (A B ) B= A if and only if A B = Solution : (a) A B = { 2, 4, 6 }{ 1, 3, 5, 7 }= { 1, 2, 3, 4, 5, 6, 7 } and B= U- B = { 2, 4, 6, 8, 9, 10 } Therefore, ( A B) B = { 1, 2, 3, 4, 5, 6, 7 } { 2, 4, 6, 8, 9, 10 } = { 2, 4, 6 } = A The algebra of sets 1. Commutative Laws a. For A B = B A b. For A B = B A addition multiplication or or union intersection 2. Associative Laws a. For addition ( A B ) C = A ( B C ) b. For multiplication ( A B ) C = A ( B C ) 3. Distributive Laws a. A ( B C ) = ( A B ) ( A C ) b. A ( B C ) = ( A B ) ( A C ) 4. Identity Laws a. A = A b. A = c. A U = U d. A U = A or or union intersection 5. Idempotent Laws a. A A = A b. A A = A 6. Complement Laws a. A A = b. A A = c. ( A)= A d. = and 7. Absorption Laws A ( A B ) = A 8. De Morgan’s Laws a. ( A B ) = AB b. ( A B ) = A B Example A and B are two sets such that A has 12 elements, B has 17 elements and A B contains 21 elements. Find the number of elements in A B. Solution : n (A) = 12, n (B) = 17 and n (A B) = 21 Using the fact, n ( A B) = n (A) + n (B) - n ( A B), 21 = 12 + 17 - n ( A B ) n ( A B ) = 29 - 21 = 8 Example In a class of 50 students, 35 students play foot ball, 25 students play both football as well as base ball. All the students play at least one of the two games. How many students play base ball ? Solution : Let F be the set of the students who play foot ball, and C be the set of students who play base ball. Then we have n (C F) = 50 n (f) = 35 and n (C F) = 25 Now the problem can diagram as in the adjoining figure. be visualized by means Thus we have n ( C F ) = n (F) + n (C) - n (C F ) The numberof students who play only baseball = n (C) - n ( C F ) = n (C F) - n (F) = 50 - 35 = 15 Example If A BBA and BC, then find which of the sets A, B and C are equal. Solution : If A B, B C A C But given that C A A = C . . . (1) Now, A = C A B and C B . . . (I) But given that B C . . . (II) From (I) and (II) B = C . . . (2) From (1) and (2) A = B = C Given A1 A2 A3 . . . A10 = U, answer the following : 1. A1 A10 ? 2. Is A1 (A2 A3) 3. What is A1 A3 A5 A7 ? 4. What is (A9) (A10)? 5. What is A1 A2 A3 . . . A10 ? Solution : 1. Yes. 2. Yes. 3. A1 of a Venn 4. A10 = . . . . ..(given) 10 = (A9) ‗ =(A9) (A9) (A10)= (A9) 5. Using the fact that if A B, then A B = B, we get A1 A2 (Given) A A2 = A2 and A3 A3 A2 A3 = A3 A1 A2 A3 = A3 A3 A4 (given) A3 A4 = A4 A1 A2 A3 A4 = A4 . . . Thus finally we get, A1 A2 A3 A4 . . . A10 = A10 Example In the athletic team of a certain school, 21 students are in the Basketball team, 26 are in the Hockey team and 29 are in the football team. If 14 play Hockey and Basketball, 12 play football and Basketball, 15 play Hockey and football and 8 play all the three, find : (1)How many players are there in all ? (2) How many play only foot - ball ? Solution : 1) n (B H F ) = n (B) + n - n ( H F) - n ( B F) + n ( B H F ) (H) n (B H F ) = 21 + 26 +29 - 14 -25 - 12 + 8 = 84 - 41 = 43 2) Foot - ball and basket - ball but not Hockey = 12 - 8 =4 Foot - ball and Hockey but not Basket - ball = 29 - ( 4 + 7 + 8 ) + n (F) - n ( B H ) = 29 - 19 = 10 RELATIONS ON SETS A (binary) relation R between sets X and Y is a subset of X×Y. product.) (X×Y is a Cartesian Thus, a relation is a set of pairs. The interpretation of this subset is that it contains all the pairs for which the relation is true. We write xRy if the relation is true for x and y (equivalently, if (x,y)∈R). X and Y can be the same set, in which case the relation is said to be "on" rather than "between": A (binary) relation R on set E is a subset of E×E. (E×E is a Cartesian product.) Examples using E={0,1,2,3}: 1. {(0,0), (1,1), (2,2), (3,3)}. This relation is =. 2. {(0,1), (0,2), (0,3), (1,2), (1,3), (2,3)}. This relation is <. 3. {(0,0), (1,1), (1,0), (2,2), (2,1), (2,0), (3,3), (3,2), (3,1), (3,0)}. This relation is ≥. Relations may also be of other arities. An n-ary relation R between sets X1, ... , and Xn is a subset of the n-ary product X1×...×Xn, in which case R is a set of n-tuples. Some specific relations The empty relation between sets X and Y, or on E, is the empty set ∅. The empty relation is false for all pairs. The full relation (or universal relation) between sets X and Y is the set X×Y. The full relation on set E is the set E×E. The full relation is true for all pairs. The identity relation on set E is the set {(x,x) | x∈E}. The identity relation is true for all pairs whose first and second element are identical. Examples All these relations are definitions of the relation "likes" on the set {Ann, Bob, Chip}. Happy world In this world, "likes" is the full relation on the universe. Because it is full, every person likes every other person, including him- or herself. The extension of this "likes" relation is {(Ann,Ann),(Ann,Bob),(Ann,Chip),(Bob,Ann),(Bob,Bob),(Bob,Chip), (Chip,Ann),(Chip,Bob),(Chip,Chip)}. Narcissistic world In this world, "likes" is the identity relation on the universe. Because it is the identity relation, every person likes him- or herself, but no one else. The extension of this "likes" relation is {(Ann,Ann),(Bob,Bob),(Chip,Chip)}. Emptily unhappy world In this world, "likes" is the empty relation. Because it is empty, no person likes any other person, including him- or herself. The extension of this "likes" relation is {}. Properties of relations Let R be a relation on E, and let x,y,z∈E. A ... relation R is if ... A ... reflexive XRx irreflexive xRy implies x≠y symmetric xRy implies yRx antisymmetric xRy and yRx implies x=y transitive xRy and yRz implies xRz Examples using =, <, and ≤ on integers: = is reflexive (2=2) = is symmetric (x=2 implies 2=x) < is transitive (2<3 and 3<5 implies 2<5) < is irreflexive (2<3 implies 2≠3) ≤ is antisymmetric (x≤y and y≤x implies x=y) Examples using Ann, Bob, and Chip: relation R is if ... Happy world "likes" is reflexive, symmetric, and transitive. (It is an equivalence relation.) Narcissistic world "likes" is reflexive, symmetric, antisymmetric, and transitive. (It is both an equivalence relation and a non-strict order relation, and on this world produces an antichain.) Emptily unhappy world "likes" is not reflexive, and is trivially irreflexive, symmetric, antisymmetric, and transitive. Circularly unhappy world This world's extension of "likes" is {(Ann,Bob),(Bob,Chip),(Chip,Ann)}. irreflexive, antisymmetric, and not transitive. "likes" is Somewhat-happy world with 2-circuit This world's extension of "likes" is {(Ann,Bob),(Bob,Ann),(Chip,Chip)}. "likes" is neither reflexive nor irreflexive, but is both symmetric and transitive.. Happy world with 2-circuit This world's extension of "likes" is {(Ann,Ann),(Ann,Bob),(Bob,Ann),(Bob,Bob),(Chip,Chip)}. "likes" is reflexive, symmetric, and transitive.. (It is an equivalence relation.) Equivalence relations An equivalence relation is a relation that is reflexive, symmetric, and transitive. Example: = is an equivalence relation, because = is reflexive, symmetric, and transitive. An equivalence relation partitions its domain E into disjoint equivalence classes. Each equivalence class contains a set of elements of E that are equivalent to each other, and all elements of E equivalent to any element of the equivalence class are members of the equivalence class. The equivalence classes are disjoint: there is no x∈E such that x is in more than one equivalence class. The equivalence classes exhaust E: there is no x∈E such that x is in no equivalence class. Any element of an equivalence class may be its representative; the representative stands for all the members of its equivalence class. Examples: Smaller circle plus dot happy world This world's "likes" is an equivalence relation, and so it induces a partition of {Ann,Bob,Chip}. The partition consists of two equivalence classes, {Ann,Bob} and {Chip}. These equivalence classes are disjoint (their intersection is empty) and exhaustive (every element is in an equivalence class). Narcissistic world This world's "likes" is also an equivalence relation, inducing a partition consisting of three singleton equivalence classes {Ann}, {Bob}, and {Chip} (clearly disjoint and exhaustive). Happy world This world's "likes" is also an equivalence relation. The partition it induces consists of one equivalence class, {Ann,Bob,Chip} (exhaustive and trivially disjoint). Order relations An order (or partial order) is a relation that is antisymmetric and transitive. Examples: ≤ is an order relation on numbers. ⊆ is an order relation on sets. The prefix relation on binary strings is an order relation. The symbol ⊑ is often used to represent an arbitrary partial order. In mathematics and formal reasoning, order relations are commonly allowed to include equal elements as well. However, for some authors and in everyday usage, orders are more commonlyirreflexive, so that "John is taller than Thomas" does not include the possibility that John and Thomas are the same height. A strict order is one that is irreflexive and transitive; such an trivially antisymmetric because there is no x and y such that xRy and yRx. order is also A non-strict order is one that is reflexive, antisymmetric, and transitive. Any order we discuss will be considered non-strict unless specifically stated otherwise. Examples: < is strict, ≤ is non-strict. ⊂ is strict, ⊆ is non-strict. "taller than" is strict (no one is taller than him- or herself). An order relation R on E is elements x,y∈E. a total order if either xRy or yRx for every pair of An order relation R on E is a partial order if there is a pair of elements x,y∈E for which neither xRy nor yRx. Let R be an order relation on E and let x,y∈E. x and y are incomparable under R if neither xRy nor yRx. We write this as x||y (or x#y). From the definitions, we can see that a total order is one for which no two elements are incomparable, and a partial order is one for which at least two elements are incomparable. Examples: < on the integers is a total order. For any two integers x and y, either x<y or y<x. ⊂ on the powerset of the integers is a partial order; it is not total. There are many incomparable sets in this (and any other) powerset. For example, {1,4,9}⊄{1,3,5} and {1,3,5}⊄{1,4,9}, so these two sets are incomparable and we write {1,4,9}||{1,3,5} or {1,4,9}#{1,3,5}. Constructing a relation from other relations Let R be a relation from X to Y and S be a relation from Y to Z. The composition (or join) of R and S, {(x,z)∈X×Z | xRy and ySz for some y∈Y}. written R.S, is the relation A function-style notation S○R is also sometimes seen, but is quite inconvenient for relations. The notation R.S is easier to deal with as the relations are named in the order that leaves them adjacent to the elements that they apply to (thus x(R.S)z because xRy and ySz for some y). The product of two relations R and S is the relation {(w,x,y,z) | wRx∧yRz} } The converse (or transpose) of R, written R−1, is the relation {(y,x) | xRy}. The closure of a relation R is the relation {(x,z) | (x,y)∈R∧(y,z)∈R}. The transitive closure of R is the smallest transitive relation S such that R⊆S. You can obtain the transitive closure of R by closing it, closing the result, and continuing to close the result of the previous closure until no further tuples are added. Because relations are sets (of pairs), all the operations on sets also apply to relations. The intersection of R and S, written RS, is the relation {x(RS)y | xRy and xSy}. The union of R and S, written R∪S, is the relation {x(R∪S)y | xRy or xSy}. The difference of R and S, {x(R−S)y | xRy but not xSy}. written R−S or R \ S, is the relation Examples Let X={Airplane,Pool,Restaurant} Y={Goggles,Heels,Seatbelt,Tuxedo} Z={Buckle,Pocket,Strap} R be the relation "is where one wears", with extension {(Airplane,Seatbelt),(Airplane,Tuxedo),(Pool,Goggles),(Restaurant,Heels),(Restauran t,Tuxedo)} S the relation "can have a", with extension {(Goggles,Strap),(Heels,Buckle),(Heels,Strap),(Seatbelt,Buckle),(Seatbelt,Strap),(Tux edo,Pocket)} Composition R.S is {(Airplane,Buckle), (Airplane,Pocket), (Airplane,Strap), (Pool,Buckle), (Pool,Strap), (Restaurant,Buckle), (Restaurant,Pocket), (Restaurant,Strap)}. Converse R-1 is {(Goggles,Pool),(Heels,Restaurant),(Seatbelt,Airplane),(Tuxedo,Airplane),(Tuxedo,Restaura nt)}. Concepts sometimes confused with each other Transitivity and composition may seem similar: both are defined using x, y, and z, for one thing. But they are unrelated: transitivity is a property of a single relation, while composition is an operator on two relations that produces a third relation (which may or may not be transitive). Symmetric and converse may also seem similar; both are described by swapping the order of pairs. But they are also unrelated: symmetry is a property of a single relation, while converse is an operator that takes a relation and produces another relation (which may or may not be symmetric). It is true, however, that the union of a relation with its converse is a symmetric relation. Relations on relations Because relations are sets (of pairs), the relations on sets also apply to relations. Let E be a set and R and S be relations on E. R and S are equal if for every x,y∈E, xRy iff xSy. R is a subset of S if for every x,y∈E, xRy implies xSy. Examples: "Happy world" is equal to the full relation. "Smaller circle plus dot somewhat-happy world likes" is a subset of "Smaller circle plus dot happy world likes". Order Relation partial order poset total/linear order Shoppers in a grocery store are served at a cashier on the first-come-first-served basis. When there are many people at cashiers, lines are formed. People in these lines are ordered for service: Those at the head of a line are served sooner than those at the end. Cars waiting for the signal to change at an intersection are also ordered similarly. Natural numbers can also be ordered in the increasing order of their magnitude. Those are just a few examples of order we encounter in our daily lives. The order relations we are going to study here are an abstraction of those relations. The properties common to orders we see in our daily lives have been extracted and are used to characterize the concepts of order. Here we are going to learn three types of order: partial order, total order, and quasi order. Definition(partial order): A binary relation R on a set A is a partial order if and only if it is (1) reflexive, (2) antisymmetric, and (3) transitive. The ordered pair <A, R> is called a poset (partially ordered set) when R is a partial order. Example 1: The less-than-or-equal-to relation on the set of integers I is a partial order, and the set I with this relation is a poset. Example 2: The subset relation on the power set of a set, say {1, 2} , is also a partial order, and the set {1, 2} with the subset relation is a poset. Definition(total order): A binary relation R on a set A is a total order if and only if it is (1) a partial order, and (2) for any pair of elements a and b of A, < a, b > ϵ R or < b, a > ϵ R. That is, every element is related with every element one way or the other. A total order is also called a linear order. Example 3: The less-than-or-equal-to relation on the set of integers I is a total order. The strictly-less-than and proper-subset relations are not partial order because they are not reflexive. They are examples of some relation called quasi order. Definition(quasi order): A binary relation R on a set A is a quasi order if and only if it is (1) irreflexive, and (2) transitive. A quasi order is necessarily antisymmetric as one can easily verify. Caution Like many other definitions there is another fairly widely used definition of quasi order in the literature. According to that definition a quasi order is a relation that is reflexive and transitive. Example 4: The less-than relation on the set of integers I is a quasi order. Example 5: The proper subset relation on the power set of a set, say {1, 2} , is also a quasi order. The concept of least/greatest number in a set of integers can be generalized for a general poset. We start with the concepts of minimal/maximal elements. A Hasse diagram is a graph for a poset which does not have loops and arcs implied by the transitivity. Further, it is drawn so that all arcs point upward eliminating arrowheads. To obtain the Hassse diagram of a poset, first remove the loops, then remove arcs < a, b > if and only if there is an element c that < a, c > and < c, b > exist in the given relation. Example 10: For the relation {< a, a >, < a, b >, < a, c >, < b, b >, < b, c >, < c, c >} on set {a, b,c}, the Hasse diagram has the arcs {< a, b >, < b, c >} as shown below. Lattices In this section we introduce lattices as special type of partial ordered set and we discuss basic properties of lattices and some important type of special lattices. Lattice Ordered Sets In this section we define lattice ordered sets and see some examples. A poset (L, £ ) is called lattice ordered set if for every pair of elements x, y Î L, the sup (x, y) and inf (x, y) exist in L. Example 1: Let S be a nonempty set. Then (P(S), Í ) is a lattice ordered set. For (P (S), Í ) is a poset. Further for any subsets A, B of S, inf (A, B) = A Ç B Î P(S) and sup (A, B) = A È B Î P(S). Example 2: Every totally ordered set is a lattice ordered set. Example 3: Consider the set of all positive integer Z+ with divisor as a relation, i.e., a £ b if and only if a½b.Then (Z+ , ½) is a poset. For, if a, b Z+, then inf (a, b) = GCD(a, b) Z+ and sup (a, b) = LCM(a, b) Z+. Thus, inf (a, b) and sup (a,b) exist in Z+ for any two element a, b Î Z+. Hence (Z+ , ½) is a lattice ordered set. In fact (Dn , ½) ( Dn denotes the set of all positive divisors of positive number n ) is also a lattice ordered set. Example 4: Consider the set B, where Bn = {(l1, l2, … , ln) / li = 0 or 1, for 1 £ r £ n}. Define the relation £ ' by (i1, i2, … , in) £ ' (j1, j2, … , jn) if and only if ir £ jr , 1 £ r £ n. Note that here in the expression ir £ jr, £ is usual less than or equal to. Observe that inf [ (i1, i2, ….. ,in), (j1, j2, … , jn)] = (min (i1, j1), min (i2,j2), …. , min (in, jn) ) and sup [ (i1, i2, … , in), (j1, j2, … , jn)] = (max (i1, j1), max (i2,j2), …. , max (in, jn) ) Since min (ir, jr) and max (ir, jr) is either 0 or 1, so, inf { (i1, i2,… , in), (j1,j2, .. ,jn) } and sup {(i1, i2, … , in), (j1, j2, … , jn) } exist in B. Thus, (Bn, £ ) is a lattice ordered set. Algebraic Lattice In this section we define algebraic lattice by using two binary operations * (meet)and ⨁ (join). Then we shall prove that lattice ordered sets and algebraic lattices are equivalent. . An algebraic lattice (L, *, ⨁ ) is a non empty set L with two binary operations * (meet)and ⨁ (join), which satisfy the following conditions for all x, y, z L. L1. x * y = y * x, x ⨁ y = y ⨁ x (Commutative) L2. x * (y*z) = (x * y) * z, x ⨁ (y ⨁ z) = (x ⨁ y) ⨁ z (Associative) L3. x * (x ⨁ y) = x, x ⨁ (x * y) = x (Absorption) L4. x * x = x, x ⨁ x = x (Idempotent) Theorem Let (L, £) be a lattice ordered set. If we define x * y = inf (x, y), x ⨁ y = sup (x, y) then (L, *, ⨁ ) is an algebraic lattice. Proof: Given that (L, £ ) is a lattice ordered set and x * y = inf(x, y) and x ⨁ y = sup (x, y). Now we shall prove that * and ⨁ satisfy the commutative,associative, absorption and idempotent laws. Commutative x * y = inf (x, y) = inf (y, x) = y * x. x ⨁ y = sup (x, y) = sup (y, x) = y ⨁ x. Associative x * (y * z) = inf (x, (y * z)) = inf (x, inf (y,z)) = inf (x,y,z) = inf ( inf (x, y), z)) = inf ((x*y), z) = (x*y) *z. Now, x ⨁ (y ⨁ z) = sup (x, (y ⨁ z)) = sup (x, sup (y,z)) = sup (x, y,z) = sup (sup (x,y), z) = sup ((x ⨁ y), z) = (x ⨁ y) ⨁ z. Absorption Now, x * (x ⨁ y) = inf (x, x ⨁ y) = inf (x, sup (x, y)) = x [since x £ sup (x, y)]and x ⨁ (x * y) = sup (x, x * y) = sup (x, inf (x, y)) = x [since inf (x, y) £ x ]. Idempotent We have, x * x = inf (x, x) = x and x ⨁ x = sup (x, x) = x. Hence (L, * , ⨁ ) is an algebraic lattice. Theorem 3: Let (L, *, ⨁ ) be an algebraic lattice. If we define x £ ≤y x£y x ⨁ y = y, then (L, £ ) is a lattice ordered set. x * y = x or Proof: Given that (L, *, ) is an algebraic lattice and x y x * y = x or x y = y. We shall now prove that (L, ) is a poset and inf (x, y) and sup (x, y) exist in L, for all x, y in L. is reflexive Since x * x = x, for all x L (by indempotent of *). We have by definition of , x x, for all x L. Therefore, is reflexive. is anti-symmetric If x y and y x in L, then by definition of , we have x * y = x and y * x = y. But * satisfies commutative law, so, we have x * y = y * x. Therefore, x = y. Hence, is anti-symmetric. is transitive If x y and y z, then by the definition of , we have x * y = x and y * z = y. Therefore, x * z = (x * y) * z = x * (y * z) [by associativity of *] = x * y [by definition )] = x [by definition of ] Hence, by definition of , we have x z. Thus, is transitive. sup (x, y) and inf (x, y) exist in L We shall now show that inf (x, y) = x * y and sup (x, y) = x y. Now by absorption law, we have x = x * (x y) and y = y * (x y) Then by the definition of , we have x x y and y x y Therefore, x y is an upper bound for x and y. Let z be any upper bound for x and y in L. Then x z and y z. So, by definition of , we have x z = z and y z = z …… ( 1 ) Therefore, (x y) z = x (y z) [by associative law] = x z [by ( 1 )]= z [by ( 1 )]. Thus, by definition of , we have x y z. that is, x y is related to every upper bound of x and y. Hence sup (x, y) = x y. Similarly, we can show that inf (x, y) = x * y. Thus, x * y and x y exists for every x, y L. Hence, we have (L, ) is lattice ordered set. Remark 1: From the Theorem 3.2.1 and the Theorem 3.2.2, we see that if we have lattice ordered set (L, ) then we can get an algebraic lattice (L, *, ) and conversely. Hence, we conclude that the algebraic lattice and a lattice ordered sets are equivalent system. Thus, here after we shall say simply lattice to mean both. In an algebraic system it is better convenience for imposing further conditions on the binary operations. Hence developing structural concepts will be much easier than the ordered system. In fact, it is one of the motivation to view a lattice ordered set as an algebraic lattice. Sublattice, Direct Product and Homomorphism In this section we discuss sublattices of a lattice, direct product oftwo lattices and homomorphism between two lattices. Sublattices Substructure helps to know more about the whole structure. So, here we discuss about sublattice of a lattice. Let (L, *, ) be a lattice and let S be subset of L. The substructure (S, *, ) is a sublattice of (L, *, ) if and only if S is closed under both operations * and . Remark A subset S in a lattice (L, *, ) is said to be sublattice, for a, b a b= d in L, then c, d must necessary exist in S also. 1: S, if a * b = c in L and Example 1: Consider the lattice L represented by the following Hasse diagram. Here the substructure S1 represented by the Hasse diagram given below is not a sublattice, for inf (a, b) = 0 in L, which does not belong to S1. It is clear that the substructure S2 represented by the Hasse diagram given below is sublattice of L. It is interesting to note that the substructure 3 of L represented by the in the following Hasse diagram is not a sublattice but it is a lattice on its own. So, it is a lattice without being a sublattice. Exercise:ind all the sub lattices of (D30, ). 1. Let L be a lattice and let a < style="font-family: Symbol;">Î L / a x b }. Prove that [a,b] is a sublattice. Direct Product of Lattices From given two lattices, we can always construct a new lattice by taking Cartesian product of the given two lattices. So, in this section we discuss about product of two lattices. Let (L, *, ) and (M, , ) be two lattices. Consider the Cartesian product of L and M, that is, L M = {(x, y) / x L, y M}. Define operations and in L M, by (x, y) (a, b) = (x * a, y (x a, y b), then we shall prove that ( L M, , ) is a lattice. b) and (x, y) (a, b) = and are commutative. By definition (x, y) (a, b) = (x * a, y = (a * x, b y) (since * and b) are commutative) = (a, b) (x, y) (by definition ). Similarly, (x, y) (a, b) = (x a, y = (a x, b b) y) = (a, b) (x, y). Hence, commutative law holds good for both operations and . and are associative [ ( x, y) (a, b) ) (u, v)] = [ (x * a, y b) ] (u, v) (by definition of ) = [ (x * a ) * u, (y b) v] (again by definition of ) = [ x * (a * u), y (b = [ (x, y) (a * u, b v) ] (since * and are associative) v) ] (by definition of ) = [ (x, y) [ (a, b) (u, v) ] (by definition of ) Similarly we can show that [ (x, y) (a, b) ] (u, v) = (x, y) [ (a, b) (u, v) ] Thus, associative law hold good for both operations and in L M. Absorption (x, y) [ (x, y) (a, b) ] = (x, y) [ x a, y b] = [ x * (x a), y (y b) ] (by definition of and ) = (x, y ) (by absorption law in L and M). Therefore, absorption law hold good in L M. Idempotent (x, y) (x, y) = [ x * x, y y) (x, y) = (x, y). y] = (x, y) (since * and satisfy idempotent law) Similarly, (x, Hence, (L M, , ) is an algebraic lattice. Thus, (L M, , ) is a lattice. Remark : If (L, *, ) is a lattice, then L² = L x L is a lattice. In general one can show that Ln = L L L …. L (n times) is a lattice. In the finite lattices, Bn is a very important lattices, where B = {0,1}, which has rich structural property and will play very important role in the applications. Let (L, ) and (M, ' ) be two lattices, then we have already seen that (L M, R) where (x1,y1) R (x2, y2) if and only if x1 x2 and y1 ' y2, is a poset. It can be proved that (L M, R) is a lattice ordered set. Homomorphism In this section to understand the structural similarity between two lattices we define homomorphism between two lattices and we discuss about it. Let (L, *, ) and (M, , ) be two lattices. A function f : LM is called a Lattice homomorphism if f (a * b) = f (a) f (b) and f (a b) = f (a) f (b), for all a, b L, and it is called order preserving if x y in L implies f (x) ' f (y), where is an order relation in L and ' is an order relation in M. A bijecitve homomorphism is called isomorphism. Example 1: Consider the lattices D6 = {1,2,3,6} and D30 = {1,2,3,5,6,10,15,30}. We can show that there exist a homomorphism f between D6 and D30. Define a mapping f from D6 into D30 by f (1) = 1, f(2) = 6, f (3) = 15 and f (6) = 30. Then f (1 * 2) = f(1) = 1. f (1) * f(2) = 1 * 6 = 1. [Note that in both D6 and D30 a * b and a b are GCD and LCM of two elementa, b] Similarly, f (1 * 3) = f(1) = f(1) * f(3). f(1 * 6) = f(1) * f (6) = f(1). f(2 * 3) = f(2) * f(3) = f(1). f(2 * 6) = f(2) * f(6) = f(2). f(3 * 6) = f(3) * f(6) = f(3). Similarly we can prove that f (x y) =f (x) f (y) for all x, y D6 . Thus, f is homomorphism. Note that f is not onto but f is one-one. Hence f is not an isomorphism. Special Lattices In this section we shall discuss some of the special types of lattices which in turn help to define the Boolean algebra. Isotone, Distributive and Modular Inequalities In this subsection we shall prove that in every lattice the operation * and are isotone and distributive and modular inequalities holds good. Lemma : In every lattice L the operation * and are isotone, i.e., if y z x * y x * z and x y x z. Proof: x * y = (x * x) * (y * z) (since x * x = x and since y z, y * z = y) = (x * y) * (x * z) (by associative and commutative of *). x * y x * z (since a b a * b = a). Also, x z = (x x) (y z) = (x y) (x z) x y x z. Hence the lemma. Theorem: The elements of an arbitrary lattice satisfy the following inequalities i. x * (y z) (x * y) (x * z) ii. x (y * z) (x y) * (x z) (distributive inequalities.) iii. x z x * (y z) (x * y) (x * z) = (x * y) z x z x (y * z) (x y) * (x z) = (x y) * x (modular inequalities.) Proof: Claim: Distributive inequalities are true in a lattice. By definition of yyz and zyz. By isotone property we have x * y x * (yz) ............... (1) and x * z x * (yz) ............... (2) From (1) and (2) we observe that x * (y z) is an upper bound for x * y and x * z. Hence, (x * y) (x * z) x * (y z). By duality principle, we have (x y) * (x z) x (y * z). ii) It is given that z x, then z * x = z. From the inequality ( i ) we have x* (y z)(x*y)xzTherefore, x * (y z) (x * y) z. Since x z, we have x z = z. Thus, from the inequality x (y * z) (x y) * (x z), we have x (y * z) (x y) * z. Hence the theorem. Modular Lattices In this section we shall define and discuss about the modular lattices. A lattice L is said to be modular if for all x, y, z L, xz x * (y z) = (x * y) z. Example 1: (P(A), , ) is a modular lattice. Example 2: The set of all normal subgroups of a group form a modular lattice. [Recall that a subgroup H of a group G is said to be normal if gHg-1 = H, for all g G]. It can be easily shown that M, the set of normal subgroups of agroup G, with `set inclusion' relation is a poset. Now for any two normal subgroups H1 and H2 of G, we have H1 * H2 = inf (H1, H2) = H1 H2 and H1 H2 = sup (H1, H2) = H1H2. Since H1 H2 and H1H2 are normal subgroups if both H1 and H2 are normal subgroups. Therefore, (M, ) is a lattice ordered set. Hence (M, *, ) is an algebraic lattice. Let H1, H2, H3, M such that H1 H3. Since in every lattice modular inequality holds good, we have H1 (H2 * H3) (H1 H2) * H3 ………. (1) Now we shall prove that (H1 H2) * H3 H1 (H2 * H3). Let a (H1 H2) * H3 i.e., a (H1 H2) H3 a H1 H2 and a H3 a = h1h2 and a = h3, for some h1 H1 ,h2 H2 and h3 H3. Therefore, h1h2 = h3 h2 = h11 h3 H3 [ h3 H3 and h1H1 H3 , therefore, h1-1 h3 H3] h2 H2 and h2 H3 Thus, h2 H2 H3 ……… (2) Since a = h1h2, we have a H1(H2 H3) (by (2)) That is, aH1 (H2 * H3) That is, (H1 H2) * H3 H1 (H2 * H3) ………. (3) From (1) and (3) we have H1 (H2 * H3) = (H1 H2) * H3. Hence (M, *,) is a modular lattice. Theorem : A lattice L is modular if and only if x, y, z L , x (y * (x z)) = (x y) * (x z). Proof : Let (L, *, ) be a modular lattice Then, if x z implies x (y * z) = (x y) * z ……… (1) But, for all x , z L,x x z, So, by (1) we have x (y * (x z)) = (x y) * (x z), for all x, y, z L Conversely, suppose x (y * (x z)) = (x y) * (x z). ……… ( 2 ) Then we shall prove that L is modular. If x z then x z = z ………. (3) Substitute (3) in (2), we have if x z x (y * z) = (x y) * z Thus, (L, *, ) is modular.If we have a characteristic result in terms of Hasse diagram for the modular lattice then it would effectively help in deciding a given lattice is modular or not. So, we shall prove the following lemma. Lemma : The "Pentagon Lattice" represented by the Hasse diagram given below is not modular. Proof: From the structure of the pentagon lattices we see that c a. Now c (b * a) = c 0 = c. On the other hand, (c b) * a = 1 * a = a. Definitely c a, thus, pentagon lattice is not a modular lattice. On the other hand, it can be proved that if any lattice whose substructure is isomorphic to a pentagon lattice cannot be a modular lattice. So, we have the following theorem. Theorem A lattice L is modular if and only if none of its sublattice is isomorphic to the "pentagon lattice" Exercise 1: Prove that the intervals [x, x y] and [ x * y, y] are isomorphic in a modular lattice. [ Byinterval [u ,v] we mean the set { t L / utv }] Exercise 2: Prove that if a b and if there exists c L with a c = bc and a * c = b * c then a = b Distributive LatticesIn this section we will define and discuss distributive lattices. A lattice (L, *, ) is called a distributive lattice if for any a, b, c L, a * (b c) = (a * b) (a * c) a (b * c) = (a b)*(ac) Example 1: (P(A), , ) is a distributive lattice. Example 2: Every totally ordered set is a distributive lattice. Proof: In a totally ordered set (T, ) for any two elements a, b in T, we have either ab or ba. Therefore, for any three elements a,b, c in T, the following are the possible situations in the structure of (T, ). All these possible choices can be covered in the following two cases. Case 1: a b or a c [ the first four choices ] Case 2: a b and ac [ the last two choices ] For the case 1, we have, a*(b c) = a and (a * b) (a * c) = a a = a For the case 2, we have, a*(b c ) = b c and (a * b) (a * c) = b c Hence any totally ordered set (T, ) is a distributive lattice. Remark : It is clear from the definition of distributive lattice that if a c then a * c = c and a c = a. Therefore, a * (b c) = (a * b) (a * c) = (a * b) c. If a c then a * c = a and a c = c. Therefore we have a (b * c) = (a b) * (a c) = (a b) * c. Thus, every distributive lattice is modular. On the other hand every modular lattice need not be distributive. For example, the following modular lattice called diamond lattice is not distributive lattice. Diamond Lattice: For,(b * c) = a 0 = a (a b) * (a c) = 1 * 1 = 1 Therefore, a(b * c) (a b) * (a c). Hence, a diamond lattice is not a distributive lattice. It is interesting to observe that if a lattice is not modular it cannot be a distributive lattice. It follows from the Theorem . and the above Remark1, we have the following theorem which will effectively decide the given lattice is distributive or not. Theorem : A lattice is distributive iff none of its sublattice is isomorphic to either the pentagon lattice or diamond lattice. [ For the proof refer [ 2 ] ] Exercise: Prove that the direct product of two distributive lattices is a distributive lattice. Theorem: Let (L, *, ) be a distributive lattice. Then for any a, b, c L, a * b = a * c and a b = a c b = c [cancellation law]. Proof: (a * b) c = (a * c) c = c (since a * b = a * c and by absorption law, (a * c) c = c) Now, (a * b) c = (a c) * (b c) (by distributive law) = (a b) * (b c) (since a c = a b) = b (a * c) (by distributive law) = b (a * b) (since a * c = a * b) = b (by absorption law) Hence, b = c . Complemented Lattices In a lattice (L, *, ),the greatest element of the lattice is denoted by 1 and the least element is denoted by 0. If a lattice (L, *,) has0 and 1, then we have, x * 0 = 0, x 0 = x, x * 1 = x, x 1 = 1, for all x L. A lattice L with 0 and 1 is complemented if for each x in L there exists atleast one y L such that x * y = 0 and x y = 1 and such element y is called complement of x. Note: It is customary to denote complement of x by x'. Example 1: Consider the lattice (P(A), ) Here 0 = and 1 = A. Then, for every S P(A), that is, S A, complement of S is A\ S, i.e. S'. Example 2: Consider the lattice L described in the Hasse diagram given below. Here, c does not have a complement. For, c * 0 = 0, but, c 0 = c. Therefore, 0 can not be a complement of c. Since a c = c, therefore, a can not be a complement of c. Further, since c * b = c, b is not a complement of c. Also, c * 1 = c, 1 is not a complement of c. Hence, c does not have any complement in L. Therefore, L is not a complemented lattice. Example 3: In a totally ordered set, except 0 and 1, all the other elements do not have complements. Example 4: Consider the lattice L described by the Hasse diagram given below. Here, for c, we have, c * a = 0 and c a =1 and also, c * b = 0 and c b = 1. Thus, c has a and b as its complements. From this example, it is clear that complement of an element in a complemented lattice need not be unique. Theorem : In a distributive lattice L with 0 and 1, if a complement of an element exists then it is unique. Proof: Let L be a distributive lattice with 0 and 1. Let aL. Suppose a' and a" be two complement of a. Then by the definition of complement of an element, we have a * a' = 0 and a a' = 1 a a" = 0 and a a" = 1 Therefore, a * a' = a * a" and a a' = a a". Therefore by cancellation law in a distributive lattice, we have a' = a". Thus, complement of an element in a distributive lattice is unique. BOOLEAN ALGEBRA BOOLE is one of the persons in a long historical chain who were concerned with formalizing and mechanizing the process of logical thinking. BOOLEAN ALGEBRA is a generalization of set algebra and the algebra of propositions. Boolean Algebra is a tool for studying and applying logic. . We learn how BOOLEAN algebra is used to construct and simplify electric circuits. Switching circuits, which are used in the design of computer chips, are introduced with a discussion of the techniques needed to simplify their design. . We also show how a purely algebraic approach to some parts of logic is possible by using BOOLEAN Algebras and how this technique can also be used to study set theory. Definition: Boolean Algebra is an algebraic structure defined on a set of elements is together with two binary operations, the product (or meet) and the sum (or join) provided the following Hunthington postulates are satisfied: 1. a. Closure with respect to the operator + b. Closure with respect to the operator x 2. a. An identity element with respect to + is 0 x+0=0+x b. An identity element with respect to . is 1 x.1=1.x=x 3. a. Commutative with respect to + x+y=y+x b. Commutative with respect to . x.y=y.x 4. a. . is distributive over + x(y + z) = xy + xz b. + is distributive over . x + (yz) = (x + y)(x + z) 5. For every element x B, there exists an element x' B (complement of x) such that: a. x + x' = 1 b. x . x' = 0 6. There exists at least two elements x, y B such that x = y. Example: Show that the algebra of subsets of a set and the algebra of propositions are Boolean algebras. Solution: * let S be any set and K = P(S) be the power set ( and the set of all subsets ) of S. Then K is the Boolean algebra, where the meet is the intersection of two sets; the join is the union of two sets; the Boolean complement is the complement of a set ; the zero element is the empty se; the unit is S. * Let L be the set of all propositions. Then L is a boolean algebra, where the meet is the conjuction of two propositions; the join is the disjunction of two propositions; the booleancomplement is the negation of a proposition; the zero element is a proposition F that is always false; the unit element is a propostion T that is always true. Two Valued Boolean Algebra: A two valued Boolean Algebra is defined on a set of two elements, B = { 0, 1 }, with rules for the two binary operators + and . x y xy 0 0 0 0 1 0 1 0 0 1 1 1 x y x+y 0 0 0 0 1 1 1 0 1 1 1 1 x x' 0 1 1 0 These rules are exactly the same as the AND, OR, & NOT operations, respectively. Now show that the Hunthington postulates are valid for the set B = { 0, 1 } and the two binary operators defined above. 1. Closure The result of each operation is 1 or 0 and 1, 0 B. 2. From the table an identity element with respect to + is 0, since 0+1=1+0=1 An identity element with respect to . is 1, since 1.1 = 1 1.0 = 0.1 = 0 3. Commutative law 0 + 1 = 1 + 0 = 1 ( for + ) 0 . 1 = 1 . 0 = 0 ( for . ) 4. Distributive law a. . is distributive over + : x ( y + z ) = xy + xz b. + is distributive over . : x + ( y. z) = (x + y) . (x + z) x y z y+z x.(y+z) x.y x.z xy + xz 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 5. From the complement table, 0+0=0 a. x + x' = 1 since 0 + 0' = 0 + 1 = 1 1 + 1' = 1 + 0 = 1 b. x . x' = 0 since 0 . 0' = 0 . 1 = 0 1 . 1 ' = 1. 0 = 0 6. Two valued boolean algebra has two distinct elements 1 and 0. Theorems and Properties of Boolean Algebra: Theorem 1: a. x + x = x proof: x+x = = ( x + x ) (x + x') = (x + xx') = x+0 = x b. x . x = x proof: (x+x).1 by postulate (2b) x.x = x. x + 0 = x . x + x . x' = x (x + x') = x.1 = x Theorem 2: a. x + 1 = 1 proof: x+1 = 1 . ( x + 1) = ( x + x' )( x + 1) = x + x' . 1 = x + x' = 1 b. x.0 = 0 by duality Theorem 3: (x')' = x Theorem 4: a. x + ( y + z ) = (x+y)+z associative b. x ( yz ) ( xy ) z associative = Theorem 5: ( De Morgan ) a. ( x + y )' = x' y' b. ( xy )' = x' + y' proof: x y x+y (x+y)' x' y' x'y' 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 0 0 Theorem 6: (Absorption) a. x + xy = x proof: x + xy = x.1 + xy by postulate 2 (b) = x (1 + y) by postulate 4 (a) = x(y+1) by postulate 3 (a) = x.1 by theorem 2 (a) = x by postulate 2(b) b. x ( x + y ) = x proof: x y xy x+xy 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 Operator precedence for evaluating the boolean expression is: 1. First the expressions inside parentheses must be evaluated. 2. Complement ( NOT ) 3. AND 4. OR BOOLEAN FUNCTIONS: A binary variable can take the value of 0 and 1. A boolean function is an expression formed with binary variables, the two binary operators OR and AND, the unary operator NOT, parentheses, equal sign. For a given value of the variables, the function can be either 0 or 1. Example: F1 = xyz' F1 = 1 if x = 1 and y = 1 and z' = 1; otherwise F1 = 0 A Boolean function may also be represented in a truth table. to represent a function in a truth table, we need 2n combimations of 1's and 0's of the n binary variables. F2 = x + y'z F2 = 1 if x = 1 or if y = 0, while z = 1 F3 = x'y'z + x'yz + xy' F4 = xy' + x'z x y z F1 F2 F3 F4 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 0 1 0 0 The number of rows : 2n ( n = number of binary variables) A boolean function may be transformed from an algebraic expression into a logic diagram composed of AND, OR, NOT gates. Example: Simplify the boolean functions to a minimum number of literals. 1. x + x'y = ( x + x' ) ( x + y ) = 1.( x + y ) = x + y 2. x ( x' + y ) = xx' + xy = 0 + xy = xy 3. x'y'z + x'yz + xy' = x'z (y' + y) + xy' = x'z + xy' 4. xy + x'z + yz = xy + x'z + yz ( x + x' ) = xy + x'z + xyz + x'yz = xy ( 1 + z ) + x'z ( 1 + y ) = xy + x'z 5. ( x + y ) ( x'z ) ( y + z ) = ( x + y ) ( x' + z ) Complement of a Function: ( A + B + C )' Example: = ( A + X )' = A' X ' = A' ( B + C )' = A' . ( B' C' ) = A'B'C' let B + C = X De Morgan thm 5a De Morgan thm. 5a Find the complement of the functions. F1 = x' yz' + x'y'z and F2 = x ( y'z' + yz ) F1' F2' = ( x' y z' + x' y' z )' = ( x' y z' )' ( x' y' z )' = ( x + y' + z ) ( x + y + z' ) = [ x ( y' z' + yz ) ]' = x' + ( y'z' + yz )' = x' + ( y'z' )' . ( yz )' = x' + ( y + z ) ( y' + z' ) Example: Find the complement of the functions F1 and F2 by taking their duals and complementing each literal. F1 = x'yz' + x' y' z The dual of F1 is : ( x' + y + z' ) ( x' + y' + z ) Complement each literal : F1' = ( x + y' + z ) ( x + y + z' ) F2 = x ( y' z' + yz ) The dual of F2 is x + ( y' + z' ) ( y + z ) Complement each literal: F2' = x' + ( y + z ) ( y' + z' ) CANONICAL AND STANDARD FORMS: Minterms and Maxterms: A binary variable may appear in its normal form(x) or in its complement form ( x' ) Two binary variables x and y combined with an AND operation. . Four possible combinations : x'y' x'y xy' xy Each of these terms are called MINTERM ( Standard Product ) . n variables can be combined to form 2n minterms. . Each minterm is obtained from an AND term of the n variables, with each variable being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1. . n variables forming an Or term, with each variable being primed or unprimed, provide 2n possible combinations, called MAXTERMS ( or Standard sums ) . Each MAXTERM is obtained from an OR term of the n variables, with each variable being unprimed if the corresponding bit is a 0 and primed if a 1. MINTERMS x y z Term MAXTERMS Designation Term Designation 0 0 0 x' y' z' m0 x+y+z M0 0 0 1 x' y' z m1 x + y + z' M1 0 1 0 x' y z' m2 x + y' + z M2 0 1 1 x' y z m3 x + y' + z' M3 1 0 0 x y' z' m4 x' + y + z M4 1 0 1 x y' z m5 x' + y + z' M5 1 1 0 x y z' m6 x' + y' + z M6 1 1 1 xyz m7 x' + y' + z' M7 A BOOLEAN function may be expressed algebraically from a given truth table by forming a MINTERM for each combination of the variables which produces a 1 in the function, than taking the OR of all those terms. EXAMPLE: Functions of three variables x y z function f1 function f2 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 The function f1 is determined by expressing the combinations 001, 100, 111, as x'y'z, xy'z, xy'z', xyz. Since each one of these minterms results in f1 = 1. f1 = x'y'z + xy'z' + xyz = m1 + m4 + m7 f2 = x'yz + xy'z + xyz' + xyz = m3 + m5 + m6 +m7 NOTE 1: Any boolean function can be expressed as a sum of minterms. ( SUM - ORing of terms ) Complement: Read from the truth table by forming a MINTERM for each combination that produces a 0 in the function and then ORing those terms. f1' = x'y'z' + x'yz' + x'yz + xy'z +xyz' If we take the complement of f1' we obtain the function f1. f1 = (x+y+z) (x+y'+z) (x+y'+z) (x'+y+z') (x'+y'+ +z) = m0 . m2 . m3 . m5 . m6 NOTE 2 : Any boolean function can be expressed as a product of MAXTERMS ( product AND ing of terms) Procedure for obtaining the product of MAXTERMs from the truth table is: * Form a maxterm for each combination of the variables which produces a 0 in the function. * Form the AND of all those maxterms. BOOLEAN functions expressed as a SUM of MINTERMS or PRODUCT of MAXTERMS are said to be in CANONICAL FORM. SUM OF MINTERMS It is sometimes convenient to express a boolean function in its sum of minterm form. To do this we should have each term with all variables. To expand the terms with missing variables we should AND these terms by (x + x') where x is the missing variable. Example: Express F = A + B'C as a sum of minterms. F = A + B'C = A ( B + B' ) + ( A + A' )B'C = AB + AB' + AB'C + A'B'C Note the terms AB and AB' are still lack the variable C, we will expand them by ( C + C ') = AB ( C + C' ) + AB' ( C + C ' ) + AB'C + A'B'C = ABC + ABC' + AB'C + AB'C ' + AB'C + A'B'C = ABC + ABC' + AB'C + AB'C ' + A'B'C = m7 + m6 + m5 + m4 +m1 = ( 1, 4, 5, 6, 7 ) PRODUCT OF MAXTERMS To express the boolean function as a product of MAXTERMs it must first, be brought into a form of OR terms. This may be done by using the distributive law: x + yz = ( x + y ) ( x + z ) Then any missing variable x in each OR term is OR ed with xx'. EXAMPLE: Express F = xy + x'z in product of maxterm form. F F = ( xy + x'z ) = ( x' + xy ) ( z + xy ) = ( x' + x ) ( x' + y ) ( z + x ) ( z + y ) = ( 1 ) ( x' + y ) ( x + z ) ( y + z ) = ( x' + y + zz' ) ( x + z + yy' ) ( y + z + xx' ) = (x'+y+z) (x'+y+z') (x+z+y) (x+z+y') (y+z+x) (y+z+x') = Reduce the terms which appear twice = (x' + y + z) (x' + y + z') (x + z + y') (x + z + y') = 100 = ( 0, 2, 4, 5 ) 101 000 010 CONVERSION BETWEEN CANONICAL FORMS Consider the function F ( A, B, C ) = F '( A,B, C ) ( 1, 4, 5, 6, 7 ) = ( 0, 2, 3 ) If we take the complement of F ' by the De Morgan's theorem, we obtain F in a different form: F ( m0 + m2 + m3 )' = m0' . m2'. m3' = M0.M2.M3 = ( 0, 2, 3 ) m'j = Mj To convert from one canonical form to another: . interchange the symbols and . list those numbers missing from the original form. EXAMPLE: F ( x, y, z ) = ( 0, 2, 4, 5 ) is expressed in the product of MAXTERM form. It's conversion tosum of MINTERMS is: F ( x, y, z ) = ( 1, 3, 6, 7 ) STANDARD FORMS: Another way to express Boolean function is in standard forms. There are two types of standard forms: . The sum of products . The product of sums The SUM of PRODUCTs is a boolean expression containing AND terms, called PRODUCT terms, of one or more literals each. The SUM denotes the OR ing of these terms. Example: A function expressed in sum of products is F1 = y' + xy + x'yz' The expression has three product terms of one, two, and three literals each, respectively. The PRODUCT of SUMs is a boolean expression containing OR terms, called SUM terms. Each term may have any number of literals. The PRODUCT denotes the AND ing of these terms. Example: A function expressed in product of sums is: F2 = x ( y' + z ) ( x' + y + z' + w ) This expression has three sum terms of one, two, and four literals each. The product is an AND operation. * A Boolean function may be expressed in a nonstandard form. For example, F3 = ( AB + CD ) ( A'B' + C 'D' ) is neither in sum of products nor in product of sums. It can be changed to a standard form by using the distributive law to remove the parentheses: F3 = A'B'CD + ABC 'D' OTHER LOGIC OPERATIONS There are 22n functions for n binary variables. For 2 variables, n = 2, the number of possible BOOLEAN function is 16. Truth tables for the16 functions of two binary variables x& y. x y F F F F F F F F F F F1 F1 F1 F1 F1 F1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 operato r symbo l . / / + ' ' F1 represents the truth table for AND - the operator symbol is . F7 represents the truth table for OR - the operator symbol is + Boolean expressions for the 16 function of two variables: Boolean function Operator Symbol F0 = 0 Name Comments Null Binary constant 0 F1 = xy x.y AND x and y F2 = xy' x/y INHIBITION x but not y TRANSFER x INHIBITION y but not x TRANSFER y F3 = x F4 = x'y y/x F5 = y F6 = xy' + x'y xy EXCLUSIVE-OR x or y but not both F7 = x + y x+y OR x or y F8 = ( x + y )' xy NOR Not - or F9 = xy + x'y' xy EQUIVALANCE x equals y F10 = y' y' COMPLEMENT Not y F11 = x + y' xy IMPLICATION If y then x F12 = x' x' COMPLEMENT Not x F13 = x' + y xy IMPLICATION If x then y F14 = ( xy )' xy NAND Not - And IDENTITY Binary constant 1 F15 = 1 The 16 functions listed can be divided into three categories. 1. Two functions that produce a constant 0 or 1. 2. Four functions with unary operations complement and transfer. DIGITAL LOGIC GATES Boolean functions are expressed in terms of AND, OR, NOT operations. There fore it is easy to implement a Boolean function with these types of gates. Of the 16 function in the table " Boolean Expressions"; . two are equal to a constant, . four others are repeated twice . two inhibition & implication, are not commutative or associative & thus are impractical to use as standard logic gates. . other eight : complement transfer AND OR NAND NOR Exculisive - OR ( EX - OR ) Equivalance ( EX - NOR ) are used as standard gates in digital design. A gate can be extended to have multiple inputs if the binary operation it represents is COMMUTATIVE and ASSOCIATIVE. x+y = y+x (x + y) + z = x+(y+z) commutative associative OR function can be extended to three or more variables. NAND & NOR functions are commutative and their gates can be extended to have more than two inputs. NAND & NOR operators are not associative. ie; ( x y ) z x(y z) (xy)z = [( x + y )' + z]' = ( x + y ) z'= xz' + yz' x(y)z) = [ x + ( y + z )']' = x' ( y + z ) = x'y+ x'z To overcome this diffuculty, define the multiple NOR (or NAND) gate as a complemented OR ( or AND ) gate. x y z = [( x + y + z )' x y z = ( xyz )' Demonstration of non - associativity of NOR operator ( x y ) z = ( x + y ) z' x ( y z ) = x' ( y + z ) Three input NOR gate: ( x + y + z )' Three input NAND gate: ( xyz )' Cascaded NOR and NAND gates: F = [ ( ABC )' . ( DE )' ] ' = ABC + DE . The exclusive - OR and equivalance gates are both COMMUTATIVE and ASSOCIATIVE and can be extended to more than two inputs. The exclusive - OR is an odd function ie ; it is equal to 1 if the input variables have an odd number of 1's. The equivalance function is an even function; ie; it is equal to 1 if the input variables have an even number of 0's. Example: Construct a circuit for the expression a. ( x + y ) x' b. x' ( y + z' )' Example: What is the expression ( the output ) of the following circuit? Result: F = ( x + y + z ) . ( x' y' z' ) Can we simplift it ? F = ( x + y + z ) . ( x + y + z )' = 0 This circuit always produce logic 0, independent of x, y, z and all gates are useless. Example: There is a comittee with three people. Each person votes either yes or no for a proposal. If at least two people vote yes, the proposal is passed. Design a circuit that determines whether a proposal passes. Solution: Let x = 1 if the 1st person votes yes, x = 0 if he votes no. y = 1 if the 2nd person votes yes, y = 0 if he votes no. z = 1 if the 3rd person votes yes, z = 0 if he votes no. A circuit must be designed that produces output 1 from x, y and z. When two or more of x, y and z are 1. One of the representation of the boolean function is xy + xz + yz The circuit which implements the function f ( x, y, z ) = xy + xz + yz Example : Sometimes the lights are controlled by more than one switch, like in the stairs. The downstairs switch is variable x, and the upstairs switch is the variable y. The lights should get on when both x and y are on or both are of. Draw the logic circuit of Light ( x, y ) x y Light ( x, y ) minterm 0 0 1 xy 0 1 0 1 0 0 1 1 1 x'y' SIMPLIFICATION OF BOOLEAN FUNCTIONS : The MAP method: The complexity of the digital logic gates that implement a BOOLEAN function is related to the complexity of the algebraic expression. The map method provides a simple straightforward procedure for minimizing BOOLEAN functions. This method may be regarded as: . a pictorial form of a truth table or . as an extension of the venn diagram The map method first proposed by Veitch and modified by Karnaugh. The map is a diagram made up of squares. Each square represents one minterm. The simplest algebraic expression is any one in a sum of products or product of sums that has a minimum number of literals. Two and Three Variable Maps: There are four minterms for two variables. Since the map consists of four squares, one for each minterm. m0 m1 m2 m3 0 1 x'y' x'y xy' xy This map shows the relationship between the squares and the two variables. The 0's and 1's marked for each row and each column designate the values of variables a and y respectively. x appears primed in row 0 and unprimed in row 1. y appears primed in column 0 and unprimed in column 1. The function xy is shown in the following figure. 0 1 0 1 1 xy Since xy is equal to m3, 1 is placed inside the square that belongs to m3. The function x + y is represented in the following map by three squares marked with 1's. These squares are found from the minterms of the function: x + y = x'y + xy' + xy = m1 + m2 + m3 0 1 1 1 1 x+y A three variable map is shown in the following figure. m0 m1 m3 m2 m4 m5 m7 m6 (a) 00 01 11 10 0 x'y'z' x'y'z x'yz x'yz' 1 xyz' xy'z xyz xyz' (b) This figure is marked with numbers to show the relationship between the squares and the three variables. There are 23 = 8 minterms for 3 binary variables. Therefore a map consists of 8 squares. For example: the square assigned to m5 corresponds to row 1 and column 01. When these numbers are concatenated, they give the binary number 101, whose decimal equivalent is 5. To understand the usefulness of the map for simplifying Boolean functions; Any two adjacent squares in the map differ by only one variable which is primed in one square and unprimed in the other. For example m5 and m7. Variable y is primed in m5 and unprimed in m7, the other two variables are the same. From the postulates, the sum of minterms in adjacent squares can be simplified to a single AND term consisting of only two literals. m5 + m7 = xy'z + xyz = xz ( y' + y ) = xz Example: Simplify the Boolean function: F = x'yz + x'yz' + xy'z' + xy'z 1 st, 1 is marked in each square as needed to represent the function as shown in the following figure. x' 0 x 1 y' y' y y 00 01 11 10 1 1 1 1 This can be done in two ways. 1. By converting each minterm to a binary number and then marking a 1 in the corresponding square. 2. By obtaining the coincidence of the variables in each term. For example, the term x'yz has represents minterm m3 in square 011. the corresponding binary number 011 and The second way to recognize the square is by the coincidence of the variables x', y, z, which is found in the map by observing that x' belongs to the four squares in the first row, y belongs to the four squares in the two right columns, and z belongs to the four squares in the two middle columns. The area that belongs to all three literals is the single square in the first row and third column F = x'y + xy' Example: Simplify the Boolean function F = x'yz + xy'z' + xyz + xyz' x' 0 x 1 y' y' y y 00 01 11 10 1 1 z' z 1 1 z z' F = yz + xz' The vertical group corresponds to yz and the horizontol group corresponds to xz' Example: Simplify the Boolean function F = A'C + A'B + AB'C + BC B B 01 11 10 A' 0 1 1 1 A 1 1 C C 00 1 F = C + A' B C: central four group A' B: Right - Top 2 group FOUR VARIABLE MAP m0 m1 m3 m2 m4 m5 m7 m6 m12 m13 m15 m14 m8 m11 m10 m9 y' y' y 00 01 11 y 10 w' 00 x' w' 01 x w 11 x w 10 x' z' z z z' In four variable Karnaugh maps: . One square corresponds to a single minterm. . Two adjacent squares corresponds to a term with three literals. . Four adjacent squares corresponds to a term with two literals. . Eight adjacent squares corresponds to a term with one literal. . Sixteen adjacent squares corresponds to a term of logic 1. Example: Simplify the Boolean function F (w, x, y, z ) = ( 0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14 ) y' y' y 00 01 11 y 10 w' 00 1 1 1 x' w' 01 1 1 1 x w 11 1 1 1 x w 10 1 1 z' z F x' z z' = y' + w'z' + xz' = 8 adjacent + upper 4 adjacent + lower 4 adjacent FIVE AND SIX VARIABLE MAPS: Maps with more than four variable gets more complex to use. For 5 variable map we need 25 = 32 and for 6 variable map 64 cells. Five Variable Map: F ( A, B, C, D, E ) 000 001 011 010 C C C C 110 111 101 100 00 A 01 B 11 B A 10 D E D D D E E E Six Variable Map: F ( A, B, C, D, E, F ) D D D D 000 001 011 010 110 111 101 100 000 001 C 011 B 010 B A 110 B A 111 B A 101 C C C A 100 E F F E E E F Example: Simplify the 5 variable Boolean function F F ( A, B, C, D, E ) = (0,2,4,6,9,11,13,15,17,21,25,27,29,31) 000 001 011 00 1 C C C C 010 110 111 101 100 1 1 1 01 1 1 1 1 B A 11 1 1 1 1 B A 10 1 1 D E E D D D E E F = BE + AD'E + A'B'E' PRODUCT OF SUMS SIMPLIFICATION So far we have seen Karnaugh map simplification in sum of products form. With little difference, we can implement this method as " product of sums " form. In this method we mark the zeros into the box, we form F' in sum of products form, negate F' by DeMorgan's rule and obtain the product of sums form. Example: Simplify F ( A, B, C, D ) = ( 0, 1, 2, 5, 8, 9, 10 ) in a. Sum of Products b. Product of Sums form and draw the logic circuits. Solution: a. F = B'D' + B'C' + A'C'D C C 01 11 10 00 1 1 0 1 01 0 1 0 0 B A 11 0 0 0 0 B A 10 1 1 0 1 D D 00 b. Applying DeMorgan to the solution in (a) F = B'D' + B'C ' + A'C 'D F '= (B + D ) . ( B + C ) . ( A + C + D' ) By table: C C 01 11 10 00 1 1 0 1 01 0 1 0 0 B A 11 0 0 0 0 B A 10 1 1 0 1 D D 00 F ' = AB + CD + BD' DON'T CARE CONDITIONS In a logic table, except the o's and 1's; there are cases where the truth value of a certain combination is significant. For example, for a logic circuit which accepts 4 - bit Decimal number, there are 6 combinations which are not used. Any logical circuit which operates on these 4 - bit decimal code will ignore the combinations greater than decimal 9. So we "Don't care" these combinations. In the Karnaugh map, we mark the don't care cells with "x" and may group into 1s boxes or 0's boxes as convenient. Example: Simplify the Boolean function F (w,x,y,z) = (1,3,7,11,15) with Don't-care conditions d (w, x,y,z) = ( 0, 2, 5 ) a. 00 01 11 10 00 x 1 1 x 01 0 x 1 0 11 0 0 1 0 10 0 0 1 0 Considering x's as 1, we get F = w'z + yz b. x 1 1 x 0 x 1 0 0 0 1 0 0 0 1 0 Considering x's as 0, we get F ' = z' + wy ' and we get F = z. ( w' + y ) PROBLEMS PART A 1. Prove that A (B C) = (A B) (A C) 2. If A, B, C, D are sets, prove algebraically that (A B) X (C D) = (AXC) (BXD). Give an example to support this result. 3. Define minset. Consider the subset, A = {1,7,8}, B = {1,6,9,10} and C = {1,9,10} where U = {1,2,3,…….,10}. List the non-empty minsets generated by A,B,C 4. Define partial order relations. Give an example 5. Prove that the sum first ‗n‘ natural numbers is n(n+1)/2, by Mathematical Induction . 6. If f: R R and g: R R are defined by f(x) = 2x+5, g(x) = 3x+k, find k so that fog = gof 7. Show that the function f: R R, f(x) = sin x is neither one-one nor onto function. 8. Test whether the function f: R R f(x) = x2+2 is one-one onto? 9. Give an example of a relation R defined on a suitable set which is reflexive and symmetric but not transitive 10. If 43 students in a village who applied for engineering or medical or for both., 32 applied for engineering, 19 applied for medical, find the number of students who applied only for medical 11. Test whether the function f:R R, f(x) = |x| + x is one-one onto function 12. If f:A B is one-one onto, prove that fof -1 = IB 13. Let S ={x, x2/ x N} and T ={(x,2x)/x N } where N ={1,2….}. Find the range of S and T. Find S T and S T 14. Define subset and Powerset with example 15. Let R be the equivalence relation defined on the set X ={0,1,2,3} given by R ={(0,0),(0,1),(0,2),(1,0),(1,1),(1,2),(2,0),(2,2),(3,3)}. Check whether ‗R‘ is an equivalence relation. 16. Find the sets A and B if A-B ={1,3,7,11}, B-A ={2,6,8} and A B ={4,9} PART B 1. If R is a relation in the set of integers such that (a,b) R iff 3a + 4b =7n for some integers n, prove that R is an equivalence relation 2. If R is the relation on the set S of positive integers such that (a,b) R if and only if ab is a perfect square, show that R is an equivalence relation 3. If f: R R g: R R are defined by f(x) = x2-2, g(x) = x+4, find (fog) and (gof) and check whether these functions are injective, surjective and bijective 4. There are 2500 students in a school. Of these 1700 have taken course in ‗C‘, 1000 have taken a course in Pascal, 550 a course in networking, further 750 have taken a course in both C and Pascal, 400 taken course in both Pascal and Networking and 275 have taken course in both Networking and C. If 200 of these students have taken courses in C, Pascal and Networking how many of these 2500 have taken any of these 3 courses C, Pascal and Networking. How many of 2500 have not taken any of these 3 courses C, Pascal and Networking. 5. If f: A B and g: B C both 1-1 onto functions, then (gof): A C. Prove that 1. (gof) is 1-1 onto function 2. (gof)-1 = f-1og-1 6. How many integers between 1 and 300 are 1. not divisible by any of the integers 3,5,7 2. divisible by 5 but by neither 3 nor 7 7. Prove that (i) (A-C) (C-B) = and (ii) A-(B C) = (A-B) (A-C) FUNCTIONS Definitions on Function function domain, codomain image image of set range sum of functions product of functions one-to-one function (injection) onto function (surjection) one-to-one onto function (bijection) inverse function composite function Contents A function is something that associates each element of a set with an element of another set (which may or may not be the same as the first set). The concept of function appears quite often even in nontechnical contexts. For example, a social security number uniquely identifies the person, the income tax rate varies depending on the income, the final letter grade for a course is often determined by test and exam scores, homeworks and projects, and so on. In all these cases to each member of a set (social security number, income, tuple of test and exam scores, homeworks and projects) some member of another set (person, tax rate, letter grade, respectively) is assigned. As you might have noticed, a function is quite like a relation. In fact, formally, we define a function as a special type of binary relation. Definition (function): A function, denote it by f, from a set A to a set B is a relation from A to B that satisfies 1. for each element a in A, there is an element b in B such that <a, b> is in the relation, and 2. if <a, b> and <a, c> are in the relation, then b = c . The set A in the above definition is called the domain of the function and B its codomain. Thus, f is a function if it covers the domain (maps every element of the domain) and it is single valued. The relation given by f between a and b represented by the ordered pair <a, b> is denoted as f(a) = b , and b is called the image of a under f . The set of images of the elements of a set S under a function f is called the image of the set S under f, and is denoted by f(S) , that is,f(S) = { f(a) | a S }, where S is a subset of The image of the domain under f is called the range of f . the domain A of f. Properties of Function Below f is a function from a set A to a set B, S ⊆ A, and T ⊆ B. Property 1: f( S ∪ T ) = f(S) ∪ f(T) Proof of Property 1: Proof for f( S ∪ T ) ⊆ f(S) ∪ f(T) : Let y be an arbitrary element of f( S ∪ T ). Then there is an element x in S ∪ T such that y = f(x). If x is in S, then y is in f(S). Hence y is in f(S) ∪ f(T) . Similarly y is in f(S) ∪ f(T) if x is in T. Hence if y ∈ f( S ∪ T ), then y ∈ f(S) ∪ f(T). QED Proof for f(S) ∪ f(T) ⊆ f( S ∪ T ) : Let y be an arbitrary element of f(S) ∪ f(T) . Then y is in f(S) or in f(T). If y is in f(S), then there is an element x in S such that y = f(x). Since x ∈ S implies x ∈ S ∪ T, f(x) ∈ f( S ∪ T ). Hence y ∈ f( S ∪ T ). Similarly y ∈ f( S ∪ T ) if y ∈ f(T) . QEDHence Property 1 has been proven. Property 2: f( S ∩ T ) ⊆ f(S) ∩ f(T) Proof of Property 2: Let y be an arbitrary element of f( S ∩ T ). Then there is an element x in S ∩ T such that y = f(x), that is there is an element x which is in S and in T, and for which y = f(x) holds. Hence y ∈ f(S) and y ∈ f(T), that is y ∈ f(S) ∩ f(T) . QEDNote here that the converse of Property 2 does not necessarily hold. For examle let S = {1}, T = {2}, and f(1) = f(2) = {3}. Then f( S∩T ) = f(φ) = φ, while f(S) ∩ f(T) = {3}. Hence f(S) ∩ f(T) can not be a subset of f( S ∩ T ) giving a counterexample to the converse of Property 2. Example: Let f be the function from the set of natural numbers N to N that maps each natural number x to x2 . Then the domain and codomain of this f are N, the image of, say 3, under this function is 9, and its range is the set of squares, i.e. { 0, 1, 4, 9, 16, ....} . Definition (sum and product): Let f and g be functions from a set A to the set of real numbers R. Then the sum and the product of f and g are defined as follows: For all x, ( f + g )(x) = f(x) + g(x) , and for all x, ( f*g )(x) = f(x)*g(x) , where f(x)*g(x) is the product of two real numbers f(x) and g(x). Example: Let f(x) = 3x + 1 and g(x) = x2 . Then ( f + g )(x) = x2 + 3x + 1 , and ( f*g )(x) = 3x3 + x2 Definition (one-to-one): A function f is said to be one-to-one (injective) , if and only if whenever f(x) = f(y) , x = y . Example: The function f(x) = x2 from the set of natural numbers N to N is a one-to-one function. Note that f(x) = x2 is not one-to-one if it is from the set of integers(negative as well as non-negative) to N , because for example f(1) = f(-1) = 1 . Definition (onto): A function f from a set A to a set B is said to be onto(surjective) , if and only if for every element y of B , there is an element x in A such that f(x) = y , that is, f is onto if and only if f( A ) = B . Example: The function f(x) = 2x from the set of natural numbers N to the set of non-negative even numbers E is an onto function. However, f(x) = 2x from the set of natural numbers N to N is not onto, because, for example, nothing in N can be mapped to 3 by this function. Definition (bijection): A function is called a bijection , if it is onto and one-to-one. Properties of Surjections, Injections and Bijections Below f is a function from a set A to a set B, and g is a function from the set B to a set C. Property 1: If f and g are surjections, then fg is a surjection. Proof of Property 1: Let z an arbitrary element in C. Then since f is a surjection, there is an element y in B such that z = f(y). Then since g is a surjection, there is an element x in A such that y = g(x). Hence by the definition of composite function, z = f(g(x)), that is z = fg(x). Hence fg is a surjection. QED Property 2: If f and g are injections, then fg is an injection. Proof of Property 2: Let x1 and x2 be arbitrary elements in A. Suppose that f(g(x1)) = f(g(x2)). Then since f is an injection, g(x1) = g(x2). Then since g is an injection, x1 = x2. That is for any pair of elements x1 and x2 in A if f(g(x1)) = f(g(x2)), then x1 = x2. Hence fg is an injection. QED Property 3: If f and g are bijections, then fg is a bijection. Proof of Property 3: Obviously this follows from Properties 1 and 2. Property 4: If fg is a surjection, then f is a surjection. Proof of Property 4: Let z an arbitrary element in C. Then since fg is a surjection, there is an element x in A such that z = f(g(x)). By the definition of fg, there is an element y in B such that y = g(x) and z = f(y). Hence for an arbitrary element z in C, there is an element y in B such that z = f(y). Hence f is a surjection. QED Property 5: If fg is an injection, then g is an injection. Property 6: If fg is a bijection, then f is a surjection and g is an injection. Proof of Property 6: Obviously this follows from Properties 4 and 5. Below f is a function from a set A to a set B, S ⊆ A, and T ⊆ B. Property 7: If f is a bijection, then f( S ∩ T ) = f(S) ∩ f(T) Proof of Property 7: Since f( S ∩ T ) ⊆ f(S) ∩ f(T) for a function f, we need to prove that f(S) ∩ f(T) ⊆ f( S ∩ T ) for a bijection f. Let y be an arbitrary element of f(S) ∩ f(T). Then there is an element x1 in S and an element x2 in T such that y = f(x1) = f(x2). Since f is a bijection, it is an injection. Hence if f(x1) = f(x2), then x1 = x2. Hence x1 (= x2) ∈ S ∩ T. Hence y (= f(x1) = f(x2)) ∈ f( S ∩ T ). Hence f(S) ∩ f(T) ⊆ f( S ∩ T ) if f is a bijection. QED Example: The function f(x) = 2x from the set of natural numbers N to the set of non-negative even numbers E is one-to-one and onto. Thus it is a bijection. Every bijection has a function called the inverse function. These concepts are illustrated in the figure below. In each figure below, the points on the left are in the domain and the ones on the right are in the codomain, and arrows show < x, f(x) > relation. Definition (inverse): Let f be a bijection from a set A to a set B. Then the function g is called the inverse function of f, and it is denoted by f -1 , if for every element y of B, g(y) = x , where f(x) = y . Note that such anx is unique for each y because f is a bijection. For example, the rightmost function in the above figure is a bijection and its inverse is obtained by reversing the direction of each arrow. Example: The inverse function of f(x) = 2x from the set of natural numbers N to the set of non-negative even numbers E is f -1(x) = 1/2 x from E to N . It is also a bijection. A function is a relation. Therefore one can also talk about composition of functions. Definition (composite function): Let g be a function from a set A to a set B , and let f be a function from B to a set C . Then the composition of functions f and g , denoted by fg , is the function from A to C that satisfies fg(x) = f( g(x) ) for all x in A . Example: Let f(x) = x2 , and g(x) = x + 1 . Then f( g(x) ) = ( x + 1 )2 . Properties of Inverse Function Below f is a function from a set A to a set B. Property 1: If f is a bijection, then its inverse f -1 is an injection. Proof of Property 1: Suppose that f -1(y1) = f -1(y2) for some y1 and y2 in B. Then since f is a surjection, there are elements x1 and x2 in A such that y1 = f(x1) and y2 =f(x2). Then since f -1(y1) = f -1(y2) by the assumption, f -1(f(x1)) = f -1(f(x2)) holds. Also by the definition of inverse function, f -1(f(x1)) = x1, and f -1(f(x2)) = x2. Hence x1 = x2. Then since f is a function, f(x1) = f(x2), that is y1 = y2. Thus we have shown that if f -1(y1) = f -1(y2), then y1 = y2. Hence f -1 is an injection. QED Property 2: If f is a bijection, then its inverse f -1 is a surjection. Proof of Property 2: Since f is a function from A to B, for any x in A there is an element y in B such that y= f(x). Then for that y, f -1(y) = f -1(f(x)) = x, since f -1 is the inverse of f. Hence for any x in A there is an element y in B such that f -1(y) = x. Hence f -1 is a surjection. QED Property 3: If f is a bijection, f(f -1(y)) = y for any y in B. Proof of Property 3: Since f is a surjection from A to B, for any y in B there is an element x in A such that y= f(x). Since by the definition of f -1, f -1(f(x)) = x holds, and since f -1(f(x)) = f -1(y), f -1(y) = x holds. Hence f(f -1(y)) = f(x) = y. Hence f(f -1(y)) = y. QED Growth of Functions big-oh max function big-omega big-theta little-oh little-omega Introduction One of the important criteria in evaluating algorithms is the time it takes to complete a job. To have a meaningful comparison of algorithms, the estimate of computation time must be independent of the programming language, compiler, and computer used; must reflect on the size of the problem being solved; and must not depend on specific instances of the problem being solved. The quantities often used for the estimate are the worst case execution time, and average execution time of an algorithm, and they are represented by the number of some key operations executed to perform the required computation. As an example for an estimate of computation time, let us consider the sequential search algorithm. Big - Oh The following example gives the idea of one function growing more rapidly than another. We will use this example to introduce the concept the big-Oh. Example: f(n) = 100 n2, g(n) = n4, the following table and figure show that g(n) grows faster than f(n) when n > 10. We say f is big-Oh of g. n f(n) g(n) 10 10,000 10,000 50 250,000 6,250,000 100 1,000,000 100,000,000 150 2,250,000 506,250,000 Definition (big-oh): Let f and g be functions from the set of integers (or the set of real numbers) to the set of real numbers. Then f(x) is said to be O( g(x) ) , which is read as f(x) is big-oh of g(x) , if and only if there are constants C and n0 such that | f(x) | | g(x) | whenever x > n0 . C Note that big-oh is a binary relation on a set of functions (What kinds of properties does ithave ? reflexive ? symmetric ? transitive ?). The relationship between f and g can be illustrated as follows when f is big-oh of g. For example, 5 x + 10 is big-oh of x2, because 5 x + 10 < 5 x2 + 10 x2 = 15 x2 for x>1. Hence for C = 15 and n0 = 1 , | 5x + 10 | C | x2 | . Similarly it can be seen that 3 x2 + 2 x + 4 < 9 x2 for x > 1 . Hence 3 x2 + 2 x + 4 is O( x2 ) . In general, we have the following theorem: Theorem 1: an xn + ... + a1 x + a0 is O( xn ) for any real numbers an , ..., a0 and any nonnegative number n . Note: Let f(x) = 3 x2 + 2 x + 4, g(x) = x2, from the above illustration, we have that f(x) is O(g(x)). Also, since x2 < 3 x2 + 2 x + 4, we can also get g(x) is O(f(x)). In this case, we say these two functions are of the same order. Growth of Combinations of Functions Big-oh has some useful properties. Some of them are listed as theorems here. Let use start with the definition of max function. Definition(max function): Let f1(x) and f2(x) be functions from a set A to a set of real numbers B. Then max( f1(x) , f2(x) ) is the function from A to B that takes as its value at each point x the larger of f1(x) and f2(x) Theorem 2: If f1(x) is O( g1(x) ) , and max( g1(x) , g2(x) ) ) . f2(x) is O( g2(x) ) , then (f1 + f2)( x ) is O( From this theorem it follows that if f1(x) and f2(x) are O( g(x) ), then (f1 + f2)( x ) is O( g(x) ) , and (f1 + f2)( x ) is O( max( f1(x) , f2(x) ) ) . Theorem 3: If f1(x) is O( g1(x) ) , and f2(x) is O( g2(x) ) , then (f1 * f2)( x ) is O( g1(x) * g2(x) ) . Big - Omega and Big - Theta Big-oh concerns with the "less than or equal to" relation between functions for large values of the variable. It is also possible to consider the "greater than or equal to" relation and "equal to" relation in a similar way. Big-Omega is for the former and big-theta is for the latter. Definition (big-omega): Let f and g be functions from the set of integers (or the set of real numbers) to the set of real numbers. Then f(x) is said to be ( g(x) ) , which is read as f(x) is big-omega of g(x) , | g(x)| whenever x > n0 . if there are constants C and n0 such that | f(x) | C Definition (big-theta): Let f and g be functions from the set of integers (or the set of real numbers) to the set of real numbers. Then f(x) is said to be ( g(x) ) , which is read as f(x) is big-theta of g(x) , if f(x) is O( g(x) ), and ( g(x) ) . We also say that f(x) is of order g(x). For example, 3x2 - 3x - 5 is ( x2 ) , because 3x2 - 3x - 5 (C = 1 , n0 = 2 ) . Hence by Theorem 1 it is theorem: x2 for integers x > 2 ( x2 ) . In general, we have the following Theorem 4: an xn + ... + a1 x + a0 is nonnegative number n . ( xn ) for any real numbers an , ..., a0 and any Little - Oh and Little - Omega If f(x) is O( g(x) ), but not ( g(x) ) , then f(x) is said to be o( g(x) ) , and it is read as f(x) is little-oh of g(x) . Similarlyfor little-omega ( ) . For example x is o(x2 ), x2 is o(2x ) , 2x is o(x ! ) , etc. Classification Of Functions Analytically represented functions are either Elementary or Non-elementary. The basic elementary functions are : 1) Power function : y = xm , m ÎR 2) Exponential function : y = ax , a > 0 but a ¹ 1 3) Logarithmic function : y = log ax , a > 0, a ¹ 1 and x > 0 4) Trigonometric functions : y = sin x, y = cos x, y = tan x, y = csc x, y = sec x and y = cot x 5) Inverse trigonometric functions y = sin-1 x, y = cos-1x, y = tan-1x, OR y = cot-1x, y = cosec-1x, y = sec-1x. y = arc sin x, y = arc cos x, y = arc tan x y = arc cot x, y = arc cos x and y = arc sec x Note that an elementary function is a function which may be represented by a single formula like y = f (x) where f(x) is made up of basic elementary functions and constants by means of a finite number of operations of addition, subtraction, multiplication, division and taking the function of a function (composite function). Consider the following examples : 1. y = 1, 2, 3 ........ n [ y = f (n) ] is not elementary as the number of operations that must be performed to get y is notfinite but it increases with 'n'. 2. A function 'f ' is defined as f (x) = x2 if 0 ≤ x ≤ 1 = 3x + 1 if 1 ≤ x ≤ 2 It is not elementary as it is not represented by a single formula but two formulae. Single valued function : For each value of x, suppose there corresponds one and only one value of y, then y is called a singled valued function. e.g. , , y = 2 logx + 4e2x b. Many valued function: To each value of x, suppose there are more than one value of y, then y is called a multiple valued or many valued function. e.g. y2 = 4ax ; x2 + y2 = a2 ; y (y-2) (y +2) = x2 c. The mapping of function f: x ® y is said to be Many-One if two or more different elements in x have same f-image in y. d. The mapping or function f is said to be One-One if different element in x have different f-images in y, i.e. x1 ¹ x2 Þ f (x1) ¹ f ( x2) or f (x1) = f (x2) Þ x1 = x2. One-One mappings are also called injection or injective mappings. e. The mapping 'f ' is said to be 'into' if there exists at least one element in y which is not the f-image of any element in x. Note that in this case range of ‘f‘ is the proper subset of y. f. The mapping 'f ' is said to be 'onto' if every element in y is the f-image of at least one element in x. In this case, the range of 'f ' is equal to y. 'Onto' mapping is also calledsurjection or Surjective mappings. One-One and onto mappings are called bijection orbijective mappings. If the domain and codomain of a function f are both the same, then f is called an operator or transformation on x. g. Odd and Even functions : If f(-x) = f(x), f(x) is called an even function. e.g. f(x) = ax4+ bx2 + c, f (x) = cos x etc. If f (-x) = -f (x), f (x) is called an odd function. e.g. f(x) = ax3 + bx , f(x) = tan x etc. Note that any function can be expressed as the sum of an even and odd function. viz. h. Explicit and Implicit functions : A function is said to be explicit when expressed directly in terms of the independent variable or variables. e.g. y = e-x. xn , y = r sin q etc. But if the function cannot be expressed directly in terms of the independent variable (or variables), the function is said to be implicit. e.g. x2y2 + 4xy + 3y + 5x + 6 = 0. Here y is implicit function of 'x'. i. A rational integral function or a polynomial, is a function of the form a0x1 + a1xn - 1+ a2xn - 2 + .......+ an-1 + an where a0 , a1, a2, ......,. a n-1 , an are constant and n is positive integer. A function which is a quotient of two polynomials such as a rational function of x. ,is called e.g. An algebraic function is a function in which y is expressed by an equation like a0y n + a1yn-1 + ..... + an = 0 where a0 a1, ......., an are rational functions of 'x' e.g. y = (2x + p) (3x2 + q) j. A transcendental function is a function which is not Algebraical, Trigonometrical, exponential and logarithmic functions are example of transcendental functions. Thus sin x, tan-1x, ekx, log (px+q) are transcendental functions. k. Monotonic functions: The function y = f(x) is monotonically increasing at a point x = a if f (a+h) > f (a) where h >0 (very small). But if f (a+h) < f (a), then f(x) is decreasing at that point x = a. The graph of such functions are always either rises or falls. e.g. y = sin x is monotonically increasing in the interval -p/2 ≤ x ≤ p/2 and decreasing in the interval p/2 ≤ x ≤ 3p/2 l. Bounded and unbounded functions: If for all values of x in a given interval, f(x) is never greater than some fixed number M, the number M is called upper bound for f(x) in that interval, whereas if f(x) is never less than some number 'm', then m is called the lower bound for f(x). If f(x) has both M and m, it is called bounded, but if one or both M or m are infinite, f(x)is called an unbounded function. m. Constant function: A function ' f ' is said to be f(x) = k, where k is constant, is called a constant funtion. e.g. f (x) = 4, then f (-2) = 4, f (0) = 4 and f (3) = 4 The graph of this function is a straight line parallel to the x-axis. n. Identity function: The function f(x) = x is called an identity function. The graph of this function is a line y = x. It is also One-One onto. o. Step function: Let x is a real number. We denote by the symbol [ x ], the greatest integer not greater than x Clearly [ 5, 3 ] = 5, [ 7 ] = 7, [-1 ] = -1, [-3.8 ] = -4. For a given real number x, [ x ] is unique. Hence we consider f(x) = [ x ]. This function is called the step function since its graph looks like steps. (For the graph of this function see the solved problem 7). p. Inverse function: Let y = f(x). It is one-one and onto. Suppose we solve this equation and express y in terms of x say x = f (y), then f(y) is the inverse of f(x) and it is written as f -1, i.e. x = f -1 (y) e.g. i) If y = 4x - 9, then x = Hence is the inverse of (4x-9) ii) If y = iii) y = tan x then x = tan-1 y or arc tan y iv) y = ex then x = logey Note that : then x = f : R ® R whose inverse f -1 exists. We know that (f-1of) (x) = x. Thus (f -1of) or (f o f -1) are identity functions Composite function : Let f : A ® B and g : B® C be two functions and x be any element of A. Then f(x) Î B. Let y = f(x) Since B is the domain of the function g and C is its codomain, g(y) Î C. Let z = g (y) then z = g (y) = g[f(x)]Î C. This shows that every element x of set A related to unique element z = g [f(x)] of C. This gives rise to a function from the set A to the set C. This function is called the composite of f and g. It is denoted by ‗g of ‘ and we have If f : A® B and g : B® C are two functions then the composite of f and g is the function gof : A® C given by (gof) (x) = g [ f(x) ] ∀ x Î A A function ' f ' is such that f (x + p) = f(x) ∀ x or f(x) and f(x + p) are both undefined, then p is the period of f : For example, ' sin e ' has period 2p rad. Since sin (x+2p) = sin x∀ x Linear function: f(x) = ax + b, a ¹ 0 is called a linear function. The highest degree of x is 1. It is always one-one onto. Now we know that a linear equation in y variables can be expressed in the form: ax + by + c = 0, a ¹ 0 , b ¹ 0. This represents a straight line. An important part of a straight line is its slope 'm'. It is a number of units the line climbs (or falls) vertically for each unit of horizontal change from left to right. Thus slope (m) = RISE/SUN=VERTICAL RANGE/HORIZONTAL RANGE=CHANGE IN Y/CHANGE IN X \m= but Dy = y1 - y2 and Dx = x1-x2 \m= Note that : or 1. slope of a horizontal line or any line parallel to x-axis is always 0, as vertical change remains 0 and horizontal change remains constant. 2. slope of a vertical line or any line parallel to y-axis, is said to be undefined, in other words, it has no slope. Since horizontal change (i.e. y) remains zero with vertical change (i.e. x) value remains constant. 3. If q indicates the inclination of an oblique line with OX then slope (m) = tan q. 4. If q is acute, the line has slope (m) which is positive and if qis obtuse, line has slope (m) which is negative. 5. If two straight lines are parallel we have their slopes being equal, i.e. [ m 1 = m2 ] and two straight lines are mutually perpendicular, the product of their slopes equals to -1, i.e. [ m1 · m2 = -1 ] Þ m1 = Standard Forms For The Equation Of A Straight Line 1. A vertical line x = 0 ) , a R has equation x = a ( y-axis has 2. A horizontal line has equation y = b (x-axis has equation y = 0), b R equation Click here to enlarge If two straight lines are a1x + b1y + c1 = 0 and a2 x + b2y + c2 = 0 then and (a1a2 + b1b2 = 0 ) for parallel lines for mutually perpendicular lines. Example 1 If f : R R. f(x) = 4x-3 x R. Find f -1, also find f o f -1 and f -1 o f. Solution : f : R R is one-one onto. Hence f -1 exists and f (x) = 4x - 3 Let y = f ( x ) = 4x-3 then 4x = y+3 x = f -1 : R R is given by f -1 ( y ) = or f -1 R R is given by f -1 (x) = (replacing y by x) (f -1 o f ) : R R is given by ( f -1 o f ) ( x ) = f -1 [ f(x) ] = f -1 ( 4x-3 ) = =x and (f -1 o f) : R R is given by ( f o f -1 ) ( x ) = f [ f -1 (x) ] = Example 2 Let f : R R and g : R R and f (x) = x3 and g (x) = x2 + 1. Find (1) f o f (2) g o g (3) g o f (4) f o g Solution : (1) ( f o f ) : R R is given as : ( f o f ) ( x ) = f [ f (x) ] = f [x3] = (x3) 3 = x9 (2) ( g o g ) : R R is given as : ( g o g ) ( x ) = g [ g (x) ] = g [ x2 + 1 ] = (x2+1)2 + 1 = x4 + 2x2 + 2 (3) ( g o f ) : R R is given as : ( g o f ) ( x ) = g [ f (x) ] = g [ x3] = (x3) 2 + 1 = x6 + 1 (4) ( f o g ) : R R is given as : ( f o g ) ( x ) = f [ g (x) ] = f [ x2 + 1 ] = (x2+1)3 Example If f(x) = f [ (2) ] = 3 f (2) Solution : L. H. S. 3 log x and (x) = x3 , show that f [ (x) ] = f [ x3 ] = log ( x3) = 3 log x Put x = 2 then f [ (2) ] = 3 log 2 R. H. S. f ( x ) = log x f ( 2 ) = log 2 3 f (2) = 3 log 2 L.H.S. = R.H.S. Example 4 If f (x) f (x) + f (-x) = 0 = x7 - 5x5 + 3 sin x show that Solution : f (x) = x7 - 5x5 + 3 sin x is an odd function \ f (-x) = -f (x) = - [ x7 - 5x5 + 3 sin x ] \ f (x) + f (-x) = 0 Example 5 If f (x) = ( x )x show that Solution : f (x) = ( x )x Example 6 If f (x) = 16x - log 2 x find f Solution : If f (x) = 16x - log2x \f= = = = 2 - ( -2) log2 2 = 2 + 2 (1) [ since. log a a = 1] =4 Example If y = f (x) = 7 show that x = f(y) Solution : y = f (x) = f (y) = Putting y = we get \ f (y) = \ f (y) = = x x = f (y) Example If f (x) = 8 find f { f [f(x)] } Solution : f (x) = f [ f(x) ] = \ f [ f(x) ] = and f { f [f(x)] } = \ f { f [f(x)] } = x Composition of Functions Suppose the rule of function f(x) is and the rule of function g(x) is . Suppose now that you want to "leapfrog" the functions as follows: Take a 2 in the domain of f and link it to 9 with the f(x) rule, and then take the 9 and link it to 157 with the g(x) rule. This is a lot of work and you would rather just work with one function, a function rule that would link the 2 directly to the 157. Since the g function operates on f(x), we can write the composition as g(f(x)). Let‘s call the new function h(x) = g(f(x)). You can simplify from the inside out or the outside in. Inside Out: Let‘s check to see if the above function will link 2 directly to 157. It does. Outside In: You can see that it is the same as the function we derived from the inside out. The following is an example of finding the composition of two functions. Example 1: Find Solution - and if : Inside Out: The composition function Outside In: Check: is equal to and . The function g(x) links a 5 to the number 25 because f(x) links the 25 to the number 668 because and the function . Let‘s see if the new function, let‘s call it h(x), will link the 5 directly to the 668. It does and the new composition function can be written Solution - : Inside Out: The composition function is equal to Outside In: Check: The function f(x) links 2 to the number 1 because function g(x) links the 1 to the number 9 because and the . Let‘s see if the new function, let‘s call it h(x), will link the 2 directly to the 9. It does and the new composition function can be written Students often ask why are these functions different. They assume that the new function created by f(g(x)) is the same function created by g(f(x)). Wrong Assumption! Sometimes they are equal, but most of the time, these functions are different. INVERSE FUNCTIONS With Restricted Domains You can always find the inverse of a one-to-one function without restricting the domain of the function. Recall that a function is a rule that links an element in the domain to just one number in the range. You could have points (3, 7), (8, 7) and (14,7) on the graph of a function. A one-to-one function adds the requirement that each element in the range is linked to just one number in the domain. In this case, the above three points would not be points on the graph of a one-to-one function because 7 links to different numbers in the domain. You can identify a one-to-one function from its graph by using the Horizontal Line Test. Mentally scan the graph with a horizontal line; if the line intersects the graph in more than one place, it is not the graph of a one-to-one function. If the function is not one-to-one, then its inverse will not be unique, and the inverse function must be unique. The domain of the original function must be restricted so that its inverse will be unique. This section will show you how to restrict the domain and then find a unique inverse on that domain. Study the graph of a function that is not one-to-one and choose a part of the graph that is one-to-one. We will find the inverse for just that part of the graph. The following is an example of finding the inverse of a function that is not one-to-one. Example 1: Find the inverse of the function . Solution: By now you should recognize that this is the equation of a parabola. Since a parabola is "U" shaped, it is not one-to-one. Take a look at the graph below. We know that if we divide the xaxis into two parts at the point x = 5, the graph on the left side of the line x = 5 is one-to-one, and the graph on the right side of the line x = 5 is also one-to-one. The red part of the x-axis is the set of all real numbers in the interval all real numbers in the interval , and the blue part of the x-axis is the set of You could have also discovered the x = 5 dividing point by finding the vertex of the parabola. You can find the vertex of parabola by rewriting the original equation so that we have . From the last form, we can read the vertex as (5, -10). We are only interested in the x-part of the point, the 5. The identify function is . The graph of the identify function is the straight line that bisects the first and third quadrants and passes through the origin. All the points on the graph of this line have an x- and y- coordinate that are equal. (2, 2), (7, 7) et. Since an inverse function is a kind of "UNDO" function, the composition of a function with its inverse is the identify function. For example, if the rule f(x) takes a 3 to 10 and the inverse function takes the 10 back to the 3, the end results is that the composite of the two functions took 3 to 3. This is the identify function. We know then that argument . Let‘s use the rule for the f(x) function with the and set it equal to x. Add 10 to both sides of the above equation. Factor the left side of the equation. Take the square root of both sides of the equation. Add 5 to both sides of the equation. Now we have a problem. We have come up with two inverses and inverses must be unique. Which one shall we choose as the inverse, or domain. ? It depends on what you choose as your restricted the If you choose the restricted domain to be , the inverse is because the range of the inverse is equal to the restricted domain of the original function. If you choose the restricted domain to be , the inverse is because the range of the inverse is equal to the restricted domain of the original function. Check: Suppose you restricted the domain function f takes the 10 to 15 because takes the 15 to 10 because . Choose a number from this domain, say 10. The . The inverse function Example 1: Find the inverse of the function . Solution: By now you should recognize that this is the equation of a parabola. Since a parabola is "U" shaped, it is not one-to-one. Take a look at the graph below. We know that if we divide the xaxis into two parts at the point , the graph on the left side of the line to-one, and the graph on the right side of the line the x-axis is the set of all real numbers in the interval is one- is also one-to-one. The red part of , and the blue part of the x- axis is the set of all real numbers in the interval You could have also discovered the You can find the vertex equation have read the vertex as so dividing point by finding the vertex of the parabola. of parabola by rewriting the original that we . From the last form, we can . We are only interested in the x-part of the point, the . The identify function is . The graph of the identify function is the straight line that bisects the first and third quadrants and passes through the origin. All the points on the graph of this line have an x- and y- coordinate that are equation. (2, 2), (7, 7) et. Since an inverse function is a kind of "UNDO" function, the composition of a function with its inverse is the identify function. For example, if the rule f(x) takes a 3 to 10 and the inverse function takes the 10 back to the 3, the end results is that the composite of the two functions took 3 to 3. This is the identify function. We know then that . Let‘s use the rule for the f(x) function with the argument and set it equal to x. Subtract 15 from both sides of the above equation. Multiply both sides of the equation by . Add to both sides of the equation. Factor the left side of the equation. Take the square root of both sides of the equation. Add to both sides of the equation. Now we have a problem. We have come up with two inverses and inverses must be unique. Which one shall we choose as the inverse, or domain. If you ? It depends on what you choose as your restricted choose the restricted domain to be , the inverse is because the range of the inverse is equal to the restricted domain of the original function. If you choose the restricted domain to be , the inverse is because the range of the inverse is equal to the restricted domain of the original function. Check: Suppose you restricted the domain function f takes the 20 to because . Choose a number from this domain, say 20.The . The inverse function takes the back because to 20 . Check: Suppose you restricted the domain . Choose a number from this domain, say 0. The function f takes the 0 to 15 because . The inverse function takes the 15 back to 0 because . The characteristic function of a set Definition Let be a set and be a subset of called the indicator function of the subset by Note that two subsets and of mapping which assigns the number of . The characteristic function of is the mapping are equal if, and only if, to every element of (also defined Denote by the . Proposition Let and be two subsets of a set ; we denote by respective characteristic functions. Then the following relations hold: and their In symmetric difference, we proved already the following proposition, using either truth tables or set properties (see prop associativity of symmetric difference 1). We prove the proposition here once more, using characteristic functions. Proposition 5.5.3 Let , and be three sets. Then the following relation holds: Proof. For, modulo 2, Let be nay set. Then we have: Closure: Given , Associativity: for any in Commutativity: for any Identity: for any in Inverse: for all ; , in ; , , ; for all . Proposition 5.5.4 (De Morgan's Laws revisited) Let . Then the following relations hold: 1. ; and be two subsets of the set 2. Proof. We prove by using on and . Recursively Defined Functions Most of the functions we have dealt with in previous chapters have been defined explicitly: by a formula in terms of the variable. We can also define functions recursively: in terms of the same function of a smaller variable. In this way, a recursive function "builds" on itself. A recursive definition has two parts: 1. Definition of the smallest argument (usually f (0) or f (1)). 2. Definition of f (n) , given f (n - 1) , f (n - 2) , etc. Here is an example of a recursively We can calculate the values of this function: f (0) =5 f (1) = f (0) + 2 = 5 + 2 = 7 f (2) = f (1) + 2 = 7 + 2 = 9 f (3) = f (2) + 2 = 9 + 2 = 11 … defined function: This recursively defined function is equivalent to the explicitly defined function f (n) = 2n + 5 . However, the recursive function is defined only for nonnegative integers. Here is another example of a recursively defined function: The values of this function are: f (0) =0 f (1) = f (0) + (2)(1) - 1 = 0 + 2 - 1 = 1 f (2) = f (1) + (2)(2) - 1 = 1 + 4 - 1 = 4 f (3) = f (2) + (2)(3) - 1 = 4 + 6 - 1 = 9 f (4) = f (3) + (2)(4) - 1 = 9 + 8 - 1 = 16 … This recursively defined function is equivalent to the explicitly defined function f (n) = n 2 . Again, the recursive function is defined only for nonnegative integers. Here is one more example of a recursively defined function: The values of this function are: f (0) =1 f (1) = 1ƒf (0) = 1ƒ1 = 1 f (2) = 2ƒf (1) = 2ƒ1 = 2 f (3) = 3ƒf (2) = 3ƒ2 = 6 f (4) = 4ƒf (3) = 4ƒ6 = 24 f (5) = 5ƒf (4) = 5ƒ24 = 120 … This is the recursive definition of the factorial function, F(n) = n! . Not all recursively defined functions have an explicit definition. The Fibonacci Numbers One special recursively defined function, which has no simple explicit definition, yields the Fibonacci numbers: The values of this function are: f (1) =1 f (2) =1 f (3) =1 + 1 = 2 f (4) =1 + 2 = 3 f (5) =2 + 3 = 5 f (6) =3 + 5 = 8 f (7) = 5 + 8 = 13 f (8) = 8 + 13 = 21 f (9) = 13 + 21 = 34 … Thus, the sequence of Fibonacci numbers is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … . These numbers have many interesting properties that will be studied in higher math. They recur often in mathematics and even in nature. The Permutation Function The permutation function is defined as: P(n, k) = Examples: P(6, 3) = P(9, 2) = P(7, 1) = P(10, 10) = = = = = = =7 = = 6(5)(4) = 120. = 9(8) = 72. = = 10! = 3628800. The permutation function yields the number of ways that n distinct items can be arranged in k spots. For example, P(7, 3) = = 210 . We can see that this yields the number of ways 7 items can be arranged in 3 spots -- there are 7 possibilities for the first spot, 6 for the second, and 5 for the third, for a total of 7(6)(5): P(7, 3) = = 7(6)(5) . Example: The coach of a basketball team is picking among 11 players for the 5 different positions in his starting lineup. How many different lineups can he pick? P(11, 5) = = = 55440 different lineups. The Combination Function The combination function is defined as: C(n, k) = Examples: C(6, 3) = = = 20. C(9, 2) = C(7, 1) = C(10, 10) = = = 36. = = 7. = = 1. The combination function yields the number of ways ndistinct items can be chosen for k spots, when the order in which they are chosen does not matter--that is, choosing ABCDE is equivalent to choosing BAEDC. In other words, we use the combination function when all spots are equivalent. Example: If Jim has 12 shirts, and needs to pack 7 for vacation, how many different combinations of shirts can he pack? C(12, 7) = = 792 different combinations of shirts. HASHING FUNCTION(mh) To save space and time, each record stored in a computer is assigned an address (memory location) in the computer's memory. The task of assigning the address is performed by the Hashing function (or Hash function) H : K → L, which maps the set K of keys to the set L of memory addresses. Thus a Hashing function provides means of identifying records stored in a table. The function H should be one-to-one. In fact, if k1 ≠ k2 implies H (k1) = H (k2), then two keys will have same address and we say that collision occurs. To resolve collisions, the following methods are used to define the hash function. 1. Division Method. In this method, we restrict the number of addresses to a fixed number (generally a prime) say m and define the hash function H : K → L by H (k) = k (mod m), k ∈ K, where k (mod m) denotes the remainder when k is divided by m. 2. Midsquare Method. As the name suggest, we square the key in this method and define hash function H : K → L by H (k) = l, where l is obtained by deleting digits from both ends of k2. 3. Folding Method. In this method the key k is partitioned into a number of parts, where each part, except possibly the last, has the same numbers of digits as the required memory address. Thus, if k = k1 +k2 + … + kn, then the hash function H : K → L is defined by H (k) = k1 + k2 + … + kn, where the last carry has been ignored. For example, if we want to find a three digit address for 817324, then using folding we have k1 + k2 = 817 + 324 = 1141, and so H (k) = H (817324) = 141, ignoring the carry digit 1 in k1 + k2. Similarly, for a two—digit address, we have k1 + k2 = 81 + 73 + 24 =178, H(817324) = 78, ignoring carry digit 1. EXAMPLE 1.81 Let H : K → L be a hash function, where L consists of two digits addresses 00,01,02,…,49. Find H (12304) using (i) Division method (ii) Midsquare method and (iii) Folding method. Solution. i. Division method. The prime number close to 49 is 47. So, we take m = 47. Then H (12304) = 12304 (mod 47) = 37 Midsquare method. Let k = 12304. Then k2 = 151388416. Therefore deleting four digits from both the ends of k2, we have ii. H (12304) = 08. iii. Folding Method. Partitioning k, we have 12304 = 12 + 30 + 4 = 46. Therefore H (12304) = 46. PROBLEMS Exercises: 1. Evaluate f(3) given that f(x) = | x - 6 | + x 2 - 1 2. Find f(x + h) - f(x) given that f(x) = a x + b 3. Find the domain of f(x) = SQRT(-x 2 - x + 2) 4. Find the range of g(x) = - SQRT(- x + 2) - 6 5. Find (f o g)(x) given that f(x) = SQRT(x) and g(x) = x 2 - 2x + 1 6. How do you obtain the graph of - f(x - 2) + 5 from the graph of f(x)? 7. Functions f and g are defined by f(x) = x 2 -2 x + 1 and g(x) = (x - 1)(x + 3) 8. Find the domain of the real valued function h defined by h(x) = SQRT ( x - 2) 9. Find the domain of g(x) = SQRT ( - x 2 + 9) + 1 / (x - 1) 10. Find the range of f(x) = | x - 2 | + 3 11. Find the range of f(x) = -x 2 - 10 12. Find the range of h(x) = x 2 - 4 x + 9 13. Functions g and h are given by g(x) = SQRT(x - 1) and h(x) = x 2 + 1Find the composite function (g o h)(x). GROUPS ALGEBRAIC STRUCTURES Algebraic manipulations when properly abstracted lead to a powerful species of mathematical structures called the algebraic structures such as Boolean algebras, groups, rings, fields and vector spaces. Binary Operations A binary operation on a set S, is a function from S x S into S. i.e. it assigns to every ordered pair of elements a, b Î S, a unique element cÎ S. We write a * b = c. More generally, for every positive integer n, an n-ary operation f on S is a function from the product set Sn = S x S x …..x S (n times) into S. For n = 1 the operation is called unary and for n = 3 it is called ternary. Since the binary operation is more often used, the term operation would mean a binary operation unless otherwise stated. For example, the operations addition and multiplication are binary operations on the set of real numbers. Operations obeying certain laws Let * be a binary operation on a set S. A subset A of S is said to be closed under * if a * b Î A for all a, bÎ A. The operation * is said to satisfy the closure law of A. * is said to be associative, if a * (b * c) = (a * b) * c for all a, b, c Î S * is said to be commutative if a* b = b*a for all a, b Î S * is said to be idempotent if a * a = a for all aÎ S * is said to be left distributive over another binary operation o defined on S, if a * (b o c) = (a * b) o (a * c) for all a, b, c Î S and right distributive if (a o b) * c = (a * c) o (b * c) for all a, b, c Î S. For example, the operation of usual multiplication on real numbers is associative, commutative and distributive over the usual addition of numbers. Note that addition of numbers is not distributive over the multiplication of numbers. But in the case of the operations union and intersection of sets, both A Ç (B U C) = (A Ç B) U (A Ç C) and A U (B Ç C) = (A U B) Ç (A U C) are true. Homomorphism Definition: Let (X, o) and (Y,*) be two algebraic system of the same type in the sense that b oth o and * are binary operations.A mapping g: X ® Y is called a homomorphism or simply a morphism, from(X, o) to (Y, *) if for any x, y Î X g(x o y) = g(x) * g(y) Definition Let g be a homomorphism from (X, o) to (Y, *). If g: X® Y is onto, then g is called an epimorphism. If g: X® Y is one-to-one, then g is called a monomorphism. If g: X® Y is one-to-one and onto , then g is called an isomorphism. Definition Let (X, o) and (Y,*) be two algebraic system such that Y Í X. A homomorphism g from (X, o) to (Y, *) in such a case g is called an endomorphism. If Y = X, then an isomorphism from (X, o) to (Y, *) is called an automorphism . Example Let (Z4, +4) and (B, +) be the algebraic system, where Z4 is the set of ―congruence modulo 4‖ and B = {0, 1}. Then (B, +) is homomorphic image of (Z4, +4)Solution: Let a mapping g: Z4 ® B be given by g([0]) = g([2]) = 0 and g([1]) = g([3]) = 1 Example Solution Given the algebraic system (N, +) and (Z4, +4), where N is the set of natural Numbers and + is the operation of addition on N, show that there exists a homomorphism from (N, +) to (Z4, +4). Define g: N® Z4 given by g(a) = [a mod 4] for any a Î N For a, bÎ N , let g(a) = [i] and g(b) =[j]; then g(a + b) = [(i + j) mod 4] = [i] +4 [j] = g(a) + g(b). GROUPS Recalling that an algebraic system (S, *) is a semigroup if the binary operation * is associative. If there exists an identity element e Î S, then (S,*) is monoid. A further condition is imposed on the elements of the monoid, i.e., the existence of an inverse for each element of S then the algebraic system is called a group. Definition Let G be a nonempty set, with a binary operation * defined on it. Then the algebraic system (G,*) is called a group if * is associative i.e. a * (b * c) = (a * b) * c for all a, b, c,Î G. there exists an element e in G such that a * e = e * a = a for all a Î G for each a Î G there is an element denoted by a-1 in G such that a * a-1 = a-1 * a = e, a-1 is called the inverse of a. From the definition it follows that (G,*) is a monoid in which each element has an inverse with respect to. * in G. A group (G,*) in which * is commutative is called an abelian group or a commutative group. If * is not commutative then (G,*) is called a non-abelian group or non-commutative group. The order of a group (G,*) is the number of elements of G, when G is finite and is denoted by o(G) or |G| Examples 1. (Z5, +5) is an abelian group of order 5. 2. G = {1, -1, i, -i} is an abelian group with the binary operation x is defined as 1 x 1 = 1, -1 x -1 = 1, i x i = -1 , -i x -i = 1, … Properties of Groups Theorem 1. The identity element of a group (G, *) is unique. If the identity is not unique, let e and e‘ be two identity elements in G. Since e is an identity e * e‘ = e‘ * e= e‘, e‘ considered as some element of G. Since e‘ is an identity, e * e‘ = e‘ * e= e, e considered as some element of G. e = e‘. Hence the identity element of a group is unique. Proof. Theorem 2. Each element in a group (G, *) has a unique inverse. Proof. Suppose a to be an element of G and a’ and a-1 to be the inverses of a in Let e be the identity element of Since a -1 is the inverse of a a -1 * a = a * a-1 = Since a ‗ is the inverse of a a ‗ * a = a * a‘ = now a‘ = e * = (a-1 * a) * a‘ = a -1 * ( a * a‘)= a-1 * e= a-1So that a‘ = a -1 Hence the inverse of element in a group is unique. G. G , e. , e. a‘ an Theorem 3. If (G, *) is a group, then (a * b) -1 = b -1 * a -1 for a , b Î G. Proof. By definition, (a * b) -1 is the inverse of a * b . Now (a * b) * ( b-1 * a -1) = ((a * b) * b -1) * a -1 = (a * (b * b -1) * a -1 = (a * e ) * a -1 = a* a -1 = e Similarly, (b -1 * a -1) * (a * b) = ((b -1 * a -1) * a) * b = ( b -1 * ( a -1 * a )) * b = ( b -1* e) * b = b -1 * b = e We have thus shown that (a * b) * ( b-1 * a -1) = (b -1 * a -1) * (a * b) = e . b -1 * a -1 is the inverse of a * b. Note 1. If a is an element of a group 2. (G, *) is group a, b, c Î G, a * c = b * c Þ a = b (G, *) then (a-1) -1 = a . Definition Any one to one mapping of a set S onto S is called a permutation of S. A set of permutations forms a group under the composite operation is called permutation group The composition of permutations on P is given in the following table. p5 · p0 p1 p2 p3 p4 p5 p4 p0 p0 p1 p2 p3 p4 p3 p2 p1 p1 p2 p0 p5 p3 p1 p2 p2 p0 p1 p4 p5 p3 p3 p4 p5 p0 p1 p4 p4 p5 p3 p2 p0 p5 p5 p3 p4 p1 p2 p0 Hence (P, o) is a group under the binary operation o (composite). Note that (P, o) is not an abelian group. In general the set Sn of all permutations on n elements is a permutation group, also called the symmetric group. The group (Sn, o) is of order n! and degree n. By considering the symmetries of regular polygons we obtain certain other permutation groups known as dihedral groups. Definition. Let (G, *) and (H, D) be two groups. A mapping g: G ® H is called a group homomorphism from (G, *) to (H, D) if for any a , b Î G g(a * b) = g(a) D g(b) eG Î G, g(eG) = eH , where eH is the identity of G. for any a Î G , g(a-1) = [g(a)] -1 Theorem 4 If (S, *) is a subgroup of (G, *) and g(S) denotes the image set of S under the homomorphism g , then (g(S), D) is a subgroup of (H, D). Proof. From (i), we have g(eG * eG) = g(eG) D g(eG) = g(eG), so that g(eG) is the identity g(eG) = eH For any a Î G, a-1 Î G and hence g(a * a-1) = g(eG) = eH = g(a) D g(a-1) g(a-1 * a) = g(eG) = eH = g(a-1) * g(a) which gives (iii). Finally, let (S, *) be a subgroup of (G, *) with eG Î S. Therefore, g(eG) = eH Î g(S). For any a Î S, a -1 Î S and g(a) and g(a-1) = [g(a)] -1 Î g(S). Also for a, b Î S, a * b Î S and consequently for g(a), g(b) Î g(S), g(a) D g(b) Î g(S). This shows that (g(S),*) is a subgroup of (H, D). Definition Let g be a group homomorphism from(G, *) to (H, D). The set of elements of G which are mapped into eH, the identity of H, is called the kernel of the homomorphism g and is denoted by ker(g). i.e., ker(g) = {x / x Î G Ù g(x) = eH} Theorem 5 The kernel of a homomorphism h from a group (G, *) to (H, D) is a subgroup of (G, *). Proof Let S be he kernel of a homomorphism g from a group (G, *) to (H, D). i.e., S = {a / g(a) = eH } Since g(eG) = eH , eG Î ker(g). Also , if a, b Î ker(g), that is , g(a) = g(b) = eH, then g(a * b) = g(a) D g(b) = eH D eH = eH, so that, a * b Î ker(g) . finally, if a Î ker(g), then g(a-1) = [g(a)] -1 = eH -1 = eH. Hence a-1 Î ker(g) and ker(g) is a subgroup of (G, *). Cyclic group A group (G, *) is called cyclic, if there exists an a Î G such that every element of G can be written as some power of a, that is a n for some integer n. In such a case G is said to be generated by a and we write G = < a> A cyclic group is necessarily abelian because, for any p, q Î G,p = a r and q= a s, for some integers r and s, so thatp* q = a r * a s = a r+s = a s+r = a s * a r = q * p. Theorem 6 Let (G, *) be a finite cyclic group generated by a Î G. If o(G) = n then a n = e, so that G = { a , a 1,a 2, …,a n = e}. Furthermore, n is the least positive integer for which a n = e. Proof Let us assume that for some positive integer m < n, a m = e. Since G is cyclic group, any element of G can be written as a k for some k Î I. Now from Euclid algorithm, we can write k = mq + r, where q is some integer and 0 £ r < m This means a k = a mq + r = (a m) q *a r = a r, so that every element of G can be expressed as a r for some 0 £ r < m , thus implying that G has at most m distinct elements, that is | G | = m < n which is a contradiction. Hence a m = e for m < n is not possible. As a next step, we show that the elements a, a 2, a 3 , …, a n are all distinct, where a n = e. Assume to the contrary that a i = a j for i < j £ n. This means that a j-1 = e where j – i < n , which again is a contradiction. Order of a group, element The order of a group G is simply the number of elements in G. Unfortunately, the word order is also associated with an element of a group and while there is a connection, it tends to be confusing in a first time meeting. The order of an element g in a group is the least positive integer k such that is the identity. For a group in which + is the binary operation we need to read this as the least positive integer k such that then g has infinite order. is the identity. If no such integer k exists, For example, in the real numbers under addition, the element 1 has infinite order. This is because has no solution (remember k has to be positive). Hence, 1 has infinite order. For the same reason, the number -1 has infinite order. Now in the non-zero real numbers under the binary operation of multiplication of real numbers, the number 1 has order 1 since . Similarly, the number -1 has order 2 since and . One warning here. If we know that in a group is the identity, k>0, it does not mean that the order of a is k. It could happen that some smaller positive integer r would give . It must be remembered that the order of an element is the LEAST POSITIVE INTEGER or else it does not exist. CYCLIC GROUPS A cyclic group is a group in which there is an element x such that each element of the group may be written as for some integer k. In additive notation, this translates to . We say that x is a generator of the cyclic group or that the group is generated by x. As an example, the integers under addition is a cyclic group. The number 1 is a generator. This is because for any n in the integers we have . Note that -1 is also a generator. Another example is provided by the set of complex numbers multiplication of complex numbers. A generator is i since and . Note that -i is also a generator. under , , For a finite cyclic group G having n elements, any element of order n is a generator. If x is a generator having order n then the order of is . It follows that a cyclic group is an abelian group although not every abelian group is a cyclic group. For example, the rational numbers under addition is not cyclic but is abelian. SUBGROUPS A non empty subset H of a group G is a subgroup of G if, under the binary operation defined on G, H is a group. In order to test whether a subset is a subgroup it is sufficient to complete the following three tests: Show Show if a, Show if then then For example, the even integers are a subgroup of the integers under addition. Certainly the identity 0 is an even integer, the sum of two even integers is an even integer and the inverse of an even integer is an even integer. The rotations and the identity in are a subgroup of together with the identity do not constitute a subgroup. . However, the reflections in For any group G and , let be the subset defined by . This is a subgroup of G and is the cyclic subgroup generated by x. So, in the non zero real numbers under multiplication the set is a cyclic subgroup. A very important result concerning subgroups of finite groups is Lagrange's Theorem which states that the order of a subgroup divides the order of a group. With regard to finite cyclic groups, if G is a finite cyclic group of order n and x is a generator, then is a cyclic subgroup of order . Indeed, every subgroup of a cyclic group is cyclic. Now Lagrange's Theorem would tell us that a cyclic subgroup of a finite cyclic group of order n must have order a divisor of n. In this case, the converse is true, namely, for every divisor m of n there is a cyclic subgroup of order m. It is generated by where x is a generator of the cyclic group and k satisfies km = n. This converse statement is not true for groups in general. Cosets For G a group and H a subgroup, a right coset of H in G is Similarly we can define a left coset Typically, a left coset gH and a right coset Hg are not equal as sets. In additive notation, a right coset would be denoted as H+g and a left coset as g+H. The right (left) cosets of a subgroup have the following properties if and only if Either or else Every element . . is an element of some right coset. Similar properties hold for left cosets. We say that the cosets partition the group G. Indeed, they are the equivalence classes of the equivalence relation on G defined by if and only if . For example, the group set consists of the 12 even permutations of is a subgroup. The right cosets of H in H The left cosets of H in H (mod H) are: are: . The Note that the number of elements in each coset is the same and that is not accidental. Also note that, other than the subgroup H, no left coset is a right coset. The map defined by is a bijection. In particular for G a finite group, all cosets have the same number of elements. This is the basis for a proof of Lagrange's Theorem. The number of cosets of H in G (right or left) is called the index and is denoted by . For G finite, we have . Thus the index multiplied by the order of the subgroup is the order of the group. Thus, for G finite, both the index and the order of the subgroup divide the order of G. A right transversal for H in G is a set consisting of one element from each right coset. This is the same as a set of equivalence class representatives. A left transversal is defined similarly. Normal subgroups A subgroup N of a group G is a normal subgroup if the left coset gN and the right coset Ng are equal as sets for each . For a given that ng =gn. Rather, it means that for a given , there is an , this does not mean such that ng = gm. Lots of examples of normal subgroups exist since every subgroup of an abelian group is a normal subgroup. For a non-abelian example, consider the subgroup of rotations in the symmetry group of the regular n-gon. This is a normal subgroup and although we could prove it by calculation it follows from the following result. Any subgroup N of index 2 in a group G is a normal subgroup of G. Homomorphisms A function is a homomorphism if for all In this definition, note that the product of place in G whereas the product with with , in G, . on the left side of the equation takes takes place in H. An onto homomorphism is called an epimorphism while an injective or one to one homomorphism is called a monomorphism. A bijective homomorphism is an isomorphism. There are some other named types of homomorphism which we summarize in the following table. Here is a summary of some of the properties of a homomorphism as will be representative of elements of G and . Elements such elements of H. . In particular, the images of a cyclic subgroup of G are determined by the image of a generator. If g has finite order so does and the order of monomorphism, the orders of g and Note that if of x under are equal. then the image of for each then . divides the order of g. For a under is determined by the images For example, if and . As regard the behavior with subgroups, we first define two important sets associated with a homomorphism. First, the kernel of a homomorphism by . Second, the set course the range of (or sometimes is and is denoted is used) is the image of G in H. It is of . is a normal subgroup of G is a subgroup of H. They are equal if and only if If , is the coset If K is a subgroup of G then is an epimorphism. . is a subgroup of Moreover if K is normal in G then necessarily a normal subgroup of H). (and hence a subgroup of H). is a normal subgroup of (although not If L is a subgroup of H then is a subgroup of G. Natural homomorphism Given a group G and a normal subgroup N there is a natural way to associate elements of the group with the factor group in such a way as to give a homomorphism. This mapping is and is called the natural homomomorphism. It is of course onto and so an epimorphism. The kernel of the map is N. Any two elements of G that are in the same coset of N in G are mapped to the same element of the factor group. Isomorphism The idea behind an isomorphism is to realize that two groups are structurally the same even though the names and notation for the elements are different. We say that groups G and H are isomorphic if there is an isomorphism between them. Another way to think of an isomorphism is as a renaming of elements. For example, the set of complex numbers set of integers under under complex multiplication, the addition modulo 4, and the subgroup of look different but are structurally the same. They are all of order 4 (but that's not what makes them isomorphic) and are cyclic groups. The maps (for the first pair of groups) and and third of the groups) provide the necessary isomorphisms. (for the second We often give a name to certain collections of isomorphic groups. For example, the above groups are cyclic of order 4 (usually denoted as (multiplicative notation) or (additive notation)). When we say that there are only n groups of order k (or n groups up to isomorphism) we mean that there are only n isomorphic types. Any group of k elements must be isomorphic to one of these types. For example, there are only two groups of order 4 cyclic of order 4 and the Klein 4 group. There are many groups with 4 elements but they are isomorphic to one of these. Up to isomorphism, there is only one group with a prime number of elements. It is the cyclic group where p is a prime. There is only one infinite cyclic group up to isomorphism, namely the integers under addition. In trying to prove groups isomorphic, we might set up a map between the two groups (following along the idea behind constructing a homomorphism). Then, perhaps we find this is not an isomorphism. And that is all we have found. We cannot conclude that the groups are not isomorphic yet. We might just have hit on the wrong map. For example, there are 120 bijections between two groups of order 5 (and 24 of these map the identity to the identity). Of these, only 4 are isomorphisms. The problem is much greater for more complicated groups. To show that two groups are not isomorphic, we need to exhibit a structural property of one group not shared by the other. For example, the cyclic group of order 4 has two elements of order 4 whereas the Klein 4 group has no elements of order 4. Thus the two cannot be isomorphic and belong in different isomorphism classes. Other structural things to look for (but not limited to) are number of (cyclic, abelian, non-abelian) subgroups, number of normal subgroups, isomorphism types of factor groups. SEMIGROUPS AND MONOIDS Here we consider an algebraic system consisting of a set and an associative binary operation on the set and then the algebraic system which possess an associative property with an identity element. These algebraic systems are called semigroups and monoids. Semi group Let S be a nonempty set and let * be a binary operation on S. The algebraic system (S, *) is called a semi-group if * is associative i.e. if a * (b*c) = (a * b) * c for all a, b, c Î S. Example The N of natural numbers is a semi-group under the operation of usual addition of numbers. Monoids Let M be a nonempty set with a binary operation * defined on it. Then (M, * ) is called a monoid if * is associative (i.e) a * (b * c) = (a * b) * c for all a, b, c Î M and there exists an element e in M such that a * e = e * a = a for all a Î e is called the identity element in (M,*). It is easy to prove that the identity element is unique. From the definition it follows that (M,*) is a semigroup with identity. Example1 Let S be a nonempty set and r(S) be its power set. The algebras (r(S),U) and (r(S), Ç ) are monoids with the identities f and S respectively. Example2 Let N be the set of natural numbers, then (N,+), (N, X) are monoids with the identities 0 and 1 respectively. Homomorphism of semigroups and monoids Semigroup homomorphism. Let (S, *) and (T, D) be any two semigroups. A mapping g: S ® T such that any two elements a, b Î S , g(a * b) = g(a) D g(b) is called a semigroup homomorphism. Monoid homomorphism Let (M, *,eM) and (T, D,eT) be any two monoids. A mapping g: M® T such that any two elements a, b Î M ,g(a * b) = g(a) D g(b) and g(eM) = e is called a monoid homomorphism. Theorem 1 Let (s, *) , (T, D) and (V, Å) be semigroups. A mapping g: S ® T and h: T ® V be semigroup homomorphisms. Then (hog): S ® V is a semigroup homomorphism from (S,*) to(V,Å ). Proof. Let a, b Î S. Then (h o g)(a * b) = h(g(a* b)) = h(g(a) D g(b) = h(g(a)) Å h(g(b) = (h o g)(a) Å (h o g)(b) Theorem 2 Let (s,*) be a given semigroup. There exists a homomorphism g: S ® SS, where (SS, o) is a semigroup of function from S to S under the operation of composition. Proof For any element a Î S, let g(a) = fa where f aÎ SS and f a is defined by f a(b) = a * b for any a, bÎ S g(a * b) = f a*b Now f a*b(c ) = (a * b) * c = a*(b * c)where = f a(f b(c )) = (f a o f b) (c ) Therefore, g(a * b) = f a*b = f a o f b= g(a) o g(b), this shows that g: S ® SS is homomorphism. Theorem 3 For any commutative monoid (M, *),the set of idempotent elements of M forms a submonoid. Proof. Let S be the set of idempotent elements of M.Since the identity element e Î M is idempotent, e Î S.Let a, b Î S, so that a* a = a and b * b = bNow (a * b ) * (a * b) = (a * b) * (b * a) [( M, *) is a commutative monoid ] = a * (b * b) * a = a * b * a= a * a * = a * b Hence a * b Î S and (S, *) is a submonoid. Rings If we take an Abelian group (remember: a set with a binary operation) and we define a second operation on it we get a bit more of a structure than we had with just a group. If the second operation is associative, and it is distributive over the first then we have a ring. Note that the second operation may not have an identity element, nor do we need to find an inverse for every element with respect to this second operation. As for what distributive means, intuitively it is what we do in math when perform the following change: . If the second operation is also commutative then we have what is called a commutative ring. The set of integers (with addition and multiplication) is a commutative ring (with even an identity - called unit element - for multiplication). Now let us go back to our set of remainders. What happens if we multiply ? We see that we get [5], in fact we can see a number of things according to our definitions above, [5] is its own inverse, and [1] is the multiplicative element. We can also show easily enough (by creating a complete multiplication table) that it is commutative. But notice that if we take [3] and [2], neither of which are equal to the class that the zero belongs to [0], and we multiply them, we get . This bring us to the next definition. In a commutative ring, let us take an element which is not equal to zero and call it a. If we can find a non-zero element, say b that combined with a equals zero ( ) then a is called a zero divisor. A commutative ring is called an integral domain if it has no zero divisors. Well the set Z with addition and multiplication fullfills all the necessary requirements, and so it is an integral domain. Notice that our set of remainders is not an integral domain, but we can build a similar set with remainders of division by five, for example, and voilà, we have an integral domain. Let us take, for example, the set Q of rational numbers with addition and multiplication - I'll leave out the proof that it is a ring, but I think you should be able to verify it easily enough with the above definitions. But to give you a head start, notice the addition of rationals follow all the requirements for an abelian group. Lagrange's Theorem Lagrange's theorem is the first great result of group theory. It states THEOREM: The order of a subgroup H of group G divides the order of G. First we need to define the order of a group or subgroup Definition: If G is a finite group (or subgroup) then the order of G is the number of elements of G. Lagrange's Theorem simply states that the number of elements in any subgroup of a finite group must divide evenly into the number of elements in the group. Note that the {A, B} subgroup of the group has 2 elements while the group has 4 members. Also we can recall that the subgroups of S3, the permutation group on 3 objects, that we found cosets of in the previous chapter had either 2 or 3 elements -- 2 and 3 divide evenly into 6. A consequence of Lagrange's Theorem would be, for example, that a group with 45 elements couldn't have a subgroup of 8 elements since 8 does not divide 45. It could have subgroups with 3, 5, 9, or 15 elements since these numbers are all divisors of 45. Now that we know what Lagrange's Theorem says let's prove it. We'll prove it by extablishing that the cosets of a subgroup are disjoint -- different cosets have no member in common, and each have the same number of members as the subgroup. This leads to the conclusion that a subset with n elements has k cosets each with n elements. These cosets do not overlap and together they contain every element in the group. This means that the group must have knelements -- a multiple of n. We'll accomplish our proof with two lemmas. Lemma: If H is a finite subgroup of a group G and H contains n elements then any right coset of H contains n elements. Proof: For any element x of G, Hx = {h • x | h is in H} defines a right coset of H. By the cancellation law each h in H will give a different product when multiplied on the left onto x. Thus each element of H will create a corresponding unique element of Hx. Thus Hx will have the same number of elements as H. Lemma: Two right cosets of a subgroup H of a group G are either identical or disjoint. Proof: Suppose Hx and Hy have elements h1 and h2 of H an element in common. Then for some h1 • x = h2 • y This implies that x = h1-1 • h2 • y. Since H is closed this means there is some element h3 (which equals h1-1 • h2) of H such that x = h3 • y. This means that every element of Hx can be written as an element of Hy by the correspondence h • x = (h • h3) • y for every h in H. We have shown that if Hx and Hy have a single element in common then every element of Hx is in Hy. By a symmetrical argument it follows that every element of Hy is in Hx and therefore the "two" cosets must be the same coset. Since every element g of G is in some coset (namely it's in Hg since e, the identity element is in H) the elements of G can be distributed among H and its right cosets without duplication. If k is the number of right cosets andn is the number of elements in each coset then |G| = kn. Alternate Proof: In the last chapter we showed that a • b-1 being an element of H was equivalent to a and b being in the same right coset of H. We can use this Idea establish Lagrange's Theorem. Define a relation on G with a ~ b if and only if a • b-1 is in H. Lemma: The relation a ~ b is an equivalence relation. Proof: We need to establish the three properties of an equivalence relation -- reflexive, symmetrical and transitive. (1) Reflexive: Since a • a-1 = e and e is in H it follows that for any a in G a~a (2) Symmetrical: If a ~ b then a • b-1 is in H. Then the inverse of a • b-1 is in H. But the inverse of a • b-1 is b • a-1 so b~a (3) Transitive: If a ~ b and b ~ c then both a • b-1 and b • c-1 are in H. Therefore their product (a • b-1) • (b • c-1) is in H. But the product is simply a • c-1. Thus a~c And we have shown that the relation is an equivalence relation. It remains to show that the (disjoint) equivalence classes each have as many elements as H. Lemma: The number of elements in each equivalence class is the same as the number of elements in H. Proof: For any a in G the elements of the equivalence class containing a are exactly the solutions of the equation a • x-1 = h Where h is any element of H. By the cancellation law each member h of H will give a different solution. Thus the equivalence classes have the same number of elements as H. One of the imediate results of Lagrange's Theorem is that a group with a prime number of members has no nontrivial subgroups. (why?) Definition: if H is a subgroup of G then the number of left cosets of H is called the index of H in G and is symbolized by (G:H). From our development of Lagrange's theorem we know that |G| = |H| (G:H) Converse of Lagrange's Theorem One of the most interesting questions in group theory deals with considering the converse of Lagrange's theorem. That is if a number n divides the order of group G does that mean thatG must have a subgroup of order n? The answer is no in general but the special cases where it does work out are many and interesting. They are dealt with in detail in the Sylow Theorems which we will treat later. As a tidbit we look at the following Theorem: If the order of a group G is divisible by 2 then G has a subgroup of two elements. “The lesson content has been compiled from various sources in public domain including but not limited to the internet for the convenience of the users. The university has no proprietary right on the same.” 9, Km Milestone, NH-65, Kaithal - 136027, Haryana Website: www.niilmuniversity.in