Skip to content

refactor(Semantics): drop ProbMonad + redundant Cont laws for mathlib#16

Merged
hawkrobe merged 3 commits into
mainfrom
refactor/probmonad-to-mathlib
May 29, 2026
Merged

refactor(Semantics): drop ProbMonad + redundant Cont laws for mathlib#16
hawkrobe merged 3 commits into
mainfrom
refactor/probmonad-to-mathlib

Conversation

@hawkrobe
Copy link
Copy Markdown
Owner

@hawkrobe hawkrobe commented May 29, 2026

Removes two more hand-rolled reinventions of Lean's monad infrastructure from the Composition/+Dynamic/ layer, using mathlib's Monad/LawfulMonad instead.

  • ProbMonad (Dynamic/Effects/Probability.lean): a bespoke class re-declaring Monad + LawfulMonad (pure/bind + the three laws as fields), with zero instances and zero external consumers. Deleted (along with its hand-rolled map/seq/map_id/map_comp = mathlib's Functor.map/id_map/comp_map); PState/CondProbMonad/ChoiceProbMonad now build on [Monad P]/[LawfulMonad P], keeping only observe/fail/choose.
  • Cont laws (Composition/Continuation.lean): the standalone rfl monad-law theorems duplicated the LawfulMonad (Cont R) that Effects.lean registered downstream. Moved the Monad/LawfulMonad (Cont R) instances to Continuation.lean (the type's home) and dropped the redundant laws; Effects.lean no longer re-registers them.

PMF / Cont R are the canonical instances. No external consumers of the removed declarations.

@hawkrobe hawkrobe changed the title refactor(Semantics/Dynamic): drop bespoke ProbMonad for mathlib Monad refactor(Semantics): drop ProbMonad + redundant Cont laws for mathlib May 29, 2026
@hawkrobe hawkrobe merged commit 5c44d0f into main May 29, 2026
1 check passed
@hawkrobe hawkrobe deleted the refactor/probmonad-to-mathlib branch May 30, 2026 15:04
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