Skip to content

Commit a55eb6d

Browse files
chore: adaptations for batteries#1490 (#31270)
After [batteries#1490](leanprover-community/batteries#1490) is merged: - [x] Edit the lakefile to point to leanprover-community/batteries:main - [x] Run lake update batteries - [x] Merge leanprover-community/mathlib4:master - [ ] Wait for CI and merge Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: F. G. Dorais <fgdorais@gmail.com>
1 parent 1560095 commit a55eb6d

File tree

7 files changed

+19
-42
lines changed

7 files changed

+19
-42
lines changed

Mathlib/Algebra/Module/Torsion/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ theorem exists_isTorsionBy {p : R} (hM : IsTorsion' M <| Submonoid.powers p) (d
851851
let oj := List.argmax (fun i => pOrder hM <| s i) (List.finRange d)
852852
have hoj : oj.isSome :=
853853
Option.ne_none_iff_isSome.mp fun eq_none =>
854-
hd <| List.finRange_eq_nil.mp <| List.argmax_eq_none.mp eq_none
854+
hd <| List.finRange_eq_nil_iff.mp <| List.argmax_eq_none.mp eq_none
855855
use Option.get _ hoj
856856
rw [isTorsionBy_iff_torsionBy_eq_top, eq_top_iff, ← hs, Submodule.span_le,
857857
Set.range_subset_iff]

Mathlib/Analysis/Calculus/FDeriv/Mul.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ theorem hasStrictFDerivAt_list_prod [DecidableEq ι] [Fintype ι] {l : List ι}
539539
HasStrictFDerivAt (𝕜 := 𝕜) (fun x ↦ (l.map x).prod)
540540
(l.map fun i ↦ ((l.erase i).map x).prod • proj i).sum x := by
541541
refine hasStrictFDerivAt_list_prod'.congr_fderiv ?_
542-
conv_rhs => arg 1; arg 2; rw [← List.finRange_map_get l]
542+
conv_rhs => arg 1; arg 2; rw [← List.map_get_finRange l]
543543
simp only [List.map_map, ← List.sum_toFinset _ (List.nodup_finRange _), List.toFinset_finRange,
544544
Function.comp_def, ((List.erase_getElem _).map _).prod_eq, List.eraseIdx_eq_take_drop_succ,
545545
List.map_append, List.prod_append, List.get_eq_getElem, Fin.getElem_fin, Nat.succ_eq_add_one]
@@ -575,7 +575,7 @@ theorem HasStrictFDerivAt.list_prod' {l : List ι} {x : E}
575575
HasStrictFDerivAt (fun x ↦ (l.map (f · x)).prod)
576576
(∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
577577
f' l[i] <• ((l.drop (.succ i)).map (f · x)).prod) x := by
578-
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.finRange_map_get l, List.map_map]
578+
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.map_get_finRange l, List.map_map]
579579
-- After https://github.com/leanprover-community/mathlib4/issues/19108, we have to be optimistic with `:)`s; otherwise Lean decides it need to find
580580
-- `NormedAddCommGroup (List 𝔸)` which is nonsense.
581581
refine .congr_fderiv (hasStrictFDerivAt_list_prod_finRange'.comp x
@@ -593,7 +593,7 @@ theorem HasFDerivAt.list_prod' {l : List ι} {x : E}
593593
HasFDerivAt (fun x ↦ (l.map (f · x)).prod)
594594
(∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
595595
f' l[i] <• ((l.drop (.succ i)).map (f · x)).prod) x := by
596-
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.finRange_map_get l, List.map_map]
596+
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.map_get_finRange l, List.map_map]
597597
refine .congr_fderiv (hasFDerivAt_list_prod_finRange'.comp x
598598
(hasFDerivAt_pi.mpr fun i ↦ h (l.get i) (l.get_mem i)) :) ?_
599599
ext m
@@ -606,7 +606,7 @@ theorem HasFDerivWithinAt.list_prod' {l : List ι} {x : E}
606606
HasFDerivWithinAt (fun x ↦ (l.map (f · x)).prod)
607607
(∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
608608
f' l[i] <• ((l.drop (.succ i)).map (f · x)).prod) s x := by
609-
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.finRange_map_get l, List.map_map]
609+
simp_rw [Fin.getElem_fin, ← l.get_eq_getElem, ← List.map_get_finRange l, List.map_map]
610610
refine .congr_fderiv (hasFDerivAt_list_prod_finRange'.comp_hasFDerivWithinAt x
611611
(hasFDerivWithinAt_pi.mpr fun i ↦ h (l.get i) (l.get_mem i)) :) ?_
612612
ext m

Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ theorem norm_mkPiAlgebraFin_succ_le : ‖ContinuousMultilinearMap.mkPiAlgebraFin
730730
simp only [ContinuousMultilinearMap.mkPiAlgebraFin_apply, one_mul, List.ofFn_eq_map,
731731
Fin.prod_univ_def]
732732
refine (List.norm_prod_le' ?_).trans_eq ?_
733-
· rw [Ne, List.map_eq_nil_iff, List.finRange_eq_nil]
733+
· rw [Ne, List.map_eq_nil_iff, List.finRange_eq_nil_iff]
734734
exact Nat.succ_ne_zero _
735735
rw [List.map_map, Function.comp_def]
736736

Mathlib/Data/Finset/Sort.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ theorem map_orderEmbOfFin_univ (s : Finset α) {k : ℕ} (h : s.card = k) :
234234
theorem listMap_orderEmbOfFin_finRange (s : Finset α) {k : ℕ} (h : s.card = k) :
235235
(List.finRange k).map (s.orderEmbOfFin h) = s.sort := by
236236
obtain rfl : k = s.sort.length := by simp [h]
237-
exact List.finRange_map_getElem s.sort
237+
exact List.map_getElem_finRange s.sort
238238

239239
/-- The bijection `orderEmbOfFin s h` sends `0` to the minimum of `s`. -/
240240
theorem orderEmbOfFin_zero {s : Finset α} {k : ℕ} (h : s.card = k) (hz : 0 < k) :

Mathlib/Data/List/FinRange.lean

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,47 +26,24 @@ namespace List
2626
variable {α : Type u}
2727

2828

29-
theorem finRange_eq_pmap_range (n : ℕ) : finRange n = (range n).pmap Fin.mk (by simp) := by
30-
apply List.ext_getElem <;> simp [finRange]
31-
32-
theorem nodup_finRange (n : ℕ) : (finRange n).Nodup := by
33-
rw [finRange_eq_pmap_range]
34-
exact (Pairwise.pmap nodup_range _) fun _ _ _ _ => @Fin.ne_of_val_ne _ ⟨_, _⟩ ⟨_, _⟩
35-
36-
@[simp]
37-
theorem finRange_eq_nil {n : ℕ} : finRange n = [] ↔ n = 0 := by
38-
rw [← length_eq_zero_iff, length_finRange]
39-
40-
theorem pairwise_lt_finRange (n : ℕ) : Pairwise (· < ·) (finRange n) := by
41-
rw [finRange_eq_pmap_range]
42-
exact List.pairwise_lt_range.pmap (by simp) (by simp)
43-
44-
theorem pairwise_le_finRange (n : ℕ) : Pairwise (· ≤ ·) (finRange n) := by
45-
rw [finRange_eq_pmap_range]
46-
exact List.pairwise_le_range.pmap (by simp) (by simp)
47-
4829
@[simp]
4930
lemma count_finRange {n : ℕ} (a : Fin n) : count a (finRange n) = 1 := by
5031
simp [List.Nodup.count (nodup_finRange n)]
5132

52-
theorem get_finRange {n : ℕ} {i : ℕ} (h) :
53-
(finRange n).get ⟨i, h⟩ = ⟨i, length_finRange (n := n) ▸ h⟩ := by
54-
simp
33+
@[simp] theorem idxOf_finRange {k : ℕ} (i : Fin k) : (finRange k).idxOf i = i := by
34+
simpa using (nodup_finRange k).idxOf_getElem i
5535

56-
@[simp]
57-
theorem finRange_map_get (l : List α) : (finRange l.length).map l.get = l :=
58-
List.ext_get (by simp) (by simp)
36+
@[deprecated finRange_eq_nil_iff (since := "2025-11-04")]
37+
alias finRange_eq_nil := finRange_eq_nil_iff
5938

60-
@[simp]
61-
theorem finRange_map_getElem (l : List α) : (finRange l.length).map (l[·.1]) = l :=
62-
finRange_map_get l
39+
@[deprecated (since := "2025-11-04")]
40+
alias finRange_map_get := map_get_finRange
6341

64-
@[simp] theorem idxOf_finRange {k : ℕ} (i : Fin k) : (finRange k).idxOf i = i := by
65-
simpa using (nodup_finRange k).idxOf_getElem i
42+
@[deprecated (since := "2025-11-04")]
43+
alias finRange_map_getElem := map_getElem_finRange
6644

67-
@[simp]
68-
theorem map_coe_finRange (n : ℕ) : ((finRange n) : List (Fin n)).map (Fin.val) = List.range n := by
69-
apply List.ext_getElem <;> simp
45+
@[deprecated (since := "2025-11-04")]
46+
alias map_coe_finRange := map_coe_finRange_eq_range
7047

7148
@[deprecated finRange_succ (since := "2025-10-10")]
7249
theorem finRange_succ_eq_map (n : ℕ) : finRange n.succ = 0 :: (finRange n).map Fin.succ :=

Mathlib/Data/List/Sublists.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ theorem sublists'_map (f : α → β) : ∀ (l : List α),
345345
| a::l => by simp [map_cons, sublists'_cons, sublists'_map f l, Function.comp]
346346

347347
theorem sublists_perm_sublists' (l : List α) : sublists l ~ sublists' l := by
348-
rw [← finRange_map_get l, sublists_map, sublists'_map]
348+
rw [← map_get_finRange l, sublists_map, sublists'_map]
349349
apply Perm.map
350350
apply (perm_ext_iff_of_nodup _ _).mpr
351351
· simp

lake-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"type": "git",
6666
"subDir": null,
6767
"scope": "leanprover-community",
68-
"rev": "6ac53033da7f895a7d7a8597d2455b5e68e296e6",
68+
"rev": "f2aca6fc4a47c5b67fad08d3eda5e949d5b73ac0",
6969
"name": "batteries",
7070
"manifestFile": "lake-manifest.json",
7171
"inputRev": "main",

0 commit comments

Comments
 (0)