File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed
Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,6 @@ public section
1212
1313namespace Bool
1414
15- /--
16- Boolean “equality”. `beq x y` can be written `x == y`.
17-
18- `x == y` is `true` when `x = y`. It is functionally the same as
19- `decide (x = y)` but it uses non-branching code at runtime.
20- -/
21- @[extern "lean_bool_dec_eq"]
22- protected def beq (x y : Bool) : Bool := decide (x = y)
23-
24- -- We override the default `BEq` so that it uses non-branching code at runtime.
25- instance : BEq Bool := ⟨Bool.beq⟩
26- instance : LawfulBEq Bool := ⟨of_decide_eq_true⟩
27-
2815/--
2916Boolean “logical or”. `lor x y`.
3017
@@ -75,7 +62,7 @@ Examples:
7562 * `true ^^ true = false`
7663 -/
7764@[expose, reducible, extern "lean_bool_xor"]
78- def xor (x y : Bool) : Bool := x != y
65+ def xor (x y : Bool) : Bool := bne x y
7966
8067@[inherit_doc] infixl :33 " ^^ " => Bool.xor
8168
Original file line number Diff line number Diff line change @@ -616,7 +616,7 @@ theorem or_mod_two_pow : (a ||| b) % 2 ^ n = a % 2 ^ n ||| b % 2 ^ n :=
616616
617617@[simp, grind =] theorem testBit_xor (x y i : Nat) :
618618 (x ^^^ y).testBit i = ((x.testBit i) ^^ (y.testBit i)) := by
619- simp [HXor.hXor, XorOp.xor, xor, testBit_bitwise ]
619+ simp [HXor.hXor, XorOp.xor, xor, testBit_bitwise]
620620
621621@[simp, grind =] theorem zero_xor (x : Nat) : 0 ^^^ x = x := by
622622 apply Nat.eq_of_testBit_eq
You can’t perform that action at this time.
0 commit comments