chore(SplitFold): docstring and attribute hygiene follow-up to #670 - #685
Merged
Conversation
Follow-up to #670, which merged as-is because none of these were blocking. No statement, definition or proof changes semantics. Docstrings: - `splitNth_eval_comp_pow` referenced `splitNth_def`, renamed by #670 to `eq_sum_splitNth`. - The module docstring and that docstring advertised `Polynomial.foldNth`, which does not exist in the repo; point at `FoldingPolynomial.polyFold` and `polyFold_eq_sum_of_splitNth` instead. - `eq_sum_splitNth` and `splitNth_degree_le` used `/- -/` not `/-- -/`, so the file's key identity had no docstring (pre-existing). - Note that `splitNth`'s `n = 0` branch is unreachable (`Fin 0` is empty). Attributes and names: - Drop `@[simp]` from `splitNth_degree_le` and pass it explicitly to the one `aesop` call that needs it. It is an inequality, and it was load-bearing invisibly: `folding_polynomial_eq_sum_splitNth` relied on the attribute without naming it. - `splitNthNoncomputable_of_nz` -> `private lemma splitNthNoncomputable_of_neZero`: a `@[simp]` lemma about a `private` definition should not sit in the global simp set; its sibling `splitNthNoncomputable_coeff` was already private. - `splitNthNoncomputable_eq_splitNth` -> `splitNth_eq_splitNthNoncomputable`, matching the statement's direction. Deprecation sweep: - `Polynomial.eval_finset_sum` -> `eval_finsetSum` (4 sites in `Fri/RoundConsistency.lean`). `./scripts/validate.sh` green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
🤖 PR Summaryhttps://github.com/ark-lang/ark-lib/pull/674 Statistics
Lean Declarations ✏️ Removed: 2 declaration(s)
✏️ Added: 2 declaration(s)
📋 **Additional Analysis**No findings. 📄 **Per-File Summaries**
Last updated: 2026-08-05 14:17 UTC. |
Contributor
Build Timing Report
Incremental Rebuild Signal
This compares a clean project build against an incremental rebuild in the same CI job; it is a lightweight variability signal, not a full cross-run benchmark. Slowest Current Clean-Build FilesShowing 20 slowest current targets, with comparison against the selected baseline when available.
|
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.
Follow-up to #670, which was merged as-is because none of these were blocking. Docstring and
attribute hygiene only — no statement, definition or proof term changes semantics.
Docstrings
splitNth_eval_comp_powreferencedsplitNth_def, which Clean-up 🧼 of the SplitFold.lean #670 renamed toeq_sum_splitNth.Polynomial.foldNth, which doesnot exist anywhere in the repo (
git grep -E '(def|abbrev) foldNth'→ 0 hits). The file's foldoperation is
FoldingPolynomial.polyFold; pointed at it, and atpolyFold_eq_sum_of_splitNthfor the connection tosplitNth.eq_sum_splitNthandsplitNth_degree_leused/- … -/rather than/-- … -/, so the file'skey identity had no docstring at all. Promoted both (pre-existing, not from Clean-up 🧼 of the SplitFold.lean #670).
splitNththat then = 0branch is unreachable becauseFin 0is uninhabited.Attributes and names
@[simp]fromsplitNth_degree_leand passed it explicitly to the oneaesopcall that needs it. It is an inequality, so as a global simp lemma it can only rewrite the goal
to
True— but it was also load-bearing invisibly:folding_polynomial_eq_sum_splitNthrelied on the attribute without naming it, and removing the attribute alone gives
unsolved goalsat that proof. Making the dependency explicit keeps the proof honest and letsthe global attribute go.
splitNthNoncomputable_of_nz→private lemma splitNthNoncomputable_of_neZero. It is a@[simp]lemma about theprivatedefinitionsplitNthNoncomputable, so it was putting a simplemma with an inaccessible LHS constant into the global simp set; its sibling
splitNthNoncomputable_coeffwas alreadyprivate. Also spelled outnz→neZero.splitNthNoncomputable_eq_splitNth→splitNth_eq_splitNthNoncomputable: the name was thewrong way round relative to the statement, which is
splitNth f n = splitNthNoncomputable f n.Deprecation sweep
Polynomial.eval_finset_sum→Polynomial.eval_finsetSum(4 call sites inFri/RoundConsistency.lean), which was emitting deprecation warnings on every build.Validation
./scripts/validate.shgreen. The two remaining warnings inFri/RoundConsistency.lean(overlapping instance parameters at L28, empty-line-in-command at L76) are pre-existing on
mainand untouched here.
One further change was tried and reverted: discharging
splitNth's unreachablen = 0branchwith
absurd i.2 (by omega)instead of returningf. It is tidier in principle, but it breakssplitNth_coeff'saesopproof, and rewriting a working proof for a cosmetic gain is not worthit. Left the junk value with a comment explaining why it is unreachable.