Skip to content

feat: add finRange#899

Closed
fgdorais wants to merge 4 commits intoleanprover-community:mainfrom
fgdorais:finrange
Closed

feat: add finRange#899
fgdorais wants to merge 4 commits intoleanprover-community:mainfrom
fgdorais:finrange

Conversation

@fgdorais
Copy link
Copy Markdown
Collaborator

This is to correct a name clash from #528 with Mathlib pointed out by @eric-wieser

We add List.finRange and Array.finRange (with basic lemmas). The synonyms Fin.list and Fin.enum are deprecated.

@fgdorais fgdorais added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Jul 30, 2024
@fgdorais fgdorais marked this pull request as ready for review July 30, 2024 17:21
@eric-wieser
Copy link
Copy Markdown
Member

Could you check that you have all the lemmas from Mathlib, and that the names and statements match?

https://github.com/leanprover-community/mathlib4/blob/df2eea5e25e8b5d262cd5ce237c6dd9335a98d22/Mathlib/Data/List/Range.lean#L87-L162

@fgdorais
Copy link
Copy Markdown
Collaborator Author

It's not my aim to get all the lemmas from Mathlib, but the names for the few that are here do agree. Are there any specific lemmas from Mathlib that you think are missing?

@fgdorais fgdorais added awaiting-author Waiting for PR author to address issues and removed awaiting-review This PR is ready for review; the author thinks it is ready to be merged. labels Jul 31, 2024
| l, [], t => reverseAux t l
| a::l, b::r, t => bif s a b then loop l (b::r) (a::t) else loop (a::l) r (b::t)

/-- `finRange n` is the list of all elements of `Fin n` in order -/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In mathlib the docstring is

/-- All elements of `Fin n`, from `0` to `n-1`. The corresponding finset is `Finset.univ`. -/

Should the last sentence be kept, with an added "in mathlib"?

Copy link
Copy Markdown
Collaborator Author

@fgdorais fgdorais Aug 1, 2024

Choose a reason for hiding this comment

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

Good question. I'm not sure. How useful is the second sentence for Mathlib users? It seems like it is a trivial conclusion from the first sentence, isn't it? (Provided one knows what Finset is.)

@ghost ghost added the merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author. label Aug 16, 2024
@fgdorais
Copy link
Copy Markdown
Collaborator Author

Closing for now since this will require substantial revisions after #956 gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Waiting for PR author to address issues merge-conflict This PR has merge conflicts with the `main` branch which must be resolved by the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants