agda-gset/Algebra/Group.agda

28 lines
1,010 B
Agda
Raw Permalink Normal View History

2024-05-05 14:43:35 +02:00
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)