Algebra.ideal
import Core.prop (โง, andIntro, andFst, andSnd)
import Algebra.monoid (IsMonoid)
import Algebra.group (IsGroup)
import Algebra.ring (IsCommRing)
import Algebra.groupTheory (gop, ge, ginv)
import Algebra.ringTheory (raddGroup, rmul, rone, rMulComm, rAddComm, rMulSub)
import Algebra.subgroup (IsSubgroup, IsNormal, sgIntro, sgUnit, sgOp, sgInv, abelianNormal, cosetRel)
import Core.equality (transportP, sym, trans, cong)
closedScale : (R : ๐) (r : IsCommRing R) (I : R โ ฮฉ) โ ฮฉ
closedScale = ฮปR r I. โฅ(a x : R) โ I x โ I (rmul _ r a x)โฅ
IsIdeal : (R : ๐) (r : IsCommRing R) (I : R โ ฮฉ) โ ฮฉ
IsIdeal = ฮปR r I. IsSubgroup (raddGroup r) I โง closedScale _ r I
idIntro : {R : ๐}
{r : IsCommRing R}
{I : R โ ฮฉ}
โ IsSubgroup (raddGroup r) I โ ((a x : R) โ I x โ I (rmul _ r a x)) โ IsIdeal _ r I
using (IsIdeal.eq, closedScale.eq)
idIntro = ฮปR r I sub sc. andIntro sub (โ sc)
idSub : {R : ๐} {r : IsCommRing R} {I : R โ ฮฉ} โ IsIdeal _ r I โ IsSubgroup (raddGroup r) I
using (IsIdeal.eq)
idSub = ฮปR r I h. andFst h
idScale : (R : ๐)
(r : IsCommRing R)
(I : R โ ฮฉ)
โ IsIdeal _ r I โ (a x : R) โ I x โ I (rmul _ r a x)
using (IsIdeal.eq, closedScale.unfold)
idScale = ฮปR r I h a x hx. squash-elim (andSnd h) (u. u a x hx)
idNormal : (R : ๐) (r : IsCommRing R) (I : R โ ฮฉ) โ IsNormal (raddGroup r) I
idNormal = ฮปR r I. abelianNormal (rAddComm _ r)
idScaleR : (R : ๐)
(r : IsCommRing R)
(I : R โ ฮฉ)
โ IsIdeal _ r I โ (a x : R) โ I x โ I (rmul _ r x a)
idScaleR = ฮปR r I h a x hx. transportP I (rMulComm _ r a x) (idScale _ _ _ h a x hx)