Skip to content

feat(Algorithms): Prove insertion sort is stable#446

Draft
Arleee1 wants to merge 50 commits intoleanprover:mainfrom
Arleee1:insertionstable
Draft

feat(Algorithms): Prove insertion sort is stable#446
Arleee1 wants to merge 50 commits intoleanprover:mainfrom
Arleee1:insertionstable

Conversation

@Arleee1
Copy link
Copy Markdown

@Arleee1 Arleee1 commented Mar 19, 2026

Prove the insertionsort implementation is stable.
Aristotle AI was used for portions of this work.

Depends on #372. My contributions are only in my commits.

/-
Copyright (c) 2026 Shreyas Srinivas. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Shreyas Srinivas, Eric Wieser
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you should append your name here to the authors list. You are adding new content to this file.


section SortStability

/-- Definition of a stable sorting algorithm. -/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Definition of a stable list sorting algorithm. This definition uses List functions and is of course specific to lists. We should revisit the location of this definition at some point. This is a property of lists independent of Progs on the comparison query model.

Copy link
Copy Markdown
Author

@Arleee1 Arleee1 Mar 21, 2026

Choose a reason for hiding this comment

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

Thank you for the review! I will update to specify that it is for lists. As for the location, I think it could make sense to define classes for list sorting algorithms in a separate file and another class that extends it for stable algorithms, what do you think of that idea?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a bigger change. I would leave it for a later PR. I just think a TODO comment would suffice. It should say that these definitions should be upstreamed or relocated

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants