File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -1868,23 +1868,24 @@ private theorem Nat.two_pow_lt_two_pow_add {n m : Nat} (h : m ≠ 0) :
1868
1868
2 ^ n < 2 ^ (n + m) := by
1869
1869
apply Nat.pow_lt_pow_of_lt (by omega) (by omega)
1870
1870
1871
+ @[simp] theorem signExtend_shiftLeft_of_lt {n m : Nat} {x : BitVec n} :
1872
+ (signExtend (n + m) x <<< m).msb = x.msb := by
1873
+ sorry
1874
+
1871
1875
@[simp] theorem toInt_append_zero {n m : Nat} {x : BitVec n} :
1872
1876
(x ++ 0 #m).toInt = x.toInt * (2 ^ m) := by
1873
1877
by_cases m0 : m = 0
1874
1878
· subst m0
1875
1879
simp
1876
- ·
1877
- simp only [ofNat_eq_ofNat, append_zero]
1878
- rw [toInt_eq_msb_cond]
1879
- rw [toInt_eq_msb_cond]
1880
- split
1881
- <;> split
1882
-
1883
- simp
1884
-
1885
-
1886
-
1887
-
1880
+ · simp only [ofNat_eq_ofNat, append_zero, toInt_eq_msb_cond]
1881
+ by_cases h1 : (signExtend (n + m) x <<< m).msb
1882
+ · by_cases h2: x.msb
1883
+ · sorry
1884
+ · simp only [signExtend_shiftLeft_of_lt] at h1
1885
+ contradiction
1886
+ · by_cases h2: x.msb
1887
+ · simp [signExtend_shiftLeft_of_lt, h2] at h1
1888
+ · sorry
1888
1889
1889
1890
@[simp] theorem toInt_append {x : BitVec n} {y : BitVec m} :
1890
1891
(x ++ y).toInt = if n == 0 then y.toInt else x.toInt * (2 ^ m) + y.toNat := by
You can’t perform that action at this time.
0 commit comments