| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Bundles of parameters for passing to the Ring Solver |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
-- This module packages up all the stuff that's passed to the other |
| 10 |
-- modules in a convenient form. |
| 11 |
|
| 12 |
module Tactic.RingSolver.Core.Polynomial.Parameters where |
| 13 |
|
| 14 |
open import Algebra.Bundles using (RawRing) |
| 15 |
open import Data.Bool.Base using (Bool; T) |
| 16 |
open import Level |
| 17 |
open import Relation.Unary |
| 18 |
open import Tactic.RingSolver.Core.AlmostCommutativeRing |
| 19 |
|
| 20 |
-- This record stores all the stuff we need for the coefficients: |
| 21 |
-- |
| 22 |
-- * A raw ring |
| 23 |
-- * A (decidable) predicate on "zeroeness" |
| 24 |
-- |
| 25 |
-- It's used for defining the operations on the Horner normal form. |
| 26 |
record RawCoeff ℓ₁ ℓ₂ : Set (suc (ℓ₁ ⊔ ℓ₂)) where |
| 27 |
field |
| 28 |
rawRing : RawRing ℓ₁ ℓ₂ |
| 29 |
isZero : RawRing.Carrier rawRing → Bool |
| 30 |
|
| 31 |
open RawRing rawRing public |
| 32 |
|
| 33 |
-- This record stores the full information we need for converting |
| 34 |
-- to the final ring. |
| 35 |
record Homomorphism ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Set (suc (ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄)) where |
| 36 |
field |
| 37 |
from : RawCoeff ℓ₁ ℓ₂ |
| 38 |
to : AlmostCommutativeRing ℓ₃ ℓ₄ |
| 39 |
|
| 40 |
module Raw = RawCoeff from |
| 41 |
open AlmostCommutativeRing to public |
| 42 |
|
| 43 |
field |
| 44 |
morphism : Raw.rawRing -Raw-AlmostCommutative⟶ to |
| 45 |
open _-Raw-AlmostCommutative⟶_ morphism renaming (⟦_⟧ to ⟦_⟧ᵣ) public |
| 46 |
field |
| 47 |
Zero-C⟶Zero-R : ∀ x → T (Raw.isZero x) → 0# ≈ ⟦ x ⟧ᵣ |