Skip to content

refactor(control): retire the do-stated monad law helpers - #190

Merged
dtumad merged 2 commits into
mainfrom
lawful/retire-basic
Sep 8, 2026
Merged

dtumad merged 2 commits into
mainfrom
lawful/retire-basic

Conversation

@dtumad

@dtumad dtumad commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Two-party strategy composition now uses Lean’s standard bind_assoc, bind_pure_comp, bind_map_left, and pure_bind laws directly. The four duplicate helpers in PolyFun.Control.Lawful.Basic and that module’s imports are removed; the composition theorem statements and assumptions are preserved.

Ordinary-import canaries exercise the law forms through the public composition module for an arbitrary lawful monad with independent universes. Documentation describes the verified upstream behavior, and Python bytecode caches are ignored. The generated umbrella and obsolete namespace-linter entries are updated.

Validation: ./scripts/validate.sh --lint --test --axioms, an external ordinary-import consumer, and git diff --check passed on the updated main base. The axiom sweep checked 10,904 declarations across 281 modules with zero sorry or non-standard axiom taint. Explicit checks of the two changed composition proofs report only propext and Quot.sound.

Review: checked the pinned core statements and the dependent-pair equality transport. No references to the removed module or helpers were found in the inspected VCVio and ArkLib source snapshots. Full downstream toolchain upgrades are outside this change.

@dtumad
dtumad marked this pull request as draft September 3, 2026 18:31
@dtumad
dtumad marked this pull request as ready for review September 3, 2026 18:31
dtumad and others added 2 commits September 8, 2026 17:06
Core's bind_assoc, bind_pure_comp, and bind_map_left close do-stated
goals directly (the last two are themselves stated with do), so the
Lean 4.29 workaround file has no remaining purpose.

- PolyFun/Control/Lawful/Basic.lean deleted; PolyFun.lean regenerated;
  its four topNamespace nolint entries dropped.
- Interaction/TwoParty/Compose.lean uses the core lemmas at every call
  site; the dependent-pair shape is a congrArg / pure_bind term.
- PolyFunTest/Control/LawfulDo.lean pins that the core lemmas apply to
  do-stated goals by exact.
- Docs: gotcha 8 rewritten, repo map and pfunctor page, alignment
  ledger row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nb4g3Vxgjhnhsca7BzAsFc
@dtumad
dtumad force-pushed the lawful/retire-basic branch from aa12458 to b610dc6 Compare September 8, 2026 22:51
@dtumad
dtumad merged commit 57b65a6 into main Sep 8, 2026
6 checks passed
@dtumad
dtumad deleted the lawful/retire-basic branch September 8, 2026 22:59
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