agda-gset/Algebra/Group.agda

27 lines
1,010 B
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open import Level
open import Relation.Binary.PropositionalEquality as using (_≡_)
module Algebra.Group where
record IsGroup {} (A : Set ) (_∙_ : A A A) (ε : A) (_⁻¹ : A A) : Set (suc ) where
field
assoc : {f g h : A} (f g) h f (g h)
idˡ : {g : A} ε g g
idʳ : {g : A} g ε g
invˡ : {g : A} g (g ⁻¹) ε
invʳ : {g : A} (g ⁻¹) g ε
record Group ( : Level) : Set (suc ) where
infix 8 _⁻¹
infixl 7 _∙_
field
Carrier : Set
_∙_ : Carrier Carrier Carrier
ε : Carrier
_⁻¹ : Carrier Carrier
field
isGroup : IsGroup Carrier _∙_ ε _⁻¹
open IsGroup isGroup public
∙-resp : {f h g i : Carrier} f h g i f g h i
∙-resp {f} {h} {g} {i} f≡h g≡i = ≡.trans (≡.cong (f ∙_) g≡i) (≡.cong (_∙ i) f≡h)