Repository navigation
Conversation
Add the canonical map `PFunctor.W.toM` and identify `P.W` with the well-founded trees of `P.M`, together with Lambek's lemma `M.destEquiv` and an induction principle for `PFunctor.W` through `W.mk`. Identify `P.FreeM α` with the W-type of `C α + P`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `PFunctor.Resumption P α`, the M-type of `C α + P`: possibly non-terminating programs that return an `α` or perform an operation of `P`. It has a corecursor, a bisimulation principle and a lawful monad structure, and `FreeM.toResumption` is an injective monad morphism whose image is exactly the well-founded resumptions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use `liftBind` as the implementation-detail constructor with simp-normal form `(lift a).bind k`, as for `PFunctor.FreeM`, and name the cases and lemmas accordingly (`lift_bind`, `liftBind_bind`, `dest_lift_bind`, `map_bind`, `bind_pure_comp`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `M.toResumption`, `Resumption.toMOfIsEmpty` and `equivMOfIsEmpty`, mirroring the W-type embedding of free programs, and show that embedding W-trees commutes with these maps. Describe the four tree types and the maps between them in the module documentation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `PFunctor.FreeM.toMeasure μ`, the output measure of a program whose operations answer according to `μ`, as the fold into the Giry bind, and `PFunctor.Resumption.toMeasure μ`, the supremum of its finite approximations, so divergence is lost mass. The two agree along `FreeM.toResumption`, and resumptions that never return have zero output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dtumad
requested review from
SamuelSchlesinger,
arademaker,
chenson2018,
crei,
fmontesi and
sorrachai
as code owners
October 6, 2026 00:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
PFunctor.FreeM.toMeasure μ, the output measure of a program whose operations are answered according toμ, defined as the fold into Mathlib's Giry bind, andPFunctor.Resumption.toMeasure μ, the supremum of the measures of its finite approximations, so that runs that never return contribute no mass. With discrete response spaces both sendbindto the Giry bind, they agree alongFreeM.toResumption, and resumptions that never return have zero output measure. Also adds the facts about increasing sequences of measures this needs (Measure.iSup_apply_of_monotone,Measure.bind_iSup_of_monotone,Measure.iSup_bind_of_monotone). Adapted from VCVio.Depends on:
AI agents were used to adapt VCVio definitions/proofs to Cslib definitions and conventions.