Repository navigation
Start the MeasurableSpaceMonad rebuild - #18
Draft
DavidLedvinka wants to merge 14 commits into
Draft
DavidLedvinka wants to merge 14 commits into
DavidLedvinka wants to merge 14 commits into
Conversation
added 14 commits
October 26, 2026 17:37
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.
Start the rebuild with two files under
RandomDo/MeasurableSpaceMonad, so the polymorphic foundation can be reviewed as complete additions alongside the existing implementation.Core.leancontains the functor and monad operations, conditional laws, and derived lemmas fromRandomDo/Monad/MeasurableSpace.lean. It corrects the simplifier and grind registrations to refer to the measurable space monad laws.Notation.leancontains the basicrdoadapter fromRandomDo/Monad/Notation.lean, supporting binding, branching, mutation, and early return.ForIninterfaces and loop notation are deferred to a later file.Both module docstrings include Main definitions and Notation sections. Core also explains the hierarchy and the omission of a general function-space
Applicativeinterface, citing the unit-interval evaluation-map obstruction in Aumann's original Borel structures for function spaces (1961), §3, with a direct link to the unnumbered example before Lemma 3.1 in the author-hosted reprint. The explanation distinguishes measurability for each fixed continuation in bind from jointly measurable function application. The new declarations use theMeasureTheorynamespace, with mapping, bind, andrdonotation enabled byopen MeasureTheory(oropen scoped MeasureTheory). The twordoparsers have equal priority so elaboration can select the applicable monad interface. Legacy tests import their original modules explicitly to avoid ambiguity between the old global classes and the rebuilt classes. Importing either new module does not pull in the original monad classes, concrete Measure semantics, or sampling implementations.Review
Core.leanfirst, followed byNotation.lean. Review revisions are recorded in separate commits. The existingRandomDotarget builds both modules, and the separateTestNexttarget checks polymorphic reasoning, basic notation, mutable state, and the import boundary. CI buildsTestNextexplicitly and accepts PRs targetingcodex/rebuild-*branches for subsequent dependent PRs.Validation:
lake build --wfail RandomDo TestNextlake test(passes with the existingtrace.computablestyle warning inTest/Computable.lean)lake lintlake exe mk_all --check