400 likes | 1.61k Views
Introduction to logic: Lesson 2, propositional logic. Marie Duží m arie.duzi@ vsb .c z. Some more arguments.
E N D
Introduction to logic: Lesson 2, propositional logic Marie Duží marie.duzi@vsb.cz Introduction to Logic
Some more arguments • An argument is valid iff it is necessary that under all interpretations (valuations in propositional logic), in which the premises are true the conclusion is true as well: P1,...,Pn |= Z • P1,...,Pn |= Z if and only if The statement of the form P1 and ... and Pnimplies Z is necessarily true (a tautology): |= (P1 & … & Pn) Z Introduction to Logic
Arguments P1, ..., Pn|= Ziff |=(P1& … & Pn) Z • BUT !!! • It does not mean that the conclusion is (or must be) true. We are dealing with a valid logical form, a necessary relation between premises and the conclusion. Introduction to Logic
Arguments No prime is divisible by 3 9 is divisible by 3 ---------------------------------- 9 is not a prime • It is a valid argument though the first premise is not true (3 is a prime divisible by 3). Another interpretation: All men are rational. A stone is not rational. -------------------------------- A stone is not a man. Introduction to Logic
Arguments • Or, by substituting: If the number 12 is a prime then it is not divisible by 3. 12 is divisible by 3. 12 is not a prime. • Or: 12 is not a prime number or it is not divisible by 3. 12 is divisible by 3. 12 is not a prime number. Valid argument schemes (examples of logical forms): • A B, A |= B modus ponens • A B, B |= A, modus ponens + transposition • A B, B |= A modus ponens + transposition • A B, B |= A elimination of disjunction (disjunctive syllogism) Introduction to Logic
Arguments • Hence if we prove that the conclusion logically follows from the assumptions, then by virtue of it we do not prove that the conclusion is true • It is true, provided the premises are true • The argument the premises of which are true is called sound. • Truthfulness or Falseness of premises can be a contingent matter. But the relation of logical entailment is a necessary relation (“in all the circumstances ...“). • Similarly a tautology is a logically, necessarily true formula. • If a tautology is of an implication form, then according to the definition of the implication it is true also in case of the antecedent being false, and false only in case the antecedent is true and consequent false, which corresponds to the definition of logical entailment: • A1,…,An |= C iff |= A1… An C Introduction to Logic
Propositional (Sententional) Logic • The simplest logical system. It analyzes a way of composing a complex sentence (proposition) from elementary propositions by means of logical connectives. • What is a proposition? A proposition (sentence) is a statement that can be said to be true or false. • The Two-Value Principle – tercium non datur – two-valued logic (but there are many-valued logical systems, logics of partial functions, fuzzy logics, etc.) • Is the definition of a sentence trivial? Are all the statements sentences, or in other words, do all the statements denote a proposition? No, it is not so: • The (current) King of France is bald. • True? But then the King of France exists. False? But then it is true that the King of France is not bald, hence the King of France exists as well. The statement is neither true nor false, it is not a sentence. • Did you stop beating your wife? (try to answer in case you have never been married or never beat your wife) Introduction to Logic
Propositional logic: semantic exposition (Semantics = meaning) • There are two kinds of Sentences: • Atomic (Elementary) – no proper part of the sentence is a sentence as well • Molecular (Composed) – the sentence has its own part(s) that is (are) a sentence(s) as well • The Compositionality Principle: meaning of a composed sentence is a function (depends only on) the meanings of its components. • The meaning of sentences is in propositional logic reduces to: True (1), False (0). • An algebra of truth values. Introduction to Logic
Examples of composed sentences It is raining in Pragueanditis a sunshine in Brno. S1 connective S2 • It is not truethat it is raining in Prague. connective S Introduction to Logic
Definition: language of PL • A formal language is defined by an alphabet (a set of symbols) and a grammar (a set of rules that define the way of forming “Well Formed Formulas” - WFF) • Language of Propositional Logic (PL) • alphabet: • Symbols for propositions: p, q, r, ... (also with indexes p1, p2, …) • Symbols for logical connectives: , , , , • Auxiliary symbols: (, ), [, ], {, } • Symbols ad a) stand for elementary sentences • Symbols ad b), i.e., , , , , are called: negation (), disjunction (), conjunction (), implication (), equivalence (). Introduction to Logic
Definition: language of PL Grammar (defines inductively well-formed-formulas) Inductive definition of an infinite set of WFF: • Symbols p, q, r, ... are (well-formed) formulas(the definition base). • If A, B are formulas, then expressions A, A B, A B, A B, A B are (well-formed) formulas(inductive definition step). • Only expressions due to 1. and 2. are WFFs. (the definition closure). • The language of PLis the set of well-formed formulas. Note: Formulas according to 1. are atomic formulas Formulas according to 2. are composed formulas Introduction to Logic
Well-formed formulas Notes: Symbols A, B aremetasymbols. We can substitute for them any WFF created according to the definition. The outermost parentheses can be omitted. For the logical connectives other symbols are sometimes used: Symbol alternate -------------------------------- , , & ~ Example: (p q) p is a WFF (the outer parentheses omitted) (p ) q is not a WFF Introduction to Logic
Definition: semantics (meaning) of formulas The truth-value valuation of propositional symbolsisa mappingvthatto each propositional symbol passigns a truth value, i.e., a value from the set {1,0},which codes the set {True, False}: {pi}{1,0} The truth-value function of a PL formula isa functionw, which for each valuation v of propositional symbols piassociates the formula with its truth value in the following way: • The truth value of an elementary formula p: wpv = vpforany propositional variable p. • If the truth values of formulas A, B are given, then the truth value of the formulas A, A B, A B, A B, A B are defined by the table 2.1.: Introduction to Logic
Table 2.1.: the truth–value functions Introduction to Logic
Transforming natural language to the PL language • Elementary sentences: by the propositional variables p, q, r, ... • Connectives of natural language: by means of the symbols for logical connectives: • Negation: • “it is not true that”: (unary connective) • Conjunction: • “and”: (binary, commutative connection) • Prague is a capital and 2+2=4:p q • Note: not every “and” denotes a logical connective! Example: “Peter came home and opened the window”. • Disjunction: • “or”: (binary, commutative connection) • Prague or Brno is a great city. p q • non-alternative • In a natural language we often use “or” as an alternative “either, or”: “I’ll go to the cinema or I’ll stay at home” • Alternative “or” is a non-equivalence Introduction to Logic
Implication • Implication • “if … then …“: (binary, non-commutative connective)A B; A is the antecedent, B is the consequent. • Implication (as well as any other connective) does not render any semantic connection between antecendent and consequent: material implication(middle ages: ”suppositio materialis”). • Hence implication does not render a causal or chronological connection: ”If 1+1=2, then iron is a metal” (a true proposition): p q ”If the UFOs (flying saucers) exist, then I am a pope”: p r (What does the sentence entail? Since I am not a pope, the UFOs do not exist) Note: The connectives “because”, “therefore”, “since”, etc. do not correspond to the logical implication! • “The ice-hockey team lost the match, therefore the players came home from the world championship earlier”. “Because I am sick, I stay at home”. • “sick” “home”? But then it would have to be true even if I am not sick (see the table 2.1 – the definition of implication) • We might analyze it by means of the modus ponens: [p (p q)] q
The equivalence connective • Equivalence: • ”if and only if” (iff) • ”The Greek army used to win if and only if the result of the battle depended on their physical strength”: p q • It is most frequently used in mathematics (in definitions), in a natural language its use is seldom • Example: a) “I’ll slap you if you cheat on me” cheat slap b) “I’ll slap you if and only if you cheat on me” cheat slap Situation: You did not cheat. When can you be slapped? Ad a) – You may be slapped, Ad b) – You might not be slapped. Introduction to Logic
Definition. Satisfiable formulas, tautology, contradiction, model • A model of a formula A: valuation vsuch that A is true in v: w(A)v = 1. • A formula is satisfiable iff it has at least one model • A formula is a contradiction iff it has no model • A formula is a tautology iff any valuation v is its model. • A set of formulas {A1,…,An} is satisfiable iff there is a valuation vsuch that vis a model of every formula Ai, i = 1,...,n. The valuation v is then a model of the set {A1,…,An}. Introduction to Logic
Satisfiable formulas, tautology, contradiction, model • Example. Formula A is a tautology, A is a contradiction, formulas (p q), (p q) are satisfiable. • Formula A: (p q) (p q) Introduction to Logic
Logical entailment in PL • A formula A logically follows from a set of formulas M, denotedM |= A, iff A is true in every model of the set M. • Note: Mind the Definition 1 (slide 5 of Lesson 1). The circumstancesare in propositional logic mapped as valuations (True – 1, False - 0) of elementary atomic sentences: • Under all the circumstances (means valuations in PL) such that the premises are true the conclusion must be true as well. Introduction to Logic
Examples: Logical entailment • He is at home (h) or he has gone to a pub (p) • If he is at home (h) then he is waiting for us (w) • If he is not waiting (w) for us then he has gone to the pub (p). h, p, w |h p, hw| w p 1 1 1 1 1 1conclusion 1 1 0 1 0 1 1 0 1 1 1 1is true in all 1 0 0 1 0 0 0 1 1 1 1 1the four models 0 1 0 1 1 1ofpremises 0 0 1 0 1 1 0 0 0 0 1 0 Introduction to Logic
Examples: Logical entailment • He is at home (h) or he has gone to a pub (p) • If he is at home (h) then he is waiting for us (w) • If he is not waiting (w) for us then he has gone to the pub (p). h p, h w| w p • The table has 2n lines!Hence, an indirect proof is more effective: • Assume that the argument is not valid. But then all the premises may be true and the conclusion false: • h p, hw | w p 1 1 0 1 0 0 1 0 1 0 0 contradiction Introduction to Logic
Examples: Logical entailment • All the arguments with the same logical form as a valid argument are valid: h p, h w |= w p For variables h, p, w any elementary sentence can be substituted: He plays a piano or studies logic. If he plays a piano then he is a virtuous. Hence If he is not a virtuous then he studies logic. Valid argument – the same valid logical form Introduction to Logic
Logical entailment • If the argument is valid, P1,...,Pn|= Z,then the formula of the implication form is a tautology: • |= (P1 ... Pn) Z. • A proof that a formula is a tautology or that a conclusion Z logically follows from premises can be performed: • In thedirect way – for instance by a truth-value table • In theindirect way: P1 ... Pn Z is a contradiction; hence the set of premises + negated conclusion {P1, ..., Pn, Z}is contradictory, i.e., does not have a model: there is no valuation under which all the formulas – its elements were true. Introduction to Logic
A proof of a tautology |= ((p q) q) p Indirect: ((p q) q) p negated f., must be a contradiction 1 1 attempt whether it can be 1 1 1 1 1 0 contradiction There is no valuation under which the negated formula were true. Therefore, the original formula is a tautology Introduction to Logic
The most important tautologies Tautologies with one propositional variable: |= p p |= p p the law of excluded middle |= (p p) the law of contradiction |= p p the law of double negation Introduction to Logic
Algebraic laws for conjunction, disjunction and equivalence • |= (p q) (q p) commutative laws • |= (p q) (q p) • |= (p q) (q p) • |= [(p q) r] [p (q r)] associative laws • |= [(p q) r] [p (q r)] • |= [(p q) r] [p (q r)] • |= [(p q) r] [(p r) (q r)] distributive laws • |= [(p q) r] [(p r) (q r)] Introduction to Logic
Laws of implication |= p (q p) law of simplification |= (p p) q Duns Scot’s law |= (p q) (q p) law of contra-position |= (p (q r)) ((pq) r)premises joint |= (p (q r)) (q (p r)) order of premises does not matter |= (p q) ((q r) (p r)) hypothetic sylogism |= ((p q) (q r)) (p r) transitivity of implication |= (p (q r)) ((p q) (p r)) Frege’s law |= (p p) p reductio ad absurdum |= ((p q) (p q)) p reductio ad absurdum |= (p q) p , |= (p q) q |= p (p q) , |= q (p q) Introduction to Logic
Laws of transformation |= (p q) (p q) (q p) |= (p q) (p q) (q p) |= (p q) (p q) (q p) |= (p q) (p q) |= (p q) (p q)Negation of implication |= (p q) (p q)De Morgan law |= (p q) (p q)De Morgan law These laws define a method for negating Introduction to Logic
Negation of implication Parents: If you are good you well get a new ski at Christmas! (p q) Child: I have been good all the year and there is no ski under the Christmas tree! p q (Did the parents fulfill their promise?) Attorney general: If the accused man is guilty then there was an accessory in the fact Defence lawyer: It is not true ! Question: Did the advocate (defence lawyer) help the accused man; what did he actually claim? (The man is guilty and he performed the illegal act alone!) Introduction to Logic
Negation of implication Sentence in the future tense: If you steel it I’ll kill you! (p q) It is not true: I will steel it and yet you will not kill me. p q OK, but: If the 3rd world war breaks out tomorrow then more than three million people will be killed. It is not true: The 3rd world war will break out tomorrow and less than three million people will be killed ??? Probably by negating the sentence we did not intend to claim that (certainly) the 3rd world war will break out tomorrow: There is an unsaid modality: Necessarily,if the 3rd world war breaks out tomorrow then more than three million people will be killed. It is not true: Possibly the 3rd world war breaks out tomorrow but at that case less than three million people will be killed. Handled by modal logics – not a subject of this course. Introduction to Logic
Some more arguments • Transformation from natural language may be ambiguous: If a man has high blood pressure and breathes with difficulties or he has a fever then he is sick. p – ”X has high blood pressure” q – ”X breathes with difficulties” r – ”X has a fever” s – ”X is sick” 1. possible analysis:[(p q) r] s 2. possible analysis: [p (q r)] s Introduction to Logic
Some more arguments If Charles has high blood pressure and breathes with difficulties or he has a fever then he is sick. Charles is not sick but he breathes with difficulties. What can be deduced from these facts? We have to distinguish the 1. reading and the 2. reading because they are not equivalent. The conclusions will be different. Introduction to Logic
Analysis of the 1. reading • analysis: [(p q) r] s, s, q ??? • By means of equivalent transformations: [(p q) r] s, s [(p q) r] (de transposition Morgan) (p q) r (p q), r, but q holds p, r (consequences) Hence Charles does not have a high blood pressure and does not have a fever. Introduction to Logic
Analysis of the 2. reading • analysis: [p (q r)] s, s,q ??? • reasoning with equivalent transformations: [p (q r)] s,s [p (q r)] transposition de Morgan: p (q r) butqis true the second disjunct cannot be true the first is true: p (consequence) HenceCharles does not have a high blood pressure (we cannot conclude anything about his temperature r) Introduction to Logic
A proof of both cases 1. analysis: [(p q) r] s, s, q |= p,r 2. analysis: [p (q r)] s, s, q |= p home work • 1. case – by means of a table: home work • Indirect: premises + negated conclusion (p r) (p r) and we assume that every f. is true: • [(p q) r] s, s, q, p r • 1 1 0 1 1 • 0 0 • 0 0 • 0 1 p r = 0 contradiction Introduction to Logic
Summary • Typical tasks: • Verifying a valid argument • What can be deduced from given assumptions? • Add the missing assumptions • Is a given formula a tautology, contradiction, satisfiable? • Find models of a formula, find a model of a set of formulas • Methods we have learnt till now: • Table method • reasoning and equivalent transformation • Indirect proof Introduction to Logic
Thank you for your attention See you next week Introduction to Logic