Skip to content

Commit 4e57d17

Browse files
kim-emmathlib4-botleanprover-community-mathlib4-botVierkantor
committed
chore: bump toolchain to v4.21.0-rc1 (leanprover-community#25384)
Co-authored-by: mathlib4-bot <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: Anne C.A. Baanen <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]> Co-authored-by: leanprover-community-mathlib4-bot <[email protected]>
1 parent bdc2b05 commit 4e57d17

File tree

135 files changed

+390
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+390
-509
lines changed

Archive/Examples/IfNormalization/WithoutAesop.lean

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def normalize' (l : AList (fun _ : ℕ => Bool)) :
9090
· simp_all
9191
· have := ht₃ v
9292
have := he₃ v
93-
simp_all? says simp_all only [normalized, Bool.and_eq_true, Bool.not_eq_eq_eq_not,
94-
Bool.not_true, AList.lookup_insert_eq_none, ne_eq, AList.lookup_insert]
93+
simp_all? says
94+
simp_all only [normalized, Bool.and_eq_true, Bool.not_eq_eq_eq_not, Bool.not_true,
95+
AList.lookup_insert_eq_none, ne_eq, AList.lookup_insert, reduceCtorEq, imp_false]
9596
obtain ⟨⟨⟨tn, tc⟩, tr⟩, td⟩ := ht₂
9697
split <;> rename_i h'
9798
· subst h'
@@ -101,9 +102,10 @@ def normalize' (l : AList (fun _ : ℕ => Bool)) :
101102
have := he₃ w
102103
by_cases h : w = v
103104
· subst h; simp_all
104-
· simp_all? says simp_all only [normalized, Bool.and_eq_true, Bool.not_eq_eq_eq_not,
105-
Bool.not_true, AList.lookup_insert_eq_none, ne_eq, not_false_eq_true,
106-
AList.lookup_insert_ne, implies_true]
105+
· simp_all? says
106+
simp_all only [normalized, Bool.and_eq_true, Bool.not_eq_eq_eq_not, Bool.not_true,
107+
AList.lookup_insert_eq_none, ne_eq, not_false_eq_true, AList.lookup_insert_ne,
108+
implies_true]
107109
obtain ⟨⟨⟨en, ec⟩, er⟩, ed⟩ := he₂
108110
split at b <;> rename_i h'
109111
· subst h'; simp_all

Archive/Imo/Imo2015Q6.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ theorem result (ha : Condition a) :
179179
∃ b > 0, ∃ N, ∀ m ≥ N, ∀ n > m, |∑ j ∈ Ico m n, (a j - b)| ≤ 1007 ^ 2 := by
180180
obtain ⟨b, N, hbN⟩ := exists_max_card_pool ha
181181
have bp := b_pos ha hbN
182-
use b, Int.ofNat_pos.mpr bp, N; intro m hm n hn; rw [sum_telescope ha hbN hm hn]
182+
use b, Int.natCast_pos.mpr bp, N; intro m hm n hn; rw [sum_telescope ha hbN hm hn]
183183
calc
184184
_ ≤ ∑ i ∈ range (b - 1), (2014 - i : ℤ) - ∑ i ∈ range b, (i : ℤ) :=
185185
abs_sub_le_of_le_of_le (le_sum_pool ha hbN (hm.trans hn.le))

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ theorem counted_succ_succ (p q : ℕ) :
115115
obtain ⟨hl₀, hl₁, hl₂⟩ := hl
116116
obtain hlast | hlast := hl₂ (l.head hlnil) (List.head_mem hlnil)
117117
· refine Or.inl ⟨l.tail, ⟨?_, ?_, ?_⟩, ?_⟩
118-
· rw [List.count_tail hlnil, hl₀, hlast, beq_self_eq_true, if_pos rfl, Nat.add_sub_cancel]
119-
· rw [List.count_tail hlnil, hl₁, hlast, if_neg (by decide), Nat.sub_zero]
118+
· rw [List.count_tail, hl₀, List.head?_eq_head, hlast, beq_self_eq_true, if_pos rfl,
119+
Nat.add_sub_cancel]
120+
· rw [List.count_tail, hl₁, List.head?_eq_head, hlast, if_neg (by decide), Nat.sub_zero]
120121
· exact fun x hx => hl₂ x (List.mem_of_mem_tail hx)
121122
· rw [← hlast, List.head_cons_tail]
122123
· refine Or.inr ⟨l.tail, ⟨?_, ?_, ?_⟩, ?_⟩
123-
· rw [List.count_tail hlnil, hl₀, hlast, if_neg (by decide), Nat.sub_zero]
124-
· rw [List.count_tail hlnil, hl₁, hlast, beq_self_eq_true, if_pos rfl,
124+
· rw [List.count_tail, hl₀, List.head?_eq_head, hlast, if_neg (by decide), Nat.sub_zero]
125+
· rw [List.count_tail, hl₁, List.head?_eq_head, hlast, beq_self_eq_true, if_pos rfl,
125126
Nat.add_sub_cancel]
126127
· exact fun x hx => hl₂ x (List.mem_of_mem_tail hx)
127128
· rw [← hlast, List.head_cons_tail]

Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ theorem get?_of_eq_some_of_get?_intFractPair_stream_fr_ne_zero {ifp_n : IntFract
239239
(of v).s.get? n = some ⟨1, (IntFractPair.of ifp_n.fr⁻¹).b⟩ :=
240240
have : IntFractPair.stream v (n + 1) = some (IntFractPair.of ifp_n.fr⁻¹) := by
241241
cases ifp_n
242-
simp only [IntFractPair.stream, Nat.add_eq, add_zero, stream_nth_eq, Option.some_bind,
242+
simp only [IntFractPair.stream, Nat.add_eq, add_zero, stream_nth_eq, Option.bind_some,
243243
ite_eq_right_iff]
244244
intro; contradiction
245245
get?_of_eq_some_of_succ_get?_intFractPair_stream this
@@ -253,7 +253,7 @@ theorem of_s_head_aux (v : K) : (of v).s.get? 0 = (IntFractPair.stream v 1).bind
253253
simp only [of, Stream'.Seq.map_tail, Stream'.Seq.map, Stream'.Seq.tail, Stream'.Seq.head,
254254
Stream'.Seq.get?, Stream'.map]
255255
rw [← Stream'.get_succ, Stream'.get, Option.map.eq_def]
256-
split <;> simp_all only [Option.some_bind, Option.none_bind, Function.comp_apply]
256+
split <;> simp_all only [Option.bind_some, Option.bind_none, Function.comp_apply]
257257

258258
/-- This gives the first pair of coefficients of the continued fraction of a non-integer `v`.
259259
-/

Mathlib/Algebra/Field/Rat.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance instDivisionRing : DivisionRing ℚ := inferInstance
4141

4242
protected lemma inv_nonneg {a : ℚ} (ha : 0 ≤ a) : 0 ≤ a⁻¹ := by
4343
rw [inv_def']
44-
exact divInt_nonneg (Int.ofNat_nonneg a.den) (num_nonneg.mpr ha)
44+
exact divInt_nonneg (Int.natCast_nonneg a.den) (num_nonneg.mpr ha)
4545

4646
protected lemma div_nonneg {a b : ℚ} (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b :=
4747
mul_nonneg ha (Rat.inv_nonneg hb)

Mathlib/Algebra/FreeAlgebra.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ private def liftAux (f : X → A) : FreeAlgebra R X →ₐ[R] A where
349349
rintro ⟨⟩ ⟨⟩
350350
rfl
351351
map_zero' := by
352-
dsimp
353352
change algebraMap _ _ _ = _
354353
simp
355354
map_add' := by

Mathlib/Algebra/Group/Defs.lean

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,6 @@ section
327327

328328
variable {M : Type u}
329329

330-
/-- The fundamental power operation in a monoid. `npowRec n a = a*a*...*a` n times.
331-
Use instead `a ^ n`, which has better definitional behavior. -/
332-
def npowRec [One M] [Mul M] : ℕ → M → M
333-
| 0, _ => 1
334-
| n + 1, a => npowRec n a * a
335-
336-
/-- The fundamental scalar multiplication in an additive monoid. `nsmulRec n a = a+a+...+a` n
337-
times. Use instead `n • a`, which has better definitional behavior. -/
338-
def nsmulRec [Zero M] [Add M] : ℕ → M → M
339-
| 0, _ => 0
340-
| n + 1, a => nsmulRec n a + a
341-
342330
attribute [to_additive existing] npowRec
343331

344332
variable [One M] [Semigroup M] (m n : ℕ) (hn : n ≠ 0) (a : M) (ha : 1 * a = a)
@@ -445,15 +433,15 @@ where
445433
k.binaryRec (fun y _ ↦ y) fun bn _n fn y x ↦ fn (cond bn (y * x) y) (x * x)
446434

447435
/--
448-
A variant of `npowRec` which is a semigroup homomorphisms from `ℕ₊` to `M`.
436+
A variant of `npowRec` which is a semigroup homomorphism from `ℕ₊` to `M`.
449437
-/
450438
def npowRec' {M : Type*} [One M] [Mul M] : ℕ → M → M
451439
| 0, _ => 1
452440
| 1, m => m
453441
| k + 2, m => npowRec' (k + 1) m * m
454442

455443
/--
456-
A variant of `nsmulRec` which is a semigroup homomorphisms from `ℕ₊` to `M`.
444+
A variant of `nsmulRec` which is a semigroup homomorphism from `ℕ₊` to `M`.
457445
-/
458446
def nsmulRec' {M : Type*} [Zero M] [Add M] : ℕ → M → M
459447
| 0, _ => 0

Mathlib/Algebra/Group/Fin/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance addCommMonoid (n : ℕ) [NeZero n] : AddCommMonoid (Fin n) where
4141

4242
instance instAddMonoidWithOne (n) [NeZero n] : AddMonoidWithOne (Fin n) where
4343
__ := inferInstanceAs (AddCommMonoid (Fin n))
44-
natCast i := Fin.ofNat' n i
44+
natCast i := Fin.ofNat n i
4545
natCast_zero := rfl
4646
natCast_succ _ := Fin.ext (add_mod _ _ _)
4747

Mathlib/Algebra/Homology/AlternatingConst.lean

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ def alternatingConst [HasZeroMorphisms C] : C ⥤ ChainComplex C ℕ where
3535
rintro _ _ i rfl rfl
3636
by_cases h : Even i <;> simp [Nat.even_add_one, ← Nat.not_even_iff_odd, h] }
3737
map {X Y} f := { f _ := f }
38-
map_id X := by ext; simp
39-
map_comp f g := by
40-
#adaptation_note /-- Around nightly 2025-03-25, need dsimp only -/
41-
dsimp only; ext; simp
4238

4339
variable [HasZeroMorphisms C] [HasZeroObject C]
4440

Mathlib/Algebra/Homology/Double.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ noncomputable def mkHomFromDouble : double f hi₀₁ ⟶ K where
118118
eqToHom (by rw [hk₁]) ≫ (doubleXIso₁ f hi₀₁ h).hom ≫ φ₁ ≫ eqToHom (by rw [hk₁])
119119
else 0
120120
comm' k₀ k₁ hk := by
121-
dsimp
122121
by_cases h₀ : k₀ = i₀
123122
· subst h₀
124123
rw [dif_pos rfl]

0 commit comments

Comments
 (0)