chore: rename Bool.toNat_le_one (#3469)
To merge after #3457. --------- Co-authored-by: Alex Keizer <alex@keizer.dev>
This commit is contained in:
parent
e17e0d36a7
commit
4e87d7f173
2 changed files with 5 additions and 3 deletions
|
|
@ -91,7 +91,7 @@ private theorem mod_two_pow_succ (x i : Nat) :
|
|||
|
||||
private theorem mod_two_pow_add_mod_two_pow_add_bool_lt_two_pow_succ
|
||||
(x y i : Nat) (c : Bool) : x % 2^i + (y % 2^i + c.toNat) < 2^(i+1) := by
|
||||
have : c.toNat ≤ 1 := Bool.toNat_le_one c
|
||||
have : c.toNat ≤ 1 := Bool.toNat_le c
|
||||
rw [Nat.pow_succ]
|
||||
omega
|
||||
|
||||
|
|
|
|||
|
|
@ -217,11 +217,13 @@ def toNat (b:Bool) : Nat := cond b 1 0
|
|||
|
||||
@[simp] theorem toNat_true : true.toNat = 1 := rfl
|
||||
|
||||
theorem toNat_le_one (c:Bool) : c.toNat ≤ 1 := by
|
||||
theorem toNat_le (c : Bool) : c.toNat ≤ 1 := by
|
||||
cases c <;> trivial
|
||||
|
||||
@[deprecated toNat_le] abbrev toNat_le_one := toNat_le
|
||||
|
||||
theorem toNat_lt (b : Bool) : b.toNat < 2 :=
|
||||
Nat.lt_succ_of_le (toNat_le_one _)
|
||||
Nat.lt_succ_of_le (toNat_le _)
|
||||
|
||||
@[simp] theorem toNat_eq_zero (b : Bool) : b.toNat = 0 ↔ b = false := by
|
||||
cases b <;> simp
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue