Skip to content

Commit d81357c

Browse files
Update lean-toolchain for leanprover/lean4#10524
2 parents 6285336 + e7ff8fe commit d81357c

File tree

1,042 files changed

+15799
-7816
lines changed

Some content is hidden

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

1,042 files changed

+15799
-7816
lines changed

.github/build.in.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,12 @@ jobs:
625625
run: |
626626
lake build Batteries Qq Aesop ProofWidgets Plausible
627627
628+
- name: build AesopTest (nightly-testing only)
629+
# Only run on the mathlib4-nightly-testing repository
630+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
631+
run: |
632+
lake build AesopTest
633+
628634
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
629635
# Instead we run it in a cron job on master: see `lean4checker.yml`.
630636
# Output is posted to the zulip topic

.github/workflows/bors.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ jobs:
635635
run: |
636636
lake build Batteries Qq Aesop ProofWidgets Plausible
637637
638+
- name: build AesopTest (nightly-testing only)
639+
# Only run on the mathlib4-nightly-testing repository
640+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
641+
run: |
642+
lake build AesopTest
643+
638644
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
639645
# Instead we run it in a cron job on master: see `lean4checker.yml`.
640646
# Output is posted to the zulip topic

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,12 @@ jobs:
642642
run: |
643643
lake build Batteries Qq Aesop ProofWidgets Plausible
644644
645+
- name: build AesopTest (nightly-testing only)
646+
# Only run on the mathlib4-nightly-testing repository
647+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
648+
run: |
649+
lake build AesopTest
650+
645651
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
646652
# Instead we run it in a cron job on master: see `lean4checker.yml`.
647653
# Output is posted to the zulip topic

.github/workflows/build_fork.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,12 @@ jobs:
639639
run: |
640640
lake build Batteries Qq Aesop ProofWidgets Plausible
641641
642+
- name: build AesopTest (nightly-testing only)
643+
# Only run on the mathlib4-nightly-testing repository
644+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
645+
run: |
646+
lake build AesopTest
647+
642648
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
643649
# Instead we run it in a cron job on master: see `lean4checker.yml`.
644650
# Output is posted to the zulip topic

Archive/Imo/Imo1962Q4.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kevin Lacker, Heather Macbeth
55
-/
66
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
7-
import Mathlib.Tactic.Polyrith
87

98
/-!
109
# IMO 1962 Q4

Archive/Imo/Imo2006Q3.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Tian Chen
55
-/
66
import Mathlib.Analysis.SpecialFunctions.Sqrt
7-
import Mathlib.Tactic.Polyrith
87

98
/-!
109
# IMO 2006 Q3

Archive/Imo/Imo2024Q5.lean

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ structure Path (N : ℕ) where
7373
nonempty : cells ≠ []
7474
head_first_row : (cells.head nonempty).1 = 0
7575
last_last_row : (cells.getLast nonempty).1 = Fin.last (N + 1)
76-
valid_move_seq : cells.Chain' Adjacent
76+
valid_move_seq : cells.IsChain Adjacent
7777

7878
/-- The first monster on a path, or `none`. -/
7979
noncomputable def Path.firstMonster (p : Path N) (m : MonsterData N) : Option (Cell N) :=
@@ -197,7 +197,7 @@ lemma Path.exists_mem_fst_eq (p : Path N) (r : Fin (N + 2)) : ∃ c ∈ p.cells,
197197
have hi' : i - 1 < i := by omega
198198
exact of_decide_eq_false (List.not_of_lt_findIdx hi') this
199199
have ha : Adjacent p.cells[i - 1] p.cells[i] := by
200-
convert List.chain'_iff_get.1 p.valid_move_seq (i - 1) ?_
200+
convert List.isChain_iff_get.1 p.valid_move_seq (i - 1) ?_
201201
· simp [Nat.sub_add_cancel hi]
202202
· omega
203203
exact ha.le_of_lt h
@@ -223,7 +223,7 @@ lemma Path.findFstEq_fst (p : Path N) (r : Fin (N + 2)) : (p.findFstEq r).1 = r
223223
simpa using h
224224

225225
lemma find?_eq_eq_find?_le {l : List (Cell N)} {r : Fin (N + 2)} (hne : l ≠ [])
226-
(hf : (l.head hne).1 ≤ r) (ha : l.Chain' Adjacent) :
226+
(hf : (l.head hne).1 ≤ r) (ha : l.IsChain Adjacent) :
227227
l.find? (fun c ↦ c.1 = r) = l.find? (fun c ↦ r ≤ c.1) := by
228228
induction l
229229
case nil => simp at hne
@@ -234,7 +234,7 @@ lemma find?_eq_eq_find?_le {l : List (Cell N)} {r : Fin (N + 2)} (hne : l ≠ []
234234
simp only [h, decide_false, Bool.false_eq_true, not_false_eq_true, List.find?_cons_of_neg, h']
235235
rcases tail with ⟨⟩ | ⟨htail, ttail⟩
236236
· simp
237-
· simp only [List.chain'_cons_cons] at ha
237+
· simp only [List.isChain_cons_cons] at ha
238238
rcases ha with ⟨ha1, ha2⟩
239239
simp only [List.head_cons] at hf
240240
simp only [ne_eq, reduceCtorEq, not_false_eq_true, List.head_cons, ha2, true_implies] at hi
@@ -292,7 +292,7 @@ def Path.tail (p : Path N) : Path N where
292292
· exact p.last_last_row
293293
valid_move_seq := by
294294
split_ifs
295-
· exact List.Chain'.tail p.valid_move_seq
295+
· exact List.IsChain.tail p.valid_move_seq
296296
· exact p.valid_move_seq
297297

298298
lemma Path.tail_induction {motive : Path N → Prop} (ind : ∀ p, motive p.tail → motive p)
@@ -338,7 +338,8 @@ lemma Path.firstMonster_eq_of_findFstEq_mem {p : Path N} {m : MonsterData N}
338338
induction p using Path.tail_induction
339339
case base p h0 =>
340340
have hl := p.one_lt_length_cells
341-
have adj : Adjacent p.cells[0] p.cells[1] := List.chain'_iff_get.1 p.valid_move_seq 0 (by omega)
341+
have adj : Adjacent p.cells[0] p.cells[1] :=
342+
List.isChain_iff_get.1 p.valid_move_seq 0 (by omega)
342343
simp_rw [Adjacent, Nat.dist] at adj
343344
have hc0 : (p.cells[0].1 : ℕ) = 0 := by
344345
convert Fin.ext_iff.1 p.head_first_row
@@ -384,7 +385,7 @@ lemma Path.findFstEq_fst_sub_one_mem (p : Path N) {r : Fin (N + 2)} (hr : r ≠
384385
simp [List.getElem_zero, head_first_row, hr] at h
385386
simp_rw [cells.find?_eq_head_dropWhile_not hd, Option.get_some]
386387
rw [← cells.takeWhile_append_dropWhile (p := fun c ↦ ! decide (r ≤ c.1)),
387-
List.chain'_append] at valid_move_seq
388+
List.isChain_append] at valid_move_seq
388389
have ha := valid_move_seq.2.2
389390
simp only [List.head?_eq_head hd', List.getLast?_eq_getLast ht, Option.mem_def,
390391
Option.some.injEq, forall_eq'] at ha
@@ -421,7 +422,7 @@ def Path.ofFn {m : ℕ} (f : Fin m → Cell N) (hm : m ≠ 0)
421422
last_last_row := by
422423
simp [Fin.last, List.getLast_ofFn, hl]
423424
valid_move_seq := by
424-
rwa [List.chain'_ofFn]
425+
rwa [List.isChain_ofFn]
425426

426427
lemma Path.ofFn_cells {m : ℕ} (f : Fin m → Cell N) (hm : m ≠ 0)
427428
(hf : (f ⟨0, Nat.pos_of_ne_zero hm⟩).1 = 0)
@@ -446,7 +447,7 @@ def Path.reflect (p : Path N) : Path N where
446447
rw [List.getLast_map]
447448
exact p.last_last_row
448449
valid_move_seq := by
449-
refine List.chain'_map_of_chain' _ ?_ p.valid_move_seq
450+
refine List.isChain_map_of_isChain _ ?_ p.valid_move_seq
450451
intro x y h
451452
simp_rw [Adjacent, Nat.dist, Cell.reflect, Fin.rev] at h ⊢
452453
omega

Cache/IO.lean

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def CURLBIN :=
7070

7171
/-- leantar version at https://github.com/digama0/leangz -/
7272
def LEANTARVERSION :=
73-
"0.1.15"
73+
"0.1.16-pre2"
7474

7575
def EXE := if System.Platform.isWindows then ".exe" else ""
7676

@@ -317,6 +317,11 @@ def mkBuildPaths (mod : Name) : CacheM <| List (FilePath × Bool) := do
317317
(packageDir / LIBDIR / path.withExtension "ilean.hash", true),
318318
(packageDir / IRDIR / path.withExtension "c", true),
319319
(packageDir / IRDIR / path.withExtension "c.hash", true),
320+
-- this is needed for packages using the module system:
321+
(packageDir / LIBDIR / path.withExtension "olean.private", false),
322+
(packageDir / LIBDIR / path.withExtension "olean.private.hash", false),
323+
(packageDir / LIBDIR / path.withExtension "olean.server", false),
324+
(packageDir / LIBDIR / path.withExtension "olean.server.hash", false),
320325
(packageDir / LIBDIR / path.withExtension "extra", false)]
321326

322327
/-- Check that all required build files exist. -/

Cache/Requests.lean

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,23 +440,41 @@ def getProofWidgets (buildDir : FilePath) : IO Unit := do
440440
-- Check if the ProofWidgets build is out-of-date via `lake`.
441441
-- This is done through Lake as cache has no simple heuristic
442442
-- to determine whether the ProofWidgets JS is out-of-date.
443-
let exitCode ← (← IO.Process.spawn {cmd := "lake", args := #["-q", "build", "--no-build", "proofwidgets:release"]}).wait
444-
if exitCode == 0 then -- up-to-date
443+
let out ← IO.Process.output
444+
{cmd := "lake", args := #["-v", "build", "--no-build", "proofwidgets:release"]}
445+
if out.exitCode == 0 then -- up-to-date
445446
return
446-
else if exitCode == 3 then -- needs fetch (`--no-build` triggered)
447+
else if out.exitCode == 3 then -- needs fetch (`--no-build` triggered)
447448
pure ()
448449
else
449-
throw <| IO.userError s!"Failed to validate ProofWidgets cloud release: lake failed with error code {exitCode}"
450+
printLakeOutput out
451+
throw <| IO.userError s!"Failed to validate ProofWidgets cloud release: \
452+
lake failed with error code {out.exitCode}"
450453
-- Download and unpack the ProofWidgets cloud release (for its `.js` files)
451-
let exitCode ← (← IO.Process.spawn {cmd := "lake", args := #["-q", "build", "proofwidgets:release"]}).wait
452-
if exitCode != 0 then
453-
throw <| IO.userError s!"Failed to fetch ProofWidgets cloud release: lake failed with error code {exitCode}"
454+
IO.print "Fetching ProofWidgets cloud release..."
455+
let out ← IO.Process.output
456+
{cmd := "lake", args := #["-v", "build", "proofwidgets:release"]}
457+
if out.exitCode == 0 then
458+
IO.println " done!"
459+
else
460+
IO.print "\n"
461+
printLakeOutput out
462+
throw <| IO.userError s!"Failed to fetch ProofWidgets cloud release: \
463+
lake failed with error code {out.exitCode}"
454464
-- Prune non-JS ProofWidgets files (e.g., `olean`, `.c`)
455465
try
456466
IO.FS.removeDirAll (buildDir / "lib")
457467
IO.FS.removeDirAll (buildDir / "ir")
458468
catch e =>
459469
throw <| IO.userError s!"Failed to prune ProofWidgets cloud release: {e}"
470+
where
471+
printLakeOutput out := do
472+
unless out.stdout.isEmpty do
473+
IO.eprintln "lake stdout:"
474+
IO.eprint out.stderr
475+
unless out.stderr.isEmpty do
476+
IO.eprintln "lake stderr:"
477+
IO.eprint out.stderr
460478

461479
/-- Downloads missing files, and unpacks files. -/
462480
def getFiles

0 commit comments

Comments
 (0)