|
| 1 | +------------------------------------------------------------------------ |
| 2 | +-- The Agda standard library |
| 3 | +-- |
| 4 | +-- Quotient groups |
| 5 | +------------------------------------------------------------------------ |
| 6 | + |
| 7 | +{-# OPTIONS --safe --cubical-compatible #-} |
| 8 | + |
| 9 | +open import Algebra.Bundles using (Group) |
| 10 | +open import Algebra.NormalSubgroup using (NormalSubgroup) |
| 11 | + |
| 12 | +module Algebra.Construct.Quotient.Group {c ℓ c′ ℓ′} (G : Group c ℓ) (N : NormalSubgroup G c′ ℓ′) where |
| 13 | + |
| 14 | +open Group G |
| 15 | + |
| 16 | +import Algebra.Definitions as AlgDefs |
| 17 | +open import Algebra.Morphism.Structures |
| 18 | +open import Algebra.Properties.Group G |
| 19 | +open import Algebra.Structures using (IsGroup) |
| 20 | +open import Data.Product.Base |
| 21 | +open import Level using (_⊔_) |
| 22 | +open import Relation.Binary.Core using (_⇒_) |
| 23 | +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) |
| 24 | +open import Relation.Binary.Structures using (IsEquivalence) |
| 25 | +open import Relation.Binary.Reasoning.Setoid setoid |
| 26 | + |
| 27 | +open NormalSubgroup N |
| 28 | + |
| 29 | +infix 0 _by_ |
| 30 | + |
| 31 | +data _≋_ (x y : Carrier) : Set (c ⊔ ℓ ⊔ c′) where |
| 32 | + _by_ : ∀ g → x // y ≈ ι g → x ≋ y |
| 33 | + |
| 34 | +≋-refl : Reflexive _≋_ |
| 35 | +≋-refl {x} = N.ε by begin |
| 36 | + x // x ≈⟨ inverseʳ x ⟩ |
| 37 | + ε ≈⟨ ι.ε-homo ⟨ |
| 38 | + ι N.ε ∎ |
| 39 | + |
| 40 | +≋-sym : Symmetric _≋_ |
| 41 | +≋-sym {x} {y} (g by x//y≈ιg) = g N.⁻¹ by begin |
| 42 | + y // x ≈⟨ ⁻¹-anti-homo-// x y ⟨ |
| 43 | + (x // y) ⁻¹ ≈⟨ ⁻¹-cong x//y≈ιg ⟩ |
| 44 | + ι g ⁻¹ ≈⟨ ι.⁻¹-homo g ⟨ |
| 45 | + ι (g N.⁻¹) ∎ |
| 46 | + |
| 47 | + |
| 48 | +≋-trans : Transitive _≋_ |
| 49 | +≋-trans {x} {y} {z} (g by x//y≈ιg) (h by y//z≈ιh) = g N.∙ h by begin |
| 50 | + x // z ≈⟨ ∙-congʳ (identityʳ x) ⟨ |
| 51 | + x ∙ ε // z ≈⟨ ∙-congʳ (∙-congˡ (inverseˡ y)) ⟨ |
| 52 | + x ∙ (y \\ y) // z ≈⟨ ∙-congʳ (assoc x (y ⁻¹) y) ⟨ |
| 53 | + (x // y) ∙ y // z ≈⟨ assoc (x // y) y (z ⁻¹) ⟩ |
| 54 | + (x // y) ∙ (y // z) ≈⟨ ∙-cong x//y≈ιg y//z≈ιh ⟩ |
| 55 | + ι g ∙ ι h ≈⟨ ι.∙-homo g h ⟨ |
| 56 | + ι (g N.∙ h) ∎ |
| 57 | + |
| 58 | +≋-isEquivalence : IsEquivalence _≋_ |
| 59 | +≋-isEquivalence = record |
| 60 | + { refl = ≋-refl |
| 61 | + ; sym = ≋-sym |
| 62 | + ; trans = ≋-trans |
| 63 | + } |
| 64 | + |
| 65 | +≈⇒≋ : _≈_ ⇒ _≋_ |
| 66 | +≈⇒≋ {x} {y} x≈y = N.ε by begin |
| 67 | + x // y ≈⟨ x≈y⇒x∙y⁻¹≈ε x≈y ⟩ |
| 68 | + ε ≈⟨ ι.ε-homo ⟨ |
| 69 | + ι N.ε ∎ |
| 70 | + |
| 71 | +open AlgDefs _≋_ |
| 72 | + |
| 73 | +≋-∙-cong : Congruent₂ _∙_ |
| 74 | +≋-∙-cong {x} {y} {u} {v} (g by x//y≈ιg) (h by u//v≈ιh) = g N.∙ normal h y .proj₁ by begin |
| 75 | + x ∙ u // y ∙ v ≈⟨ ∙-congˡ (⁻¹-anti-homo-∙ y v) ⟩ |
| 76 | + x ∙ u ∙ (v ⁻¹ ∙ y ⁻¹) ≈⟨ assoc (x ∙ u) (v ⁻¹) (y ⁻¹) ⟨ |
| 77 | + (x ∙ u // v) // y ≈⟨ ∙-congʳ (assoc x u (v ⁻¹)) ⟩ |
| 78 | + x ∙ (u // v) // y ≈⟨ ∙-congʳ (∙-congˡ u//v≈ιh) ⟩ |
| 79 | + x ∙ ι h // y ≈⟨ ∙-congʳ (∙-congˡ (identityˡ (ι h))) ⟨ |
| 80 | + x ∙ (ε ∙ ι h) // y ≈⟨ ∙-congʳ (∙-congˡ (∙-congʳ (inverseˡ y))) ⟨ |
| 81 | + x ∙ ((y \\ y) ∙ ι h) // y ≈⟨ ∙-congʳ (∙-congˡ (assoc (y ⁻¹) y (ι h))) ⟩ |
| 82 | + x ∙ (y \\ y ∙ ι h) // y ≈⟨ ∙-congʳ (assoc x (y ⁻¹) (y ∙ ι h)) ⟨ |
| 83 | + (x // y) ∙ (y ∙ ι h) // y ≈⟨ assoc (x // y) (y ∙ ι h) (y ⁻¹) ⟩ |
| 84 | + (x // y) ∙ (y ∙ ι h // y) ≈⟨ ∙-cong x//y≈ιg (proj₂ (normal h y)) ⟩ |
| 85 | + ι g ∙ ι (normal h y .proj₁) ≈⟨ ι.∙-homo g (normal h y .proj₁) ⟨ |
| 86 | + ι (g N.∙ normal h y .proj₁) ∎ |
| 87 | + |
| 88 | +≋-⁻¹-cong : Congruent₁ _⁻¹ |
| 89 | +≋-⁻¹-cong {x} {y} (g by x//y≈ιg) = normal (g N.⁻¹) (y ⁻¹) .proj₁ by begin |
| 90 | + x ⁻¹ ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (identityˡ (x ⁻¹)) ⟨ |
| 91 | + (ε ∙ x ⁻¹) ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (∙-congʳ (inverseʳ (y ⁻¹))) ⟨ |
| 92 | + ((y ⁻¹ ∙ y ⁻¹ ⁻¹) ∙ x ⁻¹) ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (assoc (y ⁻¹) ((y ⁻¹) ⁻¹) (x ⁻¹)) ⟩ |
| 93 | + y ⁻¹ ∙ (y ⁻¹ ⁻¹ ∙ x ⁻¹) ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (∙-congˡ (⁻¹-anti-homo-∙ x (y ⁻¹))) ⟨ |
| 94 | + y ⁻¹ ∙ (x ∙ y ⁻¹) ⁻¹ ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (∙-congˡ (⁻¹-cong x//y≈ιg)) ⟩ |
| 95 | + y ⁻¹ ∙ ι g ⁻¹ ∙ y ⁻¹ ⁻¹ ≈⟨ ∙-congʳ (∙-congˡ (ι.⁻¹-homo g)) ⟨ |
| 96 | + y ⁻¹ ∙ ι (g N.⁻¹) ∙ y ⁻¹ ⁻¹ ≈⟨ proj₂ (normal (g N.⁻¹) (y ⁻¹)) ⟩ |
| 97 | + ι (normal (g N.⁻¹) (y ⁻¹) .proj₁) ∎ |
| 98 | + |
| 99 | +quotientIsGroup : IsGroup _≋_ _∙_ ε _⁻¹ |
| 100 | +quotientIsGroup = record |
| 101 | + { isMonoid = record |
| 102 | + { isSemigroup = record |
| 103 | + { isMagma = record |
| 104 | + { isEquivalence = ≋-isEquivalence |
| 105 | + ; ∙-cong = ≋-∙-cong |
| 106 | + } |
| 107 | + ; assoc = λ x y z → ≈⇒≋ (assoc x y z) |
| 108 | + } |
| 109 | + ; identity = record |
| 110 | + { fst = λ x → ≈⇒≋ (identityˡ x) |
| 111 | + ; snd = λ x → ≈⇒≋ (identityʳ x) |
| 112 | + } |
| 113 | + } |
| 114 | + ; inverse = record |
| 115 | + { fst = λ x → ≈⇒≋ (inverseˡ x) |
| 116 | + ; snd = λ x → ≈⇒≋ (inverseʳ x) |
| 117 | + } |
| 118 | + ; ⁻¹-cong = ≋-⁻¹-cong |
| 119 | + } |
| 120 | + |
| 121 | +quotientGroup : Group c (c ⊔ ℓ ⊔ c′) |
| 122 | +quotientGroup = record { isGroup = quotientIsGroup } |
| 123 | + |
| 124 | +η : Group.Carrier G → Group.Carrier quotientGroup |
| 125 | +η x = x -- because we do all the work in the relation |
| 126 | + |
| 127 | +η-isHomomorphism : IsGroupHomomorphism rawGroup (Group.rawGroup quotientGroup) η |
| 128 | +η-isHomomorphism = record |
| 129 | + { isMonoidHomomorphism = record |
| 130 | + { isMagmaHomomorphism = record |
| 131 | + { isRelHomomorphism = record |
| 132 | + { cong = ≈⇒≋ |
| 133 | + } |
| 134 | + ; homo = λ _ _ → ≋-refl |
| 135 | + } |
| 136 | + ; ε-homo = ≋-refl |
| 137 | + } |
| 138 | + ; ⁻¹-homo = λ _ → ≋-refl |
| 139 | + } |
| 140 | + |
0 commit comments