Skip to content

Commit

Permalink
feat(logic/basic): a few lemmas about xor (#8650)
Browse files Browse the repository at this point in the history
Inspired by #8579
  • Loading branch information
urkud committed Aug 14, 2021
1 parent 94e4667 commit 50d3de9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/logic/basic.lean
Expand Up @@ -339,6 +339,18 @@ theorem imp.swap : (a → b → c) ↔ (b → a → c) :=
theorem imp_not_comm : (a → ¬b) ↔ (b → ¬a) :=
imp.swap

/-! ### Declarations about `xor` -/

@[simp] theorem xor_true : xor true = not := funext $ λ a, by simp [xor]

@[simp] theorem xor_false : xor false = id := funext $ λ a, by simp [xor]

theorem xor_comm (a b) : xor a b = xor b a := by simp [xor, and_comm, or_comm]

instance : is_commutative Prop xor := ⟨xor_comm⟩

@[simp] theorem xor_self (a : Prop) : xor a a = false := by simp [xor]

/-! ### Declarations about `and` -/

theorem and_congr_left (h : c → (a ↔ b)) : a ∧ c ↔ b ∧ c :=
Expand Down

0 comments on commit 50d3de9

Please sign in to comment.