2014-08-22 23:36:47 +00:00
|
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
-- Authors: Jeremy Avigad
|
|
|
|
|
|
|
|
|
|
-- logic.connectives.identities
|
|
|
|
|
-- ============================
|
|
|
|
|
|
|
|
|
|
-- Useful logical identities. In the absence of propositional extensionality, some of the
|
|
|
|
|
-- calculations use the type class support provided by logic.connectives.instances
|
|
|
|
|
|
2014-08-28 01:39:55 +00:00
|
|
|
|
import logic.core.instances
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
|
|
|
|
using relation
|
|
|
|
|
|
|
|
|
|
theorem or_right_comm (a b c : Prop) : (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b :=
|
|
|
|
|
calc
|
2014-08-28 18:10:04 +00:00
|
|
|
|
(a ∨ b) ∨ c ↔ a ∨ (b ∨ c) : or_assoc
|
|
|
|
|
... ↔ a ∨ (c ∨ b) : {or_comm}
|
|
|
|
|
... ↔ (a ∨ c) ∨ b : iff_symm or_assoc
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
|
|
|
|
theorem or_left_comm (a b c : Prop) : a ∨ (b ∨ c)↔ b ∨ (a ∨ c) :=
|
|
|
|
|
calc
|
2014-08-28 18:10:04 +00:00
|
|
|
|
a ∨ (b ∨ c) ↔ (a ∨ b) ∨ c : iff_symm or_assoc
|
|
|
|
|
... ↔ (b ∨ a) ∨ c : {or_comm}
|
|
|
|
|
... ↔ b ∨ (a ∨ c) : or_assoc
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
|
|
|
|
theorem and_right_comm (a b c : Prop) : (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b :=
|
|
|
|
|
calc
|
2014-08-28 18:10:04 +00:00
|
|
|
|
(a ∧ b) ∧ c ↔ a ∧ (b ∧ c) : and_assoc
|
|
|
|
|
... ↔ a ∧ (c ∧ b) : {and_comm}
|
|
|
|
|
... ↔ (a ∧ c) ∧ b : iff_symm and_assoc
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
|
|
|
|
theorem and_left_comm (a b c : Prop) : a ∧ (b ∧ c)↔ b ∧ (a ∧ c) :=
|
|
|
|
|
calc
|
2014-08-28 18:10:04 +00:00
|
|
|
|
a ∧ (b ∧ c) ↔ (a ∧ b) ∧ c : iff_symm and_assoc
|
|
|
|
|
... ↔ (b ∧ a) ∧ c : {and_comm}
|
|
|
|
|
... ↔ b ∧ (a ∧ c) : and_assoc
|