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

chore: prefer · == a over a == · #3056

Merged
merged 5 commits into from
Jun 14, 2024
Merged

chore: prefer · == a over a == · #3056

merged 5 commits into from
Jun 14, 2024

Conversation

kim-em
Copy link
Collaborator

@kim-em kim-em commented Dec 12, 2023

We recently discovered inconsistencies in Mathlib and Std over the ordering of the arguments for ==.

The most common usage puts the "more variable" term on the LHS, and the "more constant" term on the RHS, however there are plenty of exceptions, and they cause unnecessary pain when switching (particularly, sometimes requiring otherwise unneeded LawfulBEq hypotheses).

This convention is consistent with the (obvious) preference for x == 0 over 0 == x when one term is a literal.

We recently updated Std to use this convention leanprover-community/batteries#430

This PR changes the two major places in Lean that use the opposite convention, and adds a suggestion to the docstring for BEq about the preferred convention.

@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 Dec 12, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Dec 12, 2023

  • ❗ Mathlib CI will not be attempted unless you rebase your PR onto the 'nightly' branch. (2023-12-12 23:17:58)
  • ✅ Mathlib branch lean-pr-testing-3056 has successfully built against this PR. (2024-06-14 04:36:05) View Log

@kim-em kim-em requested a review from digama0 as a code owner June 14, 2024 03:16
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 14, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc June 14, 2024 03:29 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 14, 2024
@kim-em kim-em added this pull request to the merge queue Jun 14, 2024
Merged via the queue into master with commit 2cf478c Jun 14, 2024
14 checks passed
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jun 14, 2024
@kim-em kim-em deleted the swap_List.elem branch June 15, 2024 06:25
github-merge-queue bot pushed a commit that referenced this pull request Jul 17, 2024
The previous argument order was a conscious choice, but I had missed
#3056.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR 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