Skip to content

Commit 2015ac8

Browse files
authored
Merge branch 'lean4' into update-mathlib-pr-workflow
2 parents 0a07879 + 478f0f4 commit 2015ac8

File tree

4 files changed

+48
-25
lines changed

4 files changed

+48
-25
lines changed

data/community.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ These guidelines apply to the
8383
[Lean Zulip chat](https://leanprover.zulipchat.com/)
8484
and the [leanprover-community GitHub organization](https://github.com/leanprover-community/).
8585

86-
To clarify the above: actions that can result in suspension or banning from the Lean community Zulip include harassment, discriminatory or disrespectful behavior, sustained off-topic or disruptive posts, repeated low effort posts, use of the community to complete coursework or work tasks, use of sock-puppet accounts, DM spam, unsolicited mass DMs to users, significant use of AI without attribution, posting of "slop" AI-generated code accompanied by unjustified and incorrect claims about said code, and ignoring moderator guidance. This list is not exhaustive and the maintainers retain broad discretion in user moderation.
86+
To clarify the above: actions that can result in suspension or banning from the Lean community Zulip include harassment, discriminatory or disrespectful behavior, sustained off-topic or disruptive posts, repeated low effort posts, use of the community to complete coursework or work tasks, use of sock-puppet accounts, DM spam, unsolicited mass DMs to users, significant use of AI without attribution, unrequested posting of "slop" AI-generated code, making unjustified and incorrect claims about AI-generated code, and ignoring moderator guidance.
87+
88+
This is not a free code review service. Posts that amount to 'look at my project' without a specific question or prior community involvement will be removed and the poster suspended.
89+
90+
This list is not exhaustive and the maintainers retain broad discretion in user moderation.
8791

8892
Repeated violations will result in temporary suspensions, which will increase in length if the behavior continues. Egregious individual incidents will result in bans.
8993

templates/contribute/index.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ style violations documented in this guide are welcome. Other stylistic PRs that
6161
approval by the authors of the affected files may be closed. We invite authors to instead discuss the proposed
6262
change on Zulip and, when significant consensus among reviewers is reached, to open a PR to the style guide.
6363

64+
## Use of AI
65+
66+
Using artificial intelligence tools to generate code is becoming more and more common. While this can be practical, their use also poses ethical, ecological, legal and social concerns. We recognise that there are strong differences in opinion on this topic, and do not enforce a strict ban. That said, while individual action alone will not address these concerns, we ask you to consider the effects of your AI use and if it is truly necessary.
67+
68+
If you use artificial intelligence (such as, by using github's copilot mode, asking an LLM like ChatGPT or using an agent like Codex, Claude or Gemini), please explain this in the PR description. Explain which tool(s) you used and how you used it. This provides useful context for reviewers: tools make different mistakes than humans, so knowing this makes it easier to spot common errors.
69+
70+
It is essential that you can vouch for all the code submitted in a PR, and understand all the content written by an AI. If you don't, then it is possible that the PR actually has negative value to the community, and you are expecting others to do the real work for you!
71+
6472
## Working on mathlib
6573

6674
We use `git` to manage and version control `mathlib`.
@@ -154,11 +162,15 @@ Labels can only be edited directly by "GitHub collaborators", which is approxima
154162
However, anyone can add/remove the labels below by writing the following commands in a comment on the PR (each on its own line):
155163
- `awaiting-author` will add the **"awaiting-author"** label
156164
- `-awaiting-author` will remove the **"awaiting-author"** label
165+
- `awaiting-zulip` will add the **"awaiting-zulip"** label
166+
- `-awaiting-zulip` will remove the **"awaiting-zulip"** label. Use this once a decision has been reached and has been implemented.
157167
- `WIP` will add the **"WIP"** label
158168
- `-WIP` will remove the **"WIP"** label
159169
- `easy` will add the **"easy"** label
160170
- `-easy` will remove the **"easy"** label
161-
- Similarly, the labels for use by contributors upstreaming work from the downstream projects **brownian**, **carleson**, **CFT**, **FLT**, **sphere-packing** and **toric** can also be added and removed in the same way.
171+
- `help-wanted`, `-help-wanted`, `please-adopt`, `-please-adopt` can be used to mark a PR in need of external input.
172+
- Similarly, the labels for use by contributors upstreaming work from the downstream projects **brownian**, **carleson**, **CFT**, **FLT**, **infinity-cosmos**, **sphere-packing** and **toric** can also be added and removed in the same way.
173+
- Any topic label of the form `t-*` (e.g. `t-topology`), as well as the labels `CI` and `IMO`, can also be added and removed in the same way. PRs are auto-labeled based on their contents, but sometimes the auto-labeling is incorrect or incomplete so this lets you manually override it. See [available topic labels](https://github.com/leanprover-community/mathlib4/labels?q=t-).
162174

163175
This list is exhaustive. If you would like to add a different label, please, bring it up on Zulip!
164176

templates/contribute/style.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,10 @@ We allow, but discourage, contributors from simultaneously renaming declarations
740740
In this case, no deprecation attribute is required for X, but it is for W.
741741

742742
Named instances do not require deprecations. Deprecated declarations can be deleted after 6 months.
743+
744+
### Avoid `nonrec`
745+
746+
The `nonrec` keyword tells Lean to assume that apparently recursive calls in the declaration body
747+
are not actually recursive, and instead look for declarations in other namespaces with the same name.
748+
Avoid `nonrec` when the recursive call conflicts with another declaration *in a namespace*, because then adding the namespace to that declaration is more informative (to both Lean and the user). If it conflicts with a declaration in the root namespace, then both `nonrec` and `_root_.[...]` are acceptable. Sometimes avoiding `nonrec` requires forgoing the use of dot notation within the body of that declaration.
749+
(There are currently many places in Mathlib that break this rule.)

templates/contribute/tags_and_branches.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The Lean Github ecosystem
22

3-
Documentation of the branches, tags, and CI workflows relevant for making pull requests to Lean, Std, and
3+
Documentation of the branches, tags, and CI workflows relevant for making pull requests to Lean, Batteries, and
44
Mathlib.
55

66
* [Things you need to know](#things-you-need-to-know) is relevant for everyone
@@ -35,23 +35,23 @@ Mathlib.
3535
* Every PR automatically receives a toolchain after it builds successfully. The PR will then have label `toolchain-available`.
3636
To use PR #NNNN in a project, your `lean-toolchain` file should contain
3737
`leanprover/lean4-pr-releases:pr-release-NNNN`.
38-
* For any PR that potentially affects Std or Mathlib, you should base your PR off the HEAD of the `nightly-with-mathlib` branch.
38+
* For any PR that potentially affects Batteries or Mathlib, you should base your PR off the HEAD of the `nightly-with-mathlib` branch.
3939
In that case, a `lean-pr-testing-NNNN` Mathlib branch is created, described in detail below, and results from this branch are
4040
reported via comments in the PR discussion.
4141

42-
### `leanprover/std4` (aka 'Std')
42+
### `leanprover-community/batteries` (aka 'Batteries')
4343

4444
* Development occurs on `main`.
45-
* Std uses the latest stable release or release candidate in its `lean-toolchain`.
45+
* Batteries uses the latest stable release or release candidate in its `lean-toolchain`.
4646
* Because we release `v4.X+1.0-rc1` immediately after releasing `v4.X.0`,
47-
Std is only very briefly on stable releases.
47+
Batteries is only very briefly on stable releases.
4848
* The first commit on `main` which uses a new toolchain is tagged with the version number of that
4949
toolchain (e.g. `v4.2.0`).
5050
* There is a branch `stable` which follows the `v4.X.0` tags.
51-
* Std has a branch `bump/v4.X.0` for the upcoming stable release of Lean,
51+
* Batteries has a branch `bump/v4.X.0` for the upcoming stable release of Lean,
5252
* which contains adaptations for breaking changes that have been approved by the maintainers
5353
* and which will be using a `leanprover-lean4:nightly-YYYY-MM-DD` toolchain.
54-
* Std has a branch `nightly-testing` which
54+
* Batteries has a branch `nightly-testing` which
5555
* uses a recent nightly release (this is updated automatically)
5656
* has all commits from `main` merged into it automatically
5757
* may have any changes from `bump/v4.X.0` merged into it manually
@@ -64,53 +64,53 @@ Mathlib.
6464
* Thus if `nightly-testing-YYYY-MM-DD` exists, we know that on it:
6565
* the `lean-toolchain` is `leanprover/lean4:nightly-YYYY-MM-DD`, and
6666
* CI succeeds.
67-
* When changes are required to Std to adapt to a breaking change in Lean,
67+
* When changes are required to Batteries to adapt to a breaking change in Lean,
6868
you will need to make a branch, and later open a PR from that branch.
6969
(Note that the steps below happen automatically at Mathlib,
70-
but need to be done manually for Std.)
70+
but need to be done manually for Batteries.)
7171
* If the change was made in `leanprover/lean4#NNNN`,
72-
then the Std adaptation branch should be called `lean-pr-testing-NNNN`.
73-
* The Std adaptation branch should be based off the tag `nightly-testing-YYYY-MM-DD`
72+
then the Batteries adaptation branch should be called `lean-pr-testing-NNNN`.
73+
* The Batteries adaptation branch should be based off the tag `nightly-testing-YYYY-MM-DD`
7474
where `YYYY-MM-DD` is the date of the nightly release that your Lean PR is based off.
7575
* If the `nightly-testing-YYYY-MM-DD` tag does not yet exist, you will need to wait
7676
(and possibly move forward to a subsequent nightly).
7777
Contact @semorrison for assistance if needed.
78-
* Ideally you will push the `lean-pr-testing-NNNN` branch to the main Std repository;
78+
* Ideally you will push the `lean-pr-testing-NNNN` branch to the main Batteries repository;
7979
we can provide write access if needed.
8080
* The `lean-toolchain` on this branch must contain `leanprover/lean4-pr-releases:pr-release-NNNN`.
8181
* You may open a PR from the `lean-pr-testing-NNNN` branch, either before or after
8282
making the required adaptations.
8383
* When opening the PR, remember to set the base branch to `nightly-testing`.
8484
* Please label the PR with the `v4.X.0` and 'depends on core changes' labels.
8585
(Or ask for this to be done if you don't have write access.)
86-
* Once the Lean PR has been merged and published in a nightly release, the Std adaptation PR
86+
* Once the Lean PR has been merged and published in a nightly release, the Batteries adaptation PR
8787
* should have its `lean-toolchain` updated to `leanprover/lean4:nightly-YYYY-MM-DD`
8888
* its changes may be merged manually into `nightly-testing` as needed to keep `nightly-testing`
8989
working (do not change the base and merge the PR, we still need it).
90-
* Once the Std adaptation PR has been approved,
90+
* Once the Batteries adaptation PR has been approved,
9191
a maintainer will merge it into `bump/v4.X.0` (not `nightly-testing-YYYY-MM-DD`).
9292
* It is always allowed to merge `bump/v4.X.0` into `nightly-testing`, but not conversely.
9393
(Changes to `bump/v4.X.0` have been reviewed, but changes to `nightly-testing` may not have been.)
94-
* When it is time to update Std to a new Lean release,
94+
* When it is time to update Batteries to a new Lean release,
9595
*hopefully* all that is required is to make a new PR
9696
consisting of squash merging `bump/v4.X.0` to `main`.
9797

9898
### `leanprover-community/mathlib4` (aka 'Mathlib')
9999

100-
* Everything said above about Std applies to Mathlib, except:
100+
* Everything said above about Batteries applies to Mathlib, except:
101101
* Development occurs on `master`.
102102
* PRs to Mathlib should be made from forks. Mathlib's `.olean` cache now works with PRs from forks.
103103
* The `lean-pr-testing-NNNN`, `nightly-testing`, `nightly-testing-*` tags, and `bump/v4*` branches
104104
all live at `leanprover-community/mathlib4-nightly-testing`, which is a fork of mathlib4.
105105
If you will regularly need write access to these branches, you can ask in the
106106
[nightly-testing channel](https://leanprover.zulipchat.com/#narrow/stream/428973-nightly-testing)
107107
on Zulip to be added to the `nightly-testing` GitHub team.
108-
* Note that the `nightly-testing` branch of Mathlib may use the `nightly-testing` branch of Std as required.
109-
* Similarly a `bump/v4.X.0` branch of Mathlib may use the `bump/v4.X.0` branch of Std as required.
108+
* Note that the `nightly-testing` branch of Mathlib may use the `nightly-testing` branch of Batteries as required.
109+
* Similarly a `bump/v4.X.0` branch of Mathlib may use the `bump/v4.X.0` branch of Batteries as required.
110110
* Branches `lean-pr-testing-NNNN` are automatically created for any Lean PR that passes CI,
111-
and is based off a nightly release. (Unlike for Std, where they must be created manually.)
112-
* Mathlib adaptation PRs on `lean-pr-testing-NNNN` branches may need to change the Std dependency
113-
to use a `lean-pr-testing-NNNN` branch of Std, if Std also experiences breakages.
111+
and is based off a nightly release. (Unlike for Batteries, where they must be created manually.)
112+
* Mathlib adaptation PRs on `lean-pr-testing-NNNN` branches may need to change the Batteries dependency
113+
to use a `lean-pr-testing-NNNN` branch of Batteries, if Batteries also experiences breakages.
114114

115115
### Mathlib nightly and bump branches
116116

@@ -150,7 +150,7 @@ To make this process as smooth as possible, we follow the following procedure:
150150
* For every PR to Lean, we attempt to run Mathlib CI against the resulting toolchain.
151151
* For this to work, you will need to rebase your PR onto the `nightly-with-mathlib` branch.
152152
The `nightly-with-mathlib` branch points to the latest nightly lean release which passes mathlib CI,
153-
and for which a `nightly-testing-YYYY-MM-DD` tag exists on Mathlib (and possibly Std).
153+
and for which a `nightly-testing-YYYY-MM-DD` tag exists on Mathlib (and possibly Batteries).
154154
* The bot will create a `lean-pr-testing-NNNN` branch at `leanprover-community/mathlib4-nightly-testing`
155155
from the `nightly-testing-YYYY-MM-DD` tag, or push an empty commit to it if it already exists.
156156
* Subsequent CI results from that Mathlib branch will be reported back to the Lean PR
@@ -164,4 +164,4 @@ To make this process as smooth as possible, we follow the following procedure:
164164
to wait for `nightly-with-mathlib` to be updated and rebase onto that.
165165

166166

167-
<img src="img/tags_and_branches.png" alt="Overview of branches at Mathlib/Std" width="80%"/>
167+
<img src="img/tags_and_branches.png" alt="Overview of branches at Mathlib/Batteries" width="80%"/>

0 commit comments

Comments
 (0)