Skip to content

Commit

Permalink
universal property of polynomials as rings
Browse files Browse the repository at this point in the history
  • Loading branch information
felixwellen committed Aug 7, 2024
1 parent 7005291 commit 72226e5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
module Cubical.Algebra.CommRing.Instances.Polynomials.Typevariate.OnCoproduct where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function using (_∘_)
open import Cubical.Foundations.Function using (_∘_; _$_)
open import Cubical.Foundations.Structure using (⟨_⟩)

open import Cubical.Data.Sum as ⊎
Expand Down Expand Up @@ -45,10 +45,13 @@ module CalculatePolynomialsOnCoproduct (R : CommRing ℓ) (I J : Type ℓ) where
mapVars (inr j) = var j

to∘MapVars : to .fst ∘ mapVars ≡ var
to∘MapVars = funExt λ {(inl i) to .fst (constPolynomial _ _ $cr var i)
≡⟨ cong (λ z z i) (evalInduce (R [ I ⊎ J ]) (constPolynomial R (I ⊎ J)) (var ∘ inl)) ⟩
var (inl i) ∎;
(inr j) (to .fst (var j) ≡⟨ cong (λ z z j) evalVarTo ⟩ var (inr j) ∎)}
to∘MapVars =
funExt λ {(inl i) to .fst (constPolynomial _ _ $cr var i)
≡⟨ cong (λ z z i)
(evalInduce (R [ I ⊎ J ])
(constPolynomial R (I ⊎ J)) (var ∘ inl)) ⟩
var (inl i) ∎;
(inr j) (to .fst (var j) ≡⟨ cong (λ z z j) evalVarTo ⟩ var (inr j) ∎)}

from : CommRingHom (R [ I ⊎ J ]) ((R [ I ]) [ J ])
from = inducedHom
Expand All @@ -59,7 +62,7 @@ module CalculatePolynomialsOnCoproduct (R : CommRing ℓ) (I J : Type ℓ) where
evalVarFrom : from .fst ∘ var ≡ mapVars
evalVarFrom = evalInduce ((R [ I ]) [ J ]) (constPolynomial (R [ I ]) J ∘cr constPolynomial R I) mapVars

toFrom : to ∘cr from ≡ (idCommRingHom _)
toFrom : to ∘cr from ≡ (idCommRingHom (R [ I ⊎ J ]))
toFrom =
idByIdOnVars
(to ∘cr from)
Expand All @@ -68,14 +71,35 @@ module CalculatePolynomialsOnCoproduct (R : CommRing ℓ) (I J : Type ℓ) where
(to .fst ∘ from .fst ∘ var ≡⟨ cong (to .fst ∘_) evalVarFrom ⟩
to .fst ∘ mapVars ≡⟨ to∘MapVars ⟩
var ∎)
{-
fromTo : from ∘cr to ≡ (idCommRingHom _)

{- from and to are R[I]-algebra homomorphisms:
this is true definitionally for to.
-}
fromAlgebraHom : from ∘cr I→I+J ≡ constPolynomial (R [ I ]) J
fromAlgebraHom =
hom≡ByValuesOnVars
((R [ I ]) [ J ]) (constPolynomial (R [ I ]) J ∘cr constPolynomial R I)
(from ∘cr I→I+J) (constPolynomial (R [ I ]) J)
refl refl
(funExt
(λ i (from ∘cr I→I+J) .fst (var i)
≡⟨ cong (from .fst)
(evalOnVars (R [ I ⊎ J ])
(constPolynomial R (I ⊎ J))
(var ∘ inl) i) ⟩
from .fst (var (inl i))
≡⟨ evalOnVars ((R [ I ]) [ J ])
(constPolynomial (R [ I ]) J ∘cr constPolynomial R I)
mapVars (inl i) ⟩
constPolynomial (R [ I ]) J $cr var i ∎))

fromTo : from ∘cr to ≡ (idCommRingHom $ (R [ I ]) [ J ])
fromTo =
idByIdOnVars
(from ∘cr to)
(from .fst ∘ to .fst ∘ constPolynomial (R [ I ]) J .fst ≡⟨⟩
from .fst ∘ I→I+J .fst
≡⟨ cong fst (hom≡ByValuesOnVars ((R [ I ]) [ J ]) {!from ∘cr I→I+J!} {!I→I+J!} {!!} {!!} {!!} {!!}) ⟩
from .fst ∘ I→I+J .fst ≡⟨ cong fst fromAlgebraHom ⟩
constPolynomial (R [ I ]) J .fst ∎)
(from .fst ∘ to .fst ∘ var ≡⟨ {!!} ⟩ var ∎)
-}
(from .fst ∘ to .fst ∘ var ≡⟨ cong (from .fst ∘_) (funExt $ evalOnVars (R [ I ⊎ J ]) I→I+J (var ∘ inr) ) ⟩
from .fst ∘ var ∘ inr ≡⟨ (funExt $ λ j evalOnVars _ _ _ (inr j)) ⟩
var ∎)
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,15 @@ module _ {R : CommRing ℓ} {I : Type ℓ'} (S : CommRing ℓ'') (f : CommRingH
opaque
unfolding var
evalInduce : : I ⟨ S ⟩)
evalVar (inducedHom S f φ) ≡ φ
evalVar (inducedHom S f φ) ≡ φ
evalInduce φ = refl

opaque
unfolding var
evalOnVars : : I ⟨ S ⟩)
(i : I) inducedHom S f φ .fst (var i) ≡ φ i
evalOnVars φ i = refl

opaque
unfolding var
induceEval : (g : CommRingHom (R [ I ]) S)
Expand Down
1 change: 1 addition & 0 deletions Cubical/Algebra/CommRing/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ module _ where
RingHom→CommRingHom
(compRingHom (CommRingHom→RingHom f) (CommRingHom→RingHom g))

infixr 9 _∘cr_ -- same as functions
_∘cr_ : {R : CommRing ℓ} {S : CommRing ℓ'} {T : CommRing ℓ''}
CommRingHom S T CommRingHom R S CommRingHom R T
g ∘cr f = compCommRingHom f g
Expand Down

0 comments on commit 72226e5

Please sign in to comment.