💡 What is Mathematical Logic?
In logic, we treat sentences like math equations. A statement can only be True (T) or False (F). We use "connectives" to join simple statements together to figure out if the overall result is True or False.
Interactive Logic Simulator
Don't just memorize the tables—test them! Change the values of $p$ and $q$ below to see how different connectives change the final result.
1. The Core Connectives (Cheat Sheet)
Here are the standard rules for evaluating compound statements.
| Symbol | Name | How to Read It | The "Cheat Code" (Rule) |
|---|---|---|---|
| $\wedge$ | Conjunction | "p and q" | Both must be True. ($T \wedge T \equiv T$. Otherwise $F$) |
| $\vee$ | Disjunction | "p or q" | Both must be False to lose. ($F \vee F \equiv F$. Otherwise $T$) |
| $\rightarrow$ | Conditional | "If p, then q" | Only false if a True promise is broken. ($T \rightarrow F \equiv F$. Otherwise $T$) |
| $\leftrightarrow$ | Biconditional | "p iff q" | Matches win! True if both are the same. ($T \leftrightarrow T \equiv T$, $F \leftrightarrow F \equiv T$) |
2. Negations (Flipping the Switch)
Negation ($\sim$) flips $T$ to $F$, and $F$ to $T$. When negating compound statements, use De Morgan's Laws.
- De Morgan's Laws:
$$ \sim(p \wedge q) \equiv \sim p \vee \sim q $$
$$ \sim(p \vee q) \equiv \sim p \wedge \sim q $$
- Negating an "If... Then" (Conditional):
$$ \sim(p \rightarrow q) \equiv p \wedge \sim q $$
- Negating a Biconditional:
$$ \sim(p \leftrightarrow q) \equiv (p \wedge \sim q) \vee (q \wedge \sim p) $$
3. The "If... Then" Family
For any conditional statement $p \rightarrow q$, we can rearrange it in three specific ways:
- Original Statement: $$ p \rightarrow q $$ (If P, then Q)
- Converse (Reverse it): $$ q \rightarrow p $$ (If Q, then P)
- Inverse (Negate it): $$ \sim p \rightarrow \sim q $$ (If not P, then not Q)
- Contrapositive: $$ \sim q \rightarrow \sim p $$ (If not Q, then not P)
🔥 Note: A statement and its Contrapositive always have the exact same truth value!
4. Laws of Logic (Algebra of Statements)
Let $t$ = Tautology (always True) and $c$ = Contradiction (always False).
- Identity Laws:
$$ p \wedge t \equiv p \quad \text{(Adding an always-true does nothing)}$$
$$ p \vee c \equiv p \quad \text{(Adding an always-false does nothing)}$$
- Complement Laws:
$$ p \vee \sim p \equiv t \quad \text{(Always True)}$$
$$ p \wedge \sim p \equiv c \quad \text{(Always False)}$$
- Distributive Law (Multiplying out):
$$ p \wedge (q \vee r) \equiv (p \wedge q) \vee (p \wedge r) $$
$$ p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r) $$
- Absorption Law (Swallowing terms):
$$ p \vee (p \wedge q) \equiv p $$
$$ p \wedge (p \vee q) \equiv p $$