New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(data/polynomial): use monoid_algebra.lift
and aeval
#2492
Conversation
Some functions and lemmas in `polynomial` now take bundled homomorphisms as arguments.
Don't make `additive` and `multiplicative` irreducible (yet?) because it breaks compilation here and there. Also prove that homomorphisms from `ℕ`, `ℤ` and their `multiplicative` versionsare defined by the image of `1`.
I wonder why it fails to unify instances in `polynomial.algebra`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LaGTM
|
||
variables {R A} | ||
|
||
theorem aeval_def' : | ||
aeval R A x p = monoid_algebra.lift R (multiplicative ℕ) A (powers_hom A x) p := rfl | ||
theorem aeval_def' : aeval R A x p = add_monoid_algebra.lift R ℕ A (powers_hom A x) p := rfl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right hand side looks quite intimidating compared to p.eval x
. Is this the new simp-normal-form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general there seem to be very few simp-lemmas for aeval
. I would expect simp-lemmas for aeval_X
and aeval_C
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a simp
lemma. This is a lemma “show me an ugly definition, I want to apply some theorem about add_monoid_algebra.lift
”. I'll see if it can be removed. You can find aeval_X
and aeval_C
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for explaining. It certainly can stay.
Thanks for doing all this refactoring work! |
What happened to this PR? I've lost track of plans to refactor polynomials. |
monoid_algebra
instead ofadd_monoid_algebra
;aeval
usingmonoid_algebra.lift
;eval
etc.