-
Notifications
You must be signed in to change notification settings - Fork 260
Add ideals and quotient rings #2855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: quotient-groups
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,90 @@ | ||||||||||||||||||||||||
| ------------------------------------------------------------------------ | ||||||||||||||||||||||||
| -- The Agda standard library | ||||||||||||||||||||||||
| -- | ||||||||||||||||||||||||
| -- Quotient rings | ||||||||||||||||||||||||
| ------------------------------------------------------------------------ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| {-# OPTIONS --safe --cubical-compatible #-} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| open import Algebra.Bundles using (Ring; RawRing) | ||||||||||||||||||||||||
| open import Algebra.Ideal using (Ideal) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| module Algebra.Construct.Quotient.Ring {c ℓ} (R : Ring c ℓ) {c′ ℓ′} (I : Ideal R c′ ℓ′) where | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| open Ring R | ||||||||||||||||||||||||
| private module I = Ideal I | ||||||||||||||||||||||||
| open I using (ι; normalSubgroup) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| open import Algebra.Construct.Quotient.Group +-group normalSubgroup public | ||||||||||||||||||||||||
| using (_≋_; _by_; ≋-refl; ≋-sym; ≋-trans; ≋-isEquivalence; ≈⇒≋; quotientIsGroup; quotientGroup; project; project-surjective) | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How much of this list actually needs to be exported? |
||||||||||||||||||||||||
| renaming (≋-∙-cong to ≋-+-cong; ≋-⁻¹-cong to ≋‿-‿cong) | ||||||||||||||||||||||||
jamesmckinna marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| open import Algebra.Definitions _≋_ | ||||||||||||||||||||||||
| open import Algebra.Morphism.Structures using (IsRingHomomorphism) | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be bumped up above the |
||||||||||||||||||||||||
| open import Algebra.Properties.Semiring semiring | ||||||||||||||||||||||||
| open import Algebra.Properties.Ring R | ||||||||||||||||||||||||
|
Comment on lines
+24
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A pity that we don't (yet) have it so that the second presupposes the first cf. #2804 ? |
||||||||||||||||||||||||
| open import Algebra.Structures | ||||||||||||||||||||||||
| open import Function.Definitions using (Surjective) | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused, AFAICT? |
||||||||||||||||||||||||
| open import Level | ||||||||||||||||||||||||
| open import Relation.Binary.Reasoning.Setoid setoid | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. should this be part of the API exported by |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ≋-*-cong : Congruent₂ _*_ | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be tempted to use a local module (I forget the syntax for doing just inside the proof part) where |
||||||||||||||||||||||||
| ≋-*-cong {x} {y} {u} {v} (j by ιj+x≈y) (k by ιk+u≈v) = ι j I.*ₗ k I.+ᴹ j I.*ᵣ u I.+ᴹ x I.*ₗ k by begin | ||||||||||||||||||||||||
| ι (ι j I.*ₗ k I.+ᴹ j I.*ᵣ u I.+ᴹ x I.*ₗ k) + x * u ≈⟨ +-congʳ (ι.+ᴹ-homo (ι j I.*ₗ k I.+ᴹ j I.*ᵣ u) (x I.*ₗ k)) ⟩ | ||||||||||||||||||||||||
| ι (ι j I.*ₗ k I.+ᴹ j I.*ᵣ u) + ι (x I.*ₗ k) + x * u ≈⟨ +-congʳ (+-congʳ (ι.+ᴹ-homo (ι j I.*ₗ k) (j I.*ᵣ u))) ⟩ | ||||||||||||||||||||||||
| ι (ι j I.*ₗ k) + ι (j I.*ᵣ u) + ι (x I.*ₗ k) + x * u ≈⟨ +-congʳ (+-cong (+-cong (ι.*ₗ-homo (ι j) k) (ι.*ᵣ-homo u j)) (ι.*ₗ-homo x k)) ⟩ | ||||||||||||||||||||||||
| ι j * ι k + ι j * u + x * ι k + x * u ≈⟨ binomial-expansion (ι j) x (ι k) u ⟨ | ||||||||||||||||||||||||
| (ι j + x) * (ι k + u) ≈⟨ *-cong ιj+x≈y ιk+u≈v ⟩ | ||||||||||||||||||||||||
| y * v ∎ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| quotientRawRing : RawRing c (c ⊔ ℓ ⊔ c′) | ||||||||||||||||||||||||
| quotientRawRing = record | ||||||||||||||||||||||||
| { Carrier = Carrier | ||||||||||||||||||||||||
| ; _≈_ = _≋_ | ||||||||||||||||||||||||
| ; _+_ = _+_ | ||||||||||||||||||||||||
| ; _*_ = _*_ | ||||||||||||||||||||||||
| ; -_ = -_ | ||||||||||||||||||||||||
| ; 0# = 0# | ||||||||||||||||||||||||
| ; 1# = 1# | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+42
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
avoids redundant DRY ...? |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| quotientIsRing : IsRing _≋_ _+_ _*_ (-_) 0# 1# | ||||||||||||||||||||||||
| quotientIsRing = record | ||||||||||||||||||||||||
| { +-isAbelianGroup = record | ||||||||||||||||||||||||
| { isGroup = quotientIsGroup | ||||||||||||||||||||||||
| ; comm = λ x y → ≈⇒≋ (+-comm x y) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+54
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need to create, nor import,
Suggested change
|
||||||||||||||||||||||||
| ; *-cong = ≋-*-cong | ||||||||||||||||||||||||
| ; *-assoc = λ x y z → ≈⇒≋ (*-assoc x y z) | ||||||||||||||||||||||||
| ; *-identity = record | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as this is 'just' a pair, use |
||||||||||||||||||||||||
| { fst = λ x → ≈⇒≋ (*-identityˡ x) | ||||||||||||||||||||||||
| ; snd = λ x → ≈⇒≋ (*-identityʳ x) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; distrib = record | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||
| { fst = λ x y z → ≈⇒≋ (distribˡ x y z) | ||||||||||||||||||||||||
| ; snd = λ x y z → ≈⇒≋ (distribʳ x y z) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| quotientRing : Ring c (c ⊔ ℓ ⊔ c′) | ||||||||||||||||||||||||
| quotientRing = record { isRing = quotientIsRing } | ||||||||||||||||||||||||
|
Comment on lines
+69
to
+70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, can we inline the definition of |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| project-isHomomorphism : IsRingHomomorphism rawRing quotientRawRing project | ||||||||||||||||||||||||
| project-isHomomorphism = record | ||||||||||||||||||||||||
|
Comment on lines
+72
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As with #2854 maybe have the algebra name |
||||||||||||||||||||||||
| { isSemiringHomomorphism = record | ||||||||||||||||||||||||
| { isNearSemiringHomomorphism = record | ||||||||||||||||||||||||
| { +-isMonoidHomomorphism = record | ||||||||||||||||||||||||
| { isMagmaHomomorphism = record | ||||||||||||||||||||||||
| { isRelHomomorphism = record | ||||||||||||||||||||||||
| { cong = ≈⇒≋ | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; homo = λ _ _ → ≋-refl | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; ε-homo = ≋-refl | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; *-homo = λ _ _ → ≋-refl | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; 1#-homo = ≋-refl | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| ; -‿homo = λ _ → ≋-refl | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||
| ------------------------------------------------------------------------ | ||||||||||||||||||||
| -- The Agda standard library | ||||||||||||||||||||
| -- | ||||||||||||||||||||
| -- Ideals of a ring | ||||||||||||||||||||
| ------------------------------------------------------------------------ | ||||||||||||||||||||
|
|
||||||||||||||||||||
| {-# OPTIONS --safe --cubical-compatible #-} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| open import Algebra.Bundles using (Ring) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| module Algebra.Ideal {c ℓ} (R : Ring c ℓ) where | ||||||||||||||||||||
|
|
||||||||||||||||||||
| open Ring R using (+-group; +-comm) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| open import Algebra.Module.Construct.Sub.Bimodule using (Subbimodule) | ||||||||||||||||||||
| import Algebra.Module.Construct.TensorUnit as TU | ||||||||||||||||||||
| open import Algebra.NormalSubgroup (+-group) | ||||||||||||||||||||
| open import Level | ||||||||||||||||||||
|
|
||||||||||||||||||||
| record Ideal c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) where | ||||||||||||||||||||
| field | ||||||||||||||||||||
| -- a (two sided) ideal is exactly a subbimodule of R considered as a bimodule over itself | ||||||||||||||||||||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd put the comment above the
Suggested change
|
||||||||||||||||||||
| subbimodule : Subbimodule (TU.bimodule {R = R}) c′ ℓ′ | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally find the parametrisation in
Suggested change
which would then permit the earlier import of open import Algebra.Module.Construct.TensorUnit using (bimodule)I'd even be tempted to go further: conventionally, the canonical name for the tensor unit (wrt whatever tensor product structure) is open import Algebra.Module.Construct.TensorUnit renaming (bimodule to 𝕀)but this is being hyper-nitpicky! (maybe!?) |
||||||||||||||||||||
|
|
||||||||||||||||||||
| open Subbimodule subbimodule public | ||||||||||||||||||||
|
|
||||||||||||||||||||
| normalSubgroup : NormalSubgroup c′ ℓ′ | ||||||||||||||||||||
| normalSubgroup = record | ||||||||||||||||||||
| { isNormal = abelian⇒subgroup-normal +-comm subgroup | ||||||||||||||||||||
jamesmckinna marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
| } | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can, somewhat counterintuitively, simplify this to