Skip to content

chore: Option cleanup - #7897

Merged
TwoFX merged 7 commits into
masterfrom
markus/option-upstreaming
Apr 10, 2025
Merged

TwoFX merged 7 commits into
masterfrom
markus/option-upstreaming

Conversation

@TwoFX

@TwoFX TwoFX commented Apr 10, 2025 •

Copy link
Copy Markdown
Member

This PR cleans up the Option development, upstreaming some results from mathlib in the process.

Notable changes:

  • the name <op>_eq_some_iff is preferred over <op>_eq_some
  • the simp normal form for <$> is Option.map, for >>= is Option.bind and for <|> is Option.orElse (for the former two, this was already true before this PR). All further lemmas about these operations are now stated only in terms of Option.map/Option.bind/Option.orElse. Previously, in some cases both versions were available, with a prime used to disambiguate (the primed version was usually the "non-ascii-art" version). Now, there are no lemmas about the ascii-art versions besides the ones turning them into the non-ascii-art operations, and there is only one version of every lemma, about the non-ascii-art operation, and named without a prime.

@TwoFX TwoFX added the changelog-library Library label Apr 10, 2025
@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 Apr 10, 2025
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 2025
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 10, 2025
@ghost ghost added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Apr 10, 2025
@ghost

ghost commented Apr 10, 2025 •

Copy link
Copy Markdown

Mathlib CI status (docs):

@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc April 10, 2025 12:09 Inactive
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 2025
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 10, 2025
@digama0

digama0 commented Apr 10, 2025

Copy link
Copy Markdown
Collaborator

Why are all the lemmas getting removed? If you remove even the simp normalization theorem, that just means these will become stuck terms with no lemmas able to work on them.

@TwoFX

TwoFX commented Apr 10, 2025

Copy link
Copy Markdown
Member Author

@digama0 I'm not removing the simp normalization theorems. Only lemmas whose LHS is not in simp normal form are changing. If I made a mistake somewhere, please let me know.

@digama0

digama0 commented Apr 10, 2025

Copy link
Copy Markdown
Collaborator

Okay, I misunderstood the content of the second bullet point in the PR description to mean that you were removing everything that mentions <$> including the normalization theorem.

@TwoFX

TwoFX commented Apr 10, 2025

Copy link
Copy Markdown
Member Author

@digama0 Thanks, I've rephrased the comment so that it is less ambiguous.

@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc April 10, 2025 15:08 Inactive
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 2025
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 10, 2025
@ghost ghost added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Apr 10, 2025
@TwoFX
TwoFX marked this pull request as ready for review April 10, 2025 18:53
@TwoFX
TwoFX requested a review from kim-em as a code owner April 10, 2025 18:53
@TwoFX
TwoFX enabled auto-merge April 10, 2025 18:53
@TwoFX
TwoFX added this pull request to the merge queue Apr 10, 2025
Merged via the queue into master with commit cf3b257 Apr 10, 2025
kmill added a commit to leanprover-community/mathlib4 that referenced this pull request Apr 19, 2025
* fixes

* fix test

* fix

* chore: adaptations for leanprover/lean4#7797

* stricter rfl check

* fix merge

* Trigger CI for leanprover/lean4#7797

* Trigger CI for leanprover/lean4#7797

* Trigger CI for leanprover/lean4#7797

* inverse construction

* Update lean-toolchain for testing leanprover/lean4#7791

* lake update

* Fix

* Fix

* Fix

* chore: bump to nightly-2025-04-03

* more fixes

* merge lean-pr-testing-6325

* bump proofwidgets

* Update lean-toolchain for testing leanprover/lean4#7812

* shake

* fix shake

* fix tests

* import mathlib.init

* Update lean-toolchain for testing leanprover/lean4#7816

* Trigger CI for leanprover/lean4#7816

* Update lean-toolchain for testing leanprover/lean4#7802

* Fix

* fixes

* Fix (pending upstream changes)

* Trigger CI for leanprover/lean4#7802

* fix

* chore: bump to nightly-2025-04-04

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Update lean-toolchain for testing leanprover/lean4#7818

* Fix

* Fix

* Fix

* Merge master into nightly-testing

* Fix

* Fix comments

* fixes

* Trigger CI for leanprover/lean4#7816

* fix

* fix

* missing doc-string?

* chore: bump to nightly-2025-04-05

* chore: bump to nightly-2025-04-06

* move Batteries to nightly-testing

* lake update

* lint

* fix

* chore: bump to nightly-2025-04-07

* sprinkle noncomputable

* fix: relativize file paths

fix for leanprover/lean4#7822

* chore: reset cache

* chore: bump to nightly-2025-04-07

* shake

* fix: relativize more

* Update lean-toolchain for testing leanprover/lean4#7856

* Update lean-toolchain for testing leanprover/lean4#7851

* Fix

* Fix

* Fix

* Fix

* chore: bump to nightly-2025-04-08

* Update lean-toolchain for testing leanprover/lean4#7870

* Trigger CI for leanprover/lean4#7870

* Trigger CI for leanprover/lean4#7870

* Trigger CI for leanprover/lean4#7870

* wip

* Trigger CI for leanprover/lean4#7870

* .

* chore: bump to nightly-2025-04-09

* Trigger CI for leanprover/lean4#7870

* .

* bump

* lake update

* fixes for leanprover/lean4#7873

* fixes

* deprecations

* chore: bump to nightly-2025-04-10

* chore: `Option.zipWith` -> `Option.merge`

* lake update

* toolchain

* fix

* fix

* Update lean-toolchain for testing leanprover/lean4#7897

* Trigger CI for leanprover/lean4#7897

* fix

* lake update and fix

* Fix

* Fix

* Trigger CI for leanprover/lean4#7897

* fix merge

* chore: adaptations for nightly-2025-04-10

* chore: bump to nightly-2025-04-14

* fix

* .

* annotate changed goal state

* fixes (adaptation notes)

* cleanup imports

* cleanup

* Update lean-toolchain for testing leanprover/lean4#7933

* Fix

* Fix

* Update lean-toolchain for testing leanprover/lean4#7975

* remove adaptation notes

* chore: bump to nightly-2025-04-16

---------

Co-authored-by: leanprover-community-mathlib4-bot <[email protected]>
Co-authored-by: Kim Morrison <[email protected]>
Co-authored-by: Markus Himmel <[email protected]>
Co-authored-by: Rob23oba <[email protected]>
Co-authored-by: Mario Carneiro <[email protected]>
Co-authored-by: Johan Commelin <[email protected]>
Co-authored-by: github-actions <[email protected]>
@TwoFX
TwoFX deleted the markus/option-upstreaming branch August 4, 2025 07:19

This branch was previously deployed

1 inactive deployment
lean-lang.org/lean4/doc — 2626e439 Deployed Apr 10, 2025 by github-actions[bot]
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 changelog-library Library 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