Lecture 7. Logical proofs
SlidesInfo
Here you can find the lecture slides.
You can use them to follow along during the lecture and to go through the material again after.
Feel free to ask questions during the lecture!!
Technical info
You can use the arrow keys to navigate through the slides, or alternatively, click the little arrows on the slides themselves.
Pressing the F-key while the slides are selected, puts them in fullscreen. You can quit fullscreen by pressing ESC.
There are more the slides can do, find out under https://revealjs.com/ .
∀I
Logical methods for AI
Lecture 7
Logical proofs
This work is licensed under CC BY 4.0
-
Logical proofs
Proof systems
Model of step-wise inference:Ada is either in the study or on the Philosopher’s Walk, and if she’s on the Philosopher’s Walk, she’s thinking about mathematics. Ada is not in the study, so she must be thinking about mathematics.
Proofs
- Sequence of formulas, where each is either:
- assumption/axiom
- derived from earlier formulas via an inference rule
- Final formula = conclusion.
Inference rule
$$\begin{array}{ccc} A_1 & \dots & A_n \\ \hline & C \end{array}$$-
Proof systems
Hilbert systems
- Axioms: Basic truths
- Inference rules: as few as possible
- Axioms: $$ A\to ( B\to A)$$ $$( A\to ( B\to C))\to(( A\to B)\to ( A\to C))$$ $$(\neg A\to \neg B)\to ( B\to A)$$
- Inference rule: $$A,A\to B\vdash B$$
- $((\mathsf{RAIN} \to ((\mathsf{RAIN} \to \mathsf{RAIN}) \to \mathsf{RAIN})) \to ((\mathsf{RAIN} \to (\mathsf{RAIN} \to \mathsf{RAIN})) \to (\mathsf{RAIN} \to \mathsf{RAIN})))$
Axiom 2. with $A=\mathsf{RAIN}, B=(\mathsf{RAIN}\to \mathsf{RAIN}),$ and $C=\mathsf{RAIN}$
- $(\mathsf{RAIN} \to ((\mathsf{RAIN} \to \mathsf{RAIN}) \to \mathsf{RAIN}))$
Axiom 1. with $A=\mathsf{RAIN}$ and $B=(\mathsf{RAIN}\to \mathsf{RAIN})$)
- $((\mathsf{RAIN} \to (\mathsf{RAIN} \to \mathsf{RAIN})) \to (\mathsf{RAIN} \to \mathsf{RAIN}))$
From 1. and 2. by MP.
- $(\mathsf{RAIN} \to (\mathsf{RAIN} \to \mathsf{RAIN}))$
Axiom 1. with $A=\mathsf{RAIN}$ and $B=\mathsf{RAIN}$.
- $(\mathsf{RAIN} \to \mathsf{RAIN})$
From 3. and 4. by MP.
- $\neg \mathsf{STUDY}\to\mathsf{WALK}$ (Assumption)
- $\neg \mathsf{STUDY}$ (Assumption)
- $\mathsf{WALK}$ (1.,2. MP)
- $\mathsf{WALK}\to\mathsf{MATH}$ (Assumption)
- $\mathsf{MATH}$ (3.,4. MP)
Natural deduction
- No axioms
- Only inference rules
- Try to model "natural" deduction
Discharging assumptions: $$\vdash \neg(\mathsf{RAIN}\land\neg\mathsf{RAIN})$$
Resolution-based systems
- No axioms
- One rule
Resolution rule
$l_{i},k_{j}$ literals:
$$\begin{array}{ccc} l_1\lor l_2\lor \dots\lor p & & \neg p\lor k_1\lor k_2\lor\dots \\ \hline & l_1\lor l_2\lor \dots k_1\lor k_2\lor\dots \end{array}$$ $$\begin{array}{ccc} p & & \neg p \\ \hline & \bot \end{array}$$Problem
$$\mathsf{RAIN}\vDash\mathsf{RAIN}\lor\mathsf{SNOW}?$$(Re)Solution
$$A_1,A_2,\dots\vdash C\Leftrightarrow $$ $$CNF(A_1),CNF(A_2),\dots,CNF(\neg C)\vdash \bot$$-
Applications
Metalogic
- Soundness: All derivable inferences are valid
- Completeness: All valid inferences are derivable
- Soundness and completeness: $$P_1,P_2,\dots\vDash C\ \Leftrightarrow \ P_1,P_2,\dots\vdash C$$
- Computationally tractable model of valid inference
Proof verification
- Interactive theorem prover (ITP): program that checks inferences in formal language
- Distribution of epistemic burden.
Example
variable {p : Prop}
variable {q : Prop}
variable {r : Prop}
open Classical
theorem hilbert_1 : p → (q → p) := by
intro h
intro _
exact h
theorem hilbert_2: (p → (q → r))→ ((p → q) → (p → r)) := by
intros h1 h2 hp
apply h1 hp
apply h2
assumption
theorem hilbert_3 : (¬p → ¬q) → (q → p) := by
intros h hq
by_cases hp : p
· -- Case when p is true
exact hp
· -- Case when p is false (¬p)
have hnq := h hp
contradiction
#print hilbert_1
#print hilbert_2
#print hilbert_3
Lean 4 Life
Automated theorem proving
- Automating mathematical reasoning.
- Teach neural networks to use ITPs.
- Very active area of research.