Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore: bump Std dependency (shiftRight lemmas) #7771

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions Mathlib/Data/Nat/Size.lean
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ end
theorem zero_shiftLeft (n) : 0 <<< n = 0 := by simp
#align nat.zero_shiftl Nat.zero_shiftLeft

theorem shiftRight_eq_div_pow (m) : ∀ n, m >>> n = m / 2 ^ n
| 0 => (Nat.div_one _).symm
| k + 1 => by
rw [shiftRight_add, shiftRight_eq_div_pow m k]
simp [Nat.div_div_eq_div_mul, ← Nat.pow_succ]
#align nat.shiftr_eq_div_pow Nat.shiftRight_eq_div_pow

theorem shiftLeft'_ne_zero_left (b) {m} (h : m ≠ 0) (n) : shiftLeft' b m n ≠ 0 := by
Expand Down
19 changes: 0 additions & 19 deletions Mathlib/Init/Data/Nat/Bitwise.lean
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,6 @@ theorem shiftLeft_zero (m) : m <<< 0 = m := rfl
theorem shiftLeft_succ (m n) : m <<< (n + 1) = 2 * (m <<< n) := by
simp only [shiftLeft_eq, Nat.pow_add, Nat.pow_one, ← Nat.mul_assoc, Nat.mul_comm]

@[simp]
theorem shiftRight_zero : n >>> 0 = n := rfl

@[simp]
theorem shiftRight_succ (m n) : m >>> (n + 1) = (m >>> n) / 2 := rfl

@[simp]
theorem zero_shiftRight : ∀ n, 0 >>> n = 0 := by
intro n
induction' n with n IH
case zero =>
simp [shiftRight]
case succ =>
simp [shiftRight, IH]

/-- `testBit m n` returns whether the `(n+1)ˢᵗ` least significant bit is `1` or `0`-/
def testBit (m n : ℕ) : Bool :=
bodd (m >>> n)
Expand Down Expand Up @@ -307,10 +292,6 @@ theorem shiftLeft'_add (b m n) : ∀ k, shiftLeft' b m (n + k) = shiftLeft' b (s
theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k := by
intro k; simp only [← shiftLeft'_false, shiftLeft'_add]

theorem shiftRight_add (m n : Nat) : ∀ k, m >>> (n + k) = (m >>> n) >>> k
| 0 => rfl
| k + 1 => by simp [add_succ, shiftRight_add]

theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
Expand Down
2 changes: 1 addition & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[{"git":
{"url": "https://github.com/leanprover/std4",
"subDir?": null,
"rev": "dd2549f76ff763c897fe997061e2625a7d628eaf",
"rev": "727fa6aa1113c376ea1873812d1ab5c17a24f1d2",
"opts": {},
"name": "std",
"inputRev?": "main",
Expand Down