Skip to content

Commit cac12f2

Browse files
committed
chore: polish clzAux_eq_iff_forall_of_clzAux_lt
1 parent f81df3b commit cac12f2

File tree

2 files changed

+47
-500
lines changed

2 files changed

+47
-500
lines changed

src/Init/Data/BitVec/Bitblast.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,14 +1992,14 @@ theorem clz_eq_clzAuxRec_of_false (x : BitVec w) (h : ∀ i, n < i → x.getLsbD
19921992
by_cases hi' : 0 < i
19931993
· apply h; exact hi'
19941994
· simp [show i = 0 by omega, hx0]
1995-
· case succ n inh =>
1995+
· case succ n ihn =>
19961996
by_cases hxn : x.getLsbD (n + 1)
19971997
· have : n + 1 < w + 1 := by
19981998
apply Classical.byContradiction
19991999
intro hcontra
20002000
simp only [show w + 1 ≤ n + 1 by omega, getLsbD_of_ge, false_eq_true] at hxn
2001-
simp only [clz, clzAuxRec, Nat.add_eq_zero, succ_ne_self, _root_.and_false, ↓reduceIte, Nat.add_one_sub_one,
2002-
Nat.mod_eq_of_lt (by omega)]
2001+
simp only [clz, clzAuxRec, Nat.add_eq_zero, succ_ne_self, _root_.and_false, ↓reduceIte,
2002+
Nat.add_one_sub_one, Nat.mod_eq_of_lt (by omega)]
20032003
simp only [iff_false, show ¬∀ i, i < w + 1 → x.getLsbD i = false by simp; exists n + 1] at heq
20042004
simp only [hxn, ↓reduceIte, toNat_eq, toNat_ofNat]
20052005
rw [Nat.mod_eq_of_lt (by omega), Nat.mod_eq_of_lt (by omega),
@@ -2009,7 +2009,7 @@ theorem clz_eq_clzAuxRec_of_false (x : BitVec w) (h : ∀ i, n < i → x.getLsbD
20092009
apply h
20102010
omega
20112011
· simp only [clzAuxRec, hxn, false_eq_true, ↓reduceIte]
2012-
apply inh
2012+
apply ihn
20132013
intro i hi
20142014
by_cases hi : n + 1 < i
20152015
· apply h; exact hi

0 commit comments

Comments
 (0)