|
| 1 | +------------------------------------------------------------------------ |
| 2 | +-- The Agda standard library |
| 3 | +-- |
| 4 | +-- Quotient rings |
| 5 | +------------------------------------------------------------------------ |
| 6 | + |
| 7 | +{-# OPTIONS --safe --cubical-compatible #-} |
| 8 | + |
| 9 | +open import Algebra.Bundles using (AbelianGroup; Ring; RawRing) |
| 10 | +open import Algebra.Construct.Sub.Ring.Ideal using (Ideal) |
| 11 | + |
| 12 | +module Algebra.Construct.Quotient.Ring |
| 13 | + {c ℓ} (R : Ring c ℓ) {c′ ℓ′} (I : Ideal R c′ ℓ′) |
| 14 | + where |
| 15 | + |
| 16 | +open import Algebra.Morphism.Structures using (IsRingHomomorphism) |
| 17 | +open import Data.Product.Base using (_,_) |
| 18 | +open import Function.Base using (_∘_) |
| 19 | +open import Level using (_⊔_) |
| 20 | + |
| 21 | +import Algebra.Construct.Quotient.AbelianGroup as Quotient |
| 22 | + |
| 23 | +private |
| 24 | + module R = Ring R |
| 25 | + module I = Ideal I |
| 26 | + module R/I = Quotient R.+-abelianGroup I.subgroup |
| 27 | + |
| 28 | + |
| 29 | +open R/I public |
| 30 | + using (_≋_; _by_; ≋-refl; ≈⇒≋ |
| 31 | + ; quotientAbelianGroup |
| 32 | + ; π; π-isMonoidHomomorphism; π-surjective |
| 33 | + ) |
| 34 | + |
| 35 | +open import Algebra.Definitions _≋_ using (Congruent₂) |
| 36 | + |
| 37 | +≋-*-cong : Congruent₂ R._*_ |
| 38 | +≋-*-cong {x} {y} {u} {v} (j by ιj+x≈y) (k by ιk+u≈v) = ι j *ₗ k +ᴹ j *ᵣ u +ᴹ x *ₗ k by begin |
| 39 | + ι (ι j *ₗ k +ᴹ j *ᵣ u +ᴹ x *ₗ k) + x * u ≈⟨ +-congʳ (ι.+ᴹ-homo (ι j *ₗ k +ᴹ j *ᵣ u) (x *ₗ k)) ⟩ |
| 40 | + ι (ι j *ₗ k +ᴹ j *ᵣ u) + ι (x *ₗ k) + x * u ≈⟨ +-congʳ (+-congʳ (ι.+ᴹ-homo (ι j *ₗ k) (j *ᵣ u))) ⟩ |
| 41 | + ι (ι j *ₗ k) + ι (j *ᵣ u) + ι (x *ₗ k) + x * u ≈⟨ +-congʳ (+-cong (+-cong (ι.*ₗ-homo (ι j) k) (ι.*ᵣ-homo u j)) (ι.*ₗ-homo x k)) ⟩ |
| 42 | + ι j * ι k + ι j * u + x * ι k + x * u ≈⟨ binomial-expansion (ι j) x (ι k) u ⟨ |
| 43 | + (ι j + x) * (ι k + u) ≈⟨ *-cong ιj+x≈y ιk+u≈v ⟩ |
| 44 | + y * v ∎ |
| 45 | + where |
| 46 | + open R using (_+_; _*_; +-congʳ ;+-cong; *-cong) |
| 47 | + open import Algebra.Properties.Semiring R.semiring using (binomial-expansion) |
| 48 | + open import Relation.Binary.Reasoning.Setoid R.setoid |
| 49 | + open I using (ι; _*ₗ_; _*ᵣ_; _+ᴹ_) |
| 50 | + |
| 51 | +quotientRawRing : RawRing c (c ⊔ ℓ ⊔ c′) |
| 52 | +quotientRawRing = record { RawRing R.rawRing hiding (_≈_) ; _≈_ = _≋_ } |
| 53 | + |
| 54 | +quotientRing : Ring c (c ⊔ ℓ ⊔ c′) |
| 55 | +quotientRing = record |
| 56 | + { isRing = record |
| 57 | + { +-isAbelianGroup = isAbelianGroup |
| 58 | + ; *-cong = ≋-*-cong |
| 59 | + ; *-assoc = λ x y z → ≈⇒≋ (R.*-assoc x y z) |
| 60 | + ; *-identity = ≈⇒≋ ∘ R.*-identityˡ , ≈⇒≋ ∘ R.*-identityʳ |
| 61 | + ; distrib = (λ x y z → ≈⇒≋ (R.distribˡ x y z)) , (λ x y z → ≈⇒≋ (R.distribʳ x y z)) |
| 62 | + } |
| 63 | + } where open AbelianGroup quotientAbelianGroup using (isAbelianGroup) |
| 64 | + |
| 65 | +π-isRingHomomorphism : IsRingHomomorphism R.rawRing quotientRawRing π |
| 66 | +π-isRingHomomorphism = record |
| 67 | + { isSemiringHomomorphism = record |
| 68 | + { isNearSemiringHomomorphism = record |
| 69 | + { +-isMonoidHomomorphism = π-isMonoidHomomorphism |
| 70 | + ; *-homo = λ _ _ → ≋-refl |
| 71 | + } |
| 72 | + ; 1#-homo = ≋-refl |
| 73 | + } |
| 74 | + ; -‿homo = λ _ → ≋-refl |
| 75 | + } |
| 76 | + |
0 commit comments