2014-02-02 02:27:14 +00:00
|
|
|
import tactic
|
2014-01-05 20:05:08 +00:00
|
|
|
definition xor (x y : Bool) : Bool := (not x) = y
|
|
|
|
infixr 50 ⊕ : xor
|
2014-01-05 19:03:35 +00:00
|
|
|
print xor true false
|
2014-01-05 20:05:08 +00:00
|
|
|
variable a : Bool
|
2014-01-05 19:03:35 +00:00
|
|
|
print a ⊕ a ⊕ a
|
2014-01-06 03:10:21 +00:00
|
|
|
check @subst
|
2014-01-05 20:05:08 +00:00
|
|
|
theorem EM2 (a : Bool) : a \/ (not a) :=
|
2014-02-02 02:27:14 +00:00
|
|
|
case (fun x : Bool, x \/ (not x)) (by simp) (by simp) a
|
2014-01-05 20:05:08 +00:00
|
|
|
check EM2
|
|
|
|
check EM2 a
|
2014-02-02 02:27:14 +00:00
|
|
|
theorem xor_neq (a b : Bool) : (a ⊕ b) ↔ ((¬ a) = b)
|
|
|
|
:= refl (a ⊕ b)
|