Skip to content

[ new ] Polynomials - #3123

Draft
gallais wants to merge 8 commits into
agda:masterfrom
samparkky:prof-edits
Draft

gallais wants to merge 8 commits into
agda:masterfrom
samparkky:prof-edits

Conversation

@gallais

@gallais gallais commented Oct 1, 2026

Copy link
Copy Markdown
Member

New iteration on #2821

Please hold off on commenting for now

module _ (_≟0 : ∀ a → Dec (a ≈A 0#)) where

-- true degree function of a polynomial
deg : Poly → Maybe ℕ

@gallais gallais Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/Algebra/Polynomial/Morphism/Morphism.agda Outdated
⟦ a ⟧ +B β *B eval β p +B eval β (b ∷ q)
∎

eval-1#-homomorphic : (β : CR.Carrier B) → eval β (A1# ∷ []) ≈B 1#

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) ⟨

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ought to work?

Suggested change
≈⟨ B.+-congˡ (-‿distribʳ-* (CR.ring B) β (eval β p)) ⟨
≈⟨ B.+-congˡ (B.-‿distribʳ-* β (eval β p)) ⟨

Comment on lines +66 to +75
module B = CR B
open B
using (distrib)
renaming
(_≈_ to _≈B_
; _+_ to _+B_
; _*_ to _*B_
; -_ to -B_
; setoid to B-Set)
using (0#; 1#)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) →

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 β

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define id# (?) and

Suggested change
x-mapsto-β : (β : CR.Carrier B) → eval β (A0# ∷ A1# ∷ []) ≈B β
eval-id# : (β : CR.Carrier B) → eval β id# ≈B β

Comment on lines +293 to +294
ı : A.Carrier → Poly
ı r = r ∷ []

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) →

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gallais left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly cosmetic changes

samparkky and others added 2 commits October 1, 2026 19:56
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants