Skip to content

Commit fbe2201

Browse files
committed
Further cleanup
1 parent 03782d8 commit fbe2201

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/Init/Data/BitVec/Lemmas.lean

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,23 +1868,24 @@ private theorem Nat.two_pow_lt_two_pow_add {n m : Nat} (h : m ≠ 0) :
18681868
2 ^ n < 2 ^ (n + m) := by
18691869
apply Nat.pow_lt_pow_of_lt (by omega) (by omega)
18701870

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+
18711875
@[simp] theorem toInt_append_zero {n m : Nat} {x : BitVec n} :
18721876
(x ++ 0#m).toInt = x.toInt * (2 ^ m) := by
18731877
by_cases m0 : m = 0
18741878
· subst m0
18751879
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
18881889

18891890
@[simp] theorem toInt_append {x : BitVec n} {y : BitVec m} :
18901891
(x ++ y).toInt = if n == 0 then y.toInt else x.toInt * (2 ^ m) + y.toNat := by

0 commit comments

Comments
 (0)