We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ae3099 commit f2447c4Copy full SHA for f2447c4
src/Init/Data/BitVec/Lemmas.lean
@@ -1955,8 +1955,12 @@ theorem msb_concat {w : Nat} {b : Bool} {x : BitVec w} :
1955
· cases b <;> simp <;> omega
1956
1957
@[simp] theorem toFin_concat (x : BitVec w) (b : Bool) :
1958
- (concat x b).toFin = x.toNat * 2 + b.toNat := by
1959
- simp
+ (concat x b).toFin = Fin.mk (x.toNat * 2 + b.toNat) (by
+ have := Bool.toNat_lt b
1960
+ simp [← Nat.two_pow_pred_add_two_pow_pred, Bool.toNat_lt b]
1961
+ omega
1962
+ ) := by
1963
+ simp [← Fin.val_inj]
1964
1965
@[simp] theorem not_concat (x : BitVec w) (b : Bool) : ~~~(concat x b) = concat (~~~x) !b := by
1966
ext i; cases i using Fin.succRecOn <;> simp [*, Nat.succ_lt_succ]
0 commit comments