Skip to content

Commit

Permalink
chore: bump dependencies (leanprover-community#10954)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
  • Loading branch information
3 people committed Feb 25, 2024
1 parent a3692d9 commit a62da66
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 68 deletions.
7 changes: 1 addition & 6 deletions Mathlib/Data/BitVec/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,9 @@ lemma toFin_nsmul (n : ℕ) (x : BitVec w) : toFin (n • x) = n • x.toFin :=
lemma toFin_zsmul (z : ℤ) (x : BitVec w) : toFin (z • x) = z • x.toFin := rfl
@[simp] lemma toFin_pow (n : ℕ) : toFin (x ^ n) = x.toFin ^ n := rfl

@[simp] lemma toFin_natCast (n : ℕ) : toFin (n : BitVec w) = n := by
lemma toFin_natCast (n : ℕ) : toFin (n : BitVec w) = n := by
apply toFin_inj.mpr; simp only [ofFin_natCast]

-- See Note [no_index around OfNat.ofNat]
lemma toFin_ofNat (n : ℕ) :
toFin (no_index (OfNat.ofNat n : BitVec w)) = OfNat.ofNat n := by
simp only [OfNat.ofNat, BitVec.ofNat, and_pow_two_is_mod, Fin.ofNat']

end

/-!
Expand Down
49 changes: 0 additions & 49 deletions Mathlib/Data/Int/Order/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -445,74 +445,25 @@ protected theorem sign_eq_ediv_abs (a : ℤ) : sign a = a / |a| :=

/-! ### `/` and ordering -/


protected theorem ediv_mul_le (a : ℤ) {b : ℤ} (H : b ≠ 0) : a / b * b ≤ a :=
le_of_sub_nonneg <| by rw [mul_comm, ← emod_def]; apply emod_nonneg _ H
#align int.div_mul_le Int.ediv_mul_le

protected theorem ediv_le_of_le_mul {a b c : ℤ} (H : 0 < c) (H' : a ≤ b * c) : a / c ≤ b :=
le_of_mul_le_mul_right (le_trans (Int.ediv_mul_le _ (ne_of_gt H)) H') H
#align int.div_le_of_le_mul Int.ediv_le_of_le_mul

protected theorem mul_lt_of_lt_ediv {a b c : ℤ} (H : 0 < c) (H3 : a < b / c) : a * c < b :=
lt_of_not_ge <| mt (Int.ediv_le_of_le_mul H) (not_le_of_gt H3)
#align int.mul_lt_of_lt_div Int.mul_lt_of_lt_ediv

protected theorem mul_le_of_le_ediv {a b c : ℤ} (H1 : 0 < c) (H2 : a ≤ b / c) : a * c ≤ b :=
le_trans (mul_le_mul_of_nonneg_right H2 (le_of_lt H1)) (Int.ediv_mul_le _ (ne_of_gt H1))
#align int.mul_le_of_le_div Int.mul_le_of_le_ediv

protected theorem le_ediv_of_mul_le {a b c : ℤ} (H1 : 0 < c) (H2 : a * c ≤ b) : a ≤ b / c :=
le_of_lt_add_one <|
lt_of_mul_lt_mul_right (lt_of_le_of_lt H2 (lt_ediv_add_one_mul_self _ H1)) (le_of_lt H1)
#align int.le_div_of_mul_le Int.le_ediv_of_mul_le

protected theorem le_ediv_iff_mul_le {a b c : ℤ} (H : 0 < c) : a ≤ b / c ↔ a * c ≤ b :=
⟨Int.mul_le_of_le_ediv H, Int.le_ediv_of_mul_le H⟩
#align int.le_div_iff_mul_le Int.le_ediv_iff_mul_le

protected theorem ediv_le_ediv {a b c : ℤ} (H : 0 < c) (H' : a ≤ b) : a / c ≤ b / c :=
Int.le_ediv_of_mul_le H (le_trans (Int.ediv_mul_le _ (ne_of_gt H)) H')
#align int.div_le_div Int.ediv_le_ediv

protected theorem ediv_lt_of_lt_mul {a b c : ℤ} (H : 0 < c) (H' : a < b * c) : a / c < b :=
lt_of_not_ge <| mt (Int.mul_le_of_le_ediv H) (not_le_of_gt H')
#align int.div_lt_of_lt_mul Int.ediv_lt_of_lt_mul

protected theorem lt_mul_of_ediv_lt {a b c : ℤ} (H1 : 0 < c) (H2 : a / c < b) : a < b * c :=
lt_of_not_ge <| mt (Int.le_ediv_of_mul_le H1) (not_le_of_gt H2)
#align int.lt_mul_of_div_lt Int.lt_mul_of_ediv_lt

protected theorem ediv_lt_iff_lt_mul {a b c : ℤ} (H : 0 < c) : a / c < b ↔ a < b * c :=
⟨Int.lt_mul_of_ediv_lt H, Int.ediv_lt_of_lt_mul H⟩
#align int.div_lt_iff_lt_mul Int.ediv_lt_iff_lt_mul

protected theorem le_mul_of_ediv_le {a b c : ℤ} (H1 : 0 ≤ b) (H2 : b ∣ a) (H3 : a / b ≤ c) :
a ≤ c * b := by rw [← Int.ediv_mul_cancel H2]; exact mul_le_mul_of_nonneg_right H3 H1
#align int.le_mul_of_div_le Int.le_mul_of_ediv_le

protected theorem lt_ediv_of_mul_lt {a b c : ℤ} (H1 : 0 ≤ b) (H2 : b ∣ c) (H3 : a * b < c) :
a < c / b :=
lt_of_not_ge <| mt (Int.le_mul_of_ediv_le H1 H2) (not_le_of_gt H3)
#align int.lt_div_of_mul_lt Int.lt_ediv_of_mul_lt

protected theorem lt_ediv_iff_mul_lt {a b : ℤ} (c : ℤ) (H : 0 < c) (H' : c ∣ b) :
a < b / c ↔ a * c < b :=
⟨Int.mul_lt_of_lt_ediv H, Int.lt_ediv_of_mul_lt (le_of_lt H) H'⟩
#align int.lt_div_iff_mul_lt Int.lt_ediv_iff_mul_lt

theorem ediv_pos_of_pos_of_dvd {a b : ℤ} (H1 : 0 < a) (H2 : 0 ≤ b) (H3 : b ∣ a) : 0 < a / b :=
Int.lt_ediv_of_mul_lt H2 H3 (by rwa [zero_mul])
#align int.div_pos_of_pos_of_dvd Int.ediv_pos_of_pos_of_dvd

theorem natAbs_eq_of_dvd_dvd {s t : ℤ} (hst : s ∣ t) (hts : t ∣ s) : natAbs s = natAbs t :=
Nat.dvd_antisymm (natAbs_dvd_natAbs.mpr hst) (natAbs_dvd_natAbs.mpr hts)
#align int.nat_abs_eq_of_dvd_dvd Int.natAbs_eq_of_dvd_dvd

theorem ediv_eq_ediv_of_mul_eq_mul {a b c d : ℤ} (H2 : d ∣ c) (H3 : b ≠ 0) (H4 : d ≠ 0)
(H5 : a * d = b * c) : a / b = c / d :=
Int.ediv_eq_of_eq_mul_right H3 <| by
rw [← Int.mul_ediv_assoc _ H2]; exact (Int.ediv_eq_of_eq_mul_left H4 H5.symm).symm
#align int.div_eq_div_of_mul_eq_mul Int.ediv_eq_ediv_of_mul_eq_mul

theorem ediv_dvd_of_dvd {s t : ℤ} (hst : s ∣ t) : t / s ∣ t := by
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Data/List/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3663,8 +3663,8 @@ variable [DecidableEq α]

theorem map_erase [DecidableEq β] {f : α → β} (finj : Injective f) {a : α} (l : List α) :
map f (l.erase a) = (map f l).erase (f a) := by
have this : Eq a = Eq (f a) ∘ f := by ext b; simp [finj.eq_iff]
simp [erase_eq_eraseP, erase_eq_eraseP, eraseP_map, this]; rfl
have this : (a == ·) = (f a == f ·) := by ext b; simp [beq_eq_decide, finj.eq_iff]
rw [erase_eq_eraseP, erase_eq_eraseP, eraseP_map, this]; rfl
#align list.map_erase List.map_erase

theorem map_foldl_erase [DecidableEq β] {f : α → β} (finj : Injective f) {l₁ l₂ : List α} :
Expand Down Expand Up @@ -3720,7 +3720,7 @@ theorem erase_diff_erase_sublist_of_sublist {a : α} :
| b :: l₁, l₂, h =>
if heq : b = a then by simp only [heq, erase_cons_head, diff_cons]; rfl
else by
simp only [erase_cons_head b l₁, erase_cons_tail l₁ heq,
simp only [erase_cons_head b l₁, erase_cons_tail l₁ (not_beq_of_ne heq),
diff_cons ((List.erase l₂ a)) (List.erase l₁ a) b, diff_cons l₂ l₁ b, erase_comm a b l₂]
have h' := h.erase b
rw [erase_cons_head] at h'
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/List/BigOperators/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ theorem prod_map_erase [DecidableEq ι] [CommMonoid M] (f : ι → M) {a} :
| b :: l, h => by
obtain rfl | ⟨ne, h⟩ := Decidable.List.eq_or_ne_mem_of_mem h
· simp only [map, erase_cons_head, prod_cons]
· simp only [map, erase_cons_tail _ ne.symm, prod_cons, prod_map_erase _ h,
· simp only [map, erase_cons_tail _ (not_beq_of_ne ne.symm), prod_cons, prod_map_erase _ h,
mul_left_comm (f a) (f b)]
#align list.prod_map_erase List.prod_map_erase
#align list.sum_map_erase List.sum_map_erase
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/List/Nodup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ theorem Nodup.erase_eq_filter [DecidableEq α] {l} (d : Nodup l) (a : α) :
symm
rw [filter_eq_self]
simpa [@eq_comm α] using m
· rw [erase_cons_tail _ h, filter_cons_of_pos, IH]
· rw [erase_cons_tail _ (not_beq_of_ne h), filter_cons_of_pos, IH]
simp [h]
#align list.nodup.erase_eq_filter List.Nodup.erase_eq_filter

Expand Down
4 changes: 4 additions & 0 deletions Mathlib/Data/List/Sigma.lean
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ theorem mem_keys_kerase_of_ne {a₁ a₂} {l : List (Sigma β)} (h : a₁ ≠ a

theorem keys_kerase {a} {l : List (Sigma β)} : (kerase a l).keys = l.keys.erase a := by
rw [keys, kerase, erase_eq_eraseP, eraseP_map, Function.comp]
simp only [beq_eq_decide]
congr
funext
simp
#align list.keys_kerase List.keys_kerase

theorem kerase_kerase {a a'} {l : List (Sigma β)} :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Multiset/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ theorem erase_cons_head (a : α) (s : Multiset α) : (a ::ₘ s).erase a = s :=
@[simp]
theorem erase_cons_tail {a b : α} (s : Multiset α) (h : b ≠ a) :
(b ::ₘ s).erase a = b ::ₘ s.erase a :=
Quot.inductionOn s fun l => congr_arg _ <| List.erase_cons_tail l h
Quot.inductionOn s fun l => congr_arg _ <| List.erase_cons_tail l (not_beq_of_ne h)
#align multiset.erase_cons_tail Multiset.erase_cons_tail

@[simp]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/NNRat/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ theorem lt_toNNRat_iff_coe_lt {q : ℚ≥0} : q < toNNRat p ↔ ↑q < p :=

theorem toNNRat_mul (hp : 0 ≤ p) : toNNRat (p * q) = toNNRat p * toNNRat q := by
rcases le_total 0 q with hq | hq
· ext <;> simp [toNNRat, hp, hq, max_eq_left, mul_nonneg]
· ext; simp [toNNRat, hp, hq, max_eq_left, mul_nonneg]
· have hpq := mul_nonpos_of_nonneg_of_nonpos hp hq
rw [toNNRat_eq_zero.2 hq, toNNRat_eq_zero.2 hpq, mul_zero]
#align rat.to_nnrat_mul Rat.toNNRat_mul
Expand Down Expand Up @@ -378,7 +378,7 @@ theorem natAbs_num_coe : (q : ℚ).num.natAbs = q.num := rfl
@[simp, norm_cast] lemma den_natCast (n : ℕ) : den n = 1 := rfl

theorem ext_num_den (hn : p.num = q.num) (hd : p.den = q.den) : p = q := by
ext
refine ext <| Rat.ext ?_ ?_
· apply (Int.natAbs_inj_of_nonneg_of_nonneg _ _).1 hn
exact Rat.num_nonneg.2 p.2
exact Rat.num_nonneg.2 q.2
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Init/Data/Rat/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/

import Std.Data.Rat.Basic
import Std.Data.Rat.Lemmas
import Mathlib.Mathport.Rename

/-!
Expand All @@ -13,5 +13,5 @@ import Mathlib.Mathport.Rename

#align rat.ext Rat.ext
#align rat Rat
#align rat.ext_iff Rat.ext_iff
#noalign rat.ext_iff
#align rat.floor Rat.floor
7 changes: 7 additions & 0 deletions Mathlib/Logic/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1285,3 +1285,10 @@ theorem dite_prop_iff_and {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
#align if_false_left_eq_and if_false_left

end ite

theorem not_beq_of_ne [BEq α] [LawfulBEq α] {a b : α} (ne : a ≠ b) : ¬(a == b) :=
fun h => ne (eq_of_beq h)

theorem beq_eq_decide [BEq α] [LawfulBEq α] {a b : α} : (a == b) = decide (a = b) := by
rw [← beq_iff_eq a b]
cases a == b <;> simp
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/DiophantineApproximation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ private theorem aux₂ : 0 < u - ⌊ξ⌋ * v ∧ u - ⌊ξ⌋ * v < v := by
((mul_le_mul_right <| hv₀').mpr <|
(sub_le_sub_iff_left (u : ℝ)).mpr ((mul_le_mul_right hv₀).mpr (floor_le ξ)))
have hu₁ : u - ⌊ξ⌋ * v ≤ v := by
refine' le_of_mul_le_mul_right (le_of_lt_add_one _) hv₁
refine' _root_.le_of_mul_le_mul_right (le_of_lt_add_one _) hv₁
replace h := h.2
rw [← sub_lt_iff_lt_add, ← mul_assoc, ← sub_mul, ← add_lt_add_iff_right (v * (2 * v - 1) : ℝ),
add_comm (1 : ℝ)] at h
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/NumberTheory/SumFourSquares.lean
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ theorem lt_of_sum_four_squares_eq_mul {a b c d k m : ℕ}
(h : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = k * m)
(ha : 2 * a < m) (hb : 2 * b < m) (hc : 2 * c < m) (hd : 2 * d < m) :
k < m := by
refine lt_of_mul_lt_mul_right (lt_of_mul_lt_mul_left ?_ (zero_le (2 ^ 2))) (zero_le m)
refine _root_.lt_of_mul_lt_mul_right
(_root_.lt_of_mul_lt_mul_left ?_ (zero_le (2 ^ 2))) (zero_le m)
calc
2 ^ 2 * (k * ↑m) = ∑ i : Fin 4, (2 * ![a, b, c, d] i) ^ 2 := by
simp [← h, Fin.sum_univ_succ, mul_add, mul_pow, add_assoc]
Expand Down
1 change: 1 addition & 0 deletions Mathlib/Tactic/LibrarySearch.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Std.Lean.Parser
import Std.Tactic.SolveByElim
import Std.Tactic.TryThis
import Std.Data.MLList.Heartbeats
import Std.Control.Nondet.Basic
import Mathlib.Lean.Meta
import Mathlib.Lean.Meta.DiscrTree
import Mathlib.Lean.Expr.Basic
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 @@
[{"url": "https://github.com/leanprover/std4",
"type": "git",
"subDir": null,
"rev": "4c366aba55d28778421b8a1841e5512fd5c53c43",
"rev": "cbc437aed076ea3aeb83f318d572f8b6de38265d",
"name": "std",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
Expand Down

0 comments on commit a62da66

Please sign in to comment.