Skip to content

feat: add a predicate for monad morphisms - #856

Open
eric-wieser wants to merge 6 commits into
leanprover:mainfrom
eric-wieser:monadHom
Open

feat: add a predicate for monad morphisms#856
eric-wieser wants to merge 6 commits into
leanprover:mainfrom
eric-wieser:monadHom

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

We show that various list operations are preserved under monad morphisms, and that FreeM.liftM is.

Note that PolyFun already has the bundled version, but having the unbundled version now does not preclude adding the bundled version later.

We show that various list operations are monad morphisms, and that FreeM.liftM is.
@sorrachai sorrachai self-assigned this Sep 3, 2026
kim-em added a commit to kim-em/cslib that referenced this pull request Sep 5, 2026
The generic List.orderedInsertM/insertionSortM commute with any monad
morphism, stated with the IsMonadHom laws of
leanprover#856 inlined and needing no
lawfulness on either side. Since evaluation against an oracle is a monad
morphism to Id, the executable Id instantiation is List.insertionSort
with no separate proof about the generic definition, and the framework's
complexity bounds apply to the generic program definitionally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pxy48TaP92UgEq28KGm8BG
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.

2 participants