module Algebra.Magma.Unital.EckmannHilton where
The Eckmann-Hilton argumentπ
The Eckmann-Hilton argument shows that two unital magmas
on the same carrier
type that satisfy a particular interchange law are not only equal to
another, but are also commutative and associative.
More precisely, let and two unital magmas such that
module _ {β : _} {A : Type β} {_β_ : A β A β A} {_β'_ : A β A β A} {e : A} {e' : A} (unital-mgm : is-unital-magma e _β_) (unital-mgm' : is-unital-magma e' _β'_) (interchange : (a b c d : A) β (a β b) β' (c β d) β‘ (a β' c) β (b β' d)) where
Then, one can first show that both operations share a unit, i.e.Β Notably, this holds because the units can be expanded to products of themselves, which can then be transformed into another by making use of the interchange equation.
units-equal : e β‘ e' units-equal = e β‘β¨ sym (idl unital-mgm) β©β‘ (e β e) β‘β¨ apβ _β_ (sym (idl unital-mgm')) (sym (idr unital-mgm')) β©β‘ ((e' β' e) β (e β' e')) β‘β¨ sym (interchange e' e e e') β©β‘ ((e' β e) β' (e β e')) β‘β¨ apβ _β'_ (idr unital-mgm) (idl unital-mgm) β©β‘ (e' β' e') β‘β¨ idl unital-mgm' β©β‘ e' β
From there on, we are able to derive that one operation is equal to the dual of the other, once again by using the interchange law as well as swapping units whenever needed.
β-reverse-β' : (x y : A) β x β y β‘ y β' x β-reverse-β' x y = x β y β‘β¨ apβ _β_ (sym (idl unital-mgm')) (sym (idr unital-mgm')) β©β‘ (e' β' x) β (y β' e') β‘β¨ sym (interchange e' y x e') β©β‘ (e' β y) β' (x β e') β‘β¨ apβ _β'_ (ap (_β y) (sym units-equal)) (ap (x β_) (sym units-equal)) β©β‘ (e β y) β' (x β e) β‘β¨ apβ _β'_ (idl unital-mgm) (idr unital-mgm) β©β‘ y β' x β
By a similar method, we can show pointwise equality of the two operators.
operations-equal : (x y : A) β x β y β‘ x β' y operations-equal x y = x β y β‘β¨ apβ _β_ (sym (idr unital-mgm')) (sym (idl unital-mgm')) β©β‘ (x β' e') β (e' β' y) β‘β¨ sym (interchange x e' e' y) β©β‘ (x β e') β' (e' β y) β‘β¨ apβ _β'_ (sym (ap (_β_ x) units-equal)) (sym (ap (_β y) units-equal)) β©β‘ (x β e) β' (e β y) β‘β¨ apβ _β'_ (idr unital-mgm) (idl unital-mgm) β©β‘ x β' y β
These two properties make it rather straightforward to show that is commutative - since we know that as well as the proof can be completed by simple path concatenation.
β-commutative : (x y : A) β x β y β‘ y β x β-commutative x y = β-reverse-β' x y β sym (operations-equal y x)
Finally, associativity of the operation can be established by what can be informally described as rotating the elements of the product, using commutativity inside the factors of a products that can then be interchanged and reduced. Thus, associativity combined with the assumed unitality allows us to prove that the operation is a monoid.
β-associative : (x y z : A) β x β (y β z) β‘ (x β y) β z β-associative x y z = sym ( (x β y) β z β‘β¨ ap (Ξ» a β (x β y) β a) (sym (idr unital-mgm)) β©β‘ (x β y) β (z β e) β‘β¨ ap (Ξ» x β x β (z β e)) (β-commutative x y) β©β‘ (y β x) β (z β e) β‘β¨ operations-equal (y β x) (z β e) β©β‘ (y β x) β' (z β e) β‘β¨ interchange y x z e β©β‘ (y β' z) β (x β' e) β‘β¨ β-commutative (y β' z) (x β' e) β©β‘ (x β' e) β (y β' z) β‘β¨ apβ _β_ (sym (operations-equal x e)) (sym (operations-equal y z)) β©β‘ (x β e) β (y β z) β‘β¨ ap (_β (y β z)) (idr unital-mgm) β©β‘ x β (y β z) β) β-is-monoid : is-monoid e _β_ β-is-monoid .has-is-semigroup .has-is-magma = unital-mgm .has-is-magma β-is-monoid .has-is-semigroup .associative = β-associative _ _ _ β-is-monoid .idl = unital-mgm .idl β-is-monoid .idr = unital-mgm .idr