@@ -157,7 +157,7 @@ def induction {motive : ∀ {w}, BitVec w → Prop}
157157 exact nil
158158 | succ w ih =>
159159 rw [←cons_msb_setWidth x]
160- exact cons w x.msb (setWidth w x) (ih (setWidth w x) )
160+ exact cons w _ _ (ih _ )
161161
162162/--
163163Induction principle for bitvectors, viewing them as built from `concat` (MSB to LSB).
@@ -221,7 +221,7 @@ theorem foldl_nil : foldl f a nil = a := by
221221
222222@[simp]
223223theorem foldl_cons {x : BitVec w} : foldl f a (cons b x) = foldl f (f a b) x := by
224- simp [foldl, getElem_cons, Nat.foldRev_succ, ↓reduceDIte]
224+ simp only [foldl, getElem_cons, Nat.foldRev_succ, ↓reduceDIte]
225225 congr
226226 ext
227227 rw [dif_neg (by omega)]
@@ -244,7 +244,7 @@ theorem foldrIdx_nil : foldrIdx f a nil = a := by
244244@[simp]
245245theorem foldrIdx_cons {x : BitVec w} :
246246 foldrIdx f a (cons b x) = f ⟨w, by omega⟩ b (foldrIdx (fun i => f ⟨i.val, by omega⟩) a x) := by
247- simp [foldrIdx, getElem_cons]
247+ simp only [foldrIdx, getElem_cons, Nat.fold_succ, ↓reduceDIte ]
248248 congr
249249 ext
250250 rw [dif_neg (by omega)]
@@ -264,7 +264,7 @@ theorem foldlIdx_nil : foldlIdx f a nil = a := by
264264@[simp]
265265theorem foldlIdx_cons {x : BitVec w} :
266266 foldlIdx f a (cons b x) = foldlIdx (fun acc i => f acc ⟨i.val, by omega⟩) (f a ⟨w, by omega⟩ b) x := by
267- simp [foldlIdx, getElem_cons, Nat.foldRev_succ, ↓reduceDIte]
267+ simp only [foldlIdx, getElem_cons, Nat.foldRev_succ, ↓reduceDIte]
268268 congr
269269 ext
270270 rw [dif_neg (by omega)]
0 commit comments