Skip to content

Commit f2e465c

Browse files
feat(resource): HubCeiling — hub ceilings, reach grades, weighted residue measure (squeakwell R5–R7) (#67)
## Summary New module `Resource/HubCeiling.lean`, parametric over the `ResourceAlgebra` interface, serving rungs R5–R7 of the [hyperpolymath/squeakwell](https://github.com/hyperpolymath/squeakwell) proof ladder (database recovery reads a modality's reachability through the regeneration graph as a tropical grade). ## What is proved - **R6 hub ceiling, element form.** `TropicalAdapterPath.hub_ceiling` is over `List TransportClass` and does not transfer to the matrix closure literally; the algebraic kernel does. Under `OneTop` (the unit is the top of the order — true at `MinPlus` and `MinMax`, refuted at `MaxPlus` by `maxplus_not_one_top`): `factor_le`, `factor_le_right`; with absorption and idempotence `zero_bot`, `join_bound`, `lsum_bound`; lifted to matrix products `matMul_row_bound`, `single_hub_ceiling`; and to closures **only under an explicit `IsStar` fixed-point hypothesis** (`single_hub_star_ceiling`), since the repository has no walk semantics for `matStar` in Lean. - **R7 reach grade.** `reachGrade A S m` = `⊞`-sum of closure entries over an observed `Bool` set. `reachGrade_mono_mat`, `reachGrade_mono_set` (via the new `lsum_filter_mono`), `one_le_reachGrade` (an observed node has the full grade). - **R5 weighted residue measure.** `weightedResidueMeasure w : ResidueMeasure (List M) R` for any resource algebra (free-monoid homomorphism; only `one_mul` and `mul_assoc` used). `weighted_counts_events` recovers the existing max-plus event counter as the constant-weight instance. `List M` stays opaque — the EchoBridge boundary invariant holds. ## Changes - `Resource/HubCeiling.lean` (new), wired into `Resource.lean` - `.github/workflows/lean.yml`: nine new `#print axioms` lines in the audit - `PROOF-STATUS.adoc`: module list and target count ## Verification (this environment) ``` lake build # Lean 4.35.0, Build completed successfully (21 jobs) lake env lean axcheck.lean # every new headline: no axioms, or [propext, Quot.sound] ``` No `sorry`, no `Classical.choice`, no new axiom declarations. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDizuhJtQDcxHxM2wj8)_ --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
1 parent 168f09d commit f2e465c

4 files changed

Lines changed: 423 additions & 4 deletions

File tree

‎.github/workflows/lean.yml‎

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,43 @@ jobs:
7171
#print axioms Resource.Bridge.grade_le_sequential
7272
#print axioms Resource.Bridge.hub_ceiling_le
7373
#print axioms Resource.Bridge.embed_tcZero_ne_zero
74+
-- HubCeiling: squeakwell R5–R7 (hub ceiling, reach grade, weighted residue measure)
75+
#print axioms Resource.HubCeiling.factor_le
76+
#print axioms Resource.HubCeiling.single_hub_ceiling
77+
#print axioms Resource.HubCeiling.single_hub_star_ceiling
78+
#print axioms Resource.HubCeiling.lsum_filter_mono
79+
#print axioms Resource.HubCeiling.reachGrade_mono_mat
80+
#print axioms Resource.HubCeiling.reachGrade_mono_set
81+
#print axioms Resource.HubCeiling.one_le_reachGrade
82+
#print axioms Resource.HubCeiling.weightedResidueMeasure
83+
#print axioms Resource.HubCeiling.Witness.maxplus_not_one_top
7484
EOF
7585
out="$(lake env lean /tmp/axcheck.lean 2>&1)"
7686
echo "$out"
77-
if echo "$out" | grep -qiE 'sorry|Classical\.choice'; then
78-
echo "::error::axiom audit failed — sorry or Classical.choice present"
87+
if echo "$out" | grep -qiE 'sorry|Classical\.choice|error'; then
88+
echo "::error::axiom audit failed — sorry, Classical.choice or an elaboration error present"
89+
exit 1
90+
fi
91+
# Lean may wrap a long "depends on axioms: [...]" list over several
92+
# lines, so parse the output with newlines collapsed to spaces.
93+
flat="$(printf '%s' "$out" | tr '\n' ' ')"
94+
# Every audited declaration must yield exactly one parsed verdict;
95+
# an unparseable result fails instead of reading as "no axioms".
96+
expected="$(grep -c '^#print axioms ' /tmp/axcheck.lean)"
97+
verdicts="$(printf '%s' "$flat" \
98+
| grep -oE "does not depend on any axioms|depends on axioms: \[[^]]*\]" \
99+
| wc -l)"
100+
if [ "$verdicts" -ne "$expected" ]; then
101+
echo "::error::axiom audit failed — parsed $verdicts verdicts for $expected '#print axioms' lines"
102+
exit 1
103+
fi
104+
# Allowlist: every printed dependency must be propext or Quot.sound.
105+
# Any other axiom (a project `axiom`, funext, Classical.*) fails the audit.
106+
# grep exits 1 when nothing is left over (the good case); tolerate only that.
107+
extra="$(printf '%s' "$flat" | grep -oE 'depends on axioms: \[[^]]*\]' \
108+
| sed -E 's/.*\[(.*)\]/\1/; s/,/ /g' | tr ' ' '\n' \
109+
| grep -v '^$' | grep -vxE 'propext|Quot\.sound' || test "$?" -eq 1)"
110+
if [ -n "$extra" ]; then
111+
echo "::error::axiom audit failed — axioms outside the allowlist: $extra"
79112
exit 1
80113
fi

‎PROOF-STATUS.adoc‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type-checked in this environment from what is CI-gated but not re-checked here.
1212
* Toolchain: **Lean 4 v4.35.0** (pinned in `lean-toolchain`), *no Mathlib*
1313
dependency (pure core Lean 4).
1414
* Command: `lake build` after `rm -rf .lake/build` (clean rebuild).
15-
* Result: **Build completed successfully — 20/20 targets**, i.e. every Lean
15+
* Result: **Build completed successfully — 21/21 targets** (2026-11-09, with `HubCeiling`), i.e. every Lean
1616
module type-checks.
1717

1818
Modules (libs `Tropical` + `Resource`):
@@ -22,7 +22,10 @@ Modules (libs `Tropical` + `Resource`):
2222
* `Resource.lean` aggregator + `Resource/Algebra/{Interface,Ordered,Dioid,ParametricLaws}.lean`
2323
(the ordered-semiring / resource-algebra interface + parametric transport theorem).
2424
* `Resource/Instances/{MaxPlus,MinPlus,MinMax,Linear,Affine}.lean` (concrete semirings).
25-
* `Resource/{Bridge,Closure,Conformance,Stress,EchoBridge}.lean`.
25+
* `Resource/{Bridge,Closure,Conformance,Stress,EchoBridge,HubCeiling}.lean`
26+
(`HubCeiling` added 2026-11-09: hub ceilings, reach grades, weighted residue
27+
measure for `hyperpolymath/squeakwell` rungs R5–R7; built here with
28+
`lake build`, axiom audit `propext`/`Quot.sound` only, no `sorry`).
2629

2730
Reproduce:
2831
[source,sh]

‎Resource.lean‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Resource.EchoBridge
1414
import Resource.Conformance
1515
import Resource.Bridge
1616
import Resource.Closure
17+
import Resource.HubCeiling
1718

1819
/-!
1920
# `Resource` — the resource-grade axis (aggregator)
@@ -61,4 +62,10 @@ import Resource.Closure
6162
bottleneck). The `EntryBounded` / `AllPairsCosts`
6263
certificate and `matStar` monotonicity mirror
6364
`typed-wasm`'s Idris `Tropical.idr` onto the axis.
65+
* `Resource.HubCeiling` — hub ceilings (`factor_le`, `single_hub_ceiling`,
66+
`single_hub_star_ceiling` under an explicit `IsStar`),
67+
reach grades over an observed set (`reachGrade`,
68+
monotone in matrix and set; `one ⊑` on observed nodes),
69+
and the generic `weightedResidueMeasure`. Serves
70+
`hyperpolymath/squeakwell` rungs R5–R7.
6471
-/

0 commit comments

Comments
 (0)