Examples.Classical.Groups.AbelianGroup¶
Worked example: (ℤ, +, 0, -) as an abelian group¶
This is the Examples.Classical.Groups.AbelianGroup module of the Agda Universal Algebra Library.
The integers under addition are the canonical abelian group — the same carrier and
operations as the CyclicGroup example, now additionally
witnessing commutativity via stdlib's +-comm.
The abelian group (ℤ, +, 0, -)¶
ℤ-abelianGroup : AbelianGroup ℤ-abelianGroup = eqsToAbelianGroup ℤ _+_ 0ℤ -_ +-assoc +-identityˡ +-identityʳ +-inverseˡ +-inverseʳ +-comm open Polymorphic.AbelianGroup-Op ℤ-abelianGroup using ( _∙_ ; ε ; _⁻¹ )
Acceptance checks¶
∙-is-+-ag : ∀ (a b : ℤ) → a ∙ b ≡ a + b ∙-is-+-ag a b = refl ε-is-0-ag : ε ≡ 0ℤ ε-is-0-ag = refl ⁻¹-is-neg-ag : ∀ (a : ℤ) → a ⁻¹ ≡ - a ⁻¹-is-neg-ag a = refl
The bundle round-trips pointwise on the operation, the identity, and the inverse.
open Polymorphic.AbelianGroup-Op ⟪ ⟨ ℤ-abelianGroup ⟩ᵃᵍ ⟫ᵃᵍ using () renaming ( _∙_ to _·_ ; ε to ε· ; _⁻¹ to _⁻¹· ) roundtrip-∙-ag : ∀ (a b : ℤ) → a · b ≡ a + b roundtrip-∙-ag a b = refl roundtrip-ε-ag : ε· ≡ 0ℤ roundtrip-ε-ag = refl roundtrip-⁻¹-ag : ∀ (a : ℤ) → a ⁻¹· ≡ - a roundtrip-⁻¹-ag a = refl