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

[Merged by Bors] - feat: stability of List.insertionSort #16065

Closed
wants to merge 11 commits into from

Conversation

marcusrossel
Copy link
Collaborator

@marcusrossel marcusrossel commented Aug 22, 2024

The statements of stability follow those used for mergeSort in leanprover/lean4#5092.


This PR is a result of this discussion on Zulip, where @semorrison recommended we verify that List.insertionSort is stable.

Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Aug 22, 2024
Copy link

github-actions bot commented Aug 22, 2024

PR summary cbd44d5495

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Sublist.orderedInsert_sublist
+ cons_sublist_orderedInsert
+ pair_sublist_insertionSort
+ pair_sublist_insertionSort'
+ sublist_insertionSort
+ sublist_insertionSort'

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@kim-em kim-em added the awaiting-author A reviewer has asked the author a question or requested changes label Aug 23, 2024
@kim-em
Copy link
Contributor

kim-em commented Aug 23, 2024

Otherwise LGTM!

@grunweg grunweg added the t-data Data (lists, quotients, numbers, etc) label Aug 23, 2024
@marcusrossel marcusrossel removed the awaiting-author A reviewer has asked the author a question or requested changes label Aug 28, 2024
@marcusrossel marcusrossel added the awaiting-author A reviewer has asked the author a question or requested changes label Aug 28, 2024
@marcusrossel
Copy link
Collaborator Author

marcusrossel commented Aug 29, 2024

I've added the stability theorems based on <+~, as well as the additional lemma orderedInsert_sublist.

@marcusrossel marcusrossel removed the awaiting-author A reviewer has asked the author a question or requested changes label Aug 29, 2024
@marcusrossel
Copy link
Collaborator Author

marcusrossel commented Aug 29, 2024

Also, leanprover/lean4-nightly@6d0b008 adds Pairwise.erase, which I would use on Line 425. Should I add a TODO indicating that this should be changed once Mathlib uses the next release, or is this not important enough?

Copy link
Collaborator

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

And please add the TODO, yes

Mathlib/Data/List/Sort.lean Outdated Show resolved Hide resolved
@Ruben-VandeVelde Ruben-VandeVelde added the awaiting-author A reviewer has asked the author a question or requested changes label Aug 31, 2024
@marcusrossel marcusrossel removed the awaiting-author A reviewer has asked the author a question or requested changes label Sep 1, 2024
@marcusrossel
Copy link
Collaborator Author

I've changed the theorem names as to align with leanprover/lean4#5242

@kim-em
Copy link
Contributor

kim-em commented Sep 29, 2024

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Sep 29, 2024
mathlib-bors bot pushed a commit that referenced this pull request Sep 29, 2024
The statements of stability follow those used for `mergeSort` in leanprover/lean4#5092.



Co-authored-by: Matthew Ballard <matt@mrb.email>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Sep 29, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: stability of List.insertionSort [Merged by Bors] - feat: stability of List.insertionSort Sep 29, 2024
@mathlib-bors mathlib-bors bot closed this Sep 29, 2024
@mathlib-bors mathlib-bors bot deleted the insertion-sort branch September 29, 2024 09:43
fbarroero pushed a commit that referenced this pull request Oct 2, 2024
The statements of stability follow those used for `mergeSort` in leanprover/lean4#5092.



Co-authored-by: Matthew Ballard <matt@mrb.email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants