Skip to content

Commit dfe7147

Browse files
Merge branch 'exteriorPower-basis' of https://github.com/morrison-daniel/mathlib4 into exteriorPower-basis
2 parents a3ec737 + 550c0f3 commit dfe7147

264 files changed

Lines changed: 2988 additions & 664 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.

.github/workflows/commit_verification.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ permissions:
2222

2323
env:
2424
TRANSIENT_PREFIX: "transient: "
25-
AUTO_PREFIX: "x: "
25+
# Support both "x " and "x: " (legacy) prefixes
26+
AUTO_PREFIX_COLON: "x: "
27+
AUTO_PREFIX_SPACE: "x "
2628

2729
jobs:
2830
verify:
@@ -46,8 +48,9 @@ jobs:
4648
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
4749
4850
# Check if any commits have transient or auto prefix
51+
# Auto prefix can be "x " or "x: " (legacy)
4952
HAS_SPECIAL=$(git log --format="%s" "$BASE_SHA..$HEAD_SHA" | \
50-
grep -E "^(${TRANSIENT_PREFIX}|${AUTO_PREFIX})" || true)
53+
grep -E "^(${TRANSIENT_PREFIX}|${AUTO_PREFIX_COLON}|${AUTO_PREFIX_SPACE})" || true)
5154
5255
if [[ -n "$HAS_SPECIAL" ]]; then
5356
echo "has_special=true" >> "$GITHUB_OUTPUT"

.github/workflows/nightly_bump_and_merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ jobs:
230230
}
231231
232232
# Find tags that are ancestors of this branch with the right format
233-
LATEST_TAG=$(git tag --merged HEAD | grep "nightly-testing-[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}" | sort -r | head -n 1)
233+
LATEST_TAG=$(git tag --merged HEAD | grep "nightly-testing-[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\(-rev[0-9]\+\)\?" | sort -rV | head -n 1)
234234
echo "Latest tag found for $BRANCH: ${LATEST_TAG:-none}"
235235
236236
# Return to nightly-testing branch

.github/workflows/nightly_detect_failure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ jobs:
274274
core.setOutput('toolchain_content', content);
275275
core.setOutput('branch_name', branchName);
276276
277-
const match = content.match(/leanprover\/lean4:nightly-(\d{4}-\d{2}-\d{2})/);
277+
const match = content.match(/leanprover\/lean4:nightly-(\d{4}-\d{2}-\d{2}(?:-rev\d+)?)/);
278278
if (!match) {
279279
core.setFailed('Toolchain pattern did not match');
280280
return null;
@@ -292,7 +292,7 @@ jobs:
292292
type: 'stream'
293293
topic: 'Mathlib status updates'
294294
content: |
295-
⚠️ Warning: The lean-toolchain file in bump branch `${{ steps.bump_version.outputs.branch_name }}` does not match the expected pattern 'leanprover/lean4:nightly-YYYY-MM-DD'.
295+
⚠️ Warning: The lean-toolchain file in bump branch `${{ steps.bump_version.outputs.branch_name }}` does not match the expected pattern 'leanprover/lean4:nightly-YYYY-MM-DD(-revK)'.
296296
297297
**Branch:** `${{ steps.bump_version.outputs.branch_name }}`
298298
**File URL:** https://github.com/${{ github.repository }}/blob/${{ steps.bump_version.outputs.branch_sha }}/lean-toolchain
@@ -418,7 +418,7 @@ jobs:
418418
if last_bot_message:
419419
last_content = last_bot_message['content']
420420
# Extract nightly date and bump branch from last bot message
421-
date_match = re.search(r'bump/nightly-(\d{4}-\d{2}-\d{2})', last_content)
421+
date_match = re.search(r'bump/nightly-(\d{4}-\d{2}-\d{2}(?:-rev\d+)?)', last_content)
422422
branch_match = re.search(r'PR that to (bump/v[\d.]+)', last_content)
423423
if date_match and branch_match:
424424
last_date = date_match.group(1)

.github/workflows/nolints.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
- name: Create Pull Request
3737
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
3838
with:
39+
# this needs to be set, otherwise the last person who edited the `cron` line may get tagged
40+
author: "mathlib-nolints[bot] <258989889+mathlib-nolints[bot]@users.noreply.github.com>"
3941
token: ${{ steps.app-token.outputs.token }}
4042
commit-message: "chore(scripts): update nolints.json"
4143
branch: "nolints"
@@ -44,5 +46,7 @@ jobs:
4446
body: |
4547
I am happy to remove some nolints for you!
4648
49+
---
50+
4751
[workflow run for this PR](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
4852
labels: "auto-merge-after-CI"

.github/workflows/remove_deprecated_decls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ jobs:
218218
if: ${{ steps.process_dates.outputs.from_date && toJson(inputs.dry_run) != 'true' && steps.find-pr.outputs.pr_found != 'true' }}
219219
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
220220
with:
221+
# this needs to be set, otherwise the last person who edited the `cron` line may get tagged
222+
author: "mathlib-nolints[bot] <258989889+mathlib-nolints[bot]@users.noreply.github.com>"
221223
token: ${{ steps.app-token.outputs.token }}
222224
commit-message: "chore: remove declarations deprecated between ${{ steps.process_dates.outputs.from_date }} and ${{ steps.process_dates.outputs.to_date }}"
223225
branch: ${{ env.BRANCH_NAME }}

.github/workflows/update_dependencies.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ jobs:
124124
if: ${{ steps.pr-title.outcome == 'success' }}
125125
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
126126
with:
127+
# this needs to be set, otherwise the last person who edited the `cron` line may get tagged
128+
author: "mathlib-update-dependencies[bot] <258990618+mathlib-update-dependencies[bot]@users.noreply.github.com>"
127129
token: ${{ steps.app-token.outputs.token }}
128130
commit-message: "chore: update Mathlib dependencies ${{ env.timestamp }}"
129131
# this branch is referenced in update_dependencies_zulip.yml

Cache/Requests.lean

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -374,39 +374,38 @@ def monitorCurl (args : Array String) (size : Nat)
374374
return s
375375

376376
/-- Call `curl` to download files from the server to `CACHEDIR` (`.cache`).
377-
Exit the process with exit code 1 if any files failed to download. -/
377+
Return the number of files which failed to download. -/
378378
def downloadFiles
379379
(repo : String) (hashMap : IO.ModuleHashMap)
380-
(forceDownload : Bool) (parallel : Bool) (warnOnMissing : Bool): IO Unit := do
380+
(forceDownload : Bool) (parallel : Bool) (warnOnMissing : Bool): IO Nat := do
381381
let hashMap ← if forceDownload then pure hashMap else hashMap.filterExists false
382+
if hashMap.isEmpty then IO.println "No files to download"; return 0
382383
let size := hashMap.size
383-
if size > 0 then
384-
IO.FS.createDirAll IO.CACHEDIR
385-
IO.println s!"Attempting to download {size} file(s) from {repo} cache"
386-
let failed ← if parallel then
387-
IO.FS.writeFile IO.CURLCFG (← mkGetConfigContent repo hashMap)
388-
let args := #["--request", "GET", "--parallel",
389-
-- commented as this creates a big slowdown on curl 8.13.0: "--fail",
390-
"--silent",
391-
"--retry", "5", -- there seem to be some intermittent failures
392-
"--write-out", "%{json}\n", "--config", IO.CURLCFG.toString]
393-
let {success, failed, done, ..} ←
394-
monitorCurl args size "Downloaded" "speed_download" (removeOnError := true)
395-
IO.FS.removeFile IO.CURLCFG
396-
if warnOnMissing && success + failed < done then
397-
IO.eprintln "Warning: some files were not found in the cache."
398-
IO.eprintln "This usually means that your local checkout of mathlib4 has diverged from upstream."
399-
IO.eprintln "If you push your commits to a branch of the mathlib4 repository, CI will build the oleans and they will be available later."
400-
IO.eprintln "Alternatively, if you already have pushed your commits to a branch, this may mean the CI build has failed part-way through building."
401-
pure failed
402-
else
403-
let r ← hashMap.foldM (init := []) fun acc _ hash => do
404-
pure <| (← IO.asTask do downloadFile repo hash) :: acc
405-
pure <| r.foldl (init := 0) fun f t => if let .ok true := t.get then f else f + 1
406-
if failed > 0 then
407-
IO.println s!"{failed} download(s) failed"
408-
IO.Process.exit 1
409-
else IO.println "No files to download"
384+
IO.FS.createDirAll IO.CACHEDIR
385+
IO.println s!"Attempting to download {size} file(s) from {repo} cache"
386+
let failed ← if parallel then
387+
IO.FS.writeFile IO.CURLCFG (← mkGetConfigContent repo hashMap)
388+
let args := #["--request", "GET", "--parallel",
389+
-- commented as this creates a big slowdown on curl 8.13.0: "--fail",
390+
"--silent",
391+
"--retry", "5", -- there seem to be some intermittent failures
392+
"--write-out", "%{json}\n", "--config", IO.CURLCFG.toString]
393+
let {success, failed, done, ..} ←
394+
monitorCurl args size "Downloaded" "speed_download" (removeOnError := true)
395+
IO.FS.removeFile IO.CURLCFG
396+
if warnOnMissing && success + failed < done then
397+
IO.eprintln "Warning: some files were not found in the cache."
398+
IO.eprintln "This usually means that your local checkout of mathlib4 has diverged from upstream."
399+
IO.eprintln "If you push your commits to a branch of the mathlib4 repository, CI will build the oleans and they will be available later."
400+
IO.eprintln "Alternatively, if you already have pushed your commits to a branch, this may mean the CI build has failed part-way through building."
401+
pure failed
402+
else
403+
let r ← hashMap.foldM (init := []) fun acc _ hash => do
404+
pure <| (← IO.asTask do downloadFile repo hash) :: acc
405+
pure <| r.foldl (init := 0) fun f t => if let .ok true := t.get then f else f + 1
406+
if failed > 0 then
407+
IO.println s!"{failed} download(s) failed"
408+
return failed
410409

411410
/-- Check if the project's `lean-toolchain` file matches mathlib's.
412411
Print and error and exit the process with error code 1 otherwise. -/
@@ -481,7 +480,8 @@ def getFiles
481480
getProofWidgets (← read).proofWidgetsBuildDir
482481

483482
if let some repo := repo? then
484-
downloadFiles repo hashMap forceDownload parallel (warnOnMissing := true)
483+
let failed ← downloadFiles repo hashMap forceDownload parallel (warnOnMissing := true)
484+
if failed > 0 then IO.Process.exit 1
485485
else
486486
let repoInfo ← getRemoteRepo (← read).mathlibDepPath
487487

@@ -494,8 +494,15 @@ def getFiles
494494
else
495495
[MATHLIBREPO, repoInfo.repo]
496496

497+
let mut failed : Nat := 0
497498
for h : i in [0:repos.length] do
498-
downloadFiles repos[i] hashMap forceDownload parallel (warnOnMissing := i = repos.length - 1)
499+
failed := ← (downloadFiles repos[i] hashMap forceDownload parallel (warnOnMissing := i = repos.length - 1))
500+
if failed > 10 then
501+
IO.println s!"Too many downloads failed; stopping the downloading"
502+
IO.Process.exit 1
503+
if failed > 0 then
504+
IO.println s!"Downloading {failed} files failed"
505+
IO.Process.exit 1
499506

500507
if decompress then
501508
IO.unpackCache hashMap forceUnpack

Mathlib.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ public import Mathlib.Algebra.WithConv
12671267
public import Mathlib.AlgebraicGeometry.AffineScheme
12681268
public import Mathlib.AlgebraicGeometry.AffineSpace
12691269
public import Mathlib.AlgebraicGeometry.AffineTransitionLimit
1270+
public import Mathlib.AlgebraicGeometry.AlgClosed.Basic
12701271
public import Mathlib.AlgebraicGeometry.Artinian
12711272
public import Mathlib.AlgebraicGeometry.ColimitsOver
12721273
public import Mathlib.AlgebraicGeometry.Cover.Directed
@@ -1295,8 +1296,10 @@ public import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass
12951296
public import Mathlib.AlgebraicGeometry.Fiber
12961297
public import Mathlib.AlgebraicGeometry.FunctionField
12971298
public import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
1299+
public import Mathlib.AlgebraicGeometry.Geometrically.Basic
12981300
public import Mathlib.AlgebraicGeometry.Gluing
12991301
public import Mathlib.AlgebraicGeometry.GluingOneHypercover
1302+
public import Mathlib.AlgebraicGeometry.Group.Smooth
13001303
public import Mathlib.AlgebraicGeometry.IdealSheaf.Basic
13011304
public import Mathlib.AlgebraicGeometry.IdealSheaf.Functorial
13021305
public import Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme
@@ -2534,6 +2537,7 @@ public import Mathlib.CategoryTheory.Functor.KanExtension.Preserves
25342537
public import Mathlib.CategoryTheory.Functor.OfSequence
25352538
public import Mathlib.CategoryTheory.Functor.ReflectsIso.Balanced
25362539
public import Mathlib.CategoryTheory.Functor.ReflectsIso.Basic
2540+
public import Mathlib.CategoryTheory.Functor.ReflectsIso.Jointly
25372541
public import Mathlib.CategoryTheory.Functor.RegularEpi
25382542
public import Mathlib.CategoryTheory.Functor.Trifunctor
25392543
public import Mathlib.CategoryTheory.Functor.TwoSquare
@@ -2624,6 +2628,7 @@ public import Mathlib.CategoryTheory.Limits.Constructions.Over.Connected
26242628
public import Mathlib.CategoryTheory.Limits.Constructions.Over.Products
26252629
public import Mathlib.CategoryTheory.Limits.Constructions.Pullbacks
26262630
public import Mathlib.CategoryTheory.Limits.Constructions.WeaklyInitial
2631+
public import Mathlib.CategoryTheory.Limits.Constructions.WidePullbackOfTerminal
26272632
public import Mathlib.CategoryTheory.Limits.Constructions.ZeroObjects
26282633
public import Mathlib.CategoryTheory.Limits.Creates
26292634
public import Mathlib.CategoryTheory.Limits.Elements
@@ -3142,6 +3147,7 @@ public import Mathlib.CategoryTheory.Sites.Over
31423147
public import Mathlib.CategoryTheory.Sites.Plus
31433148
public import Mathlib.CategoryTheory.Sites.Point.Basic
31443149
public import Mathlib.CategoryTheory.Sites.Point.Category
3150+
public import Mathlib.CategoryTheory.Sites.Point.Over
31453151
public import Mathlib.CategoryTheory.Sites.Precoverage
31463152
public import Mathlib.CategoryTheory.Sites.PrecoverageToGrothendieck
31473153
public import Mathlib.CategoryTheory.Sites.Preserves
@@ -3153,6 +3159,7 @@ public import Mathlib.CategoryTheory.Sites.Pullback
31533159
public import Mathlib.CategoryTheory.Sites.RegularEpi
31543160
public import Mathlib.CategoryTheory.Sites.Sheaf
31553161
public import Mathlib.CategoryTheory.Sites.SheafCohomology.Basic
3162+
public import Mathlib.CategoryTheory.Sites.SheafCohomology.MayerVietoris
31563163
public import Mathlib.CategoryTheory.Sites.SheafHom
31573164
public import Mathlib.CategoryTheory.Sites.SheafOfTypes
31583165
public import Mathlib.CategoryTheory.Sites.Sheafification
@@ -5571,6 +5578,7 @@ public import Mathlib.Order.ConditionallyCompleteLattice.Defs
55715578
public import Mathlib.Order.ConditionallyCompleteLattice.Finset
55725579
public import Mathlib.Order.ConditionallyCompleteLattice.Group
55735580
public import Mathlib.Order.ConditionallyCompleteLattice.Indexed
5581+
public import Mathlib.Order.ConditionallyCompletePartialOrder.Defs
55745582
public import Mathlib.Order.Copy
55755583
public import Mathlib.Order.CountableDenseLinearOrder
55765584
public import Mathlib.Order.Cover
@@ -6073,6 +6081,7 @@ public import Mathlib.RingTheory.Finiteness.Bilinear
60736081
public import Mathlib.RingTheory.Finiteness.Cardinality
60746082
public import Mathlib.RingTheory.Finiteness.Cofinite
60756083
public import Mathlib.RingTheory.Finiteness.Defs
6084+
public import Mathlib.RingTheory.Finiteness.Descent
60766085
public import Mathlib.RingTheory.Finiteness.Finsupp
60776086
public import Mathlib.RingTheory.Finiteness.Ideal
60786087
public import Mathlib.RingTheory.Finiteness.Lattice
@@ -6154,6 +6163,7 @@ public import Mathlib.RingTheory.Ideal.Lattice
61546163
public import Mathlib.RingTheory.Ideal.Maps
61556164
public import Mathlib.RingTheory.Ideal.Maximal
61566165
public import Mathlib.RingTheory.Ideal.MinimalPrime.Basic
6166+
public import Mathlib.RingTheory.Ideal.MinimalPrime.Colon
61576167
public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization
61586168
public import Mathlib.RingTheory.Ideal.MinimalPrime.Noetherian
61596169
public import Mathlib.RingTheory.Ideal.NatInt
@@ -7481,6 +7491,7 @@ public import Mathlib.Topology.Order.ProjIcc
74817491
public import Mathlib.Topology.Order.Real
74827492
public import Mathlib.Topology.Order.Rolle
74837493
public import Mathlib.Topology.Order.ScottTopology
7494+
public import Mathlib.Topology.Order.SuccPred
74847495
public import Mathlib.Topology.Order.T5
74857496
public import Mathlib.Topology.Order.UpperLowerSetTopology
74867497
public import Mathlib.Topology.Order.WithTop

Mathlib/Algebra/BigOperators/Finprod.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public import Mathlib.Algebra.Group.Indicator
1010
public import Mathlib.Algebra.Group.Support
1111
public import Mathlib.Algebra.Module.Torsion.Free
1212
public import Mathlib.Algebra.Notation.FiniteSupport
13-
public import Mathlib.Algebra.Order.BigOperators.Group.Finset
1413
public import Mathlib.Algebra.Order.Ring.Defs
1514
public import Mathlib.Data.Set.Finite.Lattice
1615

Mathlib/Algebra/BigOperators/Group/Finset/Gaps.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Authors: Yizheng Zhu
55
-/
66
module
77

8-
public import Mathlib.Algebra.BigOperators.Fin
98
public import Mathlib.Order.Interval.Finset.Gaps
9+
public import Mathlib.Algebra.BigOperators.Group.Finset.Basic
1010
/-!
1111
# Sum of gaps
1212

0 commit comments

Comments
 (0)