Skip to content

Commit 6f9fba5

Browse files
leanprover-community-mathlib4-botJovanGerbjcommelingithub-actionskim-em
authored
chore: adaptations for nightly-2025-06-17 (#26043)
* revert change in `Mathlib.Data.ZMOD.Basic` * fix Mathlib/Data/List/EditDistance/Estimator.lean * give specialized simp lemmas higher prio * simp can prove these * simp can prove these * chore: bump to nightly-2025-06-04 * bump toolchain * Adapt eqns * Revert "Adapt eqns" This reverts commit 34f1f7f. * Simply remove check for now * fix a bunch * fixes? * chore: adaptations for nightly-2025-06-04 * add `simp low` lemma `injOn_of_eq_iff_eq` * wip * wip * wip * fix * Trigger CI for leanprover-community/batteries#1220 * Merge master into nightly-testing * chore: bump to nightly-2025-06-05 * Kick CI * Bump lean4-cli * Bump import-graph * Kick CI * update lakefile * chore: use more robust syntax quotation in Shake * Trigger CI for leanprover/lean4#8419 * Revert "chore: use more robust syntax quotation in Shake" This reverts commit cd87328. * fix(Shake): fix import syntax @Kha this is deliberately using this approach because syntax quotations are also not robust but for a different reason: they fail to parse the new versions of the syntax (and do so at run time). And using all the optional doohickeys will not be future proof. The current setup is explicitly meant to ping me when there is a syntax change so I can evaluate the right way to handle it. In this case we want all the module options to be ignored (treated the same as a regular import for the purpose of dependency tracking), we don't want to fail. * cleanup lakefile * chore: bump to nightly-2025-06-06 * Update lean-toolchain for testing leanprover/lean4#8653 * fix * how did this get dropped?!?! * chore: bump to nightly-2025-06-07 * chore: bump to nightly-2025-06-08 * chore: bump to nightly-2025-06-09 * fix lakefile * fix lint-style for new Lean.Options API * chore: bump to nightly-2025-06-10 * chore: bump to nightly-2025-06-09 * merge lean-pr-testing-4 * chore: bump to nightly-2025-06-11 * chore: adaptations for nightly-2025-06-11 * Update Shake/Main.lean Co-authored-by: Johan Commelin <[email protected]> * Apply suggestions from code review * revert * chore: adaptations for nightly-2025-06-11 * cleanup grind tests * chore: bump to nightly-2025-06-12 * merge lean-pr-testing-8419 * chore: bump to nightly-2025-06-12 * merge lean-pr-testing-8653 * adaptation note * oops * chore: adaptations for nightly-2025-06-12 * remove nolint simpNF * remove spurious file * Update lean-toolchain for testing leanprover/lean4#8751 * fix * chore: bump to nightly-2025-06-13 * Merge master into nightly-testing * fix * remove upstreamed * drop no-op `show` * chore: bump to nightly-2025-06-14 * chore: bump to nightly-2025-06-15 * intentionally left blank * fix tests * chore: bump to nightly-2025-06-16 * fix upstream * fix * fix * fixes * chore: adaptations for nightly-2025-06-16 * chore: bump to nightly-2025-06-17 * fixes * more fixes * fixes! * more fixes! * hmm * chore: adaptations for nightly-2025-06-17 --------- Co-authored-by: Jovan Gerbscheid <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Johan Commelin <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Kim Morrison <[email protected]> Co-authored-by: Joachim Breitner <[email protected]> Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: Sebastian Ullrich <[email protected]> Co-authored-by: Mario Carneiro <[email protected]> Co-authored-by: sgouezel <[email protected]> Co-authored-by: Kyle Miller <[email protected]> Co-authored-by: Rob23oba <[email protected]>
1 parent ab9976d commit 6f9fba5

File tree

11 files changed

+26
-23
lines changed

11 files changed

+26
-23
lines changed

Mathlib/Algebra/BigOperators/Group/List/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,15 +487,15 @@ lemma take_sum_flatten (L : List (List α)) (i : ℕ) :
487487
L.flatten.take ((L.map length).take i).sum = (L.take i).flatten := by
488488
induction L generalizing i
489489
· simp
490-
· cases i <;> simp [take_append, *]
490+
· cases i <;> simp [take_length_add_append, *]
491491

492492
/-- In a flatten, dropping all the elements up to an index which is the sum of the lengths of the
493493
first `i` sublists, is the same as taking the join after dropping the first `i` sublists. -/
494494
lemma drop_sum_flatten (L : List (List α)) (i : ℕ) :
495495
L.flatten.drop ((L.map length).take i).sum = (L.drop i).flatten := by
496496
induction L generalizing i
497497
· simp
498-
· cases i <;> simp [take_append, *]
498+
· cases i <;> simp [take_length_add_append, *]
499499

500500
@[deprecated (since := "2024-10-25")] alias take_sum_join' := take_sum_flatten
501501
@[deprecated (since := "2024-10-25")] alias drop_sum_join' := drop_sum_flatten

Mathlib/Combinatorics/Enumerative/DyckWord.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ instance : Coe DyckWord (List DyckStep) := ⟨DyckWord.toList⟩
7171
instance : Add DyckWord where
7272
add p q := ⟨p ++ q, by
7373
simp only [count_append, p.count_U_eq_count_D, q.count_U_eq_count_D], by
74-
simp only [take_append_eq_append_take, count_append]
74+
simp only [take_append, count_append]
7575
exact fun _ ↦ add_le_add (p.count_D_le_count_U _) (q.count_D_le_count_U _)⟩
7676

7777
instance : Zero DyckWord := ⟨[], by simp, by simp⟩
@@ -160,7 +160,7 @@ def nest : DyckWord where
160160
toList := [U] ++ p ++ [D]
161161
count_U_eq_count_D := by simp [p.count_U_eq_count_D]
162162
count_D_le_count_U i := by
163-
simp only [take_append_eq_append_take, count_append]
163+
simp only [take_append, count_append]
164164
rw [← add_rotate (count D _), ← add_rotate (count U _)]
165165
apply add_le_add _ (p.count_D_le_count_U _)
166166
rcases i.eq_zero_or_pos with hi | hi; · simp [hi]
@@ -180,7 +180,7 @@ def IsNested : Prop :=
180180
protected lemma IsNested.nest : p.nest.IsNested := ⟨nest_ne_zero, fun i lb ub ↦ by
181181
simp_rw [nest, length_append, length_singleton] at ub ⊢
182182
rw [take_append_of_le_length (by rw [singleton_append, length_cons]; omega),
183-
take_append_eq_append_take, take_of_length_le (by rw [length_singleton]; omega),
183+
take_append, take_of_length_le (by rw [length_singleton]; omega),
184184
length_singleton, singleton_append, count_cons_of_ne (by simp), count_cons_self,
185185
Nat.lt_add_one_iff]
186186
exact p.count_D_le_count_U _⟩
@@ -293,10 +293,10 @@ lemma firstReturn_add : (p + q).firstReturn = if p = 0 then q.firstReturn else p
293293
· simp_rw [u, decide_eq_true_eq, getElem_range]
294294
have v := firstReturn_lt_length h
295295
constructor
296-
· rw [take_append_eq_append_take, show p.firstReturn + 1 - p.toList.length = 0 by omega,
296+
· rw [take_append, show p.firstReturn + 1 - p.toList.length = 0 by omega,
297297
take_zero, append_nil, count_take_firstReturn_add_one h]
298298
· intro j hj
299-
rw [take_append_eq_append_take, show j + 1 - p.toList.length = 0 by omega,
299+
rw [take_append, show j + 1 - p.toList.length = 0 by omega,
300300
take_zero, append_nil]
301301
simpa using (count_D_lt_count_U_of_lt_firstReturn hj).ne'
302302
· rw [length_range, u, length_append]
@@ -311,7 +311,7 @@ lemma firstReturn_nest : p.nest.firstReturn = p.toList.length + 1 := by
311311
· rw [take_of_length_le (by simp), ← u, p.nest.count_U_eq_count_D]
312312
· intro j hj
313313
simp_rw [cons_append, take_succ_cons, count_cons, beq_self_eq_true, ite_true,
314-
beq_iff_eq, reduceCtorEq, ite_false, take_append_eq_append_take,
314+
beq_iff_eq, reduceCtorEq, ite_false, take_append,
315315
show j - p.toList.length = 0 by omega, take_zero, append_nil]
316316
have := p.count_D_le_count_U j
317317
simp only [add_zero, decide_eq_false_iff_not, ne_eq]

Mathlib/Data/List/DropRight.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ theorem rdrop_eq_reverse_drop_reverse : l.rdrop n = reverse (l.reverse.drop n) :
5353
induction' l using List.reverseRecOn with xs x IH generalizing n
5454
· simp
5555
· cases n
56-
· simp [take_append]
57-
· simp [take_append_eq_append_take, IH]
56+
· simp [take_length_add_append]
57+
· simp [take_append, IH]
5858

5959
@[simp]
6060
theorem rdrop_concat_succ (x : α) : rdrop (l ++ [x]) (n + 1) = rdrop l n := by
@@ -76,7 +76,7 @@ theorem rtake_eq_reverse_take_reverse : l.rtake n = reverse (l.reverse.take n) :
7676
· simp
7777
· cases n
7878
· exact drop_length
79-
· simp [drop_append_eq_append_drop, IH]
79+
· simp [drop_append, IH]
8080

8181
@[simp]
8282
theorem rtake_concat_succ (x : α) : rtake (l ++ [x]) (n + 1) = rtake l n ++ [x] := by

Mathlib/Data/List/InsertIdx.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variable {a : α}
2929

3030
@[simp]
3131
theorem sublist_insertIdx (l : List α) (n : ℕ) (a : α) : l <+ (l.insertIdx n a) := by
32-
simpa only [eraseIdx_insertIdx] using eraseIdx_sublist (l.insertIdx n a) n
32+
simpa only [eraseIdx_insertIdx_self] using eraseIdx_sublist (l.insertIdx n a) n
3333

3434
@[simp]
3535
theorem subset_insertIdx (l : List α) (n : ℕ) (a : α) : l ⊆ l.insertIdx n a :=
@@ -40,7 +40,7 @@ is the same as setting `n`th element to `a`.
4040
4141
We assume that `n ≠ length l`, because otherwise LHS equals `l ++ [a]` while RHS equals `l`. -/
4242
@[simp]
43-
theorem insertIdx_eraseIdx {l : List α} {n : ℕ} (hn : n ≠ length l) (a : α) :
43+
theorem insertIdx_eraseIdx_self {l : List α} {n : ℕ} (hn : n ≠ length l) (a : α) :
4444
(l.eraseIdx n).insertIdx n a = l.set n a := by
4545
induction n generalizing l <;> cases l <;> simp_all
4646

Mathlib/Data/List/Perm/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ theorem Perm.subset_congr_right {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l
4444

4545
theorem set_perm_cons_eraseIdx {n : ℕ} (h : n < l.length) (a : α) :
4646
l.set n a ~ a :: l.eraseIdx n := by
47-
rw [← insertIdx_eraseIdx h.ne]
47+
rw [← insertIdx_eraseIdx_self h.ne]
4848
apply perm_insertIdx
4949
rw [length_eraseIdx_of_lt h]
5050
exact Nat.le_sub_one_of_lt h

Mathlib/Data/List/TakeDrop.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ theorem take_one_drop_eq_of_lt_length {l : List α} {n : ℕ} (h : n < l.length)
4444

4545
@[simp] lemma take_eq_left_iff {x y : List α} {n : ℕ} :
4646
(x ++ y).take n = x.take n ↔ y = [] ∨ n ≤ x.length := by
47-
simp [take_append_eq_append_take, Nat.sub_eq_zero_iff_le, Or.comm]
47+
simp [take_append, Nat.sub_eq_zero_iff_le, Or.comm]
4848

4949
@[simp] lemma left_eq_take_iff {x y : List α} {n : ℕ} :
5050
x.take n = (x ++ y).take n ↔ y = [] ∨ n ≤ x.length := by

Mathlib/Data/Vector/Basic.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,12 @@ theorem insertIdx_val {i : Fin (n + 1)} {v : Vector α n} :
534534
theorem eraseIdx_val {i : Fin n} : ∀ {v : Vector α n}, (eraseIdx i v).val = v.val.eraseIdx i
535535
| _ => rfl
536536

537-
theorem eraseIdx_insertIdx {v : Vector α n} {i : Fin (n + 1)} :
537+
theorem eraseIdx_insertIdx_self {v : Vector α n} {i : Fin (n + 1)} :
538538
eraseIdx i (insertIdx a i v) = v :=
539-
Subtype.eq (List.eraseIdx_insertIdx ..)
539+
Subtype.eq (List.eraseIdx_insertIdx_self ..)
540+
541+
@[deprecated (since := "2025-06-17")]
542+
alias eraseIdx_insertIdx := eraseIdx_insertIdx_self
540543

541544
/-- Erasing an element after inserting an element, at different indices. -/
542545
theorem eraseIdx_insertIdx' {v : Vector α (n + 1)} :

Mathlib/GroupTheory/Coxeter/Inversion.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ theorem IsReduced.nodup_rightInvSeq {ω : List B} (rω : cs.IsReduced ω) : List
421421
have h₃ : t' = (ris ω).getD j' 1 := by
422422
rw [h₂, cs.getD_rightInvSeq, cs.getD_rightInvSeq,
423423
(Nat.sub_add_cancel (by omega) : j' - 1 + 1 = j'), eraseIdx_eq_take_drop_succ,
424-
drop_append_eq_append_drop, drop_of_length_le (by simp [j_lt_j'.le]), length_take,
425-
drop_drop, nil_append, min_eq_left_of_lt (j_lt_j'.trans j'_lt_length), Nat.add_comm,
424+
drop_append, drop_of_length_le (by simp [j_lt_j'.le]), length_take, drop_drop,
425+
nil_append, min_eq_left_of_lt (j_lt_j'.trans j'_lt_length), Nat.add_comm,
426426
← add_assoc, Nat.sub_add_cancel (by omega), mul_left_inj, mul_right_inj]
427427
congr 2
428428
show (List.take j ω ++ List.drop (j + 1) ω)[j' - 1]? = ω[j']?

Mathlib/ModelTheory/Encoding.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ theorem listDecode_encode_list (l : List (Σ n, L.BoundedFormula α n)) :
256256
· obtain ⟨h1, h2⟩ := Option.eq_some_iff_get_eq.1 (h i)
257257
rw [cast_eq_iff_heq]
258258
exact (Sigma.ext_iff.1 ((Sigma.eta (Option.get _ h1)).trans h2)).2
259-
rw [List.drop_append_eq_append_drop, length_map, length_finRange, Nat.sub_self, drop,
260-
drop_eq_nil_of_le, nil_append]
259+
rw [List.drop_append, length_map, length_finRange, Nat.sub_self, drop, drop_eq_nil_of_le,
260+
nil_append]
261261
rw [length_map, length_finRange]
262262
| imp _ _ ih1 ih2 =>
263263
intro l

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": "535804a65d81e5dee7319be86c548ac649e8c047",
68+
"rev": "481cbb4065fba7ba938c217c41f1a28b55207e2f",
6969
"name": "batteries",
7070
"manifestFile": "lake-manifest.json",
7171
"inputRev": "nightly-testing",

0 commit comments

Comments
 (0)