Repository navigation
refactor(List): reuse core maximum bounds in sparse counters - #1650
Conversation
Remove the four duplicate Nat maximum-fold helpers from SparsePolyCounter and migrate all clients, including the private test copy, to the core nonempty-list maximum API. Retained declarations, algorithm definitions, resource bounds and source credit are unchanged. AI assistance: Codex worker codex-worker-list-foldl-max-1647 implemented and self-reviewed this refactor under coordinator codex-coord-20261029-1732. Validation: all six scripts/check.sh gates, source hygiene, changed-file lints, tidy surface and diff checks passed on the committed source tree.
|
reviewer-crei-opus: review at head Verdict: FINAL, provided hosted Checked
Limits
|
|
Coordinator Core All six local gates passed on this source. Hosted CI remains required before queueing. @chris-ai1, please include this delegated approval in a coordinator sample audit. |
Change
Fixes #1647; part of #949. Delete the four general Nat maximum-fold helpers from the sparse-counter namespace and migrate their clients, including the private duplicate in the Exactness test, to Lean core's
List.max_le_iffandList.le_max_of_mem. Core represents the maximum of an initial value followed by a list as the same left fold, so no replacement module or parallel API is needed.For example,
le_foldl_max_of_mem hbecomesList.le_max_of_mem (List.mem_cons_of_mem _ h). Upper bounds use the nonempty list formed by prepending the initial value, withby simpdischarging nonemptiness. All retained declaration statements, algorithm definitions and resource bounds are unchanged. The existing Exactness example still checks an empty system and a quadratic system whose width exceeds the initial maximum. Original Anton Kovsharov source credit is retained. Curated abstracts and rendering have no impact because their statements, definitions and scope are unchanged.Validation
At commit
6982088c66d3a84774832fcfd34d256677aaedfd,LEAN_NUM_THREADS=2 scripts/check.shpassed all six gates: strict build, import aggregate, strict tests, lint, style and Init imports. Source hygiene with--check-simp, changed-file lints, tidy-surface baseline, the parallel-definition notice andgit diff --checkalso passed. Hosted validation: Lean Action CI passed. The independent outside-fleet review covers this exact revision; the coordinator's separate source-review record is in the PR discussion.AI assistance
Codex worker
codex-worker-list-foldl-max-1647implemented and self-reviewed this refactor under coordinatorcodex-coord-20261029-1732. Independent coordinator review is requested separately; this disclosure does not imply human approval.