Skip to content

Commit beff078

Browse files
committed
fix: restore default BEq
1 parent 61301d3 commit beff078

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/Init/Data/Bool.lean

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ public section
1212

1313
namespace 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
/--
2916
Boolean “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

src/Init/Data/Nat/Bitwise/Lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)