module Cubical.Algebra.CommRing.Instances.Unit where

open import Cubical.Foundations.Prelude

open import Cubical.Data.Unit

open import Cubical.Algebra.Ring
open import Cubical.Algebra.CommRing

private
  variable
     ℓ' : Level

open CommRingStr

UnitCommRing : CommRing 
fst UnitCommRing = Unit*
0r (snd UnitCommRing) = tt*
1r (snd UnitCommRing) = tt*
_+_ (snd UnitCommRing) = λ _ _  tt*
_·_ (snd UnitCommRing) = λ _ _  tt*
- snd UnitCommRing = λ _  tt*
isCommRing (snd UnitCommRing) =
  makeIsCommRing isSetUnit*  _ _ _  refl)  { tt*  refl })  _  refl)
                  _ _  refl)  _ _ _  refl)  { tt*  refl })
                  _ _ _  refl)  _ _  refl)

mapToUnitCommRing : { : Level} (R : CommRing ℓ')  CommRingHom R (UnitCommRing { = })
mapToUnitCommRing R .fst = λ _  tt*
mapToUnitCommRing R .snd .IsCommRingHom.pres0 = refl
mapToUnitCommRing R .snd .IsCommRingHom.pres1 = refl
mapToUnitCommRing R .snd .IsCommRingHom.pres+ = λ _ _  refl
mapToUnitCommRing R .snd .IsCommRingHom.pres· = λ _ _  refl
mapToUnitCommRing R .snd .IsCommRingHom.pres- = λ _  refl

isPropMapToUnitCommRing : { : Level} (R : CommRing ℓ')  isProp (CommRingHom R (UnitCommRing { = }))
isPropMapToUnitCommRing R f g = CommRingHom≡ (funExt λ _  refl)