-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededphase 1 - theoryPhase 1 of the roadmap, focusing on theory completenessPhase 1 of the roadmap, focusing on theory completeness
Description
Implement algebra evaluation and substitution: aeval and bind₁
Summary
Implement algebra evaluation (aeval) and polynomial substitution (bind₁) for multivariate polynomials. These are fundamental operations for evaluating polynomials in algebras and composing polynomials.
Context
Part of Phase 1: Foundation Completion (API completeness) as outlined in ROADMAP.md line 55. These functions are essential for working with polynomial algebras and are commonly used in Mathlib.
What to Implement
-
aeval {n : ℕ} {R σ : Type} [CommSemiring R] [CommSemiring σ] [Algebra R σ] (f : Fin n → σ) (p : CMvPolynomial n R) : σ- Algebra evaluation: evaluates polynomial in an algebra
- Given an algebra
σoverRand a functionf : Fin n → σ, evaluates the polynomial - Location:
CompPoly/Multivariate/CMvPolynomial.leanline 207
-
bind₁ {n m : ℕ} {R : Type} [CommSemiring R] [BEq R] [LawfulBEq R] (f : Fin n → CMvPolynomial m R) (p : CMvPolynomial n R) : CMvPolynomial m R- Substitution: substitutes polynomials for variables
- Given
f : Fin n → CMvPolynomial m R, substitutesf ifor variableX i - Location:
CompPoly/Multivariate/CMvPolynomial.leanline 215
Dependencies
eval₂(already exists) - can be used as a building block foraevalAlgebratypeclass from MathlibCMvPolynomialmultiplication and addition (forbind₁)monomialconstructor (for building substituted terms)
Implementation Notes
aeval
- Can likely implement via
eval₂usingalgebraMap R σas the ring homomorphism - For each monomial
mwith coefficientc, computealgebraMap R σ c * ∏ᵢ (f i)^(m[i]) - Sum over all monomials
bind₁
- For each monomial
mwith coefficientc, computec * ∏ᵢ (f i)^(m[i]) - Sum over all monomials
- Can use
aevalwithCMvPolynomial m Ras the algebra, or implement directly
Properties to Prove
aeval f (C c) = algebraMap R σ caeval f (X i) = f iaeval f (p + q) = aeval f p + aeval f qaeval f (p * q) = aeval f p * aeval f qbind₁ f (C c) = C cbind₁ f (X i) = f ibind₁ f (p + q) = bind₁ f p + bind₁ f qbind₁ f (p * q) = bind₁ f p * bind₁ f qbind₁ (fun i => X i) p = p(identity substitution)
Mathlib References
MvPolynomial.aeval- Similar concept in MathlibMvPolynomial.bind₁- Similar concept in MathlibMvPolynomial.eval₂Hom- Related evaluation homomorphism
Success Criteria
-
aevalcorrectly evaluates polynomials in an algebra -
bind₁correctly substitutes polynomials for variables - All basic properties are proven (see above)
- Relationship with
eval₂is established
Tags
phase-1api-completenessmultivariate-polynomialsalgebra
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededphase 1 - theoryPhase 1 of the roadmap, focusing on theory completenessPhase 1 of the roadmap, focusing on theory completeness