Table of contents
Propositional Logic
Parent: Discrete Mathematics
Subject: Computer Science
Type: Semester
SL#: 2401281130
Status: Current

Proposition

A proposition is a declarative statement which is either true or false. For example, considering the statement: New Delhi is the capital of India, is a proposition. On the other hand, considering: x+2=10x+2=10, is not a proposition because the value of xx is unknown, therefore, cannot be stated whether, it is true or false.


Propositional Operators

Negation

Representation: ,¬\sim,\lnot

If pp is the proposition, then the negation of pp is denoted by p\sim p, and it simply reverses the truth value of pp.

E.g.:

p:It is cold todayp:\textnormal{It is cold today}

p:It is not cold today\sim p:\textnormal{It is not cold today}

Truth table:

ppp\sim p
TF
FT

Conjugation

Representation: \wedge

For any two proposition, pp and qq, the conjunction is denoted by pqp\wedge q, and it gives the true value when both pp and qq are true.

E.g.:

p:It is cold todayp:\textnormal{It is cold today}

q:It is Fridayq:\textnormal{It is Friday}

pq:It is cold today and it is Fridayp\wedge q:\textnormal{It is cold today and it is Friday}

Truth table:

ppqqpqp\wedge q
TTT
TFF
FTF
FFF

Disjunction

Representation: \vee

For any two proposition pp, and qq, the disjunction is denoted by pqp\vee q, and gives the true value if either of them or both are true.

E.g.:

p:It is cold todayp:\textnormal{It is cold today}

q:It is Fridayq:\textnormal{It is Friday}

pq:Either it is cold today or it is Fridayp\vee q:\textnormal{Either it is cold today or it is Friday}

Truth table:

ppqqpqp\vee q
TTT
TFT
FTT
FFF

Implication

Representation: \to

For any two proposition pp and qq, the statement if pp then qq is called an implication and it is denoted by pqp\to q. It gives false when pp is true and qq is false, otherwise it is true.

E.g.:

p:It is cold todayp:\textnormal{It is cold today}

q:It is Fridayq:\textnormal{It is Friday}

pq:If it is cold today then it is Fridayp\to q:\textnormal{If it is cold today then it is Friday}

Truth table

ppqqpqp\to q
TTT
TFF
FTT
FFT

Bi

Representation: \leftrightarrow

For any two proposition pp and qq, the statement pp, iff., qq is called biconditional, and is denoted by pqp\leftrightarrow q. It gives true value when both pp and qq have the same value.

E.g.:

q:It is cold todayq:\textnormal{It is cold today}

q:It is Fridayq:\textnormal{It is Friday}

pq:It is cold today iff. it is Fridayp\leftrightarrow q:\textnormal{It is cold today iff. it is Friday}

Truth table

ppqqpqp\leftrightarrow q
TTT
TFF
FTF
FFT

Example 1: Express the following statement in propositional logic:

It is Saturday and I am not going to college\textnormal{It is Saturday and I am not going to college}

Solution:

p:It is Saturdayp:\textnormal{It is Saturday}

q:I am going to collegeq:\textnormal{I am going to college}

Well formed formula (WFF): pqp\wedge\sim q

Example 2: Express the following statement in propositional logic:

Either it is hot today or I am at home\textnormal{Either it is hot today or I am at home}

Solution:

p:It is hot todayp:\textnormal{It is hot today}

q:I am at homeq:\textnormal{I am at home}

Well formed formula (WFF): pqp\vee q

Example 3: Express the following statement in propositional logic:

3+46 and C.S. class will not be held3+4\ne6\textnormal{ and C.S. class will not be held}

Solution:

p:3+4=6p:3+4=6

q:C.S. class will be heldq:\textnormal{C.S. class will be held}

Well formed formula (WFF): pq\sim p\wedge\sim q

Example 4: Draw the truth table for (pq)r(\sim p\wedge q)\wedge \sim r.

ppqqrrpq\sim p\wedge q(pq)r)(\sim p\wedge q)\wedge \sim r)
TTTFF
TTFFF
TFTFF
TFFFF
FTTTF
FTFTT
FFTFF
FFFFF

Example 5: Check the equivalence for the following:

p(qr)(pq)rp\to(q\to r)\cong(p\wedge q)\to r

Solution:

ppqqrrqrq\to rp(qr)p\to(q\to r)pqp\wedge q(pq)r(p\wedge q)\to r
TTTTTTT
TTFFFTF
TFTTTFT
TFFTTFT
FTTTTFT
FTFFTFT
FFTTTFT
FFFTTFT

From the truth table, it can be concluded that:

p(qr)(pq)rp\to(q\to r)\cong(p\wedge q)\to r

Implication and bicondition can be further be simplifed as:

pq=pqp\rightarrow q=\sim p\vee q pq=(pq)(qp)=(pq)(qp)p\leftrightarrow q=(p\rightarrow q)\wedge(q\rightarrow p)=(\sim p\vee q)\wedge(\sim q\vee p)

Laws for propositional logic

Following are the laws for propositional logic:

  1. Idempotent law:
    • pp=pp\wedge p=p
    • pp=pp\vee p=p
  2. Commutative law:
    • pq=qpp\vee q=q\vee p
    • pq=qpp\wedge q=q\wedge p
  3. Associative law:
    • (pq)r=p(qr)(p\vee q)\vee r=p\vee(q\vee r)
    • (pq)r=p(qr)(p\wedge q)\wedge r=p\wedge(q\wedge r)
  4. Distributive law:
    • p(qr)=(pq)(pr)p\wedge(q\vee r)=(p\wedge q)\vee(p\wedge r)
    • p(qr)=(pq)(pr)p\vee(q\wedge r)=(p\vee q)\wedge(p\vee r)
  5. Identity law:
    • pT=Tp\vee T=T
    • pT=pp\wedge T=p
    • pF=pp\vee F=p
    • pF=Fp\wedge F=F
  6. De-morgan's law:
    • (pq)=pq\sim(p\vee q)=\sim p\wedge\sim q
    • (pq)=pq\sim(p\wedge q)=\sim p\vee\sim q
  7. Involution law:
    • (p)=p\sim(\sim p)=p
  8. Compliment law:
    • pp=Tp\vee\sim p=T
    • pp=Fp\wedge\sim p=F
  9. Contrapositive law:
    • pq=qpp\rightarrow q=\sim q\rightarrow\sim p

Conditions for compound statements

Tautology

We define a term, tautology for a compound statement such that its truth value is always true for all possible combinations. For example:

(pq)(pq)(p\wedge q)\rightarrow(p\vee q)

Truth table:

pqpqp\wedge qpqp\vee q(pq)(pq)(p\wedge q)\rightarrow(p\vee q)
TTTTT
TFFTT
FTFTT
FFFFT

Since, all values for the compound statemnet is true, it is tautogenic.

Contradiction

We define a term, contradiction for a compound statement such that its truth value is always false for all possible combinations. For example:

((pq)(pq))=(((pq)(pq))((pq)((pq)))\sim(\sim(p\wedge q)\leftrightarrow(\sim p\vee\sim q))\\ =\sim((\sim(p\wedge q)\rightarrow(\sim p\vee\sim q))\wedge((\sim p\vee\sim q)\rightarrow(\sim(p\wedge q)))\\

We know, as per De-morgan's theorem: pq=(pq)\sim p\vee\sim q=\sim(p\wedge q)

(((pq)(pq))((pq)(pq)))=(((pq)(pq))((pq)(pq)))\therefore \sim((\sim(p\wedge q)\rightarrow(\sim p\vee\sim q))\wedge((\sim p\vee\sim q)\rightarrow\sim(p\wedge q)))\\ =\sim((\sim(p\wedge q)\rightarrow\sim(p\wedge q))\wedge(\sim(p\wedge q)\rightarrow\sim(p\wedge q)))\\

We know: pp=Tp\rightarrow p=T. Similarly, (pq)(pq)=T\sim(p\wedge q)\rightarrow\sim(p\wedge q)=T

(((pq)(pq))((pq)(pq)))=(TT)=T=F\therefore \sim((\sim(p\wedge q)\rightarrow\sim(p\wedge q))\wedge(\sim(p\wedge q)\rightarrow\sim(p\wedge q)))\\ =\sim(T\wedge T)=\sim T=F

Since the final result is FF, therefore the compound statement is contradictive.

Contigency

A compound statement that is neither a tortology nor a contradiction is called contigency. For example: pqp\vee q

Example 6: pqqp\sim p\rightarrow \sim q\cong \sim q\vee p. Prove the equivalence.

LHP=pq=(p)q\textnormal{LHP}\\ =\sim p\rightarrow\sim q\\ =\sim(\sim p)\vee \sim q

As: pq=pqp\to q=\sim p\vee q, and since (p)=p\sim(\sim p)=p

(p)q=pq=qp=RHP\therefore \sim(\sim p)\vee \sim q\\ =p\vee\sim q=\sim q\vee p=\textnormal{RHP}

Therefore, pqqp\sim p\rightarrow \sim q\cong \sim q\vee p.

Example 7: Show that (pq)(pq)(p\wedge q)\to(p\vee q) is tautogenic.

(pq)(pq)=(pq)pq=pqpq=(pp)(qq)=TT=T=RHP(p\wedge q)\to(p\vee q)\\ =\sim(p\wedge q)\vee p\vee q\\ =\sim p \vee \sim q\vee p \vee q\\ =(\sim p\vee p)\vee(\sim q\vee q)\\ =T\vee T=T=\textnormal{RHP}

Therefore, the given proposition is tautogenic

Example 8: Show that p(p(qp))p\to(p\wedge(q\to p)) is tautogenic.

p(p(qp))=p(p(qp))=p(p(qp))=(pp)(pqp)=T(Tq)=TT=Tp\to(p\wedge(q\to p))\\ =p\to(p\wedge(\sim q\vee p))\\ =\sim p\vee(p\wedge(\sim q\vee p))\\ =(\sim p\vee p)\wedge(\sim p\vee \sim q \vee p)\\ =T\wedge(T\vee\sim q)\\ =T\wedge T=T

Therefore, the given proposition is tautogenic.

Problem 1: Prove the equivalence of p(qr)(pq)rp\to(q\to r)\cong(p\wedge q)\to r.

Docs
AnanyaGB
About
© MIT - 2024