Int.ring
import Int (Int, intZero, intOne, intNeg)
import Int.add (+, intAddComm)
import Int.mul (*, intMulAssoc, intMulComm, intMulOneR, intMulDistribL)
import Int.group (intAddGroup)
import Core.id (Id, eqToId)
import Algebra.monoid (IsMonoid)
import Algebra.group (IsGroup)
import Algebra.ring (IsCommRing)
intCommRing : IsCommRing Int using (Int.group.intAddGroup.eq, Algebra.ring.IsCommRing.unfold)
intCommRing =
(,)
intAddGroup
(*)
intOne
λx y z. eqToId _ _ (intMulAssoc x y z)
λx y. eqToId _ _ (intMulComm x y)
λx. eqToId _ _ (intMulOneR x)
λx y. eqToId (x + y) (y + x) (intAddComm x y)
λx y z. eqToId (x * (y + z)) (x * y + x * z) (intMulDistribL x y z)