Skip to content

Commit 886bbae

Browse files
committed
Quotient rings
1 parent ca23f3d commit 886bbae

File tree

3 files changed

+181
-0
lines changed

3 files changed

+181
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Quotient rings
5+
------------------------------------------------------------------------
6+
7+
open import Algebra.Bundles using (Ring)
8+
open import Algebra.Ideal using (Ideal)
9+
10+
module Algebra.Construct.Quotient.Ring {c ℓ c′ ℓ′} (R : Ring c ℓ) (I : Ideal R c′ ℓ′) where
11+
12+
open Ring R
13+
open Ideal I
14+
15+
open import Algebra.Construct.Quotient.Group +-group normalSubgroup
16+
public
17+
using (_≋_; _by_; ≋-refl; ≋-sym; ≋-trans; ≋-isEquivalence; ≈⇒≋; quotientIsGroup; quotientGroup)
18+
renaming (≋-∙-cong to ≋-+-cong; ≋-⁻¹-cong to ≋‿-‿cong)
19+
20+
open import Algebra.Definitions _≋_
21+
open import Algebra.Properties.Ring R
22+
open import Algebra.Structures
23+
open import Level
24+
open import Relation.Binary.Reasoning.Setoid setoid
25+
26+
≋-*-cong : Congruent₂ _*_
27+
≋-*-cong {x} {y} {u} {v} (j by x-y≈ιj) (k by u-v≈ιk) = j I.*ᵣ u I.+ᴹ y I.*ₗ k by begin
28+
x * u - y * v ≈⟨ +-congʳ (+-identityʳ (x * u)) ⟨
29+
x * u + 0# - y * v ≈⟨ +-congʳ (+-congˡ (-‿inverseˡ (y * u))) ⟨
30+
x * u + (- (y * u) + y * u) - y * v ≈⟨ +-congʳ (+-assoc (x * u) (- (y * u)) (y * u)) ⟨
31+
((x * u - y * u) + y * u) - y * v ≈⟨ +-assoc (x * u - y * u) (y * u) (- (y * v)) ⟩
32+
(x * u - y * u) + (y * u - y * v) ≈⟨ +-cong ([y-z]x≈yx-zx u x y) (x[y-z]≈xy-xz y u v) ⟨
33+
(x - y) * u + y * (u - v) ≈⟨ +-cong (*-congʳ x-y≈ιj) (*-congˡ u-v≈ιk) ⟩
34+
ι j * u + y * ι k ≈⟨ +-cong (ι.*ᵣ-homo u j) (ι.*ₗ-homo y k) ⟨
35+
ι (j I.*ᵣ u) + ι (y I.*ₗ k) ≈⟨ ι.+ᴹ-homo (j I.*ᵣ u) (y I.*ₗ k) ⟨
36+
ι (j I.*ᵣ u I.+ᴹ y I.*ₗ k) ∎
37+
38+
quotientIsRing : IsRing _≋_ _+_ _*_ (-_) 0# 1#
39+
quotientIsRing = record
40+
{ +-isAbelianGroup = record
41+
{ isGroup = quotientIsGroup
42+
; comm = λ x y ≈⇒≋ (+-comm x y)
43+
}
44+
; *-cong = ≋-*-cong
45+
; *-assoc = λ x y z ≈⇒≋ (*-assoc x y z)
46+
; *-identity = record
47+
{ fst = λ x ≈⇒≋ (*-identityˡ x)
48+
; snd = λ x ≈⇒≋ (*-identityʳ x)
49+
}
50+
; distrib = record
51+
{ fst = λ x y z ≈⇒≋ (distribˡ x y z)
52+
; snd = λ x y z ≈⇒≋ (distribʳ x y z)
53+
}
54+
}
55+
56+
quotientRing : Ring c (c ⊔ ℓ ⊔ c′)
57+
quotientRing = record { isRing = quotientIsRing }

src/Algebra/Ideal.agda

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
------------------------------------------------------------------------
2+
-- Ideals of a ring
3+
--
4+
-- The Agda standard library
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --safe --cubical-compatible #-}
8+
9+
open import Algebra.Bundles
10+
11+
module Algebra.Ideal {c ℓ} (R : Ring c ℓ) where
12+
13+
open Ring R
14+
15+
open import Algebra.Module.Bundles.Raw
16+
import Algebra.Module.Construct.TensorUnit as TU
17+
open import Algebra.Module.Morphism.Structures
18+
open import Algebra.NormalSubgroup (+-group)
19+
open import Data.Product.Base
20+
open import Level
21+
open import Relation.Binary.Reasoning.Setoid setoid
22+
23+
record Ideal c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) where
24+
field
25+
I : RawModule Carrier c′ ℓ′
26+
ι : RawModule.Carrierᴹ I Carrier
27+
ι-monomorphism : IsModuleMonomorphism I (TU.rawModule {R = rawRing}) ι
28+
29+
module I = RawModule I
30+
module ι = IsModuleMonomorphism ι-monomorphism
31+
32+
normalSubgroup : NormalSubgroup c′ ℓ′
33+
normalSubgroup = record
34+
{ N = I.+ᴹ-rawGroup
35+
; ι = ι
36+
; ι-monomorphism = ι.+ᴹ-isGroupMonomorphism
37+
; normal = λ n g record
38+
{ fst = n
39+
; snd = begin
40+
g + ι n - g ≈⟨ +-assoc g (ι n) (- g) ⟩
41+
g + (ι n - g) ≈⟨ +-congˡ (+-comm (ι n) (- g)) ⟩
42+
g + (- g + ι n) ≈⟨ +-assoc g (- g) (ι n) ⟨
43+
g - g + ι n ≈⟨ +-congʳ (-‿inverseʳ g) ⟩
44+
0# + ι n ≈⟨ +-identityˡ (ι n) ⟩
45+
ι n ∎
46+
}
47+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
open import Algebra.Bundles
4+
open import Algebra.Morphism.Structures
5+
6+
module Algebra.Ideal.Construct.Kernel
7+
{c ℓ c′ ℓ′}
8+
{R : Ring c ℓ}
9+
{S : Ring c′ ℓ′}
10+
: Ring.Carrier R Ring.Carrier S)
11+
(homomorphism : IsRingHomomorphism (Ring.rawRing R) (Ring.rawRing S) ρ)
12+
where
13+
14+
private
15+
module R = Ring R
16+
module S = Ring S
17+
module ρ = IsRingHomomorphism homomorphism
18+
19+
open import Algebra.NormalSubgroup.Construct.Kernel {G = R.+-group} {H = S.+-group} ρ ρ.+-isGroupHomomorphism public
20+
renaming (_∙ₖ_ to _+ₖ_; εₖ to 0#ₖ; _⁻¹ₖ to -ₖ_)
21+
22+
open import Algebra.Ideal R
23+
open import Algebra.Module.Bundles.Raw
24+
open import Function.Base
25+
open import Level
26+
open import Relation.Binary.Reasoning.Setoid S.setoid
27+
28+
29+
_*ₗₖ_ : R.Carrier Kernel Kernel
30+
r *ₗₖ x = record
31+
{ element = r R.* X.element
32+
; inKernel = begin
33+
ρ (r R.* X.element) ≈⟨ ρ.*-homo r X.element ⟩
34+
ρ r S.* ρ X.element ≈⟨ S.*-congˡ X.inKernel ⟩
35+
ρ r S.* S.0# ≈⟨ S.zeroʳ (ρ r) ⟩
36+
S.0# ∎
37+
}
38+
where module X = Kernel x
39+
40+
_*ᵣₖ_ : Kernel R.Carrier Kernel
41+
x *ᵣₖ r = record
42+
{ element = X.element R.* r
43+
; inKernel = begin
44+
ρ (X.element R.* r) ≈⟨ ρ.*-homo X.element r ⟩
45+
ρ X.element S.* ρ r ≈⟨ S.*-congʳ X.inKernel ⟩
46+
S.0# S.* ρ r ≈⟨ S.zeroˡ (ρ r) ⟩
47+
S.0# ∎
48+
}
49+
where module X = Kernel x
50+
51+
Kernel-rawModule : RawModule R.Carrier (c ⊔ ℓ′) ℓ
52+
Kernel-rawModule = record
53+
{ Carrierᴹ = Kernel
54+
; _≈ᴹ_ = R._≈_ on Kernel.element
55+
; _+ᴹ_ = _+ₖ_
56+
; _*ₗ_ = _*ₗₖ_
57+
; _*ᵣ_ = _*ᵣₖ_
58+
; 0ᴹ = 0#ₖ
59+
; -ᴹ_ = -ₖ_
60+
}
61+
where open RawGroup Kernel-rawGroup
62+
63+
kernelIdeal : Ideal (c ⊔ ℓ′) ℓ
64+
kernelIdeal = record
65+
{ I = Kernel-rawModule
66+
; ι = Kernel.element
67+
; ι-monomorphism = record
68+
{ isModuleHomomorphism = record
69+
{ isBimoduleHomomorphism = record
70+
{ +ᴹ-isGroupHomomorphism = IsGroupMonomorphism.isGroupHomomorphism element-isGroupMonomorphism
71+
; *ₗ-homo = λ _ _ R.refl
72+
; *ᵣ-homo = λ _ _ R.refl
73+
}
74+
}
75+
; injective = λ p p
76+
}
77+
}

0 commit comments

Comments
 (0)