Logic

Logic is the branch of mathematics that explores valid reasoning. It underpins all mathematical arguments and ensures correctness through structured inference.

Propositions

A proposition is a declarative sentence that is either true or false but not both.

  • "2 is even" → True
  • "The moon is made of cheese" → False

Logical Connectives

  • ¬P → Not P
  • P ∧ Q → P and Q
  • P ∨ Q → P or Q
  • P → Q → If P, then Q
  • P ↔ Q → P if and only if Q

Truth Tables

Example: Truth table for P ∧ Q

PQP ∧ Q
TTT
TFF
FTF
FFF

Important Logical Laws

  • De Morgan’s: ¬(P ∧ Q) ≡ ¬P ∨ ¬Q
  • Double Negation: ¬(¬P) ≡ P
  • Commutative: P ∧ Q ≡ Q ∧ P
  • Distributive: P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)

Step-by-Step Examples

  1. Statement: "It is raining and cold."
  2. Let P = "It is raining", Q = "It is cold"
  3. Negation: ¬(P ∧ Q) = ¬P ∨ ¬Q
  4. So the negation is: "It is not raining or it is not cold."

Practice Problems

1. What is the converse of: "If today is Monday, then I have math class."

Converse: "If I have math class, then today is Monday."

2. Construct the truth table for P → Q

PQP → Q
TTT
TFF
FTT
FFT

3. Negate: "All dogs bark."

Negation: "There exists at least one dog that does not bark."