-
Notifications
You must be signed in to change notification settings - Fork 248
Relax decidability module parameter of Algebra.Solver.Ring #511
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
Conversation
This replaces the `Decidable` module parameter in `Algebra.Solver.Ring` by a new predicate `WeaklyDecidable`. It only provides a subset of those equality proofs that `Decidable` can provide, and does not provide inequality proofs. As a result, ring solvers can now be used in more general situations in which decidable equality is not available. For this, a new module `Algebra.Solver.Ring.NaturalCoefficients.Default` was added which instantiates the natural coefficients solver for any `CommutativeSemiring`, such as `×-⊎-commutativeSemiring` in `Function.Related.TypeIsomorphisms.Solver`.
I incorporated the suggestions. As mentioned, I had to move |
Thanks for the PR. Merging in! |
Hmm hang on, I just took one last look and have a question. Isn't every relation |
Indeed, being However (quite to my surprise), even with the constant By the way, an operator test : ∀ x y → (x + y) ^ 3 ≈ x ^ 3 + 3 × x ^ 2 * y + 3 × x * y ^ 2 + y ^ 3
test = solve 2 (λ x y → (x :+ y) :^ 3 := x :^ 3 :+ 3 :× x :^ 2 :* y :+ 3 :× x :* y :^ 2 :+ y :^ 3) refl |
Thanks for the clarification and the PR! Merging in. I'll add some documentation afterwards. |
(See #507)
This replaces the
Decidable
module parameter inAlgebra.Solver.Ring
by a new predicate
WeaklyDecidable
. It only provides a subset of thoseequality proofs that
Decidable
can provide, and does not provideinequality proofs.
As a result, ring solvers can now be used in more general situations in
which decidable equality is not available. For this, a new module
Algebra.Solver.Ring.NaturalCoefficients.Default
was added whichinstantiates the natural coefficients solver for any
CommutativeSemiring
, such as×-⊎-commutativeSemiring
inFunction.Related.TypeIsomorphisms.Solver
.Any comments are appreciated. Is naming and location of the two new modules
Algebra.Solver.Ring.WeaklyDecidable
andAlgebra.Solver.Ring.NaturalCoefficients.Default
appropriate or are there better options?