| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Instantiates the natural coefficients ring solver, using coefficient |
| 5 |
-- equality induced by ℕ. |
| 6 |
-- |
| 7 |
-- This is sufficient for proving equalities that are independent of the |
| 8 |
-- characteristic. In particular, this is enough for equalities in |
| 9 |
-- rings of characteristic 0. |
| 10 |
------------------------------------------------------------------------ |
| 11 |
|
| 12 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 13 |
|
| 14 |
open import Algebra |
| 15 |
|
| 16 |
module Algebra.Solver.Ring.NaturalCoefficients.Default |
| 17 |
{r₁ r₂} (R : CommutativeSemiring r₁ r₂) where |
| 18 |
|
| 19 |
import Algebra.Properties.Semiring.Mult as SemiringMultiplication using (_×_) |
| 20 |
open import Data.Maybe.Base using (Maybe; map) |
| 21 |
open import Data.Nat using (_≟_) |
| 22 |
open import Relation.Binary.Consequences using (dec⇒weaklyDec) |
| 23 |
import Relation.Binary.PropositionalEquality.Core as ≡ using (refl; cong) |
| 24 |
|
| 25 |
open CommutativeSemiring R |
| 26 |
open SemiringMultiplication semiring |
| 27 |
|
| 28 |
private |
| 29 |
dec : ∀ m n → Maybe (m × 1# ≈ n × 1#) |
| 30 |
dec m n = map (λ { ≡.refl → refl }) (dec⇒weaklyDec _≟_ m n) |
| 31 |
|
| 32 |
open import Algebra.Solver.Ring.NaturalCoefficients R dec public |