Skip to content

feat(Algorithms): verify minScan (list minimum) with TimeM cost modelAdded new feat MinList#554

Open
Noobmaster-IIIT wants to merge 1 commit intoleanprover:mainfrom
Noobmaster-IIIT:feat-minscan
Open

feat(Algorithms): verify minScan (list minimum) with TimeM cost modelAdded new feat MinList#554
Noobmaster-IIIT wants to merge 1 commit intoleanprover:mainfrom
Noobmaster-IIIT:feat-minscan

Conversation

@Noobmaster-IIIT
Copy link
Copy Markdown

This PR adds a new verified algorithm module for computing the minimum of a list via a linear scan, using CSLib’s TimeM monad to track comparison-count cost.

Changes

Adds MinList.lean with:
minScan : List α → TimeM ℕ (Option α) (returns none on empty input)
minScan_correct: if minScan xs returns some m, then m ∈ xs and m ≤ z for all z ∈ xs (and none implies xs = [])
minScan_time_le: number of comparisons is bounded by xs.length
Exports the module from Cslib.lean.
Notes

Cost model: one tick (✓) per comparison x ≤ m.
The algorithm is total (handles empty lists via Option α) and matches the repo’s “prove .ret correctness + .time bound” pattern used in the existing MergeSort development.
Collaborator: Claude Opus 4.7, chatGPT 5.2

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.

1 participant