module Algebra.Monoid.Instances.Transformation.Fin where
Finite full transformation monoidsπ
The finite full transformation monoid represents the endomaps of the standard finite set
End[n] : Monoid lzero End[n] = (Fin n β Fin n) , End (el! (Fin n))
However, the definition of the full
transformation monoid End[n] on
has a few disadvantages. Firstly, elements of End[n], being
functions, are awkward to write down. On a blackboard one often writes
an element of
in the form
Here,
is the transformation sending each element in the top row to the
corresponding element in the bottom row. We would like to achieve
something similar in Mikan. Secondly, the product of two elements of
End[n] will
typically not compute until it is actually applied to an element of
We would like equal elements of
to be definitionally equal whenever possible.
We can solve both these problems using the equivalence between the
underlying set of End[n] and vectors of length
with coordinates in
Endβπ― : β End[n] β β Vec (Fin n) n Endβπ― = Equiv.inverse VecβFun π― : Monoid lzero π― = Vec (Fin n) n , monoid-transport Endβπ― (End[n] .snd)
Since the monoid structure on
was constructed directly from the monoid structure on End[n], it is
clear that these give isomorphic monoids:
Endβ π― : (el! (End[n] .fst) , End[n] .snd) Monoids.β (el! (π― .fst) , π― .snd) Endβ π― = total-iso Endβπ― (monoid-transport-hom Endβπ― (End[n] .snd))
Using list syntax for vectors, the element above can be written as
a : β π― 5 β a = [ 4 , 1 , 4 , 2 , 1 ]
Moreover, multiplication in genuinely computes, so we can write equations such as
_ : a β‘ [ 1 , 2 , 3 , 4 , 0 ] β [ 3 , 0 , 3 , 1 , 0 ] _ = refl