Repository navigation
feat(ComputablePolynomial): define SparsePoly, a computable univariate polynomial - #41339
mkaratarakis wants to merge 4 commits into
Conversation
PR summary 21af48fbe7Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (weak) |
|---|---|---|
| 5099 | 1 | exposed public sections |
Current commit 21af48fbe7
Reference commit 84ae864884
This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
…ivariate polynomial Co-Authored-By: Claude Fable 5 <[email protected]>
2f22d57 to
f128c8b
Compare
joneugster
left a comment
There was a problem hiding this comment.
Sorry this PR has been lying on the queue for quite a while!
Looks good to me, thanks! Only minor suggestions
| @[ext] structure SparsePoly (R : Type) [CommRing R] : Type where | ||
| /-- The underlying list of `(exponent, coefficient)` pairs, ordered by strictly decreasing | ||
| exponent with all coefficients nonzero. -/ | ||
| coeffs : List (ℕ × R) |
There was a problem hiding this comment.
Wouldn't it be more efficient to use a single inductive, Lean.AssocList, instead of combining List and Prod?
There was a problem hiding this comment.
Good point, thanks! I kept List (ℕ × R) because of the List API e.g Pairwise, filter, which AssocList doesn't have, but I'm happy to switch. Batteries.AssocList might be another option via toList. Let me know if you'd prefer that
There was a problem hiding this comment.
It seems that there or some open questions about the right design of the entire stack of PRs and about how useful the resulting tactics will be.
Some of this was written on #41282, which contained the entire stack of PRs combined. Some was initially discussed in the reviewer stream linked above. I'll mark this
awaiting-zulip
for now. I think there needs to be some discussion about what tactics we get out of this and how useful they will be
There was a problem hiding this comment.
Maybe this discussion should be continued/restarted in a public topic?
There was a problem hiding this comment.
SparsePoly Ris a computable, kernel-reducible representation of univariate polynomials over a commutative ringRwithDecidableEq R: a list of(exponent, coefficient)pairs with strictly decreasing exponents and nonzero coefficients, making the representation canonical. This first part defines the structure, the semanticstoPoly : SparsePoly R → Polynomial R, and addition.Started by Mario Carneiro at the Hausdorff Institute (June 2024) with design notes and an original Lean prototype by James Davenport (https://github.com/JamesHDavenport/Dagstuhl23401,
verify-irred/VerifyIrred) and the proofs were done with the help of Claude code.