Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore: replace λ by fun #11301

Closed
wants to merge 7 commits into from
Closed

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Mar 11, 2024

Per the style guidelines, λ is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes

  • In lines I was modifying anyway, I also converted => to .
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax λ x, , which I also replaced.

Open in Gitpod

@grunweg
Copy link
Collaborator Author

grunweg commented Mar 11, 2024

Drive-by question: is the Lean 3 syntax used in comments in Data/FunLike/{Embedding,Equiv} and Data/Polynomial/Laurent intended, or did somebody simply forget to fix this during the port?

@grunweg grunweg force-pushed the MR-lambda-fun branch 2 times, most recently from d93ec60 to 466480d Compare March 11, 2024 20:52
Mathlib/Algebra/Field/ULift.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Group/ULift.lean Outdated Show resolved Hide resolved
Mathlib/Algebra/Group/ULift.lean Outdated Show resolved Hide resolved
Mathlib/Analysis/SpecificLimits/Basic.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Quiver/Cast.lean Outdated Show resolved Hide resolved
Mathlib/Combinatorics/Quiver/Cast.lean Outdated Show resolved Hide resolved
grunweg and others added 2 commits March 12, 2024 08:40
Co-authored-by: Moritz Doll <moritz.doll@googlemail.com>
Copy link
Member

@mcdoll mcdoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure that we don't want any Lean 3 syntax anymore in the comments.
I am less sure whether we want to ban λ from meta-code.

test/MfldSetTac.lean Outdated Show resolved Hide resolved
@grunweg
Copy link
Collaborator Author

grunweg commented Mar 12, 2024

I'll be happy to drop the changes to the Lean/Meta or Tactic directory, if I hear this is desired.
The style guide says "The lambda notation λ x ↦ x * x, while syntactically valid, is disallowed in mathlib in favor of the fun keyword.", which to me seems to include any mathlib tactics. (If this is not desired, this should be updated: happy to make a PR.)

@dupuisf
Copy link
Contributor

dupuisf commented Mar 14, 2024

Thanks a lot!

bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Mar 14, 2024
mathlib-bors bot pushed a commit that referenced this pull request Mar 14, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Mar 14, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: replace λ by fun [Merged by Bors] - chore: replace λ by fun Mar 14, 2024
@mathlib-bors mathlib-bors bot closed this Mar 14, 2024
@mathlib-bors mathlib-bors bot deleted the MR-lambda-fun branch March 14, 2024 11:12
@grunweg
Copy link
Collaborator Author

grunweg commented Mar 14, 2024

@dupuisf Thank you for the review!
Can you help me interpret your 👍 on my comment, please? Did you mean

  • "I also had this question"
  • "I think the syntax is intential"
  • "I think somebody forgot about this; a PR is welcome"?
  • something else?

As a mathematician, I have a hard time interpreting a "yes" answer to an "or" question :-)

@dupuisf
Copy link
Contributor

dupuisf commented Mar 15, 2024

Sorry for being cryptic :-) I meant that I agree that the Lean 3 syntax in the comments is almost certainly an artifact of the port and should have been converted to Lean 4 syntax.

grunweg added a commit that referenced this pull request Mar 15, 2024
- lambda by fun (and "=>" by "\mapsto", while I was it)
- remove commas after fields (there are seemingly allowed, but not necessary)
- indent code per the style guide

I did not consistently switch to `where` syntax; I was not sure if this has side effects (e.g. on performance). If desired, I can make that change also.

I did not test the code samples; they might be broken (but at least their syntax works).

Follow-up to #11301.
@grunweg
Copy link
Collaborator Author

grunweg commented Mar 15, 2024

Thanks for elaborating. I just looked into this; five PRs later, this has been fixed. #11405 and #11409 are particular off-spring.

mathlib-bors bot pushed a commit that referenced this pull request Mar 17, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
mathlib-bors bot pushed a commit that referenced this pull request Mar 20, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
utensil pushed a commit that referenced this pull request Mar 26, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
utensil pushed a commit that referenced this pull request Mar 26, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
utensil pushed a commit that referenced this pull request Mar 26, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
Louddy pushed a commit that referenced this pull request Apr 15, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
Louddy pushed a commit that referenced this pull request Apr 15, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
Louddy pushed a commit that referenced this pull request Apr 15, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Per the style guidelines, `λ` is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes
- In lines I was modifying anyway, I also converted `=>` to `↦`.
- Also contains some mild in-passing indentation fixes in `Mathlib/Order/SupClosed`.
- Some doc comments still contained Lean 3 syntax `λ x, `, which I also replaced.

<!-- The text above the `
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Includes some doc comments and real code: this is exhaustive, with two exceptions:
- some files are handled in #11409 instead
- I left FunProp/{ToStd,RefinedDiscTree}.lean, Tactic/NormNum and Tactic/Simps alone, as these seem likely enough to end up in std.

Follow-up to #11301, much shorter this time.
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Fully update the module docstrings (in particular, the examples given therein) after #8386.

This includes switching to where syntax, but also replacing Lean 3 syntax, replacing => by "\mapsto" while at it and indenting code per the style guide. As such, it's also a follow-up to #11301.

Co-authored-by: @Vierkantor



Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants