Skip to content

Commit 8a304f5

Browse files
committed
Merge branch 'master' of github.com:leanprover-community/mathlib4 into calle/pseudo-modification
2 parents 2ae4d5d + fa601af commit 8a304f5

File tree

1,025 files changed

+19419
-9622
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,025 files changed

+19419
-9622
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,26 @@ In particular, note that most reviewers will only notice your PR
1111
if it passes the continuous integration checks.
1212
Please ask for help on https://leanprover.zulipchat.com if needed.
1313
14-
To indicate co-authors, include at least one commit authored by each
15-
co-author among the commits in the pull request. If necessary, you may
16-
create empty commits to indicate co-authorship, using commands like so:
14+
When merging, all the commits will be squashed into a single commit
15+
listing all co-authors.
16+
17+
Co-authors in the squash commit are gathered from two sources:
18+
19+
First, all authors of commits to this PR branch are included. Thus,
20+
one way to add co-authors is to include at least one commit authored by
21+
each co-author among the commits in the pull request. If necessary, you
22+
may create empty commits to indicate co-authorship, using commands like so:
1723
1824
git commit --author="Author Name <author@email.com>" --allow-empty -m "add Author Name as coauthor"
1925
20-
When merging, all the commits will be squashed into a single commit listing all co-authors.
26+
Second, co-authors can also be listed in lines at the very bottom of
27+
the commit message (that is, directly before the `---`) using the following format:
28+
29+
Co-authored-by: Author Name <author@email.com>
2130
22-
If you are moving or deleting declarations, please include these lines at the bottom of the commit message
23-
(that is, before the `---`) using the following format:
31+
If you are moving or deleting declarations, please include these lines
32+
at the bottom of the commit message (before the `---`, and also before
33+
any "Co-authored-by" lines) using the following format:
2434
2535
Moves:
2636
- Vector.* -> List.Vector.*

.github/build.in.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ env:
1515
concurrency:
1616
# label each workflow run; only the latest with each label will run
1717
# workflows on master get more expressive labels
18-
group: ${{ github.workflow }}-${{ github.ref }}.
19-
${{ ( contains(fromJSON( '["refs/heads/master", "refs/heads/staging"]'), github.ref ) && github.run_id) || ''}}
18+
group: ${{ github.workflow }}-${{ github.ref }}-${{ (contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
2019
# cancel any running workflow with the same label
2120
cancel-in-progress: true
2221

@@ -64,11 +63,11 @@ jobs:
6463
6564
# The Hoskinson runners may not have jq installed, so do that now.
6665
- name: 'Setup jq'
67-
uses: dcarbone/install-jq-action@f0e10f46ff84f4d32178b4b76e1ef180b16f82c3 # v3.1.1
66+
uses: dcarbone/install-jq-action@b7ef57d46ece78760b4019dbc4080a1ba2a40b45 # v3.2.0
6867

6968
# Checkout the master branch into a subdirectory
7069
- name: Checkout master branch
71-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
70+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7271
with:
7372
# Recall that on the `leanprover-community/mathlib4-nightly-testing` repository,
7473
# we don't maintain a `master` branch at all.
@@ -78,7 +77,7 @@ jobs:
7877

7978
# Checkout the PR branch into a subdirectory
8079
- name: Checkout PR branch
81-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8281
with:
8382
ref: "${{ PR_BRANCH_REF }}"
8483
path: pr-branch
@@ -132,8 +131,23 @@ jobs:
132131
- name: set LEAN_SRC_PATH
133132
shell: bash
134133
run: |
135-
# Construct the LEAN_SRC_PATH using the toolchain directory
136-
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible:.lake/packages/requests:.lake/packages/openAI_client:.lake/packages/reap"
134+
cd pr-branch
135+
136+
# Start with the base paths
137+
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake"
138+
139+
# Extract package names from lake-manifest.json and validate them
140+
# Only allow A-Z, a-z, 0-9, _, and - characters
141+
# Build the LEAN_SRC_PATH by appending each validated package
142+
PACKAGE_NAMES=$(jq -r '.packages[].name' lake-manifest.json)
143+
for pkg in $PACKAGE_NAMES; do
144+
if [[ "$pkg" =~ ^[A-Za-z0-9_-]+$ ]]; then
145+
LEAN_SRC_PATH="$LEAN_SRC_PATH:.lake/packages/$pkg"
146+
else
147+
echo "Warning: Skipping invalid package name: $pkg"
148+
fi
149+
done
150+
137151
echo "LEAN_SRC_PATH=$LEAN_SRC_PATH"
138152
139153
# Set it as an environment variable for subsequent steps
@@ -281,6 +295,7 @@ jobs:
281295
echo "::endgroup::"
282296
283297
../master-branch/scripts/lake-build-with-retry.sh Mathlib
298+
# results of build at pr-branch/.lake/build_summary_Mathlib*.json
284299
- name: end gh-problem-match-wrap for build step
285300
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
286301
with:
@@ -294,7 +309,7 @@ jobs:
294309
295310
- name: upload artifact containing contents of pr-branch
296311
# temporary measure for debugging no-build failures
297-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
312+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
298313
with:
299314
name: mathlib4_artifact
300315
include-hidden-files: true
@@ -349,13 +364,15 @@ jobs:
349364
run: |
350365
cd pr-branch
351366
../master-branch/scripts/lake-build-with-retry.sh Archive
367+
# results of build at pr-branch/.lake/build_summary_Archive*.json
352368
353369
- name: build counterexamples
354370
id: counterexamples
355371
continue-on-error: true
356372
run: |
357373
cd pr-branch
358374
../master-branch/scripts/lake-build-with-retry.sh Counterexamples
375+
# results of build at pr-branch/.lake/build_summary_Counterexamples*.json
359376
360377
- name: Check if building Archive or Counterexamples failed
361378
if: steps.archive.outcome == 'failure' || steps.counterexamples.outcome == 'failure'
@@ -477,12 +494,12 @@ jobs:
477494
runs-on: ubuntu-latest # Note these steps run on disposable GitHub runners, so no landrun sandboxing is needed.
478495
steps:
479496

480-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
497+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
481498
with:
482499
ref: "${{ PR_BRANCH_REF }}"
483500

484501
- name: Configure Lean
485-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
502+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
486503
with:
487504
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
488505
use-github-cache: false
@@ -525,7 +542,7 @@ jobs:
525542
lake exe graph
526543
527544
- name: upload the import graph
528-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
545+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
529546
with:
530547
name: import-graph
531548
path: import_graph.dot
@@ -538,8 +555,9 @@ jobs:
538555

539556
- name: build everything
540557
# make sure everything is available for test/import_all.lean
558+
# and that miscellaneous executables still work
541559
run: |
542-
lake build Batteries Qq Aesop ProofWidgets Plausible
560+
lake build Batteries Qq Aesop ProofWidgets Plausible pole unused
543561
544562
- name: build AesopTest (nightly-testing only)
545563
# Only run on the mathlib4-nightly-testing repository

.github/workflows/PR_summary.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424
path: pr-branch
2525

2626
# Checkout the master branch into a subdirectory
2727
- name: Checkout master branch
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
with:
3030
# When testing the scripts, comment out the "ref: master"
3131
ref: master
@@ -60,7 +60,7 @@ jobs:
6060
fi
6161
6262
- name: Set up Python
63-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
63+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
6464
with:
6565
python-version: 3.12
6666

.github/workflows/actionlint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414

1515
- name: suggester / actionlint
16-
uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
16+
uses: reviewdog/action-actionlint@f00ad0691526c10be4021a91b2510f0a769b14d0 # v1.68.0
1717
with:
1818
tool_name: actionlint
1919
fail_level: error
@@ -22,15 +22,15 @@ jobs:
2222
name: check workflows generated by build.in.yml
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626

2727
- name: update workflows
2828
run: |
2929
cd .github/workflows/
3030
./mk_build_yml.sh
3131
3232
- name: suggester / build.in.yml
33-
uses: reviewdog/action-suggester@4747dbc9f9e37adba0943e681cc20db466642158 # v1.21.0
33+
uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1.24.0
3434
with:
3535
tool_name: mk_build_yml.sh
3636
fail_level: error

.github/workflows/add_label_from_diff.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
if: github.repository == 'leanprover-community/mathlib4'
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
with:
2727
ref: ${{ github.event.pull_request.head.sha }}
2828
fetch-depth: 0
2929
- name: Configure Lean
30-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
30+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
3131
with:
3232
auto-config: false
3333
use-github-cache: false

.github/workflows/auto_assign_reviewers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
name: assign automatically proposed reviewers
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1515
with:
1616
ref: master
1717
sparse-checkout: |
1818
scripts/assign_reviewers.py
1919
2020
- name: Set up Python
21-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
21+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2222
with:
2323
python-version: '3.x'
2424

.github/workflows/bench_summary_comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
if: github.event.issue.pull_request && (startsWith(github.event.comment.body, 'Here are the [benchmark results]'))
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414
with:
1515
ref: master
1616
sparse-checkout: |
1717
scripts/bench_summary.lean
1818
1919
- name: Configure Lean
20-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
20+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
2121
with:
2222
auto-config: false
2323
use-github-cache: false

.github/workflows/bors.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ env:
2525
concurrency:
2626
# label each workflow run; only the latest with each label will run
2727
# workflows on master get more expressive labels
28-
group: ${{ github.workflow }}-${{ github.ref }}.
29-
${{ ( contains(fromJSON( '["refs/heads/master", "refs/heads/staging"]'), github.ref ) && github.run_id) || ''}}
28+
group: ${{ github.workflow }}-${{ github.ref }}-${{ (contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
3029
# cancel any running workflow with the same label
3130
cancel-in-progress: true
3231

@@ -74,11 +73,11 @@ jobs:
7473
7574
# The Hoskinson runners may not have jq installed, so do that now.
7675
- name: 'Setup jq'
77-
uses: dcarbone/install-jq-action@f0e10f46ff84f4d32178b4b76e1ef180b16f82c3 # v3.1.1
76+
uses: dcarbone/install-jq-action@b7ef57d46ece78760b4019dbc4080a1ba2a40b45 # v3.2.0
7877

7978
# Checkout the master branch into a subdirectory
8079
- name: Checkout master branch
81-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8281
with:
8382
# Recall that on the `leanprover-community/mathlib4-nightly-testing` repository,
8483
# we don't maintain a `master` branch at all.
@@ -88,7 +87,7 @@ jobs:
8887

8988
# Checkout the PR branch into a subdirectory
9089
- name: Checkout PR branch
91-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
90+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9291
with:
9392
ref: "${{ github.sha }}"
9493
path: pr-branch
@@ -142,8 +141,23 @@ jobs:
142141
- name: set LEAN_SRC_PATH
143142
shell: bash
144143
run: |
145-
# Construct the LEAN_SRC_PATH using the toolchain directory
146-
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible:.lake/packages/requests:.lake/packages/openAI_client:.lake/packages/reap"
144+
cd pr-branch
145+
146+
# Start with the base paths
147+
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake"
148+
149+
# Extract package names from lake-manifest.json and validate them
150+
# Only allow A-Z, a-z, 0-9, _, and - characters
151+
# Build the LEAN_SRC_PATH by appending each validated package
152+
PACKAGE_NAMES=$(jq -r '.packages[].name' lake-manifest.json)
153+
for pkg in $PACKAGE_NAMES; do
154+
if [[ "$pkg" =~ ^[A-Za-z0-9_-]+$ ]]; then
155+
LEAN_SRC_PATH="$LEAN_SRC_PATH:.lake/packages/$pkg"
156+
else
157+
echo "Warning: Skipping invalid package name: $pkg"
158+
fi
159+
done
160+
147161
echo "LEAN_SRC_PATH=$LEAN_SRC_PATH"
148162
149163
# Set it as an environment variable for subsequent steps
@@ -291,6 +305,7 @@ jobs:
291305
echo "::endgroup::"
292306
293307
../master-branch/scripts/lake-build-with-retry.sh Mathlib
308+
# results of build at pr-branch/.lake/build_summary_Mathlib*.json
294309
- name: end gh-problem-match-wrap for build step
295310
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
296311
with:
@@ -304,7 +319,7 @@ jobs:
304319
305320
- name: upload artifact containing contents of pr-branch
306321
# temporary measure for debugging no-build failures
307-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
322+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
308323
with:
309324
name: mathlib4_artifact
310325
include-hidden-files: true
@@ -359,13 +374,15 @@ jobs:
359374
run: |
360375
cd pr-branch
361376
../master-branch/scripts/lake-build-with-retry.sh Archive
377+
# results of build at pr-branch/.lake/build_summary_Archive*.json
362378
363379
- name: build counterexamples
364380
id: counterexamples
365381
continue-on-error: true
366382
run: |
367383
cd pr-branch
368384
../master-branch/scripts/lake-build-with-retry.sh Counterexamples
385+
# results of build at pr-branch/.lake/build_summary_Counterexamples*.json
369386
370387
- name: Check if building Archive or Counterexamples failed
371388
if: steps.archive.outcome == 'failure' || steps.counterexamples.outcome == 'failure'
@@ -487,12 +504,12 @@ jobs:
487504
runs-on: ubuntu-latest # Note these steps run on disposable GitHub runners, so no landrun sandboxing is needed.
488505
steps:
489506

490-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
507+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
491508
with:
492509
ref: "${{ github.sha }}"
493510

494511
- name: Configure Lean
495-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
512+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
496513
with:
497514
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
498515
use-github-cache: false
@@ -535,7 +552,7 @@ jobs:
535552
lake exe graph
536553
537554
- name: upload the import graph
538-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
555+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
539556
with:
540557
name: import-graph
541558
path: import_graph.dot
@@ -548,8 +565,9 @@ jobs:
548565

549566
- name: build everything
550567
# make sure everything is available for test/import_all.lean
568+
# and that miscellaneous executables still work
551569
run: |
552-
lake build Batteries Qq Aesop ProofWidgets Plausible
570+
lake build Batteries Qq Aesop ProofWidgets Plausible pole unused
553571
554572
- name: build AesopTest (nightly-testing only)
555573
# Only run on the mathlib4-nightly-testing repository

0 commit comments

Comments
 (0)