Implementing computable versions of degreeLT, degreeLE, and related theorems#88
Implementing computable versions of degreeLT, degreeLE, and related theorems#88desmondcoles1 wants to merge 16 commits intoVerified-zkEVM:masterfrom
Conversation
🤖 Gemini PR SummaryThis PR introduces computable versions of degree-bounded polynomial submodules for Features
Fixes
Refactoring
Documentation
Analysis of Changes
🎨 **Style Guide Adherence**
📄 **Per-File Summaries**
Last updated: 2026-02-24 00:12 UTC. |
7680952 to
ddd6f99
Compare
Filled in sorries
Cleaned up some notational fluff from Aristotle.
|
I think this is ready to rock n roll, I am going to change the PR from draft to finalized. One comment: I don't think my proofs are quite as neat as the ones in Mathlib, I tried to mimic the arguments as best I could but not all the proofs just ported over automatically. |
There was a problem hiding this comment.
This is awesome @desmondcoles1 , thank you!!
The general form we're looking for in CompPoly is (roughly):
- have the API functions in Basic and then
- prove those functions correct wrt Mathlib's specs via the ring equivalence functions in ToPoly.
For example, just from a stylistic standpoint we would probably prefer degree_le_iff_coeff_zero and degree_lt_iff_coeff_zero to be proved in ToPoly. I guess, to do that we would likely need to show that the ring isomorphisms are also module isomorphisms .. would it be a lot of work to implement that style?
Afaict everything is mathematically correct so I probably happy to merge this as-is and then to put on the TODO list a module isomorphism and a refactor for the future, since there are likely more proofs in Basic.lean that we should refactor in this way anyway. If it would be quick and easy to do a refactor along these stylistic lines, that would be great too!
CompPoly/Univariate/Basic.lean
Outdated
|
|
||
| section LinearEquivalences | ||
|
|
||
| -- This section contains theorem about linear isomoprhism between modules. |
There was a problem hiding this comment.
nit pick - isomoprhism -> isomorphism
Ah I'm sorry @dhsorens I misunderstood this! I can play around with refactoring things.
Hard to say until I try to do it, I would need some time to look at it, if you would prefer to merge this now (after I sort out this build error!) I can immediately start working on the refactor, I can also try to refactor it before merge, whatever is easiest for you. It sounds like the ideal solution would be to prove this, prove that the isomorphism preserves degree, and then establish equivalence between all these submodules. This would probably make a lot of the proofs shorter and more human readable. |
|
I think I know what the build error is - I updated the dependency ExtTreeMapLemmas and it's now at a newer version. If you rebase onto the current branch (post update to 4.28.0) this should be solved. You can alternatively write on your local lakefile.lean: lean/mathlib updates can be .. a pain lol |
|
yeah I think proofs are nicer this way, and that's the style I'm trying to promote for CompPoly - this way we can make full use of Mathlib's extensive theory and we can focus on the computable side of things. Let me know if you run into any issues refactoring -- thank you! |
|
Sounds good, I'll get crackin on it. |
after the update a simp + decide term was hitting maximum recursion depth, changing the proof to be more explicit resolved the issue
This PR aims to resolve issue #48. As in the description of the issue, these changes will implement computable versions of Mathlib's
Polynomial.degreeLT,Polynomial.degreeLE, and their membership characterization lemmas forCPolynomial R.To do list
degreeLTanddegreeLE