-
Notifications
You must be signed in to change notification settings - Fork 259
Modular arithmetic in terms of ideals #2729
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
Draft
Taneb
wants to merge
10
commits into
agda:master
Choose a base branch
from
Taneb:modular-arithmetic
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38f83d3
Add notion of quotient groups
Taneb 69b9aee
Quotient rings
Taneb 83ab248
Intersection of ideals
Taneb a40ce81
Add coprimality of ideals
Taneb 9a2b9fb
Add missing options pragma from ring quotient module
Taneb 8ec7935
Chinese remainder theorem
Taneb 5124b96
Minor fixes
Taneb 127f3f1
Principal ideals
Taneb a4f934d
WIP integer special case module
Taneb 9f7db10
Try new definition for equivalences
Taneb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- The Agda standard library | ||
| -- | ||
| -- Quotient groups | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| {-# OPTIONS --safe --cubical-compatible #-} | ||
|
|
||
| open import Algebra.Bundles using (Group) | ||
| open import Algebra.NormalSubgroup using (NormalSubgroup) | ||
|
|
||
| module Algebra.Construct.Quotient.Group {c ℓ} (G : Group c ℓ) {c′ ℓ′} (N : NormalSubgroup G c′ ℓ′) where | ||
|
|
||
| open Group G | ||
|
|
||
| import Algebra.Definitions as AlgDefs | ||
| open import Algebra.Morphism.Structures | ||
| open import Algebra.Properties.Group G | ||
| open import Algebra.Structures using (IsGroup) | ||
| open import Data.Product.Base | ||
| open import Level using (_⊔_) | ||
| open import Relation.Binary.Core using (_⇒_) | ||
| open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) | ||
| open import Relation.Binary.Structures using (IsEquivalence) | ||
| open import Relation.Binary.Reasoning.Setoid setoid | ||
|
|
||
| open NormalSubgroup N | ||
|
|
||
| infix 0 _by_ | ||
|
|
||
| data _≋_ (x y : Carrier) : Set (c ⊔ ℓ ⊔ c′) where | ||
| _by_ : ∀ g → ι g ∙ x ≈ y → x ≋ y | ||
|
|
||
| ≋-refl : Reflexive _≋_ | ||
| ≋-refl {x} = N.ε by trans (∙-congʳ ι.ε-homo) (identityˡ x) | ||
|
|
||
| ≋-sym : Symmetric _≋_ | ||
| ≋-sym {x} {y} (g by ιg∙x≈y) = g N.⁻¹ by begin | ||
| ι (g N.⁻¹) ∙ y ≈⟨ ∙-cong (ι.⁻¹-homo g) (sym ιg∙x≈y) ⟩ | ||
| ι g ⁻¹ ∙ (ι g ∙ x) ≈⟨ assoc (ι g ⁻¹) (ι g) x ⟨ | ||
| (ι g ⁻¹ ∙ ι g) ∙ x ≈⟨ ∙-congʳ (inverseˡ (ι g)) ⟩ | ||
| ε ∙ x ≈⟨ identityˡ x ⟩ | ||
| x ∎ | ||
|
|
||
| ≋-trans : Transitive _≋_ | ||
| ≋-trans {x} {y} {z} (g by ιg∙x) (h by ιh∙y) = h N.∙ g by begin | ||
| ι (h N.∙ g) ∙ x ≈⟨ ∙-congʳ (ι.∙-homo h g) ⟩ | ||
| (ι h ∙ ι g) ∙ x ≈⟨ assoc (ι h) (ι g) x ⟩ | ||
| ι h ∙ (ι g ∙ x) ≈⟨ ∙-congˡ ιg∙x ⟩ | ||
| ι h ∙ y ≈⟨ ιh∙y ⟩ | ||
| z ∎ | ||
|
|
||
| ≋-isEquivalence : IsEquivalence _≋_ | ||
| ≋-isEquivalence = record | ||
| { refl = ≋-refl | ||
| ; sym = ≋-sym | ||
| ; trans = ≋-trans | ||
| } | ||
|
|
||
| ≈⇒≋ : _≈_ ⇒ _≋_ | ||
| ≈⇒≋ {x} {y} x≈y = N.ε by trans (∙-cong ι.ε-homo x≈y) (identityˡ y) | ||
|
|
||
| open AlgDefs _≋_ | ||
|
|
||
| ≋-∙-cong : Congruent₂ _∙_ | ||
| ≋-∙-cong {x} {y} {u} {v} (g by ιg∙x≈y) (h by ιh∙u≈v) = g N.∙ h′ by begin | ||
| ι (g N.∙ h′) ∙ (x ∙ u) ≈⟨ ∙-congʳ (ι.∙-homo g h′) ⟩ | ||
| (ι g ∙ ι h′) ∙ (x ∙ u) ≈⟨ assoc (ι g) (ι h′) (x ∙ u) ⟩ | ||
| ι g ∙ (ι h′ ∙ (x ∙ u)) ≈⟨ ∙-congˡ (assoc (ι h′) x u) ⟨ | ||
| ι g ∙ ((ι h′ ∙ x) ∙ u) ≈⟨ ∙-congˡ (∙-congʳ x∙ιh≈ιh′∙x) ⟨ | ||
| ι g ∙ ((x ∙ ι h) ∙ u) ≈⟨ ∙-congˡ (assoc x (ι h) u) ⟩ | ||
| ι g ∙ (x ∙ (ι h ∙ u)) ≈⟨ assoc (ι g) x (ι h ∙ u) ⟨ | ||
| (ι g ∙ x) ∙ (ι h ∙ u) ≈⟨ ∙-cong ιg∙x≈y ιh∙u≈v ⟩ | ||
| y ∙ v ∎ | ||
| where | ||
| h′ : N.Carrier | ||
| h′ = normal h x .proj₁ | ||
| x∙ιh≈ιh′∙x : x ∙ ι h ≈ ι h′ ∙ x | ||
| x∙ιh≈ιh′∙x = normal h x .proj₂ | ||
|
|
||
|
|
||
| ≋-⁻¹-cong : Congruent₁ _⁻¹ | ||
| ≋-⁻¹-cong {x} {y} (g by ιg∙x≈y) = g′ by begin | ||
| ι g′ ∙ x ⁻¹ ≈⟨ x⁻¹∙ιg⁻¹≈ιg′∙x⁻¹ ⟨ | ||
| x ⁻¹ ∙ ι (g N.⁻¹) ≈⟨ ∙-congˡ (ι.⁻¹-homo g) ⟩ | ||
| x ⁻¹ ∙ ι g ⁻¹ ≈⟨ ⁻¹-anti-homo-∙ (ι g) x ⟨ | ||
| (ι g ∙ x) ⁻¹ ≈⟨ ⁻¹-cong ιg∙x≈y ⟩ | ||
| y ⁻¹ ∎ | ||
| where | ||
| g′ : N.Carrier | ||
| g′ = normal (g N.⁻¹) (x ⁻¹) .proj₁ | ||
| x⁻¹∙ιg⁻¹≈ιg′∙x⁻¹ : x ⁻¹ ∙ ι (g N.⁻¹) ≈ ι g′ ∙ x ⁻¹ | ||
| x⁻¹∙ιg⁻¹≈ιg′∙x⁻¹ = normal (g N.⁻¹) (x ⁻¹) .proj₂ | ||
|
|
||
| quotientIsGroup : IsGroup _≋_ _∙_ ε _⁻¹ | ||
| quotientIsGroup = record | ||
| { isMonoid = record | ||
| { isSemigroup = record | ||
| { isMagma = record | ||
| { isEquivalence = ≋-isEquivalence | ||
| ; ∙-cong = ≋-∙-cong | ||
| } | ||
| ; assoc = λ x y z → ≈⇒≋ (assoc x y z) | ||
| } | ||
| ; identity = record | ||
| { fst = λ x → ≈⇒≋ (identityˡ x) | ||
| ; snd = λ x → ≈⇒≋ (identityʳ x) | ||
| } | ||
| } | ||
| ; inverse = record | ||
| { fst = λ x → ≈⇒≋ (inverseˡ x) | ||
| ; snd = λ x → ≈⇒≋ (inverseʳ x) | ||
| } | ||
| ; ⁻¹-cong = ≋-⁻¹-cong | ||
| } | ||
|
|
||
| quotientGroup : Group c (c ⊔ ℓ ⊔ c′) | ||
| quotientGroup = record { isGroup = quotientIsGroup } | ||
|
|
||
| η : Group.Carrier G → Group.Carrier quotientGroup | ||
| η x = x -- because we do all the work in the relation | ||
|
|
||
| η-isHomomorphism : IsGroupHomomorphism rawGroup (Group.rawGroup quotientGroup) η | ||
| η-isHomomorphism = record | ||
| { isMonoidHomomorphism = record | ||
| { isMagmaHomomorphism = record | ||
| { isRelHomomorphism = record | ||
| { cong = ≈⇒≋ | ||
| } | ||
| ; homo = λ _ _ → ≋-refl | ||
| } | ||
| ; ε-homo = ≋-refl | ||
| } | ||
| ; ⁻¹-homo = λ _ → ≋-refl | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- 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 | ||
| open Ideal I | ||
|
|
||
| open import Algebra.Construct.Quotient.Group +-group normalSubgroup public | ||
| using (_≋_; _by_; ≋-refl; ≋-sym; ≋-trans; ≋-isEquivalence; ≈⇒≋; quotientIsGroup; quotientGroup) | ||
| renaming (≋-∙-cong to ≋-+-cong; ≋-⁻¹-cong to ≋‿-‿cong) | ||
|
|
||
| open import Algebra.Definitions _≋_ | ||
| open import Algebra.Properties.Semiring semiring | ||
| open import Algebra.Properties.Ring R | ||
| open import Algebra.Structures | ||
| open import Level | ||
| open import Relation.Binary.Reasoning.Setoid setoid | ||
|
|
||
| ≋-*-cong : Congruent₂ _*_ | ||
| ≋-*-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# | ||
| } | ||
|
|
||
| quotientIsRing : IsRing _≋_ _+_ _*_ (-_) 0# 1# | ||
| quotientIsRing = record | ||
| { +-isAbelianGroup = record | ||
| { isGroup = quotientIsGroup | ||
| ; comm = λ x y → ≈⇒≋ (+-comm x y) | ||
| } | ||
| ; *-cong = ≋-*-cong | ||
| ; *-assoc = λ x y z → ≈⇒≋ (*-assoc x y z) | ||
| ; *-identity = record | ||
| { fst = λ x → ≈⇒≋ (*-identityˡ x) | ||
| ; snd = λ x → ≈⇒≋ (*-identityʳ x) | ||
| } | ||
| ; distrib = record | ||
| { 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 } | ||
109 changes: 109 additions & 0 deletions
109
src/Algebra/Construct/Quotient/Ring/Properties/ChineseRemainderTheorem.agda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- The Agda standard library | ||
| -- | ||
| -- The Chinese Remainder Theorem for arbitrary rings | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| {-# OPTIONS --safe --cubical-compatible #-} | ||
|
|
||
| open import Algebra.Bundles | ||
|
|
||
| module Algebra.Construct.Quotient.Ring.Properties.ChineseRemainderTheorem {c ℓ} (R : Ring c ℓ) where | ||
|
|
||
| open Ring R | ||
|
|
||
| import Algebra.Construct.DirectProduct as DP | ||
| open import Algebra.Construct.Quotient.Ring as QR using (quotientRawRing) | ||
| open import Algebra.Ideal R | ||
| open import Algebra.Ideal.Coprimality R using (Coprime) | ||
| open import Algebra.Ideal.Construct.Intersection R | ||
| open import Algebra.Morphism.Structures | ||
| open import Algebra.Properties.Ring R | ||
| open import Data.Product.Base | ||
| open import Relation.Binary.Reasoning.Setoid setoid | ||
|
|
||
| module _ | ||
| {c₁ c₂ ℓ₁ ℓ₂} | ||
| (I : Ideal c₁ ℓ₁) (J : Ideal c₂ ℓ₂) | ||
| where | ||
|
|
||
| private | ||
| module I = Ideal I | ||
| module J = Ideal J | ||
|
|
||
| CRT : Coprime I J → IsRingIsomorphism (quotientRawRing R (I ∩ J)) (DP.rawRing (quotientRawRing R I) (quotientRawRing R J)) λ x → x , x | ||
| CRT ((m , n) , m+n≈1) = record | ||
| { isRingMonomorphism = record | ||
| { isRingHomomorphism = record | ||
| { isSemiringHomomorphism = record | ||
| { isNearSemiringHomomorphism = record | ||
| { +-isMonoidHomomorphism = record | ||
| { isMagmaHomomorphism = record | ||
| { isRelHomomorphism = record | ||
| { cong = λ { (t R/I∩J.by p) → (ICarrier.a t R/I.by p) , (ICarrier.b t R/J.by trans p (ICarrier.a≈b t)) } | ||
| } | ||
| ; homo = λ x y → R/I.≋-refl , R/J.≋-refl | ||
| } | ||
| ; ε-homo = R/I.≋-refl , R/J.≋-refl | ||
| } | ||
| ; *-homo = λ x y → R/I.≋-refl , R/J.≋-refl | ||
| } | ||
| ; 1#-homo = R/I.≋-refl , R/J.≋-refl | ||
| } | ||
| ; -‿homo = λ x → R/I.≋-refl , R/J.≋-refl | ||
| } | ||
| ; injective = λ {((i R/I.by p) , (j R/J.by q)) → record { a≈b = trans (sym p) q } R/I∩J.by p} | ||
| } | ||
| ; surjective = λ (a₁ , a₂) → a₁ * J.ι n + a₂ * I.ι m , λ {z} → λ | ||
| { (record {a = a; b = b; a≈b = a≈b} R/I∩J.by p) → record | ||
| { fst = a I.I.+ᴹ (a₂ - a₁) I.I.*ₗ m R/I.by begin | ||
| -- introduce a coprimality term | ||
| z - a₁ ≈⟨ +-congˡ (-‿cong (*-identityʳ a₁)) ⟨ | ||
| z - a₁ * 1# ≈⟨ +-congˡ (-‿cong (*-congˡ m+n≈1)) ⟨ | ||
| -- lots and lots of rearrangement | ||
| z - a₁ * (I.ι m + J.ι n) ≈⟨ +-congˡ (-‿cong (distribˡ a₁ (I.ι m) (J.ι n))) ⟩ | ||
| z - (a₁ * I.ι m + a₁ * J.ι n) ≈⟨ +-congˡ (-‿cong (+-comm (a₁ * I.ι m) (a₁ * J.ι n))) ⟩ | ||
| z - (a₁ * J.ι n + a₁ * I.ι m) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-identityʳ (a₁ * J.ι n)))) ⟨ | ||
| z - (a₁ * J.ι n + 0# + a₁ * I.ι m) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-congˡ (-‿inverseʳ (a₂ * I.ι m))))) ⟨ | ||
| z - (a₁ * J.ι n + (a₂ * I.ι m - a₂ * I.ι m) + a₁ * I.ι m) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-assoc _ _ _))) ⟨ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m - a₂ * I.ι m + a₁ * I.ι m) ≈⟨ +-congˡ (-‿cong (+-assoc _ _ _)) ⟩ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m + (- (a₂ * I.ι m) + a₁ * I.ι m)) ≈⟨ +-congˡ (-‿+-comm _ _) ⟨ | ||
| z + (- (a₁ * J.ι n + a₂ * I.ι m) - (- (a₂ * I.ι m) + a₁ * I.ι m)) ≈⟨ +-assoc z _ _ ⟨ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) - (- (a₂ * I.ι m) + a₁ * I.ι m) ≈⟨ +-congˡ (-‿+-comm _ _) ⟨ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) + (- - (a₂ * I.ι m) - a₁ * I.ι m) ≈⟨ +-congˡ (+-congʳ (-‿involutive _)) ⟩ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) + (a₂ * I.ι m - a₁ * I.ι m) ≈⟨ +-congˡ ([y-z]x≈yx-zx _ _ _) ⟨ | ||
| -- substitute z-t | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) + (a₂ - a₁) * I.ι m ≈⟨ +-congʳ p ⟩ | ||
| -- show we're in I | ||
| I.ι a + (a₂ - a₁) * I.ι m ≈⟨ +-congˡ (I.ι.*ₗ-homo (a₂ - a₁) m) ⟨ | ||
| I.ι a + I.ι ((a₂ - a₁) I.I.*ₗ m) ≈⟨ I.ι.+ᴹ-homo a _ ⟨ | ||
| I.ι (a I.I.+ᴹ (a₂ - a₁) I.I.*ₗ m) ∎ | ||
| ; snd = b J.I.+ᴹ (a₁ - a₂) J.I.*ₗ n R/J.by begin | ||
| -- introduce a coprimality term | ||
| z - a₂ ≈⟨ +-congˡ (-‿cong (*-identityʳ a₂)) ⟨ | ||
| z - a₂ * 1# ≈⟨ +-congˡ (-‿cong (*-congˡ m+n≈1)) ⟨ | ||
| -- lots and lots of rearrangement | ||
| z - a₂ * (I.ι m + J.ι n) ≈⟨ +-congˡ (-‿cong (distribˡ a₂ (I.ι m) (J.ι n))) ⟩ | ||
| z - (a₂ * I.ι m + a₂ * J.ι n) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-identityʳ (a₂ * I.ι m)))) ⟨ | ||
| z - (a₂ * I.ι m + 0# + a₂ * J.ι n) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-congˡ (-‿inverseʳ (a₁ * J.ι n))))) ⟨ | ||
| z - (a₂ * I.ι m + (a₁ * J.ι n - a₁ * J.ι n) + a₂ * J.ι n) ≈⟨ +-congˡ (-‿cong (+-congʳ (+-assoc (a₂ * I.ι m) (a₁ * J.ι n) _))) ⟨ | ||
| z - (a₂ * I.ι m + a₁ * J.ι n - a₁ * J.ι n + a₂ * J.ι n) ≈⟨ +-congˡ (-‿cong (+-assoc (a₂ * I.ι m + a₁ * J.ι n) (- (a₁ * J.ι n)) _)) ⟩ | ||
| z - (a₂ * I.ι m + a₁ * J.ι n + (- (a₁ * J.ι n) + a₂ * J.ι n)) ≈⟨ +-congˡ (-‿+-comm (a₂ * I.ι m + a₁ * J.ι n) (- (a₁ * J.ι n) + a₂ * J.ι n)) ⟨ | ||
| z + (- (a₂ * I.ι m + a₁ * J.ι n) - (- (a₁ * J.ι n) + a₂ * J.ι n)) ≈⟨ +-assoc z (- (a₂ * I.ι m + a₁ * J.ι n)) (- (- (a₁ * J.ι n) + a₂ * J.ι n)) ⟨ | ||
| z - (a₂ * I.ι m + a₁ * J.ι n) - (- (a₁ * J.ι n) + a₂ * J.ι n) ≈⟨ +-cong (+-congˡ (-‿cong (+-comm _ _))) (-‿cong (+-congˡ (-‿involutive _))) ⟨ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) - (- (a₁ * J.ι n) - - (a₂ * J.ι n)) ≈⟨ +-congˡ (-‿cong (-‿+-comm (a₁ * J.ι n) (- (a₂ * J.ι n)))) ⟩ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) - - (a₁ * J.ι n - a₂ * J.ι n) ≈⟨ +-congˡ (-‿involutive (a₁ * J.ι n - a₂ * J.ι n)) ⟩ | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) + (a₁ * J.ι n - a₂ * J.ι n) ≈⟨ +-congˡ ([y-z]x≈yx-zx (J.ι n) a₁ a₂) ⟨ | ||
| -- substitute z-t | ||
| z - (a₁ * J.ι n + a₂ * I.ι m) + (a₁ - a₂) * J.ι n ≈⟨ +-congʳ (trans p a≈b) ⟩ | ||
| -- show we're in I | ||
| J.ι b + (a₁ - a₂) * J.ι n ≈⟨ +-congˡ (J.ι.*ₗ-homo (a₁ - a₂) n) ⟨ | ||
| J.ι b + J.ι ((a₁ - a₂) J.I.*ₗ n) ≈⟨ J.ι.+ᴹ-homo b ((a₁ - a₂) J.I.*ₗ n) ⟨ | ||
| J.ι (b J.I.+ᴹ (a₁ - a₂) J.I.*ₗ n) ∎ | ||
| } | ||
| } | ||
| } | ||
| where | ||
| module R/I = QR R I | ||
| module R/J = QR R J | ||
| module R/I∩J = QR R (I ∩ J) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- The Agda standard library | ||
| -- | ||
| -- Ideals of a ring | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| {-# OPTIONS --safe --cubical-compatible #-} | ||
|
|
||
| open import Algebra.Bundles | ||
|
|
||
| module Algebra.Ideal {c ℓ} (R : Ring c ℓ) where | ||
|
|
||
| open Ring R | ||
|
|
||
| open import Algebra.Module.Bundles.Raw | ||
| import Algebra.Module.Construct.TensorUnit as TU | ||
| open import Algebra.Module.Morphism.Structures | ||
| open import Algebra.NormalSubgroup (+-group) | ||
| open import Data.Product.Base | ||
| open import Level | ||
| open import Relation.Binary.Reasoning.Setoid setoid | ||
|
|
||
| record Ideal c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) where | ||
| field | ||
| I : RawModule Carrier c′ ℓ′ | ||
| ι : RawModule.Carrierᴹ I → Carrier | ||
| ι-monomorphism : IsModuleMonomorphism I (TU.rawModule {R = rawRing}) ι | ||
|
|
||
| module I = RawModule I | ||
| module ι = IsModuleMonomorphism ι-monomorphism | ||
|
|
||
| normalSubgroup : NormalSubgroup c′ ℓ′ | ||
| normalSubgroup = record | ||
| { N = I.+ᴹ-rawGroup | ||
| ; ι = ι | ||
| ; ι-monomorphism = ι.+ᴹ-isGroupMonomorphism | ||
| ; normal = λ n g → record | ||
| { fst = n | ||
| -- this ends up a lot simpler now | ||
| ; snd = +-comm g (ι n) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Should insert here that the quotient map on the underlying additive subgroup of the module in fact extends to a ring homomorphism from
RtoR / I...... which given that the underlying map is
idis pretty easy by hand.