module Algebra.Quasigroup.Instances.Group where
Groups and quasigroupsπ
private variable
: Level
β : Type β A
Every group is a quasigroup, as multiplication in a group is an equivalence.
is-groupβis-left-quasigroup: β {_β_ : A β A β A}
β is-group _β_
β is-left-quasigroup _β_
{_β_ = _β_} β-group =
is-groupβis-left-quasigroup (hlevel 2) β-equivl
β-equivlβis-left-quasigroup where open is-group β-group
is-groupβis-right-quasigroup: β {_β_ : A β A β A}
β is-group _β_
β is-right-quasigroup _β_
{_β_ = _β_} β-group =
is-groupβis-right-quasigroup (hlevel 2) β-equivr
β-equivrβis-right-quasigroup where open is-group β-group
is-groupβis-quasigroup: β {_β_ : A β A β A}
β is-group _β_
β is-quasigroup _β_
{_β_ = _β_} β-group .is-quasigroup.has-is-left-quasigroup =
is-groupβis-quasigroup
is-groupβis-left-quasigroup β-group{_β_ = _β_} β-group .is-quasigroup.has-is-right-quasigroup =
is-groupβis-quasigroup is-groupβis-right-quasigroup β-group
Associative quasigroups as groupsπ
Conversely, if a quasigroup is merely inhabited and associative, then it is a group.
associative+is-quasigroupβis-group: β {_β_ : A β A β A}
β β₯ A β₯
β (β x y z β x β (y β z) β‘ (x β y) β z)
β is-quasigroup _β_
β is-group _β_
We start by observing that is-group
is an h-prop, so it
suffices to consider the case where
is inhabited.
{A = A} {_β_ = _β_} β₯aβ₯ β-assoc β-quasi =
associative+is-quasigroupβis-group (Ξ» a β to-is-group (β-group a)) β₯aβ₯ rec!
where
open is-quasigroup β-quasi renaming (has-is-magma to β-magma)
open make-group
Next, a useful technical lemma: if then
⧡-/-comm: β {a b x y}
β x β b β‘ a β y
β x ⧡ a β‘ b / y
The proof is an elegant bit of algebra. Recall that in a quasigroup, is left and right cancellative, so it suffices to show that:
Next, and so it remains to show that Crucially, is associative, so:
which completes the proof.
{a} {b} {x} {y} comm =
⧡-/-comm
β-cancell x $ β-cancelr y $(x β (x ⧡ a)) β y β‘β¨ ap (_β y) (⧡-invr x a) β©
a β y β‘Λβ¨ comm β©(x β_) (/-invl b y) β©
x β b β‘Λβ¨ ap ((b / y) β y) β‘β¨ β-assoc x (b / y) y β©
x β (x β (b / y)) β y β
With that out of the way, we shall show that
forms a group for any
: A β make-group A
β-group .group-is-set = hlevel 2
β-group a .unit = a ⧡ a
β-group a .mul x y = x β y
β-group a .inv x = (a ⧡ a) / x β-group a
Associativity is one of our hypotheses, so all that remains is left inverses and left identities. Next, note that
is just one of the quasigroup axioms. Finally, our lemma gives us so we have:
which completes the proof.
.assoc x y z =
β-group a
β-assoc x y z.invl x =
β-group a (a ⧡ a) x
/-invl .idl x =
β-group a (a ⧡ a) β x β‘β¨ ap (_β x) (⧡-/-comm refl) β©
(x / x) β x β‘β¨ /-invl x x β©
x β
Taking a step back, this result demonstrates that associative quasigroups behave like potentially empty groups.