8000 fix: make prefix `!` require that there be no whitespace after it by kmill · Pull Request #5826 · leanprover/lean4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: make prefix ! require that there be no whitespace after it #5826

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kmill
Copy link
Collaborator
@kmill kmill commented Oct 23, 2024

The high precedence of ! is causing issues with factorial notation in mathlib.

For example, in the following, the argument to use is being parsed as 3 (! contradiction).

example (h : False) : ∃ n : ℕ, n ≠ n := by
  use 3 !
  contradiction

Breaking change: expressions such as ! b now need to be written as !b.

Alternative solution (#5824): we could reduce the precedence of prefix ! to 'lead'.

Zulip discussion

The high precedence of `!` is causing issues with factorial notation in mathlib.

For example, in the following, the argument to `use` is being parsed as `3 (! contradiction)`.
```
example (h : False) : ∃ n : ℕ, n ≠ n := by
  use 3 !
  contradiction
```

Breaking change: expressions such as `! b` now need to be written as `!b`.

Alternative solution (leanprover#5824): we could reduce the precedence of prefix `!` to 'lead'.

[Zulip discussion](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/precedence.20of.20Nat.2Efactorial/near/478253033)
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Oct 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 24, 2024
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0