Repository navigation
feat(rung-3): a region crossing is a cut; K-4 laws over TropicalNat - #37
Merged
Merged
Conversation
Marches/Cut.lean (new): a cut of the region DAG is a set of regions closed under predecessors. - Cut.edge_crosses_past: in an acyclic graph every edge leaves the principal cut of its source; Cut.path_back_crosses_no_cut: an edge on a cycle crosses no cut, so Acyclic is load-bearing. - DiscSys.trace_cross_crosses_cut: every crossing in a well-typed composite trace crosses a cut holding the trace's start, not its end. - DiscSys.trace_mem_back / trace_inside / no_reentry: a trace ending in a cut was inside it all along; a trace that leaves a cut never re-enters (no_back_cross lifted from one interface to every cut). - DiscSys.composeCut: compose restricted to a cut prefix is a Discipline (prefix-closure); composeCut_trace_embed / composeCut_trace_reflect: its traces are exactly the composite's traces that end in the prefix. - Two-region Interface: trace_cross_crosses_cut, trace_stays_in_B. - CutExhibit: a concrete twoTropical trace, and a negative control. Marches/Tropical.lean: TropicalGrade reads TropicalNat as a (min,+) grade. seq_unitl and alt_idem are the two laws K-CUT-LOSS uses (K-4). better_reverses_altLe, altLe_one and s3_witness record that marches' `better` runs against its own induced order (S-3 / W-4 direction). Every new declaration depends on no axioms (#print axioms) and nothing re-declares an Agda definition. Gates: lake build -> Build completed successfully (15 jobs); grep -rnw sorry empty; #eval orbit unchanged. Rung: 3 (rung stays OPEN) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
hyperpolymath
marked this pull request as ready for review
October 14, 2026 01:22
hyperpolymath
pushed a commit
that referenced
this pull request
Oct 14, 2026
# Conflicts: # README.adoc
This was referenced Oct 14, 2026
hyperpolymath
added a commit
that referenced
this pull request
Oct 14, 2026
…tes (#38) **Stack 3/3 for MRC-01 (rung 3).** 1/3 merged as #36 (toolchain) and 2/3 as #37 (`Marches/Cut.lean` + K-4 laws). This branch was cut from #37's head before its squash. `main` has since been merged in, without rewriting history. The squash tree is byte-identical to that head, so the diff against `main` is only this PR's docs and shell glue, plus one Lean comment (the `Tropical.lean` seam note). ## What - **`docs/kcut-correspondence.adoc`**: marches' Lean names paired with choreographic-types' Agda names, at pinned commits. It is a table, not a link. Every pairing is **ASSUMED (port-and-reprove)**, in resource-algebra's M-2 idiom. Rows KC-1…KC-8 cover cuts, downward closure, K-5 (`cut-projectable`), K-2 (`proj-cut`), the K-4 laws, the S-3/W-4 direction, and M-2. - **`scripts/fetch-siblings.sh`**: clones the siblings at their pins into `_build/dependencies` (now git-ignored), using the choreographic-types pattern. Pins: choreographic-types `edb784a`, resource-algebra `cf9235c`, tropical-types `e172f8a`. - **`scripts/check-correspondence.sh`**: the mechanical part. It checks that every Lean name cited exists in this build (`#check`), that every Agda name exists at its pin, and that every pin appears in the table. Negative control: a fabricated Lean name and a fabricated Agda name go through the same checks and must be refused. It checks **names, not meanings**. - **`FALSIFIERS.adoc` F6**: "the correspondence is nominal." It **fires on one proposed row**. At `edb784a`, Agda's `Consistent p c` (`Projection.agda:89`) is a party-indexed merge condition at choices, and marches has no parties. So MRC-01's `Acyclic ↔ Consistent` pairing is withdrawn (KC-3, status OPEN). F6 stays open, narrowed. - **`Marches/Tropical.lean` seam note**: now points at resource-algebra M-2, and records where `TropicalAdapterPath.lean` actually lives (below). - **`ROADMAP.adoc` rung 3**: now a gated table. 3a–3c are met; 3d (TropicalAdapterPath import), 3e (echo-types bridge) and 3f (postern) are OPEN, so the rung stays OPEN and there is no tag. - **`STATE.adoc`**: records the session. **`README`** gets one ASSUMED row and a note on the check script; **`LIMITATIONS`** gets one bullet; **`ARCHITECTURE`** lists `docs/` and `scripts/`. ## Citation corrections found while reading the pins - T-2's `receiver-knows` / `sender-knows` are in `src/Choreographic/Instances.agda` (lines 172 and 177), not `Transport.agda`. `Transport.agda` holds the generic `knows-local-cut`. - `TropicalAdapterPath.lean` is in **hyperpolymath/tropical-types**. Its lake package is named `tropical-resource-typing`, which is the name the ROADMAP used. It is pinned to Lean **v4.13.0**, so expect friction when 3d imports it into v4.34.0. - marches' `TropicalNat` is min-plus, so it sits with `Loss`, not `MaxPlus`. It is not one of M-2's two (max-plus) objects (KC-8). ## Evidence (this head) ``` $ lake build Build completed successfully (15 jobs). $ grep -rnw sorry Marches/ Marches.lean ; echo $? 1 $ lake env lean Marches/BadGadget.lean [(false, false), (true, true), (false, false), (true, true)] $ scripts/check-correspondence.sh choreographic-types at edb784a resource-algebra at cf9235c tropical-types at e172f8a PASS: 15 Lean names and 16 sibling names exist at the pins; both negative controls refused $ shellcheck scripts/*.sh # clean $ grep -ni converg Marches/Cut.lean docs/kcut-correspondence.adoc scripts/*.sh Marches/Cut.lean:45: not protocol convergence; agda-routing owns that ground (LIMITATIONS.adoc). docs/kcut-correspondence.adoc:20:Delimitation: nothing here is a convergence claim; agda-routing owns that ``` Mutation test: I renamed one Lean name, one Agda name and one pin in the doc. The script printed `MISSING (Lean)`, `MISSING (sibling)` and `PIN NOT IN TABLE`, then `FAIL` with exit 1. Restoring the doc gives `PASS` again. ## postern Not reachable from this account on 2026-10-14 (`add_repo`: not found or no access; no `list_repos` match). No cross-issue was filed. The MRC-01 import plan is kept in the correspondence doc, ready to file. ## CI The same two pre-existing red checks as on `main` apply here, and neither is caused by this PR: - `CI` ends in `startup_failure`: `actions.lock` has drifted since #34. The fix is `gh actions-lock`, as in #25. - `estate-audit` fails because of a cicd-suite pipefail bug on a comment-only CODEOWNERS. The full diagnosis is in #37. `check-correspondence.sh` needs network access, so it is not wired into CI here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX --- _Generated by [Claude Code](https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Oct 14, 2026
Follow-up to the CodeRabbit review on #36 (thread on `lean-toolchain`, flagged Major / security): pin v4.34.1, the patched release of the 4.34 line. ## Verified against the primary source, not the bot's summary `git log v4.34.0..v4.34.1` in leanprover/lean4 shows: - three runtime reference-count fixes: - leanprover/lean4#15241: preserve sticky counts in deletion cascades - leanprover/lean4#15288: mark the children of objects whose single-threaded count overflowed - leanprover/lean4#15307: panic instead of wrapping counts in `sharecommon_quick_fn` - a `BitVec.ofNatClamp` backport - `chore: prepare release` (`5045d00`, 2026-09-24) marches checks only its own proofs, not untrusted input, so the practical risk was low. Still, this is a same-line patch bump, it costs nothing, and it keeps the estate's 4.34 soundness floor on the patched build. ## Change - `lean-toolchain`: `v4.34.0` → `v4.34.1` - `README.adoc`: the two version mentions - `STATE.adoc`: a dated entry. The v4.34.0 results are now marked historical. No source change. ## Gates (v4.34.1) ``` $ rm -rf .lake && lake build Build completed successfully (15 jobs). $ grep -rnw sorry Marches/ Marches.lean ; echo $? 1 $ lake env lean Marches/BadGadget.lean [(false, false), (true, true), (false, false), (true, true)] ``` ## Note on the stack #38 (rung-3 docs) is independent of this PR. Both add a `STATE.adoc` entry at the top, so whichever merges second will need a trivial merge, which I'll handle. CI here shows the same two pre-existing reds as `main` (`CI` `startup_failure` from `actions.lock` drift, and `estate-audit` from the cicd-suite pipefail bug). Both are diagnosed in #37. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX --- _Generated by [Claude Code](https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX)_ Co-authored-by: Claude <noreply@anthropic.com>
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.
Stack 2/3 for MRC-01 (rung 3). Stack 1/3, the toolchain move to v4.34.0, merged as #36. Next:
…-docs(correspondence table, falsifier, STATE/ROADMAP), stacked on this branch.Marches/Cut.lean(new)A cut of the region DAG is a set of regions closed under predecessors: every region that can cross into the cut is in it. This is classical downward closure. It is not choreographic-types' party-indexed
Consistent, which is a merge condition at choices; the next PR in the stack records that as a falsifier finding.Cut.edge_crosses_pastr → r'leaves the principal cut↓r.Cut.path_back_crosses_no_cutAcyclicis load-bearing.DiscSys.trace_cross_crosses_cutDiscSys.trace_mem_back,trace_insideDiscSys.no_reentryno_back_crosslifted from one interface to every cut.DiscSys.composeCutcomposerestricted to a cut prefix is aDiscipline.composeCut_trace_embed/composeCut_trace_reflecttrace_cross_crosses_cut,trace_stays_in_BInterfaceofCompose.lean, read as the 2-node DAGReassembly.boolUp.CutExhibit.*twoTropicaltrace that instantiates the theorems, plus a negative control on a self-loop.Marches/Tropical.lean: the grade at the crossingTropicalGradereadsTropicalNatas a (min,+) grade:alt = min,seq = +,one = 0.seq_unitl(𝟙 ⊗ x = x) andalt_idem(x ⊕ x = x).better_reverses_altLe.betterruns with cost, while the ⊕-induced order runs against it, as in resource-algebra's Loss and opposite to its MaxPlus.altLe_oneputs𝟙at the top, as Loss'sfin 0.s3_witnessuses the same numbers as resource-algebra's S-3 (2 ≼ 1).altLeis marches' own order, and the doc comment says so.Evidence (local, Lean v4.34.0)
#print axiomsover all 45 declarations added inCut.leanandTropicalGrade: every one reportsdoes not depend on any axioms. I re-proved three grade lemmas that had picked uppropextthrough coreNatlemmas, to match the existing kernel, which is also axiom-free.grep -ni converg Marches/Cut.lean→ only the delimitation line (45).CI: two red checks that are not this PR's
CI(thelake build+ no-sorries job) ends instartup_failure. This has happened on every run since the Dependabot bump chore(deps): bump the actions group with 2 updates #34 (runs 78–81, including onmain). That bump movedci.ymltoleanprover/lean-action@v1.6.1andcodeql.ymltocodeql-action@v4.38.2, but.github/workflows/actions.lockstill pins@v1.6.0/@v4.38.0. The lockfile is enforced at startup ("Using locked action versions from the workflow's lockfile"). Fix: re-rungh actions-lockonmain, as chore(actions): relock drifted action pins #25 did. I have not hand-edited the machine-generated lockfile. Until that lands, the local gate output above is the build evidence.estate-auditfails at the Required Files Gate. This is red onmainsince at least run 41 (1 Oct). Reproduced locally againstcicd-suite@5a10b72: the gate runs underbash -e -o pipefail, and for this repo's comment-only.github/CODEOWNERS,functional_lines=$(grep -vE '^\s*(#|//|;|$)' "$f" | wc -l)selects no lines.grepexits 1, pipefail fails the assignment, and the step exits with no::error::. That is the very case the gate's "Rule 1" means to allow. The fix belongs in hyperpolymath/cicd-suite, e.g.{ grep -vE … "$f" || true; } | wc -l.Status rows
New README rows are PROVEN by
lake build, and "conditional" where they consumeAcyclic. No cross-prover claim is made in this PR. Rung 3 stays OPEN.🤖 Generated with Claude Code
https://claude.ai/code/session_01VTeVWDEJgdYKsUNr4uhnXX
Generated by Claude Code