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

feat: additional lemmas for Option #4599

Merged
merged 1 commit into from
Jul 2, 2024
Merged

feat: additional lemmas for Option #4599

merged 1 commit into from
Jul 2, 2024

Conversation

TwoFX
Copy link
Member

@TwoFX TwoFX commented Jul 1, 2024

Split from #4583

Mathlib has isSome_map' but calls it isSome_map.

@TwoFX TwoFX requested a review from kim-em as a code owner July 1, 2024 09:00
@TwoFX TwoFX mentioned this pull request Jul 1, 2024
10 tasks
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 1, 2024 09:07 Inactive
@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 Jul 1, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries CI can not be attempted yet, as the nightly-testing-2024-07-01 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. (2024-07-01 09:15:31)

@TwoFX TwoFX changed the title feat: some Option lemmas feat: additional lemmas for Option Jul 1, 2024
Comment on lines +164 to +168
theorem isSome_map {x : Option α} : (f <$> x).isSome = x.isSome := by
cases x <;> simp

@[simp] theorem isSome_map' {x : Option α} : (x.map f).isSome = x.isSome := by
cases x <;> simp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not now, but I wonder if we should reverse all these names, and preserve the ' for the lemmas that go via the monad.

@kim-em kim-em added this pull request to the merge queue Jul 2, 2024
Merged via the queue into master with commit e12999b Jul 2, 2024
15 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jul 5, 2024
### Preliminary PRs:

- [x] #4597 
- [x] #4599
- [x] #4600
- [x] #4602
- [x] #4603
- [x] #4604
- [x] #4605
- [x] #4607
- [x] #4627
- [x] #4629 

### Quick overview over API/naming changes compared to `Lean.HashMap`
and `Batteries.HashMap`:
#### Lean

* `find?` -> `get?`/`getElem?`
* `find!` -> `get!`/`gtetElem!`
* `findD` -> `getD`
* `findEntry?` -> not implemented for now
* `insert'` -> `containsThenInsert` (order reversed in result)
* `insertIfNew` -> `getThenInsertIfNew?` (order reversed in result)
* `numBuckets` -> `Internal.numBuckets`
* `ofListWith` -> not implemented for now
* `Array.groupByKey` -> not implemented for now
* `merge` -> not implemented for now, but you can use `insertMany`

#### Batteries

* `modify` -> not implemented for now
* `mergeWith` -> not implemented for now
* `mergeWithM` -> not implemented for now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants