Skip to content

simple functional queue from Okasaki#558

Open
c-cube wants to merge 16 commits into
leanprover:mainfrom
c-cube:c-cube/functionalQueue
Open

simple functional queue from Okasaki#558
c-cube wants to merge 16 commits into
leanprover:mainfrom
c-cube:c-cube/functionalQueue

Conversation

@c-cube
Copy link
Copy Markdown

@c-cube c-cube commented May 11, 2026

Hi, this is my first attempt at contributing Lean code.

I dug out the old Okasaki, and started off with the simple queue. This should
contain a correctness proof, a complexity proof, and a mapping to a ghost list
of elements. TimeM doesn't seem to be enough for amortized complexity so
I added a module for that, and I also removed the ZeroAdd typeclass constraint
because \N doesn't implement it(!).

AI disclosure: all code is mine, but I had some assistance from GLM 5.1 to
tidy up proof terms and get unstuck.

@c-cube c-cube force-pushed the c-cube/functionalQueue branch from b7c4a9c to a3c0424 Compare May 11, 2026 02:50
Comment thread Cslib/Algorithms/Lean/FunctionalQueue/FunctionalQueue.lean
Comment thread Cslib/Algorithms/Lean/Amortized.lean Outdated
Comment thread Cslib/Algorithms/Lean/FunctionalQueue/FunctionalQueue.lean
Comment thread Cslib/Algorithms/Lean/Amortized.lean
Comment thread Cslib/Algorithms/Lean/Amortized.lean Outdated
@c-cube c-cube force-pushed the c-cube/functionalQueue branch from b22b379 to 5fb8647 Compare May 19, 2026 03:07
Comment thread Cslib/Algorithms/Lean/Amortized.lean Outdated
Comment thread Cslib/Algorithms/Lean/Amortized.lean Outdated
Comment thread Cslib/Algorithms/Lean/Amortized.lean Outdated
@c-cube c-cube requested review from eric-wieser and sorrachai May 29, 2026 02:53
@c-cube
Copy link
Copy Markdown
Author

c-cube commented May 29, 2026

this is ready for re-review

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