LOGIC Mai Phuong Vuong Lecture 1 Symbolic logics Mathematical propositions and truth values LOGIC Logical operations Propositions with quantifiers Mai Phuong Vuong School of Applied Mathematics and Informatics Hanoi University of Science and Technology 1.1 LOGIC Outline Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.2 1 Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers LOGIC Outline Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.3 1 Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers LOGIC What is a statement? Mai Phuong Vuong Definition Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.4 A statement (or a proposition) is a sentence that is true or false but not both. 1 Statement variables LOGIC What is a statement? Mai Phuong Vuong Definition Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.4 A statement (or a proposition) is a sentence that is true or false but not both. Denoted by letters of alphabet: A, B, . . . , p, q, . . . 1 1 Statement variables LOGIC What is a statement? Mai Phuong Vuong Example 1 Symbolic logics 2 Mathematical propositions and truth values Logical operations Propositions with quantifiers 3 4 A: Every natural number is either even or odd. B: Every natural number is odd. p: 1 + 1 = 2 π q: sin = 0.07 13 The truth value of a statement • A is true, A = T or A = 1 • B is false, B = F or B = 0 1.5 LOGIC Logical operations Mai Phuong Vuong 1 Symbolic logics Mathematical propositions and truth values Logical operations 2 Propositions with quantifiers 3 4 5 1.6 Negation Conjunction ∧ Disjunction ∨ Conditional → Bi-conditional ↔ LOGIC Logical operations Mai Phuong Vuong 1. Negation Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.7 If A is a statement variable, the negation of A is “not A” and is denoted A. It is true if A is false, and false if A is true. LOGIC Logical operations Mai Phuong Vuong 1. Negation Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers If A is a statement variable, the negation of A is “not A” and is denoted A. It is true if A is false, and false if A is true. Example A Every natural number is odd 3 is a prime number. 1+1=2 1.7 A NOT every natural number is odd. 3 is NOT a prime number 1 + 1 ΜΈ= 2 LOGIC Logical operations Mai Phuong Vuong 1. Negation: Table of truth values Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.8 A A 1 0 0 1 LOGIC Logical operations Mai Phuong Vuong 2. Conjunction Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.9 If A and B are statement variables, the conjunction of A and B is “A and B,” and is denoted A ∧ B. It is true only when both A and B are true, otherwise it is false. LOGIC Logical operations Mai Phuong Vuong 2. Conjunction Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers If A and B are statement variables, the conjunction of A and B is “A and B,” and is denoted A ∧ B. It is true only when both A and B are true, otherwise it is false. Example A 3 is a prime number 1<2 1.9 B 1+1=2 8 is divisible by 2 A∧B ... ... LOGIC Logical operations Mai Phuong Vuong 2. Conjunction: Table of truth values Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.10 A 1 1 0 0 B A∧B 1 1 0 0 1 0 0 0 LOGIC Logical operations Mai Phuong Vuong 3. Disjunction Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.11 If A and B are statement variables, the disjunction of A and B is “A or B,” and is denoted A ∨ B. It is false only when both A and B are false, otherwise it is true. LOGIC Logical operations Mai Phuong Vuong 3. Disjunction Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers If A and B are statement variables, the disjunction of A and B is “A or B,” and is denoted A ∨ B. It is false only when both A and B are false, otherwise it is true. Example A 3 is a prime number π is greater than 4 1.11 B 4 is an odd number π is a natural number A∨B ... LOGIC Logical operations Mai Phuong Vuong 3. Disjunction Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.12 A 1 1 0 0 B A∨B 1 1 0 1 1 1 0 0 LOGIC Logical operations Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.13 Example Evaluate the truth value of the following compound statement: A∧B LOGIC Logical operations Mai Phuong Vuong 4. Conditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.14 If A and B are statement variables, the conditional of B by A is “if A then B,” or “A implies B” and is denoted A → B. It is false only when A is true and B is false, otherwise it is true. LOGIC Logical operations Mai Phuong Vuong 4. Conditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers If A and B are statement variables, the conditional of B by A is “if A then B,” or “A implies B” and is denoted A → B. It is false only when A is true and B is false, otherwise it is true. Example A 3 is a prime number π is less than 3 1.14 B 4 is an odd number π is not a natural number A→B ... ... LOGIC Logical operations Mai Phuong Vuong 4. Conditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.15 A 1 1 0 0 B A→B 1 1 0 0 1 1 0 1 LOGIC Logical operations Mai Phuong Vuong 5. Biconditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.16 If A and B are statement variables, the biconditional of A and B is “A if and only if B,” and is denoted A ↔ B. It is true only when A and B have the same truth values, and is false if A, B have opposite truth values. LOGIC Logical operations Mai Phuong Vuong 5. Biconditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers If A and B are statement variables, the biconditional of A and B is “A if and only if B,” and is denoted A ↔ B. It is true only when A and B have the same truth values, and is false if A, B have opposite truth values. Example A 3 is a prime number π is less than 3 1.16 B 4 is an odd number π is a natural number A↔B ... ... LOGIC Logical operations Mai Phuong Vuong 5. Biconditional Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.17 A 1 1 0 0 B A↔B 1 1 0 0 1 0 0 1 LOGIC Logical operations Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.18 A 1 1 0 0 B A ∨B A ∧B A A → B A ↔ B 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 LOGIC Statement forms (Logical forms) Mai Phuong Vuong Definition Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.19 A statement form is an expression made up ofstatement variables and logical operations that becomes a statement when actual statements are substituted for the component statement variables. LOGIC Statement forms (Logical forms) Mai Phuong Vuong Definition Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers A statement form is an expression made up ofstatement variables and logical operations that becomes a statement when actual statements are substituted for the component statement variables. The true table of a statement form List the truth values correspond to all possible combinations of truth values for component statement variables. 1.19 LOGIC Statement forms (Logical forms) Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers Example Evaluate the truth value of the following statement form: (A ∨ B) ∧ A ∧ B 1.20 LOGIC Statement forms (Logical forms) Mai Phuong Vuong Definition (Tautology) Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.21 A tautology (tautological statement) is a statement form that is always true regardless of the truth values of the individual statements substituted for its statement variables. LOGIC Statement forms (Logical forms) Mai Phuong Vuong Definition (Tautology) Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers A tautology (tautological statement) is a statement form that is always true regardless of the truth values of the individual statements substituted for its statement variables. Definition (Contradiction) A contradiction (contradictory statement) is a statement form that is always false regardless of the truth values of the individual statements substituted for its statement variables. 1.21 LOGIC Statement forms (Logical form) Mai Phuong Vuong Example Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.22 Construct the truth tables for the following statement forms. Which ones are tautologies/contradictions? 1 (A ∧ B) ∨ C 2 (A ∧ B) ∨ (A ∨ (A ∧ B)) 3 ((A ∧ B) ∧ (B ∧ C)) ∧ B LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers Definition Two statement forms A and B are called logically equivalent iff they have identical truth values for each possible substitution of statement variables. Denote: 1.23 A⇔B LOGIC Logical equivalence Mai Phuong Vuong • Identical laws A∧1⇔A Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.24 A∨0⇔? LOGIC Logical equivalence Mai Phuong Vuong • Identical laws A∧1⇔A Symbolic logics A∨0⇔? Mathematical propositions and truth values Logical operations Propositions with quantifiers • Universal bound laws A∨1⇔1 A∧0⇔? 1.24 LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers • Idempotent laws A∧A⇔A A∨A⇔A A⇔A 1.25 LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values • Commutative laws Logical operations Propositions with quantifiers 1.26 A∧B ⇔B∧A A∨B ⇔B∨A LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values • Associative laws Logical operations Propositions with quantifiers 1.27 (A ∧ B) ∧ C ⇔ A ∧ (B ∧ C) (A ∨ B) ∨ C ⇔ A ∨ (B ∨ C) LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values • Distributive laws Logical operations Propositions with quantifiers 1.28 A ∧ (B ∨ C) ⇔ (A ∧ B) ∨ (A ∧ C) A ∨ (B ∧ C) ⇔ (A ∨ B) ∧ (A ∨ C) LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics • De Morgan’s laws Mathematical propositions and truth values Logical operations Propositions with quantifiers A∧B ⇔A∨B A∨B ⇔A∧B 1.29 LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics • Other laws Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.30 A→B ⇔A∨B A ↔ B ⇔ (A → B) ∧ (B → A) LOGIC Logical equivalence Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.31 Example Show that the following statement forms are logically equivalent. A ↔ B and (A ∧ B) ∨ (A ∧ B) LOGIC Quantified statements Mai Phuong Vuong Definition (Predicate (or quantified function)) Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers A predicate (or quantified function) is a sentence that contains finite number of variables and becomes a statement when specific values are substituted for the variables. Denote: P(x1 , x2 , . . . , xn ): a predicate of n variables x1 , x2 , . . . , xn . 1.32 LOGIC Quantified statements Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Definition (Domain of a predicate variable) Logical operations Propositions with quantifiers 1.33 The domain of a predicate variable is the set of all values that may be substituted in place of the variable. LOGIC Quantified statements Mai Phuong Vuong Predicates of 1 variable Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.34 3 divides n LOGIC Quantified statements Mai Phuong Vuong Predicates of 1 variable Symbolic logics Mathematical propositions and truth values 3 divides n Logical operations Propositions with quantifiers ⇓ ∃n ∈ Z, 3 divides n ∀n ∈ Z, 3 divides n 1.34 LOGIC Quantified statements Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Definition (Quantifiers) Logical operations Propositions with quantifiers 1.35 • Universal quantifier: ∀ • Existential quantifier: ∃ LOGIC Quantified statements Mai Phuong Vuong Predicates of 2 variables Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers x +y =0 ⇓ 1.36 LOGIC Quantified statements Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.37 (Quantifierk + Variablek + Domaink ) + Predicate LOGIC Quantified statements Mai Phuong Vuong Symbolic logics Example Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.38 Translate from informal language to formal language 1 All real numbers are even. 2 Every real number has a non-negative square. LOGIC Quantified statements Mai Phuong Vuong Symbolic logics Example Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.39 Translate from formal language to informal language 2 1 ∀x ∈ R, x ≥ 0 2 2 x ∈ R, x = −1 LOGIC The negation of a quantified statement Mai Phuong Vuong Example Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.40 ∀x ∈ X , P(x) ⇔ LOGIC The negation of a quantified statement Mai Phuong Vuong Example Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.40 ∀x ∈ X , P(x) ⇔ ∃x ∈ X , P(x) LOGIC The negation of a quantified statement Mai Phuong Vuong Example Symbolic logics Mathematical propositions and truth values Logical operations ∀x ∈ X , P(x) ⇔ ∃x ∈ X , P(x) Propositions with quantifiers ∃x ∈ X , P(x) ⇔ 1.40 LOGIC The negation of a quantified statement Mai Phuong Vuong Example Symbolic logics Mathematical propositions and truth values Logical operations ∀x ∈ X , P(x) ⇔ ∃x ∈ X , P(x) Propositions with quantifiers ∃x ∈ X , P(x) ⇔ ∀x ∈ X , P(x) 1.40 LOGIC The negation of a quantified statement Mai Phuong Vuong Symbolic logics Example Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.41 Write the negation of this sentence in informal language 1 All real numbers are even. 2 Every real number has a non-negative square. LOGIC The negation of a quantified statement Mai Phuong Vuong Symbolic logics Example Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.42 Translate from formal language to informal language 1 ∀x ∈ R, x < 2. 2 ∀n ∈ Z, n ÷ 2. LOGIC The negation of a quantified statement Mai Phuong Vuong Symbolic logics Mathematical propositions and truth values Logical operations Propositions with quantifiers 1.43 Example Write the negation of the following proposition, then translate it to informal language. 1 ∀x ∈ R, ∃y ∈, ∃z ∈ R, x + y + z = 0 2 ∃x ∈ R, ∀y ∈ R, x + y = 1 or x + y = −1