Skip to content

Commit e5fb376

Browse files
committed
feat(Algebra/Ring/BooleanRing): definitional lemmas for Bool ring operations (leanprover-community#38548)
Mathlib defines a ring structure on `Bool` but is missing definitional lemmas for the arithmetic operations.
1 parent 15f13f4 commit e5fb376

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Mathlib/Algebra/Ring/BooleanRing.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,3 +541,15 @@ instance : BooleanRing Bool where
541541
mul_zero a := by cases a <;> rfl
542542
nsmul := nsmulRec
543543
zsmul := zsmulRec
544+
545+
theorem Bool.zero_eq_false : 0 = false := rfl
546+
547+
theorem Bool.one_eq_true : 1 = true := rfl
548+
549+
theorem Bool.add_eq_xor (b c : Bool) : b + c = (b ^^ c) := rfl
550+
551+
theorem Bool.neg_eq_id (b : Bool) : -b = b := rfl
552+
553+
theorem Bool.sub_eq_xor (b c : Bool) : b - c = (b ^^ c) := rfl
554+
555+
theorem Bool.mul_eq_and (b c : Bool) : b * c = (b && c) := rfl

0 commit comments

Comments
 (0)