Free monoid over a given alphabet #
Main definitions #
free_monoid α
: free monoid over alphabetα
; defined as a synonym forlist α
with multiplication given by(++)
.free_monoid.of
: embeddingα → free_monoid α
sending each elementx
to[x]
;free_monoid.lift
: natural equivalence betweenα → M
andfree_monoid α →* M
free_monoid.map
: embedding ofα → β
intofree_monoid α →* free_monoid β
given bylist.map
.
Free nonabelian additive monoid over a given alphabet
Equations
- free_add_monoid α = list α
Free monoid over a given alphabet.
Equations
- free_monoid α = list α
Equations
- free_add_monoid.add_monoid = {add := λ (x y : free_add_monoid α), x ++ y, add_assoc := _, zero := list.nil α, zero_add := _, add_zero := _, nsmul := nsmul_rec (add_zero_class.to_has_add (free_add_monoid α)), nsmul_zero' := _, nsmul_succ' := _}
Equations
- free_monoid.monoid = {mul := λ (x y : free_monoid α), x ++ y, mul_assoc := _, one := list.nil α, one_mul := _, mul_one := _, npow := npow_rec (mul_one_class.to_has_mul (free_monoid α)), npow_zero' := _, npow_succ' := _}
Equations
Equations
- free_monoid.inhabited = {default := 1}
Embeds an element of α
into free_monoid α
as a singleton list.
Equations
- free_monoid.of x = [x]
Embeds an element of α
into free_add_monoid α
as a singleton list.
Equations
- free_add_monoid.of x = [x]
Recursor for free_monoid
using 1
and of x * xs
instead of []
and x :: xs
.
Recursor for free_add_monoid
using 0
and of x + xs
instead of []
and x :: xs
.
Equivalence between maps α → A
and additive monoid homomorphisms
free_add_monoid α →+ A
.
Equations
- free_add_monoid.lift = {to_fun := λ (f : α → M), {to_fun := λ (l : free_add_monoid α), (list.map f l).sum, map_zero' := _, map_add' := _}, inv_fun := λ (f : free_add_monoid α →+ M) (x : α), ⇑f (free_add_monoid.of x), left_inv := _, right_inv := _}
Equivalence between maps α → M
and monoid homomorphisms free_monoid α →* M
.
Equations
- free_monoid.lift = {to_fun := λ (f : α → M), {to_fun := λ (l : free_monoid α), (list.map f l).prod, map_one' := _, map_mul' := _}, inv_fun := λ (f : free_monoid α →* M) (x : α), ⇑f (free_monoid.of x), left_inv := _, right_inv := _}
The unique additive monoid homomorphism free_add_monoid α →+ free_add_monoid β
that sends each of x
to of (f x)
.
The unique monoid homomorphism free_monoid α →* free_monoid β
that sends
each of x
to of (f x)
.
Equations
- free_monoid.star_monoid = {to_has_involutive_star := {to_has_star := {star := list.reverse α}, star_involutive := _}, star_mul := _}
Note that star_one
is already a global simp lemma, but this one works with dsimp too