Skip to content

Commit 0c154d6

Browse files
Garmelonkim-emRob23obamathlib4-botmathlib-nightly-testing[bot]
committed
chore: bump toolchain to v4.30.0-rc1 (#37564)
Co-authored-by: Kim Morrison <kim@tqft.net> Co-authored-by: Rob23oba <robin.arnez@web.de> Co-authored-by: Kim Morrison <477956+kim-em@users.noreply.github.com> Co-authored-by: Robin Arnez <152706811+Rob23oba@users.noreply.github.com> Co-authored-by: mathlib4-bot <github-mathlib4-bot@leanprover.zulipchat.com> Co-authored-by: Joscha <joscha@plugh.de> Co-authored-by: mathlib-nightly-testing[bot] <258991302+mathlib-nightly-testing[bot]@users.noreply.github.com>
1 parent 8850ed9 commit 0c154d6

153 files changed

Lines changed: 689 additions & 492 deletions

File tree

Some content is hidden

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

Archive/Imo/Imo2024Q5.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,9 @@ lemma path1_firstMonster_of_not_edge (hN : 2 ≤ N) {m : MonsterData N} (hc₁0
778778
(hc₁N : (m (row1 hN) : ℕ) ≠ N) :
779779
(path1 hN (m (row1 hN))).firstMonster m = none ∨
780780
(path1 hN (m (row1 hN))).firstMonster m =
781-
some (⟨2, by lia⟩, ⟨(m (row1 hN) : ℕ) - 1, by lia⟩) := by
781+
some (⟨2, by lia⟩, ⟨(m (row1 hN) : ℕ) - 1, by omega⟩) := by
782782
suffices h : ∀ c ∈ (path1 hN (m (row1 hN))).cells, c ∉ m.monsterCells ∨
783-
c = (⟨2, by lia⟩, ⟨(m (row1 hN) : ℕ) - 1, by lia⟩) by
783+
c = (⟨2, by lia⟩, ⟨(m (row1 hN) : ℕ) - 1, by omega⟩) by
784784
simp only [Path.firstMonster]
785785
by_cases hn : List.find? (fun x ↦ decide (x ∈ m.monsterCells))
786786
(path1 hN (m (row1 hN))).cells = none

Cache/IO.lean

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,24 @@ def CURLBIN :=
7979
-- change file name if we ever need a more recent version to trigger re-download
8080
IO.CACHEDIR / s!"curl-{CURLVERSION}"
8181

82-
/-- leantar version at https://github.com/digama0/leangz -/
83-
def LEANTARVERSION :=
84-
"0.1.17"
85-
8682
def EXE := if System.Platform.isWindows then ".exe" else ""
8783

88-
def LEANTARBIN :=
89-
-- change file name if we ever need a more recent version to trigger re-download
90-
IO.CACHEDIR / s!"leantar-{LEANTARVERSION}{EXE}"
91-
9284
def LAKEPACKAGESDIR : FilePath :=
9385
".lake" / "packages"
9486

9587
def getCurl : IO String := do
9688
return if (← CURLBIN.pathExists) then CURLBIN.toString else "curl"
9789

98-
def getLeanTar : IO String := do
99-
return if (← LEANTARBIN.pathExists) then LEANTARBIN.toString else "leantar"
90+
/-- Path to the `leantar` binary bundled with the Lean toolchain.
91+
This has been bundled since `nightly-2026-03-09` (lean4#12822). -/
92+
private initialize leantarSysrootBin : String ← do
93+
let out ← IO.Process.output { cmd := "lean", args := #["--print-prefix"] }
94+
if out.exitCode == 0 then
95+
let path : FilePath := out.stdout.trimAscii.toString / "bin" / s!"leantar{EXE}"
96+
if ← path.pathExists then return path.toString
97+
throw <| IO.userError "leantar not found in Lean sysroot. This toolchain may predate nightly-2026-03-09."
98+
99+
def getLeanTar : IO String := return leantarSysrootBin
100100

101101
/-- Spawn a `leantar` process for decompression, writing the given JSON config to its stdin.
102102
Returns the process exit code. -/
@@ -208,7 +208,9 @@ def validateCurl : IO Bool := do
208208
match (← runCmd "curl" #["--version"]).splitOn " " with
209209
| "curl" :: v :: _ => match v.splitOn "." with
210210
| maj :: min :: _ =>
211-
let version := (maj.toNat!, min.toNat!)
211+
let some majN := String.toNat? maj | throw <| IO.userError "Invalidly formatted version of `curl`"
212+
let some minN := String.toNat? min | throw <| IO.userError "Invalidly formatted version of `curl`"
213+
let version := (majN, minN)
212214
let _ := @lexOrd
213215
let _ := @leOfOrd
214216
if version >= (7, 81) then return true
@@ -232,45 +234,6 @@ def validateCurl : IO Bool := do
232234
| _ => throw <| IO.userError "Invalidly formatted version of `curl`"
233235
| _ => throw <| IO.userError "Invalidly formatted response from `curl --version`"
234236

235-
def Version := Nat × Nat × Nat
236-
deriving Inhabited, DecidableEq
237-
238-
instance : Ord Version := let _ := @lexOrd; lexOrd
239-
instance : LE Version := leOfOrd
240-
241-
def parseVersion (s : String) : Option Version := do
242-
let [maj, min, patch] := s.splitOn "." | none
243-
some (maj.toNat!, min.toNat!, patch.toNat!)
244-
245-
def validateLeanTar : IO Unit := do
246-
if (← LEANTARBIN.pathExists) then return
247-
if let some version ← some <$> runCmd "leantar" #["--version"] <|> pure none then
248-
let "leantar" :: v :: _ := version.splitOn " "
249-
| throw <| IO.userError "Invalidly formatted response from `leantar --version`"
250-
let some v := parseVersion v | throw <| IO.userError "Invalidly formatted version of `leantar`"
251-
-- currently we need exactly one version of leantar, change this to reflect compatibility
252-
if v = (parseVersion LEANTARVERSION).get! then return
253-
let win := System.Platform.getIsWindows ()
254-
let target ← if win then
255-
pure "x86_64-pc-windows-msvc"
256-
else
257-
let mut arch ← (·.trimAscii.copy) <$> runCmd "uname" #["-m"] false
258-
if arch = "arm64" then arch := "aarch64"
259-
unless arch ∈ ["x86_64", "aarch64"] do
260-
throw <| IO.userError s!"unsupported architecture {arch}"
261-
pure <|
262-
if System.Platform.getIsOSX () then s!"{arch}-apple-darwin"
263-
else s!"{arch}-unknown-linux-musl"
264-
IO.println s!"installing leantar {LEANTARVERSION}"
265-
IO.FS.createDirAll IO.CACHEDIR
266-
let ext := if win then "zip" else "tar.gz"
267-
let _ ← runCmd "curl" (stderrAsErr := false) #[
268-
s!"https://github.com/digama0/leangz/releases/download/v{LEANTARVERSION}/leantar-v{LEANTARVERSION}-{target}.{ext}",
269-
"-L", "-o", s!"{LEANTARBIN}.{ext}"]
270-
let _ ← runCmd "tar" #["-xf", s!"{LEANTARBIN}.{ext}",
271-
"-C", IO.CACHEDIR.toString, "--strip-components=1"]
272-
IO.FS.rename (IO.CACHEDIR / s!"leantar{EXE}").toString LEANTARBIN.toString
273-
274237
/-- Recursively gets all files from a directory with a certain extension -/
275238
partial def getFilesWithExtension
276239
(fp : FilePath) (extension : String) (acc : Array FilePath := #[]) :

Cache/Main.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def main (args : List String) : IO Unit := do
113113
let hashMemo ← getHashMemo roots
114114
let hashMap := hashMemo.hashMap
115115
let goodCurl ← pure !curlArgs.contains (args.headD "") <||> validateCurl
116-
if leanTarArgs.contains (args.headD "") then validateLeanTar
117116
let get (args : List String) (force := false) (decompress := true) := do
118117
let hashMap ← if args.isEmpty then pure hashMap else hashMemo.filterByRootModules roots.keys
119118
getFiles repo? hashMap force force goodCurl decompress

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ theorem mem_adjoin_iff {s : Set A} {x : A} :
824824

825825
variable (R)
826826

827-
set_option backward.isDefEq.respectTransparency false in
828827
open scoped IsMulCommutative in
829828
/-- If all elements of `s : Set A` commute pairwise, then `adjoin R s` is a commutative
830829
ring. -/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ lemma prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
258258
| [], ys => by simp
259259
| xs, [] => by simp
260260
| x :: xs, y :: ys => by
261-
simp only [drop, length, zipWith_cons_cons, prod_cons]
261+
simp only [drop, zipWith_cons_cons, prod_cons]
262262
conv =>
263263
lhs; rw [mul_assoc]; right; rw [mul_comm, mul_assoc]; right
264264
rw [mul_comm, prod_mul_prod_eq_prod_zipWith_mul_prod_drop xs ys]

Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ theorem map'_comp {M₁ M₂ M₃ : ModuleCat.{v} R} (l₁₂ : M₁ ⟶ M₂) (
366366
induction x using TensorProduct.induction_on with
367367
| zero => rfl
368368
| tmul => rfl
369-
| add _ _ ihx ihy => grind
369+
| add _ _ ihx ihy => erw [LinearMap.map_add, LinearMap.map_add]; grind
370370

371371
end ExtendScalars
372372

Mathlib/Algebra/FiniteSupport/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ variable {β : Type*} {f : β → M} {g : α → β}
167167
lemma HasFiniteMulSupport.comp_of_injective (hg : Injective g) (hf : f.HasFiniteMulSupport) :
168168
(f ∘ g).HasFiniteMulSupport := by
169169
refine Set.Finite.of_injOn ?_ (Set.injOn_of_injective hg) hf
170-
grind [Set.mapsTo_iff_subset_preimage]
170+
grind [Set.mapsTo_iff_subset_preimage, Function.mulSupport]
171171

172172
@[to_additive (attr := fun_prop)]
173173
lemma HasFiniteMulSupport.fun_comp_of_injective (hg : Injective g) (hf : f.HasFiniteMulSupport) :

Mathlib/Algebra/Group/Ext.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ theorem CancelMonoid.toRightCancelMonoid_injective {M : Type u} :
109109
theorem CancelCommMonoid.toCommMonoid_injective {M : Type u} :
110110
Function.Injective (@CancelCommMonoid.toCommMonoid M) := by
111111
rintro @⟨@⟨@⟨⟩⟩⟩ @⟨@⟨@⟨⟩⟩⟩ h
112-
grind
112+
#adaptation_note /-- Before leanprover/lean4#13166, the last line was `grind`.
113+
The new type-directed canonicalizer tries to synthesize `Monoid M` / `CommMonoid M` to normalize
114+
sub-expressions, but fails because after `rintro` the instances exist only as destructured fields
115+
in the local context, not as registered typeclass instances. -/
116+
cases h; rfl
113117

114118
@[to_additive (attr := ext)]
115119
theorem CancelCommMonoid.ext {M : Type*} ⦃m₁ m₂ : CancelCommMonoid M⦄

Mathlib/Algebra/Homology/HomotopyCategory/MappingCocone.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ lemma δ_descCochain (n' : ℤ) (hn' : n + 1 = n') :
153153
Cochain.comp_v (n₁ := 1) _ _ _ (p + -1) p _ (by lia) hpq,
154154
Cochain.comp_v (n₂ := m + 2) _ _ _ p (p + -1) q rfl (by lia),
155155
smul_smul, Int.negOnePow_add, Int.negOnePow_even 21, rfl⟩]
156-
grind
156+
#adaptation_note /-- Before https://github.com/leanprover/lean4/pull/13166
157+
(replacing grind's canonicalizer with a type-directed normalizer), `grind` closed this goal.
158+
It is not yet clear whether this is due to defeq abuse in Mathlib or a problem in the new
159+
canonicalizer; a minimization would help. The original proof was: `grind` -/
160+
abel
157161

158162
end
159163

@@ -245,7 +249,11 @@ lemma δ_liftCochain (n' : ℤ) (hn' : n + 1 = n') :
245249
Cochain.rightShift_v _ _ _ _ _ _ _ _ (add_zero (q + -1)),
246250
Cochain.comp_v _ _ _ p q _ hpq rfl,
247251
Cochain.comp_v (n₁ := n) (n₂ := 1) _ _ _ p (q + -1) q (by lia) (by lia)]
248-
grind
252+
#adaptation_note /-- Before https://github.com/leanprover/lean4/pull/13166
253+
(replacing grind's canonicalizer with a type-directed normalizer), `grind` closed this goal.
254+
It is not yet clear whether this is due to defeq abuse in Mathlib or a problem in the new
255+
canonicalizer; a minimization would help. The original proof was: `grind` -/
256+
abel
249257

250258
end
251259

Mathlib/Algebra/Lie/CartanExists.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ lemma engel_isBot_of_isMin (hLK : finrank K L ≤ #K) (U : LieSubalgebra K L)
282282
use s \ t
283283
refine ⟨?_, ?_⟩
284284
· refine le_trans ?_ (Finset.le_card_sdiff _ _)
285-
lia
285+
omega
286286
· intro α hα
287287
simp only [Finset.mem_sdiff, Multiset.mem_toFinset, mem_roots', IsRoot.def, not_and, t] at hα
288288
exact hα.2
@@ -293,7 +293,7 @@ lemma engel_isBot_of_isMin (hLK : finrank K L ≤ #K) (U : LieSubalgebra K L)
293293
-- Which follows from our assumptions `i < r` and `r ≤ s.card`
294294
-- and the fact that the degree of `coeff χ i` is less than or equal to `r - i`.
295295
apply lt_of_le_of_lt (lieCharpoly_coeff_natDegree _ _ _ _ i (r - i) _)
296-
· lia
296+
· omega
297297
· dsimp only [r] at hi ⊢
298298
rw [Nat.add_sub_cancel' hi.le]
299299
-- We need to show that for all `α ∈ s`, the polynomial `coeff χ i` evaluates to zero at `α`.

0 commit comments

Comments
 (0)