Repository navigation
[ new ] Polynomials - #3123
[ new ] Polynomials#3123gallais wants to merge 8 commits into
Conversation
| module _ (_≟0 : ∀ a → Dec (a ≈A 0#)) where | ||
|
|
||
| -- true degree function of a polynomial | ||
| deg : Poly → Maybe ℕ |
There was a problem hiding this comment.
Maybe is standing for minus infinity so we should probably use
Relation.Nullary.Construct.Add.Infimum to make our intent more explicit.
This should probably be called degree and be moved to Base.
| ⟦ a ⟧ +B β *B eval β p +B eval β (b ∷ q) | ||
| ∎ | ||
|
|
||
| eval-1#-homomorphic : (β : CR.Carrier B) → eval β (A1# ∷ []) ≈B 1# |
There was a problem hiding this comment.
This should be using the name of the unit polynomial
| eval β (-P (a ∷ p)) | ||
| ≈⟨ B.+-congˡ (B.*-congˡ (eval-inverse-homomorphic β p)) ⟩ | ||
| ⟦ -A a ⟧ +B β *B (-B (eval β p)) | ||
| ≈⟨ B.+-congˡ (-‿distribʳ-* (CR.ring B) β (eval β p)) ⟨ |
There was a problem hiding this comment.
I think this ought to work?
| ≈⟨ B.+-congˡ (-‿distribʳ-* (CR.ring B) β (eval β p)) ⟨ | |
| ≈⟨ B.+-congˡ (B.-‿distribʳ-* β (eval β p)) ⟨ |
| module B = CR B | ||
| open B | ||
| using (distrib) | ||
| renaming | ||
| (_≈_ to _≈B_ | ||
| ; _+_ to _+B_ | ||
| ; _*_ to _*B_ | ||
| ; -_ to -B_ | ||
| ; setoid to B-Set) | ||
| using (0#; 1#) |
There was a problem hiding this comment.
| module B = CR B | |
| open B | |
| using (distrib) | |
| renaming | |
| (_≈_ to _≈B_ | |
| ; _+_ to _+B_ | |
| ; _*_ to _*B_ | |
| ; -_ to -B_ | |
| ; setoid to B-Set) | |
| using (0#; 1#) | |
| module B = CR B | |
| open B | |
| using () | |
| renaming | |
| (Carrier to B) |
And then you can use B instead of CR.Carrier B and e.g. _B.+_ instead of _B+_.
| (β *B eval β p) *B eval β q | ||
| ∎ | ||
|
|
||
| eval-inverse-homomorphic : (β : CR.Carrier B) → (p : Poly) → |
There was a problem hiding this comment.
| eval-inverse-homomorphic : (β : CR.Carrier B) → (p : Poly) → | |
| eval‿- : (β : CR.Carrier B) → (p : Poly) → |
|
|
||
| ---------------- Universal Property of Polynomial Rings ---------------- | ||
|
|
||
| x-mapsto-β : (β : CR.Carrier B) → eval β (A0# ∷ A1# ∷ []) ≈B β |
There was a problem hiding this comment.
Define id# (?) and
| x-mapsto-β : (β : CR.Carrier B) → eval β (A0# ∷ A1# ∷ []) ≈B β | |
| eval-id# : (β : CR.Carrier B) → eval β id# ≈B β |
| ı : A.Carrier → Poly | ||
| ı r = r ∷ [] |
There was a problem hiding this comment.
This should go in Poly.Base.Semiring; and be called inject maybe?
| ı : A.Carrier → Poly | ||
| ı r = r ∷ [] | ||
|
|
||
| eval-comm : (β : CR.Carrier B) → ∀ (r : A.Carrier) → ⟦ r ⟧ ≈B eval β (ı r) |
There was a problem hiding this comment.
| eval-comm : (β : CR.Carrier B) → ∀ (r : A.Carrier) → ⟦ r ⟧ ≈B eval β (ı r) | |
| eval-inject : (β : CR.Carrier B) → ∀ (r : A.Carrier) → eval β (ı r) B.≈ ⟦ r ⟧ |
| eval β (r ∷ []) | ||
| ∎ | ||
|
|
||
| eval-unique : (β : CR.Carrier B) → |
There was a problem hiding this comment.
We could lift the constant parameters to an anonymous module.
It should look something like (modulo indentation, etc.)
open RingHomo
-- Now proving the universal property of eval
module _
(ϕ : RingHomo {ℓ₁} {ℓ₁ L.⊔ ℓ₂} PolyrawRing B.rawRing)
(ϕ-inject : (r : A) → ⟦ ϕ ⟧ (ı r) ≈B (⟦ r ⟧))
(β : B) (ϕ-id# : ⟦ ϕ ⟧ id# ≈B β)
where
eval-unique : (p : Poly) → ⟦ ϕ ⟧ p ≈B eval β p
gallais
left a comment
There was a problem hiding this comment.
Mostly cosmetic changes
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
New iteration on #2821
Please hold off on commenting for now