Skip to content

Commit c56c329

Browse files
committed
Merge remote-tracking branch 'origin/master' into eric-wieser/floor-normnum
2 parents 6a9df52 + 82f8269 commit c56c329

File tree

4,614 files changed

+133400
-210847
lines changed

Some content is hidden

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

4,614 files changed

+133400
-210847
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
"onCreateCommand": "lake exe cache get!",
99

10+
"hostRequirements": {
11+
"cpus": 4
12+
},
13+
1014
"customizations": {
1115
"vscode" : {
1216
"extensions" : [ "leanprover.lean4" ]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,29 @@
44
PR is merged. Please leave a blank newline before the `---`, otherwise
55
GitHub will format the text above it as a title.
66
7+
For details on the "pull request lifecycle" in mathlib, please see:
8+
https://leanprover-community.github.io/contribute/index.html
9+
10+
In particular, note that most reviewers will only notice your PR
11+
if it passes the continuous integration checks.
12+
Please ask for help on https://leanprover.zulipchat.com if needed.
13+
714
To indicate co-authors, include lines at the bottom of the commit message
815
(that is, before the `---`) using the following format:
916
1017
Co-authored-by: Author Name <[email protected]>
1118
19+
If you are moving or deleting declarations, please include these lines at the bottom of the commit message
20+
(that is, before the `---`) using the following format:
21+
22+
Moves:
23+
- Vector.* -> Mathlib.Vector.*
24+
- ...
25+
26+
Deletions:
27+
- Nat.bit1_add_bit1
28+
- ...
29+
1230
Any other comments you want to keep out of the PR commit should go
1331
below the `---`, and placed outside this HTML comment, or else they
1432
will be invisible to reviewers.
@@ -17,6 +35,7 @@ If this PR depends on other PRs, please list them below this comment,
1735
using the following format:
1836
- [ ] depends on: #abc [optional extra text]
1937
- [ ] depends on: #xyz [optional extra text]
38+
2039
-->
2140

2241
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)

.github/workflows/PR_summary.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,41 @@ jobs:
4545
# Compute the counts for the merge base
4646
python ./scripts/count-trans-deps.py "Mathlib/" > base.json
4747
48-
# switch back to the current branch: the `no_lost_declarations` script should be here
48+
# switch back to the current branch: the `declarations_diff` script should be here
4949
git checkout "${currentHash}"
5050
- name: Post or update the summary comment
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
BRANCH_NAME: ${{ github.head_ref }}
5354
run: |
5455
PR="${{ github.event.pull_request.number }}"
5556
title="### PR summary"
5657
5758
## Import count comment
58-
importCount=$(python ./scripts/import-graph-report.py base.json head.json changed_files.txt)
59+
importCount=$(
60+
python ./scripts/import-graph-report.py base.json head.json changed_files.txt
61+
./scripts/import_trans_difference.sh
62+
)
63+
5964
if [ "$(printf '%s' "${importCount}" | wc -l)" -gt 12 ]
6065
then
61-
importCount="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Import changes" "${importCount}")"
66+
importCount="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Import changes for modified files" "${importCount}")"
6267
else
63-
importCount="$(printf '#### Import changes\n\n%s\n' "${importCount}")"
68+
importCount="$(printf '#### Import changes for modified files\n\n%s\n' "${importCount}")"
6469
fi
6570
6671
## Declarations' diff comment
67-
declDiff=$(./scripts/no_lost_declarations.sh short)
72+
declDiff=$(./scripts/declarations_diff.sh)
6873
if [ "$(printf '%s' "${declDiff}" | wc -l)" -gt 15 ]
6974
then
7075
declDiff="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Declarations diff" "${declDiff}")"
7176
else
7277
declDiff="$(printf '#### Declarations diff\n\n%s\n' "${declDiff}")"
7378
fi
79+
git checkout "${BRANCH_NAME}"
80+
currentHash="$(git rev-parse HEAD)"
81+
hashURL="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}/commits/${currentHash}"
7482
75-
message="$(printf '%s\n\n%s\n\n---\n\n%s\n' "${title}" "${importCount}" "${declDiff}")"
83+
message="$(printf '%s [%s](%s)\n\n%s\n\n---\n\n%s\n' "${title}" "$(git rev-parse --short HEAD)" "${hashURL}" "${importCount}" "${declDiff}")"
7684
7785
./scripts/update_PR_comment.sh "${message}" "${title}" "${PR}"

.github/workflows/add_label_from_comment.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,10 @@ jobs:
6464

6565
- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
6666
id: remove_labels
67-
name: Remove "awaiting-review" and "awaiting-author"
67+
name: Remove "awaiting-author"
6868
# we use curl rather than octokit/request-action so that the job won't fail
6969
# (and send an annoying email) if the labels don't exist
7070
run: |
71-
curl --request DELETE \
72-
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-review \
73-
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
7471
curl --request DELETE \
7572
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-author \
7673
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
@@ -131,13 +128,3 @@ jobs:
131128
labels: '["delegated"]'
132129
env:
133130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
135-
- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
136-
id: remove_labels
137-
name: Remove "awaiting-review"
138-
# we use curl rather than octokit/request-action so that the job won't fail
139-
# (and send an annoying email) if the labels don't exist
140-
run: |
141-
curl --request DELETE \
142-
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/awaiting-review \
143-
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'

.github/workflows/add_label_from_review.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,10 @@ jobs:
6464

6565
- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
6666
id: remove_labels
67-
name: Remove "awaiting-review" and "awaiting-author"
67+
name: Remove "awaiting-author"
6868
# we use curl rather than octokit/request-action so that the job won't fail
6969
# (and send an annoying email) if the labels don't exist
7070
run: |
71-
curl --request DELETE \
72-
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-review \
73-
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
7471
curl --request DELETE \
7572
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-author \
7673
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'
@@ -131,13 +128,3 @@ jobs:
131128
labels: '["delegated"]'
132129
env:
133130
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}
134-
135-
- if: (steps.parse_pr_head.outputs.head_user == 'leanprover-community') && (steps.parse_user.outputs.permission == 'admin')
136-
id: remove_labels
137-
name: Remove "awaiting-review"
138-
# we use curl rather than octokit/request-action so that the job won't fail
139-
# (and send an annoying email) if the labels don't exist
140-
run: |
141-
curl --request DELETE \
142-
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-review \
143-
--header 'authorization: Bearer ${{ secrets.TRIAGE_TOKEN }}'

.github/workflows/bors.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ jobs:
5050
with:
5151
python-version: 3.8
5252

53-
- name: lint
53+
- name: install elan
54+
run: |
55+
set -o pipefail
56+
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.1.1/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
57+
./elan-init -y --default-toolchain none
58+
echo "$HOME/.elan/bin" >> "${GITHUB_PATH}"
59+
60+
- name: "run style linters: Python ones and their Lean rewrite"
5461
run: |
5562
./scripts/lint-style.sh
5663
@@ -83,23 +90,6 @@ jobs:
8390
- name: check that workflows were consistent
8491
run: git diff --exit-code
8592

86-
summarize_declarations:
87-
if: github.repository == 'leanprover-community/mathlib4'
88-
name: summarize_declarations
89-
runs-on: ubuntu-latest
90-
steps:
91-
- uses: actions/checkout@v4
92-
with:
93-
## fetch the whole repository, useful to find a common fork
94-
fetch-depth: 0
95-
- name: print_lost_declarations
96-
run: |
97-
## back and forth to settle a "detached head" (maybe?)
98-
git checkout -q master
99-
git checkout -q -
100-
printf '### Summary\n\n' > "${GITHUB_STEP_SUMMARY}"
101-
./scripts/no_lost_declarations.sh >> "${GITHUB_STEP_SUMMARY}"
102-
10393
build:
10494
if: github.repository == 'leanprover-community/mathlib4'
10595
name: Build
@@ -124,18 +114,12 @@ jobs:
124114
- name: install elan
125115
run: |
126116
set -o pipefail
127-
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
117+
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.1.1/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
128118
./elan-init -y --default-toolchain none
129119
echo "$HOME/.elan/bin" >> "${GITHUB_PATH}"
130120
131121
- uses: actions/checkout@v4
132122

133-
# We update `Mathlib.lean` as a convenience here,
134-
# but verify that this didn't change anything in the `check_imported` job.
135-
- name: update Mathlib.lean
136-
run: |
137-
lake exe mk_all --lib Mathlib
138-
139123
- name: If using a lean-pr-release toolchain, uninstall
140124
run: |
141125
if [[ $(cat lean-toolchain) =~ ^leanprover/lean4-pr-releases:pr-release-[0-9]+$ ]]; then
@@ -148,11 +132,8 @@ jobs:
148132
lean --version
149133
lake --version
150134
151-
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
152-
run: lake exe mk_all
153-
154-
- name: check_imported
155-
run: git diff --exit-code
135+
- name: check {Mathlib, Tactic, Counterexamples, Archive}.lean are up to date
136+
run: lake exe mk_all --check
156137

157138
- name: build cache
158139
run: |
@@ -255,19 +236,25 @@ jobs:
255236
- name: check declarations in db files
256237
run: |
257238
python3 scripts/yaml_check.py docs/100.yaml docs/overview.yaml docs/undergrad.yaml
258-
lake exe checkYaml
239+
lake exe check-yaml
259240
260241
- name: verify `lake exe graph` works
261242
run: |
262243
lake exe graph
263244
rm import_graph.dot
264245
246+
- name: build everything
247+
# make sure everything is available for test/import_all.lean
248+
run: |
249+
lake build Batteries Qq Aesop ProofWidgets
250+
265251
- name: test mathlib
266252
id: test
267253
uses: liskin/gh-problem-matcher-wrap@v3
268254
with:
269255
linters: gcc
270-
run: lake test
256+
run:
257+
lake test
271258

272259
- name: check for unused imports
273260
id: shake

.github/workflows/build.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ jobs:
5757
with:
5858
python-version: 3.8
5959

60-
- name: lint
60+
- name: install elan
61+
run: |
62+
set -o pipefail
63+
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.1.1/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
64+
./elan-init -y --default-toolchain none
65+
echo "$HOME/.elan/bin" >> "${GITHUB_PATH}"
66+
67+
- name: "run style linters: Python ones and their Lean rewrite"
6168
run: |
6269
./scripts/lint-style.sh
6370
@@ -90,23 +97,6 @@ jobs:
9097
- name: check that workflows were consistent
9198
run: git diff --exit-code
9299

93-
summarize_declarations:
94-
if: github.repository == 'leanprover-community/mathlib4'
95-
name: summarize_declarations
96-
runs-on: ubuntu-latest
97-
steps:
98-
- uses: actions/checkout@v4
99-
with:
100-
## fetch the whole repository, useful to find a common fork
101-
fetch-depth: 0
102-
- name: print_lost_declarations
103-
run: |
104-
## back and forth to settle a "detached head" (maybe?)
105-
git checkout -q master
106-
git checkout -q -
107-
printf '### Summary\n\n' > "${GITHUB_STEP_SUMMARY}"
108-
./scripts/no_lost_declarations.sh >> "${GITHUB_STEP_SUMMARY}"
109-
110100
build:
111101
if: github.repository == 'leanprover-community/mathlib4'
112102
name: Build
@@ -131,18 +121,12 @@ jobs:
131121
- name: install elan
132122
run: |
133123
set -o pipefail
134-
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
124+
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.1.1/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
135125
./elan-init -y --default-toolchain none
136126
echo "$HOME/.elan/bin" >> "${GITHUB_PATH}"
137127
138128
- uses: actions/checkout@v4
139129

140-
# We update `Mathlib.lean` as a convenience here,
141-
# but verify that this didn't change anything in the `check_imported` job.
142-
- name: update Mathlib.lean
143-
run: |
144-
lake exe mk_all --lib Mathlib
145-
146130
- name: If using a lean-pr-release toolchain, uninstall
147131
run: |
148132
if [[ $(cat lean-toolchain) =~ ^leanprover/lean4-pr-releases:pr-release-[0-9]+$ ]]; then
@@ -155,11 +139,8 @@ jobs:
155139
lean --version
156140
lake --version
157141
158-
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
159-
run: lake exe mk_all
160-
161-
- name: check_imported
162-
run: git diff --exit-code
142+
- name: check {Mathlib, Tactic, Counterexamples, Archive}.lean are up to date
143+
run: lake exe mk_all --check
163144

164145
- name: build cache
165146
run: |
@@ -262,19 +243,25 @@ jobs:
262243
- name: check declarations in db files
263244
run: |
264245
python3 scripts/yaml_check.py docs/100.yaml docs/overview.yaml docs/undergrad.yaml
265-
lake exe checkYaml
246+
lake exe check-yaml
266247
267248
- name: verify `lake exe graph` works
268249
run: |
269250
lake exe graph
270251
rm import_graph.dot
271252
253+
- name: build everything
254+
# make sure everything is available for test/import_all.lean
255+
run: |
256+
lake build Batteries Qq Aesop ProofWidgets
257+
272258
- name: test mathlib
273259
id: test
274260
uses: liskin/gh-problem-matcher-wrap@v3
275261
with:
276262
linters: gcc
277-
run: lake test
263+
run:
264+
lake test
278265

279266
- name: check for unused imports
280267
id: shake

0 commit comments

Comments
 (0)