Rules of Inference
The mathematical foundation of logical deduction and building valid arguments.
Rules of Inference
In logic, an Argument is a sequence of statements. The last statement is the Conclusion, and the others are Premises. An argument is Valid if the conclusion must be true whenever all the premises are true.
Think of these rules as the "Legal Moves" you can make in a mathematical proof.
1. Modus Ponens (The Law of Detachment)
The most fundamental rule of deduction. If you have a conditional statement and you know the hypothesis is true, the conclusion must follow.
- Premise 1:
- Premise 2:
- Conclusion:
Example: "If it rains, the ground gets wet. It is raining. Therefore, the ground is wet."
2. Modus Tollens (The Law of Contraposition)
If a conditional is true, and the conclusion is false, then the hypothesis must also be false.
- Premise 1:
- Premise 2:
- Conclusion:
3. Essential Rules Table
| Rule Name | Premises | Conclusion |
|---|---|---|
| Addition | ||
| Simplification | ||
| Conjunction | ||
| Hypothetical Syllogism | ||
| Disjunctive Syllogism |
4. Visualizing a Syllogism
A Hypothetical Syllogism acts like a chain reaction. If leads to , and leads to , then leads directly to .
5. Valid vs. Invalid Arguments (Fallacies)
Just because an argument sounds logical doesn't mean it follows the rules.
-
Affirming the Consequent (Invalid): and does not mean .
- Example: "If I have the flu, I have a fever. I have a fever. Therefore, I have the flu." (Wrong! You could have a cold.)
-
Denying the Antecedent (Invalid): and does not mean .
6. Logic in Software: Inference Engines
In Artificial Intelligence and automated theorem provers, we use these rules to derive new facts from a database of known truths.
# A simple Inference check for Modus Ponens
def modus_ponens(if_p_then_q, p):
if if_p_then_q and p:
return True # q must be True
return None # We cannot conclude anything
# Known facts
rains_implies_wet = True
it_is_raining = True
# Deduction
ground_is_wet = modus_ponens(rains_implies_wet, it_is_raining)
print(f"Can we conclude the ground is wet? {ground_is_wet}")
Summary You have now completed Level 1: Propositional Calculus! You have moved from simple sentences to complex algebraic simplifications and finally to the rules of human and machine reasoning.
Next Step: Prepare for Level 2: Predicate Logic, where we introduce Quantifiers () to handle infinite sets and variables.