Classical.Structures.Group.AbelianGroup¶
Abelian Groups¶
This is the Classical.Structures.Group.AbelianGroup module of the Agda Universal Algebra Library.
An abelian group is an inhabitant of the type
Σ[ 𝑨 ∈ Algebra α ρ ] 𝑨 ⊨ Th-AbelianGroup, where Algebra is parameterized by
the signature type Sig-Group.
This is an equation-only extension of Group, structurally identical to the way
CommutativeMonoid extends Monoid; that is, abelianGroup→group is a pure
theory-reindex (proj₁ on the underlying algebra), and AbelianGroup-Op inherits
_∙_, ε, _⁻¹, and all five group laws through it, adding comm-law.
Satisfaction predicate and the AbelianGroup type¶
infix 4 _⊨ᵃᵍ_ _⊨ᵃᵍ_ : (𝑨 : Algebra {𝑆 = Sig-Group} α ρ) (ℰ : Eq-AbelianGroup → Term (Fin 3) × Term (Fin 3)) → Type (α ⊔ ρ) 𝑨 ⊨ᵃᵍ ℰ = ∀ i → 𝑨 ⊧ proj₁ (ℰ i) ≈ proj₂ (ℰ i) AbelianGroup : (α ρ : Level) → Type (suc α ⊔ suc ρ) AbelianGroup α ρ = Σ[ 𝑨 ∈ Algebra α ρ ] 𝑨 ⊨ᵃᵍ Th-AbelianGroup
The forgetful projection to groups¶
abelianGroup→group discards commutativity. Since an abelian
group is a group with one extra equation and no extra operations, the signature
is unchanged and no reduct is needed; the function keeps the algebra and re-indexes
the satisfaction witness, mapping each constructor of Eq-Group to
its counterpart in Eq-AbelianGroup. (This is the shape forgetful
shape as that of commutativeMonoid→monoid, in contrast with the
reduct-and-re-prove shape of monoid→semigroup.)
abelianGroup→group : AbelianGroup α ρ → Group α ρ abelianGroup→group (𝑨 , mod) = 𝑨 , λ { assoc → mod assocᵃ ; idˡ → mod idˡᵃ ; idʳ → mod idʳᵃ ; invˡ → mod invˡᵃ ; invʳ → mod invʳᵃ }
The AbelianGroup-Op module¶
AbelianGroup-Op𝑨 inherits the whole group interface through the
forgetful projection (three operations, both congruences, all three containment
lemmas and all five laws) and adds two names: equations, the new
satisfaction witness, and comm-law, commutativity in curried form.
module AbelianGroup-Op {α ρ : Level} ((𝑨 , laws) : AbelianGroup α ρ) where open Setoid 𝔻[ 𝑨 ] open Group-Op (abelianGroup→group (𝑨 , laws)) public using ( _∙_ ; ε ; _⁻¹ ; ∙-cong ; ⁻¹-cong ; interp-node-∙ ; interp-node-ε ; interp-node-⁻¹ ; assoc-law ; idˡ-law ; idʳ-law ; invˡ-law ; invʳ-law ) comm-law : ∀ x y → x ∙ y ≈ y ∙ x comm-law x y = trans (sym (interp-node-∙ (ℊ 0F) (ℊ 1F) {η})) (trans (laws comm η) (interp-node-∙ (ℊ 1F) (ℊ 0F) {η})) -- the same three-step shape every added law in the hierarchy has: -- `laws comm` between two applications of `interp-node-∙`, one -- for each side of the equation. where η : Fin 3 → 𝕌[ 𝑨 ] η = λ { 0F → x ; 1F → y ; 2F → x }
eqsToAbelianGroup¶
eqsToAbelianGroup is the constructor a downstream user calls: a
carrier, a binary operation, an identity, an inverse, and the six laws as
propositional equations. Every obligation discharges by definitional reduction,
since under ≡.setoid A the setoid equality is propositional equality and each
interpreted term reduces to the corresponding application of the supplied
operations.
eqsToAbelianGroup : {A : Type α} (_·_ : A → A → A) (e : A) (i : A → A) → (·-assoc : ∀ a b c → (a · b) · c ≡ a · (b · c)) → (·-idˡ : ∀ a → e · a ≡ a) (·-idʳ : ∀ a → a · e ≡ a) → (·-invˡ : ∀ a → (i a) · a ≡ e) (·-invʳ : ∀ a → a · (i a) ≡ e) → (·-comm : ∀ a b → a · b ≡ b · a) → AbelianGroup α α eqsToAbelianGroup _·_ e i ·-assoc ·-idˡ ·-idʳ ·-invˡ ·-invʳ ·-comm = opsToBareGroup _·_ e i , proof where proof : opsToBareGroup _·_ e i ⊨ᵃᵍ Th-AbelianGroup proof assocᵃ ρ = ·-assoc (ρ 0F) (ρ 1F) (ρ 2F) proof idˡᵃ ρ = ·-idˡ (ρ 0F) proof idʳᵃ ρ = ·-idʳ (ρ 0F) proof invˡᵃ ρ = ·-invˡ (ρ 0F) proof invʳᵃ ρ = ·-invʳ (ρ 0F) proof comm ρ = ·-comm (ρ 0F) (ρ 1F)