diff --git a/SSA/Projects/InstCombine/ForLean.lean b/SSA/Projects/InstCombine/ForLean.lean index 09c426a40..8b2e9d980 100644 --- a/SSA/Projects/InstCombine/ForLean.lean +++ b/SSA/Projects/InstCombine/ForLean.lean @@ -514,25 +514,7 @@ theorem not_sshiftRight_not {x : BitVec w} {n : Nat} : ~~~((~~~x).sshiftRight n) = x.sshiftRight n := by simp [not_sshiftRight] -@[simp] -theorem shiftLeft_shiftRight {x : BitVec w} {n : Nat}: - x >>> n <<< n = x &&& BitVec.allOnes w <<< n := by - induction n generalizing x - case zero => - ext; simp - case succ n ih => - rw [BitVec.shiftLeft_add, Nat.add_comm, BitVec.shiftRight_add, ih, - Nat.add_comm, BitVec.shiftLeft_add, BitVec.shiftLeft_and_distrib] - ext i - simp only [getLsbD_and, getLsbD_shiftLeft, Fin.is_lt, decide_True, Nat.lt_one_iff, - Bool.true_and, getLsbD_ushiftRight, getLsbD_allOnes] - rw [Nat.add_comm] - by_cases hw : w = 0 - · simp [hw] - · by_cases h : i.val = 0 - · simp [h] - · rw [Nat.sub_add_cancel (by omega)] - simp [h] +attribute [simp] shiftLeft_ushiftRight theorem ofInt_neg_one : BitVec.ofInt w (-1) = -1#w := by simp only [Int.reduceNeg, toNat_eq, toNat_ofInt, Nat.cast_pow, Nat.cast_ofNat, toNat_neg, @@ -551,18 +533,6 @@ theorem ofInt_neg_one : BitVec.ofInt w (-1) = -1#w := by Int.pred_toNat] norm_cast -@[simp] -theorem shiftLeft_add_distrib {x y : BitVec w} {n : Nat} : - (x + y) <<< n = x <<< n + y <<< n := by - induction n - case zero => - simp - case succ n ih => - simp only [shiftLeft_add, ih, toNat_eq, toNat_shiftLeft, toNat_add, Nat.shiftLeft_eq_mul_pow, - Nat.add_mod_mod, Nat.mod_add_mod, pow_one, Nat.mod_mul_mod] - rw [Nat.mod_eq_of_eq] - omega - @[simp] theorem shiftLeft_and_distrib' {x y : BitVec w} {n m : Nat} : x <<< n &&& y <<< (m + n) = (x &&& y <<< m) <<< n := by diff --git a/lake-manifest.json b/lake-manifest.json index 740ae69fd..c86769285 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,7 +5,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "2c9497c893a4f81411023b56c51f2473c7c3c452", + "rev": "cfb438195e4513212997bdff25a436c1e99a3440", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "nightly-testing", @@ -75,10 +75,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "0510a8eb7a3628edd2b79c33efa04c93f377281d", + "rev": "c0c2c8fac501e8c0580177432e21fd461cb64580", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "nightly-testing-2024-09-26", + "inputRev": "nightly-testing-2024-09-27", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/acmepjz/md4lean", diff --git a/lakefile.toml b/lakefile.toml index 05a42f08e..e637fad3f 100644 --- a/lakefile.toml +++ b/lakefile.toml @@ -4,7 +4,7 @@ defaultTargets = ["SSA"] [[require]] name = "mathlib" git = "https://github.com/leanprover-community/mathlib4" -rev = "nightly-testing-2024-09-26" +rev = "nightly-testing-2024-09-27" [[require]] name = "Cli" diff --git a/lean-toolchain b/lean-toolchain index cbe615647..594fe05fb 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:nightly-2024-09-26 +leanprover/lean4:nightly-2024-09-27