Share
Embed
Lean Proof
Propositional Logic and First Order logic - Exercises solutions
Raquel Oliveira
September 25, 2017
Transcript
30 slides
-
Table of Content Rules Propositional Logic First Order logic Lean
Raquel Oliveira Universidade Federal do Rio Grande do Norte Departamento de Inform´ atica e Matem´ atica Aplicada DIM0610 - L´ ogica Computacional 2017-09-25 1/30 -
Table of Content Rules Propositional Logic First Order logic Roteiro
1 Rules 2 Propositional Logic LCP-006 LCP-049 LCP-057 LCP-074 3 First Order logic LCPO-15 LCPO-27 LCPO-69 LCPO-83 2/30 -
Table of Content Rules Propositional Logic First Order logic ¬
Rules Negation (1) [A] . . . ⊥ (1)¬-I ¬A ¬A A ¬-E ⊥ 3/30 -
Table of Content Rules Propositional Logic First Order logic ∧
Rules Conjunction A B ∧-I A ∧ B A ∧ B ∧ − Eleft B A ∧ B ∧ − Eright A 4/30 -
Table of Content Rules Propositional Logic First Order logic ∨
Rules Disjunction A ∨ B (1) [A] . . . C (2) [B] . . . C ∨-E C A ∨ − Ileft B ∨ A A ∧ − Iright A ∨ B 5/30 -
Table of Content Rules Propositional Logic First Order logic MP
Rules Modus ponens A → B A MP B 6/30 -
Table of Content Rules Propositional Logic First Order logic ∀
Rules Universal quantifier P(x) ∀-I ∀yP(y) ∀xP(x) ∀-E P(t) 7/30 -
Table of Content Rules Propositional Logic First Order logic ∃
Rules Existential quantifier A(t) ∃-I ∃xA(x) ∃xA(x) (1) [A(y)] . . . B ∃-E B 8/30 -
Table of Content Rules Propositional Logic First Order logic LCP-006
Propositional Logic (A → (B → C)) (B → (A → C)) Γ A → (B → C) (1) Γ ∪ {A} A → (B → C) (monotocity 1) (2) Γ ∪ {A} A (assumption) (3) Γ ∪ {A} B → C (→-elim 2,3) (4) Γ ∪ {A} ∪ {B} B → C (monotocity 4) (5) Γ ∪ {A} ∪ {B} B (assumption) (6) Γ ∪ {A} ∪ {B} C (→-elim 5,6) (7) Γ ∪ {B} A → C (→-intro 7) (8) Γ ∪ {B} (A → C) (()-intro 8) (9) Γ B → (A → C) (→-intro 9) (10) Γ (B → (A → C)) (()-intro 10) (11) 9/30 -
Table of Content Rules Propositional Logic First Order logic LCP-006
Propositional Logic LCP-006: (A → (B → C)) (B → (A → C)) example (A B C: Prop)(H: A → (B → C)) : (B → (A → C)) := show B → (A →C), from ( assume Hb : B, show A → C ,from ( assume Ha : A, show C, from ( have Hbc: B → C, from H Ha, show C, from Hbc Hb ) ) ) 10/30 -
Table of Content Rules Propositional Logic First Order logic LCP-006
Propositional Logic LCP-006: (A → (B → C)) (B → (A → C)) example (A B C: Prop)(H: A → (B → C)) : (B → (A → C)) := assume Hb : B, assume Ha : A, have Hbc: B → C, from H Ha, show C, from Hbc Hb 11/30 -
Table of Content Rules Propositional Logic First Order logic LCP-049
Propositional Logic A ¬¬A A [¬A](1) ¬-E ⊥ (1)¬-I ¬¬A 12/30 -
Table of Content Rules Propositional Logic First Order logic LCP-049
Propositional Logic LCP-049: A ¬¬A example ( H: P ): ¬¬P := have H1: ¬P → false, from (assume H2: ¬P, show false, from H2 H), show ¬¬P, from not.intro H1 13/30 -
Table of Content Rules Propositional Logic First Order logic LCP-049
Propositional Logic LCP-049: A ¬¬A example ( H1: P): ¬¬P := assume H2: ¬P, show false, from H2 H1 14/30 -
Table of Content Rules Propositional Logic First Order logic LCP-057
Propositional Logic (A → B), (¬A → B) B A → B [A](1) (1)MP B ¬A → B [¬A](2) (2)MP B B 15/30 -
Table of Content Rules Propositional Logic First Order logic LCP-057
Propositional Logic LCP-057: (A → B), (¬A → B) B example (A B: Prop) (H1: A→B) (H2: ¬A→B) : B := show B, from ( by_cases (assume H3: A, show B, from H1 H3) (assume H4: ¬A, show B, from H2 H4) ) 16/30 -
Table of Content Rules Propositional Logic First Order logic LCP-057
Propositional Logic LCP-057: (A → B), (¬A → B) B example (A B: Prop) (H1: A→B) (H2: ¬A→B) : B := by_cases (assume H3: A, show B, from H1 H3) (assume H4: ¬A, show B, from H2 H4) 17/30 -
Table of Content Rules Propositional Logic First Order logic LCP-074
Propositional Logic ¬ (A ∨ B) → ¬ A ∧ ¬ B ¬(A ∨ B) (1) [A] ∨-Iright A ∨ B ¬-E ⊥ (1)¬-I ¬A ¬(A ∨ B) (2) [B] ∨-Ileft A ∨ B ¬-E ⊥ (2)¬-I ¬B ∧-I ¬A ∧ ¬B 18/30 -
Table of Content Rules Propositional Logic First Order logic LCP-074
Propositional Logic LCP-074: ¬ (A ∨ B) → ¬ A ∧ ¬ B example (A B: Prop) : ¬ (A ∨ B) → ¬ A ∧ ¬ B := assume H1: ¬ (A ∨ B), show ¬A ∧¬B, from have NA : ¬A, from (assume P1 : A, have P2 : A ∨ B, from or.inl P1, show false, from H1 P2), have NB : ¬B, from (assume P1 : B, have P2 : A ∨ B, from or.inr P1, show false, from H1 P2), and.intro NA NB 19/30 -
Table of Content Rules Propositional Logic First Order logic LCP-074
Propositional Logic LCP-074: ¬ (A ∨ B) → ¬ A ∧ ¬ B example (A B: Prop) : ¬ (A ∨ B) → ¬ A ∧ ¬ B := assume H1: ¬ (A ∨ B), and.intro (show ¬A, from (assume H2: A, have H3: A∨B, from or.inl H2, show false,from H1 H3)) (show ¬B, from (assume H4: B, have H5: A∨B, from or.inr H4, show false, from H1 H5 )) 20/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-15
First Order logic ∀x.(R(x)→S(x)) ∀y.R(y)→∀z.S(z) ∀x(R(x) → S(x)) ∀-E R(k) → S(k) (1) [∀y(R(y))] ∀-E R(k) (1)MP S(k) ∀-I ∀zS(z) 21/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-15
First Order logic LCPO-15: ∀x.(R(x)→S(x)) ∀y.R(y)→∀z.S(z) variable U: Type variables R S: U -> Prop example (H1: (∀x,(R(x)→S(x)))) : (∀y, R(y)) → (∀z, S(z)) := assume H2: ∀y, R(y), take x, have H3: R(x)→S(x), from H1 x, have H4: R(x), from H2 x, show S(x), from H3 H4 22/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-27
First Order logic ∃x.R(x)∨∃y.S(y) ∃z.(R(z)∨S(z)) ∃xR(x) ∨ ∃yS(y) (1) [∃xR(x)] ∀-E R(w) ∨-Iright R(w) ∨ S(w) ∃-I ∃z.(R(z) ∨ S(z)) (2) [∃yS(y)] ∀-E S(k) ∨-Ileft R(k) ∨ S(k) ∃-I ∃z.(R(z) ∨ S(z)) (1),(2)∨-E ∃z.(R(z) ∨ S(z)) 23/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-27
First Order logic LCPO-27: ∃x.R(x)∨∃y.S(y) ∃z.(R(z)∨S(z)) variables (U: Type) (R S: U -> Prop) example (H1: (∃x,R(x))∨(∃y,S(y))): ∃z , R(z)∨S(z) := or.elim H1 (assume H2: ∃x, (R(x)), obtain (w:U) (H4: R(w)), from H2, have H5: R(w)∨S(w), from or.inl H4, show ∃z , R(z)∨S(z), from exists.intro w H5) (assume H3: ∃y, S(y), obtain (k:U) (H6: S(k)), from H3, have H7: R(k)∨S(k), from or.inr H6, show ∃z , R(z)∨S(z), from exists.intro k H7) 24/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-69
First Order logic ∀x.(Q(x)→R(x)), ∃x.(P(x)∧¬R(x)) ∃x.(P(x)∧¬Q(x)) ∃x(P(x) ∧ ¬R(x)) (1) [P(y) ∧ ¬R(y)] ∧-Eright P(y) (1)∃-E P(y) ∃x(P(x) ∧ ¬R(x)) (2) [P(y) ∧ ¬R(y)] ∧-Eleft ¬R(y) (2)∃-E ¬R(y) ∀x(Q(x) → R(x)) ∀-E Q(y) → R(y) (3) [Q(y)] (3)MP R(y) ¬-E ⊥ (1)¬-I ¬Q(y) ∧-I P(y) ∧ ¬Q(y) ∃-I ∃x(P(x) ∧ ¬Q(x)) 25/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-69
First Order logic LCPO-69: ∀x.(Q(x)→R(x)), ∃x.(P(x)∧¬R(x)) ∃x.(P(x)∧¬Q(x)) variables (U: Type)( P Q R: U -> Prop) example (H1: ∀x, Q(x)→R(x)) (H2: ∃x, P(x)∧¬R(x)): ∃x , P(x)∧¬Q(x) := obtain y (H3: P(y)∧¬R(y)), from H2, have H4: ¬R(y), from and.right H3, have Hqr : Q(y)→R(y), from H1 y, have Hnq: ¬Q(y), from (suppose Q(y), have H5: R(y), from Hqr this, show false, from H4 H5), have H6: P(y), from and.left H3, have H7: P(y) ∧¬Q(y), from and.intro H6 Hnq, show ∃x, P(x) ∧¬Q(x), from exists.intro y H7 26/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-69
First Order logic LCPO-69: ∀x.(Q(x)→R(x)), ∃x.(P(x)∧¬R(x)) ∃x.(P(x)∧¬Q(x)) variables (U: Type)( P Q R: U -> Prop) example (H1: ∀x, Q(x)→R(x)) (H2: ∃x, P(x)∧¬R(x)): ∃x , P(x)∧¬Q(x) := obtain y H3, from H2, have Hqr : Q(y)→R(y), from H1 y, have Hnq: ¬Q(y), from (suppose Q(y), show false, from (and.right H3) (Hqr this)), have H7: P(y) ∧¬Q(y), from and.intro (and.left H3) Hnq, exists.intro y H7 27/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-83
First Order logic ∃x.(P(x)∧∃y.Q(x,y)) ∃x.∃y.(P(x)∧Q(x,y)) ∃x(P(x) ∧ ∃yQ(x, y)) (1) [P(z) ∧ ∃yQ(z, y)] ∧-Eright P(z) (1) [P(z) ∧ ∃yQ(z, y)] ∧-Eleft ∃yQ(z, y) (2) [Q(z, k)] (2)∃-E Q(z, k) ∧-I P(z) ∧ Q(z, k) (1)∃-E P(z) ∧ Q(z, k) ∃-I ∃yP(z) ∧ Q(z, y) ∃-I ∃x∃yP(x) ∧ Q(x, y) 28/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-83
First Order logic LCPO-83: ∃x.(P(x)∧∃y.Q(x,y)) ∃x.∃y.(P(x)∧Q(x,y)) variables (U: Type) (P: U -> Prop) (Q: U -> U -> Prop ) example (H1: ∃x, P x ∧ ∃y, Q x y): ∃x, ∃y, (P x ∧Q x y):= obtain x (H2: P x ∧ ∃y, Q x y), from H1, have H3: P x, from and.left H2, have H4: ∃y, Q x y, from and.right H2, obtain y (H5: Q x y), from H4, have H6: (P x ∧ Q x y), from and.intro H3 H5, have H7: ∃y, (P x ∧ Q x y), from exists.intro y H6, show ∃x, ∃y, (P x ∧ Q x y), from exists.intro x H7 29/30 -
Table of Content Rules Propositional Logic First Order logic LCPO-83
Conclus˜ ao Perguntas/Coment´ arios 30/30