Skip to content

Commit 8bee481

Browse files
committed
chore: prove clz_eq_length_iff
1 parent c0f8c74 commit 8bee481

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/Init/Data/BitVec/Bitblast.lean

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,14 +2192,19 @@ theorem clz_zero : clz 0#w = w := by
21922192
@[simp]
21932193
theorem clz_eq_length_iff {x : BitVec w} :
21942194
clz x = w ↔ x = 0#w := by
2195-
constructor
2196-
· intro h
2197-
have := clz_le (x := x)
2198-
2199-
2200-
sorry
2201-
· intro h
2202-
simp [h, clz_zero]
2195+
rcases w with _|w
2196+
· simp [clz, of_length_zero]
2197+
· constructor
2198+
· intro h
2199+
simp [clz] at h
2200+
have := clzAux_eq_iff (x := x) (n := w)
2201+
simp [h] at this
2202+
ext i
2203+
simp
2204+
apply this
2205+
omega
2206+
· intro h
2207+
simp [h, clz_zero]
22032208

22042209
/--
22052210
preliminary overflow flag for fast umulOverflow circuit

0 commit comments

Comments
 (0)