Logic
Zvi Berger
Details
Lecture outline
Logic
Syntax
Example
Precedence of Logical Operators
Precedence of Logical Operators
Subformula
Subformula
Subformula
F : (P ∧ Q) → (P ∨ ¬Q)
F , P ∧ Q , P ∨ ¬Q , P , Q, ¬Q
Subformula
F : (P ∧ Q) → (P ∨ ¬Q)
F , P ∧ Q , P ∨ ¬Q , P , Q, ¬Q
semantic
p /\ q
p \/ q
Semantic – True Table
F : P ∧ Q → P ∨ ¬Q
and the interpretation:
I : {P → true, Q → false}
To evaluate the truth value of F under I, construct the following table:
Semantic – Inductive Definition
Semantic – Inductive Definition
Semantic – Inductive Definition
F : P ∧ Q → P ∨ ¬Q
and the interpretation:
I : {P → true, Q → false}
Satisfiability and Validity
Satisfiability and Validity
Validity Proofs – True Table
F : P ∧ Q → P ∨ ¬Q
Proof System -Lyndon
Axioms (tautologies):
A1 (ϕ 🡪(ψ🡪ϕ))
A2 ((ϕ 🡪(ψ🡪η))🡪((ϕ 🡪ψ)🡪(ϕ 🡪η)))
A3 (((ϕ 🡪F)🡪F)🡪ϕ)
Inference Rule:
ϕ🡪ψ MP-Modus Ponens
ϕ
ψ
Proof System -Lyndon
Definition (Σ ⊢ φ): φ is provable from Σ if there is a derivation using sentences of Σ, the axioms A1, A2, A3 and M.P., ending in φ.
• ⊢ is syntactic (symbol manipulation); ⊨ is semantic (every assignment satisfying Σ satisfies φ).
Proof System -Lyndon
Example: from false, everything follows — F ⊢ φ:
1. F (assumption from Σ)
2. F → ((φ → F) → F) (A1 with ψ = φ → F)
3. (φ → F) → F (M.P. 1, 2)
4. ((φ → F) → F) → φ (A3)
5. φ (M.P. 3, 4)
FOL - First Order Logic
FOL - Syntax
FOL - Quantifier
FOL - Quantifier
Denote by free(F) the set of free variables of a formula F.
Denote by bound(F) the set of bound variables of a formula F
FOL - Examples
Semantic - Domain
Semantic - Assignment
FOL - Semantic
FOL – Interpreted Example
FOL - Satisfiability and Validity
F : (∀x. p(x)) → (∀y. p(y))
PL Proof System - Lyndon
Axioms (tautologies):
A1 (ϕ 🡪(ψ🡪ϕ))
A2 ((ϕ 🡪(ψ🡪η))🡪((ϕ 🡪ψ)🡪(ϕ 🡪η)))
A3 (((ϕ 🡪F)🡪F)🡪ϕ)
Inference Rule:
ϕ🡪ψ MP-Modus Ponens
ϕ
ψ
FOL Proof System - Lyndon
Extend the propositional system with quantifier and equality axioms:
4. (∀v (φ → ψ) → (φ → ∀v ψ)) — v not free in φ.
5. (∀v φ(v) → φ(t)) — no variable of t becomes bound in φ.
6. ∀v: v = v.
7. (v = w) → (A(v) → A(w)) — A(w) is A(v) with (some) v replaced by w.
Two inference rules:
Generalization (Gen): from φ(v) infer ∀x φ(x) — v not free in any assumption of Σ.
Modus Ponens (M.P.): from φ → ψ and φ infer ψ
Completeness and Soundness
Soundness: A sound system proves only correct entailments: Σ ⊢ φ → Σ ⊨ φ.
Soundness: any sentence that can be proved have a satisfying model.
Completeness: A complete system proves every entailment: Σ ⊨ φ → Σ ⊢ φ.
Completeness: any sentence with a satisfying model can be proved.
Theorem: Propositional Logic and First-Order Logic is sound and complete:
Σ ⊢ φ ⇔ Σ ⊨ φ.
Peano Arithmetic
Peano Theory - Example
Peano Theory – Non Equal
Gödel's Incompleteness
Theorem: if PA is consistent, there is a sentence G such that neither G nor ¬G can be proved from PA.
Incompleteness: some sentences cannot be proved from PA's axioms.
Presburger Arithmetic
Presburger Theory – Negative Numbers
Presburger Theory – Negative Numbers
Presburger Theory – Negative Numbers
Theory of Integers
Theory of Integers - Example
Thank you for listening