File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -368,29 +368,15 @@ theorem even_xor {m n : ℕ} : Even (m ^^^ n) ↔ (Even m ↔ Even n) := by
368368@[simp] theorem bit_lt_two_pow_succ_iff {b x n} : bit b x < 2 ^ (n + 1 ) ↔ x < 2 ^ n := by
369369 cases b <;> simp <;> omega
370370
371- /-- If `x` and `y` fit within `n` bits, then the result of any bitwise operation on `x` and `y` also
372- fits within `n` bits -/
373- theorem bitwise_lt {f x y n} (hx : x < 2 ^ n) (hy : y < 2 ^ n) :
374- bitwise f x y < 2 ^ n := by
375- induction x using Nat.binaryRec' generalizing n y with
376- | z =>
377- simp only [bitwise_zero_left]
378- split <;> assumption
379- | @f bx nx hnx ih =>
380- cases y using Nat.binaryRec' with
381- | z =>
382- simp only [bitwise_zero_right]
383- split <;> assumption
384- | f «by » ny hny =>
385- rw [bitwise_bit' _ _ _ _ hnx hny]
386- cases n <;> simp_all
371+ @[deprecated bitwise_lt_two_pow (since := "2024-12-28")]
372+ alias bitwise_lt := bitwise_lt_two_pow
387373
388374lemma shiftLeft_lt {x n m : ℕ} (h : x < 2 ^ n) : x <<< m < 2 ^ (n + m) := by
389375 simp only [Nat.pow_add, shiftLeft_eq, Nat.mul_lt_mul_right (Nat.two_pow_pos _), h]
390376
391377/-- Note that the LHS is the expression used within `Std.BitVec.append`, hence the name. -/
392378lemma append_lt {x y n m} (hx : x < 2 ^ n) (hy : y < 2 ^ m) : y <<< n ||| x < 2 ^ (n + m) := by
393- apply bitwise_lt
379+ apply bitwise_lt_two_pow
394380 · rw [add_comm]; apply shiftLeft_lt hy
395381 · apply lt_of_lt_of_le hx <| Nat.pow_le_pow_right (le_succ _) (le_add_right _ _)
396382
You can’t perform that action at this time.
0 commit comments