File: Mathlib/Algebra/FreeMonoid/Basic.lean

full_name: FreeMonoid
code: /-- Free monoid over a given alphabet. -/
@[to_additive "Free nonabelian additive monoid over a given alphabet"]
def FreeMonoid (α) 
goal: Type u_6

full_name: FreeAddMonoid
code: /-- Free monoid over a given alphabet. -/
@[to_additive "Free nonabelian additive monoid over a given alphabet"]
def FreeMonoid (α) 
goal: Type u_6

full_name: FreeMonoid.toList
code: /-- The identity equivalence between `FreeMonoid α` and `List α`. -/
@[to_additive "The identity equivalence between `FreeAddMonoid α` and `List α`."]
def toList : FreeMonoid α ≃ List α 
goal: FreeMonoid α ≃ List α

full_name: FreeAddMonoid.toList
code: /-- The identity equivalence between `FreeMonoid α` and `List α`. -/
@[to_additive "The identity equivalence between `FreeAddMonoid α` and `List α`."]
def toList : FreeMonoid α ≃ List α 
goal: FreeAddMonoid α ≃ List α

full_name: FreeMonoid.ofList
code: /-- The identity equivalence between `List α` and `FreeMonoid α`. -/
@[to_additive "The identity equivalence between `List α` and `FreeAddMonoid α`."]
def ofList : List α ≃ FreeMonoid α 
goal: List α ≃ FreeMonoid α

full_name: FreeAddMonoid.ofList
code: /-- The identity equivalence between `List α` and `FreeMonoid α`. -/
@[to_additive "The identity equivalence between `List α` and `FreeAddMonoid α`."]
def ofList : List α ≃ FreeMonoid α 
goal: List α ≃ FreeAddMonoid α

full_name: FreeMonoid.toList_symm
code: @[to_additive (attr := simp)]
theorem toList_symm : (@toList α).symm = ofList 
goal: FreeMonoid.toList.symm = FreeMonoid.ofList

full_name: FreeAddMonoid.toList_symm
code: @[to_additive (attr := simp)]
theorem toList_symm : (@toList α).symm = ofList 
goal: FreeAddMonoid.toList.symm = FreeAddMonoid.ofList

full_name: FreeMonoid.ofList_symm
code: @[to_additive (attr := simp)]
theorem ofList_symm : (@ofList α).symm = toList 
goal: FreeMonoid.ofList.symm = FreeMonoid.toList

full_name: FreeAddMonoid.ofList_symm
code: @[to_additive (attr := simp)]
theorem ofList_symm : (@ofList α).symm = toList 
goal: FreeAddMonoid.ofList.symm = FreeAddMonoid.toList

full_name: FreeAddMonoid.toList_ofList
code: @[to_additive (attr := simp)]
theorem toList_ofList (l : List α) : toList (ofList l) = l 
goal: FreeAddMonoid.toList (FreeAddMonoid.ofList l) = l

full_name: FreeMonoid.toList_ofList
code: @[to_additive (attr := simp)]
theorem toList_ofList (l : List α) : toList (ofList l) = l 
goal: FreeMonoid.toList (FreeMonoid.ofList l) = l

full_name: FreeAddMonoid.ofList_toList
code: @[to_additive (attr := simp)]
theorem ofList_toList (xs : FreeMonoid α) : ofList (toList xs) = xs 
goal: FreeAddMonoid.ofList (FreeAddMonoid.toList xs) = xs

full_name: FreeMonoid.ofList_toList
code: @[to_additive (attr := simp)]
theorem ofList_toList (xs : FreeMonoid α) : ofList (toList xs) = xs 
goal: FreeMonoid.ofList (FreeMonoid.toList xs) = xs

full_name: FreeMonoid.toList_comp_ofList
code: @[to_additive (attr := simp)]
theorem toList_comp_ofList : @toList α ∘ ofList = id 
goal: ⇑FreeMonoid.toList ∘ ⇑FreeMonoid.ofList = id

full_name: FreeAddMonoid.toList_comp_ofList
code: @[to_additive (attr := simp)]
theorem toList_comp_ofList : @toList α ∘ ofList = id 
goal: ⇑FreeAddMonoid.toList ∘ ⇑FreeAddMonoid.ofList = id

full_name: FreeAddMonoid.ofList_comp_toList
code: @[to_additive (attr := simp)]
theorem ofList_comp_toList : @ofList α ∘ toList = id 
goal: ⇑FreeAddMonoid.ofList ∘ ⇑FreeAddMonoid.toList = id

full_name: FreeMonoid.ofList_comp_toList
code: @[to_additive (attr := simp)]
theorem ofList_comp_toList : @ofList α ∘ toList = id 
goal: ⇑FreeMonoid.ofList ∘ ⇑FreeMonoid.toList = id

full_name: FreeMonoid.instCancelMonoid
code: @[to_additive]
instance : CancelMonoid (FreeMonoid α) 
goal: CancelMonoid (FreeMonoid α)

full_name: FreeAddMonoid.instAddCancelMonoid
code: @[to_additive]
instance : CancelMonoid (FreeMonoid α) 
goal: AddCancelMonoid (FreeAddMonoid α)

full_name: FreeAddMonoid.instInhabited
code: @[to_additive]
instance : Inhabited (FreeMonoid α) 
goal: Inhabited (FreeAddMonoid α)

full_name: FreeMonoid.instInhabited
code: @[to_additive]
instance : Inhabited (FreeMonoid α) 
goal: Inhabited (FreeMonoid α)

full_name: FreeAddMonoid.toList_zero
code: @[to_additive (attr := simp)]
theorem toList_one : toList (1 : FreeMonoid α) = [] 
goal: FreeAddMonoid.toList 0 = []

full_name: FreeMonoid.toList_one
code: @[to_additive (attr := simp)]
theorem toList_one : toList (1 : FreeMonoid α) = [] 
goal: FreeMonoid.toList 1 = []

full_name: FreeAddMonoid.ofList_nil
code: @[to_additive (attr := simp)]
theorem ofList_nil : ofList ([] : List α) = 1 
goal: FreeAddMonoid.ofList [] = 0

full_name: FreeMonoid.ofList_nil
code: @[to_additive (attr := simp)]
theorem ofList_nil : ofList ([] : List α) = 1 
goal: FreeMonoid.ofList [] = 1

full_name: FreeMonoid.toList_mul
code: @[to_additive (attr := simp)]
theorem toList_mul (xs ys : FreeMonoid α) : toList (xs * ys) = toList xs ++ toList ys 
goal: FreeMonoid.toList (xs * ys) = FreeMonoid.toList xs ++ FreeMonoid.toList ys

full_name: FreeAddMonoid.toList_add
code: @[to_additive (attr := simp)]
theorem toList_mul (xs ys : FreeMonoid α) : toList (xs * ys) = toList xs ++ toList ys 
goal: FreeAddMonoid.toList (xs + ys) = FreeAddMonoid.toList xs ++ FreeAddMonoid.toList ys

full_name: FreeMonoid.ofList_append
code: @[to_additive (attr := simp)]
theorem ofList_append (xs ys : List α) : ofList (xs ++ ys) = ofList xs * ofList ys 
goal: FreeMonoid.ofList (xs ++ ys) = FreeMonoid.ofList xs * FreeMonoid.ofList ys

full_name: FreeAddMonoid.ofList_append
code: @[to_additive (attr := simp)]
theorem ofList_append (xs ys : List α) : ofList (xs ++ ys) = ofList xs * ofList ys 
goal: FreeAddMonoid.ofList (xs ++ ys) = FreeAddMonoid.ofList xs + FreeAddMonoid.ofList ys

full_name: FreeAddMonoid.toList_sum
code: @[to_additive (attr := simp)]
theorem toList_prod (xs : List (FreeMonoid α)) : toList xs.prod = (xs.map toList).join 
goal: FreeAddMonoid.toList xs.sum = (List.map (⇑FreeAddMonoid.toList) xs).join

full_name: FreeMonoid.toList_prod
code: @[to_additive (attr := simp)]
theorem toList_prod (xs : List (FreeMonoid α)) : toList xs.prod = (xs.map toList).join 
goal: FreeMonoid.toList xs.prod = (List.map (⇑FreeMonoid.toList) xs).join

full_name: FreeMonoid.ofList_join
code: @[to_additive (attr := simp)]
theorem ofList_join (xs : List (List α)) : ofList xs.join = (xs.map ofList).prod 
goal: FreeMonoid.ofList xs.join = (List.map (⇑FreeMonoid.ofList) xs).prod

full_name: FreeAddMonoid.ofList_join
code: @[to_additive (attr := simp)]
theorem ofList_join (xs : List (List α)) : ofList xs.join = (xs.map ofList).prod 
goal: FreeAddMonoid.ofList xs.join = (List.map (⇑FreeAddMonoid.ofList) xs).sum

full_name: FreeAddMonoid.of
code: /-- Embeds an element of `α` into `FreeMonoid α` as a singleton list. -/
@[to_additive "Embeds an element of `α` into `FreeAddMonoid α` as a singleton list."]
def of (x : α) : FreeMonoid α 
goal: FreeAddMonoid α

full_name: FreeMonoid.of
code: /-- Embeds an element of `α` into `FreeMonoid α` as a singleton list. -/
@[to_additive "Embeds an element of `α` into `FreeAddMonoid α` as a singleton list."]
def of (x : α) : FreeMonoid α 
goal: FreeMonoid α

full_name: FreeMonoid.toList_of
code: @[to_additive (attr := simp)]
theorem toList_of (x : α) : toList (of x) = [x] 
goal: FreeMonoid.toList (FreeMonoid.of x) = [x]

full_name: FreeAddMonoid.toList_of
code: @[to_additive (attr := simp)]
theorem toList_of (x : α) : toList (of x) = [x] 
goal: FreeAddMonoid.toList (FreeAddMonoid.of x) = [x]

full_name: FreeAddMonoid.ofList_singleton
code: @[to_additive]
theorem ofList_singleton (x : α) : ofList [x] = of x 
goal: FreeAddMonoid.ofList [x] = FreeAddMonoid.of x

full_name: FreeMonoid.ofList_singleton
code: @[to_additive]
theorem ofList_singleton (x : α) : ofList [x] = of x 
goal: FreeMonoid.ofList [x] = FreeMonoid.of x

full_name: FreeMonoid.ofList_cons
code: @[to_additive (attr := simp)]
theorem ofList_cons (x : α) (xs : List α) : ofList (x :: xs) = of x * ofList xs 
goal: FreeMonoid.ofList (x :: xs) = FreeMonoid.of x * FreeMonoid.ofList xs

full_name: FreeAddMonoid.ofList_cons
code: @[to_additive (attr := simp)]
theorem ofList_cons (x : α) (xs : List α) : ofList (x :: xs) = of x * ofList xs 
goal: FreeAddMonoid.ofList (x :: xs) = FreeAddMonoid.of x + FreeAddMonoid.ofList xs

full_name: FreeAddMonoid.toList_of_add
code: @[to_additive]
theorem toList_of_mul (x : α) (xs : FreeMonoid α) : toList (of x * xs) = x :: toList xs 
goal: FreeAddMonoid.toList (FreeAddMonoid.of x + xs) = x :: FreeAddMonoid.toList xs

full_name: FreeMonoid.toList_of_mul
code: @[to_additive]
theorem toList_of_mul (x : α) (xs : FreeMonoid α) : toList (of x * xs) = x :: toList xs 
goal: FreeMonoid.toList (FreeMonoid.of x * xs) = x :: FreeMonoid.toList xs

full_name: FreeAddMonoid.of_injective
code: @[to_additive]
theorem of_injective : Function.Injective (@of α) 
goal: Function.Injective FreeAddMonoid.of

full_name: FreeMonoid.of_injective
code: @[to_additive]
theorem of_injective : Function.Injective (@of α) 
goal: Function.Injective FreeMonoid.of

full_name: FreeMonoid.recOn
code: /-- Recursor for `FreeMonoid` using `1` and `FreeMonoid.of x * xs` instead of `[]` and `x :: xs`. -/
@[to_additive (attr := elab_as_elim, induction_eliminator)
  "Recursor for `FreeAddMonoid` using `0` and
  FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`."]
-- Porting note: change from `List.recOn` to `List.rec` since only the latter is computable
def recOn {C : FreeMonoid α → Sort*} (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C xs → C (of x * xs)) : C xs 
goal: C xs

full_name: FreeAddMonoid.recOn
code: /-- Recursor for `FreeMonoid` using `1` and `FreeMonoid.of x * xs` instead of `[]` and `x :: xs`. -/
@[to_additive (attr := elab_as_elim, induction_eliminator)
  "Recursor for `FreeAddMonoid` using `0` and
  FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`."]
-- Porting note: change from `List.recOn` to `List.rec` since only the latter is computable
def recOn {C : FreeMonoid α → Sort*} (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C xs → C (of x * xs)) : C xs 
goal: C xs

full_name: FreeMonoid.recOn_one
code: @[to_additive (attr := simp)]
theorem recOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C xs → C (of x * xs)) :
    @recOn α C 1 h0 ih = h0 
goal: FreeMonoid.recOn 1 h0 ih = h0

full_name: FreeAddMonoid.recOn_zero
code: @[to_additive (attr := simp)]
theorem recOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C xs → C (of x * xs)) :
    @recOn α C 1 h0 ih = h0 
goal: FreeAddMonoid.recOn 0 h0 ih = h0

full_name: FreeMonoid.recOn_of_mul
code: @[to_additive (attr := simp)]
theorem recOn_of_mul {C : FreeMonoid α → Sort*} (x : α) (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C xs → C (of x * xs)) : @recOn α C (of x * xs) h0 ih = ih x xs (recOn xs h0 ih) 
goal: (FreeMonoid.of x * xs).recOn h0 ih = ih x xs (xs.recOn h0 ih)

full_name: FreeAddMonoid.recOn_of_add
code: @[to_additive (attr := simp)]
theorem recOn_of_mul {C : FreeMonoid α → Sort*} (x : α) (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C xs → C (of x * xs)) : @recOn α C (of x * xs) h0 ih = ih x xs (recOn xs h0 ih) 
goal: (FreeAddMonoid.of x + xs).recOn h0 ih = ih x xs (xs.recOn h0 ih)

full_name: FreeAddMonoid.casesOn
code: /-- A version of `List.cases_on` for `FreeMonoid` using `1` and `FreeMonoid.of x * xs` instead of
`[]` and `x :: xs`. -/
@[to_additive (attr := elab_as_elim, cases_eliminator)
  "A version of `List.casesOn` for `FreeAddMonoid` using `0` and
  `FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`."]
def casesOn {C : FreeMonoid α → Sort*} (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C (of x * xs)) : C xs 
goal: C xs

full_name: FreeMonoid.casesOn
code: /-- A version of `List.cases_on` for `FreeMonoid` using `1` and `FreeMonoid.of x * xs` instead of
`[]` and `x :: xs`. -/
@[to_additive (attr := elab_as_elim, cases_eliminator)
  "A version of `List.casesOn` for `FreeAddMonoid` using `0` and
  `FreeAddMonoid.of x + xs` instead of `[]` and `x :: xs`."]
def casesOn {C : FreeMonoid α → Sort*} (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C (of x * xs)) : C xs 
goal: C xs

full_name: FreeMonoid.casesOn_one
code: @[to_additive (attr := simp)]
theorem casesOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C (of x * xs)) :
    @casesOn α C 1 h0 ih = h0 
goal: FreeMonoid.casesOn 1 h0 ih = h0

full_name: FreeAddMonoid.casesOn_zero
code: @[to_additive (attr := simp)]
theorem casesOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C (of x * xs)) :
    @casesOn α C 1 h0 ih = h0 
goal: FreeAddMonoid.casesOn 0 h0 ih = h0

full_name: FreeAddMonoid.casesOn_of_add
code: @[to_additive (attr := simp)]
theorem casesOn_of_mul {C : FreeMonoid α → Sort*} (x : α) (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C (of x * xs)) : @casesOn α C (of x * xs) h0 ih = ih x xs 
goal: (FreeAddMonoid.of x + xs).casesOn h0 ih = ih x xs

full_name: FreeMonoid.casesOn_of_mul
code: @[to_additive (attr := simp)]
theorem casesOn_of_mul {C : FreeMonoid α → Sort*} (x : α) (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C (of x * xs)) : @casesOn α C (of x * xs) h0 ih = ih x xs 
goal: (FreeMonoid.of x * xs).casesOn h0 ih = ih x xs

full_name: FreeAddMonoid.hom_eq
code: @[to_additive (attr := ext)]
theorem hom_eq ⦃f g : FreeMonoid α →* M⦄ (h : ∀ x, f (of x) = g (of x)) : f = g 
goal: f = g

full_name: FreeMonoid.hom_eq
code: @[to_additive (attr := ext)]
theorem hom_eq ⦃f g : FreeMonoid α →* M⦄ (h : ∀ x, f (of x) = g (of x)) : f = g 
goal: f = g

full_name: FreeAddMonoid.sumAux
code: /-- A variant of `List.prod` that has `[x].prod = x` true definitionally.
The purpose is to make `FreeMonoid.lift_eval_of` true by `rfl`. -/
@[to_additive "A variant of `List.sum` that has `[x].sum = x` true definitionally.
The purpose is to make `FreeAddMonoid.lift_eval_of` true by `rfl`."]
def prodAux {M} [Monoid M] : List M → M
  
goal: List M → M

full_name: FreeMonoid.prodAux
code: /-- A variant of `List.prod` that has `[x].prod = x` true definitionally.
The purpose is to make `FreeMonoid.lift_eval_of` true by `rfl`. -/
@[to_additive "A variant of `List.sum` that has `[x].sum = x` true definitionally.
The purpose is to make `FreeAddMonoid.lift_eval_of` true by `rfl`."]
def prodAux {M} [Monoid M] : List M → M
  
goal: List M → M

full_name: FreeAddMonoid.sumAux_eq
code: @[to_additive]
lemma prodAux_eq : ∀ l : List M, FreeMonoid.prodAux l = l.prod
  
goal: FreeAddMonoid.sumAux l = l.sum

full_name: FreeMonoid.prodAux_eq
code: @[to_additive]
lemma prodAux_eq : ∀ l : List M, FreeMonoid.prodAux l = l.prod
  
goal: FreeMonoid.prodAux l = l.prod

full_name: FreeAddMonoid.lift
code: /-- Equivalence between maps `α → M` and monoid homomorphisms `FreeMonoid α →* M`. -/
@[to_additive "Equivalence between maps `α → A` and additive monoid homomorphisms
`FreeAddMonoid α →+ A`."]
def lift : (α → M) ≃ (FreeMonoid α →* M) 
goal: (α → M) ≃ (FreeAddMonoid α →+ M)

full_name: FreeMonoid.lift
code: /-- Equivalence between maps `α → M` and monoid homomorphisms `FreeMonoid α →* M`. -/
@[to_additive "Equivalence between maps `α → A` and additive monoid homomorphisms
`FreeAddMonoid α →+ A`."]
def lift : (α → M) ≃ (FreeMonoid α →* M) 
goal: (α → M) ≃ (FreeMonoid α →* M)

full_name: FreeMonoid.lift_ofList
code: @[to_additive (attr := simp)]
theorem lift_ofList (f : α → M) (l : List α) : lift f (ofList l) = (l.map f).prod 
goal: (FreeMonoid.lift f) (FreeMonoid.ofList l) = (List.map f l).prod

full_name: FreeAddMonoid.lift_ofList
code: @[to_additive (attr := simp)]
theorem lift_ofList (f : α → M) (l : List α) : lift f (ofList l) = (l.map f).prod 
goal: (FreeAddMonoid.lift f) (FreeAddMonoid.ofList l) = (List.map f l).sum

full_name: FreeAddMonoid.lift_symm_apply
code: @[to_additive (attr := simp)]
theorem lift_symm_apply (f : FreeMonoid α →* M) : lift.symm f = f ∘ of 
goal: FreeAddMonoid.lift.symm f = ⇑f ∘ FreeAddMonoid.of

full_name: FreeMonoid.lift_symm_apply
code: @[to_additive (attr := simp)]
theorem lift_symm_apply (f : FreeMonoid α →* M) : lift.symm f = f ∘ of 
goal: FreeMonoid.lift.symm f = ⇑f ∘ FreeMonoid.of

full_name: FreeMonoid.lift_apply
code: @[to_additive]
theorem lift_apply (f : α → M) (l : FreeMonoid α) : lift f l = ((toList l).map f).prod 
goal: (FreeMonoid.lift f) l = (List.map f (FreeMonoid.toList l)).prod

full_name: FreeAddMonoid.lift_apply
code: @[to_additive]
theorem lift_apply (f : α → M) (l : FreeMonoid α) : lift f l = ((toList l).map f).prod 
goal: (FreeAddMonoid.lift f) l = (List.map f (FreeAddMonoid.toList l)).sum

full_name: FreeMonoid.lift_comp_of
code: @[to_additive]
theorem lift_comp_of (f : α → M) : lift f ∘ of = f 
goal: ⇑(FreeMonoid.lift f) ∘ FreeMonoid.of = f

full_name: FreeAddMonoid.lift_comp_of
code: @[to_additive]
theorem lift_comp_of (f : α → M) : lift f ∘ of = f 
goal: ⇑(FreeAddMonoid.lift f) ∘ FreeAddMonoid.of = f

full_name: FreeAddMonoid.lift_eval_of
code: @[to_additive (attr := simp)]
theorem lift_eval_of (f : α → M) (x : α) : lift f (of x) = f x 
goal: (FreeAddMonoid.lift f) (FreeAddMonoid.of x) = f x

full_name: FreeMonoid.lift_eval_of
code: @[to_additive (attr := simp)]
theorem lift_eval_of (f : α → M) (x : α) : lift f (of x) = f x 
goal: (FreeMonoid.lift f) (FreeMonoid.of x) = f x

full_name: FreeAddMonoid.lift_restrict
code: @[to_additive (attr := simp)]
theorem lift_restrict (f : FreeMonoid α →* M) : lift (f ∘ of) = f 
goal: FreeAddMonoid.lift (⇑f ∘ FreeAddMonoid.of) = f

full_name: FreeMonoid.lift_restrict
code: @[to_additive (attr := simp)]
theorem lift_restrict (f : FreeMonoid α →* M) : lift (f ∘ of) = f 
goal: FreeMonoid.lift (⇑f ∘ FreeMonoid.of) = f

full_name: FreeAddMonoid.comp_lift
code: @[to_additive]
theorem comp_lift (g : M →* N) (f : α → M) : g.comp (lift f) = lift (g ∘ f) 
goal: g.comp (FreeAddMonoid.lift f) = FreeAddMonoid.lift (⇑g ∘ f)

full_name: FreeMonoid.comp_lift
code: @[to_additive]
theorem comp_lift (g : M →* N) (f : α → M) : g.comp (lift f) = lift (g ∘ f) 
goal: g.comp (FreeMonoid.lift f) = FreeMonoid.lift (⇑g ∘ f)

full_name: FreeMonoid.hom_map_lift
code: @[to_additive]
theorem hom_map_lift (g : M →* N) (f : α → M) (x : FreeMonoid α) : g (lift f x) = lift (g ∘ f) x 
goal: g ((FreeMonoid.lift f) x) = (FreeMonoid.lift (⇑g ∘ f)) x

full_name: FreeAddMonoid.hom_map_lift
code: @[to_additive]
theorem hom_map_lift (g : M →* N) (f : α → M) (x : FreeMonoid α) : g (lift f x) = lift (g ∘ f) x 
goal: g ((FreeAddMonoid.lift f) x) = (FreeAddMonoid.lift (⇑g ∘ f)) x

full_name: FreeAddMonoid.mkAddAction
code: /-- Define a multiplicative action of `FreeMonoid α` on `β`. -/
@[to_additive "Define an additive action of `FreeAddMonoid α` on `β`."]
def mkMulAction (f : α → β → β) : MulAction (FreeMonoid α) β 
goal: AddAction (FreeAddMonoid α) β

full_name: FreeMonoid.mkMulAction
code: /-- Define a multiplicative action of `FreeMonoid α` on `β`. -/
@[to_additive "Define an additive action of `FreeAddMonoid α` on `β`."]
def mkMulAction (f : α → β → β) : MulAction (FreeMonoid α) β 
goal: MulAction (FreeMonoid α) β

full_name: FreeAddMonoid.vadd_def
code: @[to_additive]
theorem smul_def (f : α → β → β) (l : FreeMonoid α) (b : β) :
    haveI := mkMulAction f
    l • b = l.toList.foldr f b 
goal: l +ᵥ b = List.foldr f b (FreeAddMonoid.toList l)

full_name: FreeMonoid.smul_def
code: @[to_additive]
theorem smul_def (f : α → β → β) (l : FreeMonoid α) (b : β) :
    haveI := mkMulAction f
    l • b = l.toList.foldr f b 
goal: l • b = List.foldr f b (FreeMonoid.toList l)

full_name: FreeMonoid.ofList_smul
code: @[to_additive]
theorem ofList_smul (f : α → β → β) (l : List α) (b : β) :
    haveI := mkMulAction f
    ofList l • b = l.foldr f b 
goal: FreeMonoid.ofList l • b = List.foldr f b l

full_name: FreeAddMonoid.ofList_vadd
code: @[to_additive]
theorem ofList_smul (f : α → β → β) (l : List α) (b : β) :
    haveI := mkMulAction f
    ofList l • b = l.foldr f b 
goal: FreeAddMonoid.ofList l +ᵥ b = List.foldr f b l

full_name: FreeMonoid.of_smul
code: @[to_additive (attr := simp)]
theorem of_smul (f : α → β → β) (x : α) (y : β) :
    (haveI := mkMulAction f
    of x • y) = f x y 
goal: FreeMonoid.of x • y = f x y

full_name: FreeAddMonoid.of_vadd
code: @[to_additive (attr := simp)]
theorem of_smul (f : α → β → β) (x : α) (y : β) :
    (haveI := mkMulAction f
    of x • y) = f x y 
goal: FreeAddMonoid.of x +ᵥ y = f x y

full_name: FreeAddMonoid.map
code: /-- The unique monoid homomorphism `FreeMonoid α →* FreeMonoid β` that sends
each `of x` to `of (f x)`. -/
@[to_additive "The unique additive monoid homomorphism `FreeAddMonoid α →+ FreeAddMonoid β`
that sends each `of x` to `of (f x)`."]
def map (f : α → β) : FreeMonoid α →* FreeMonoid β 
goal: FreeAddMonoid α →+ FreeAddMonoid β

full_name: FreeMonoid.map
code: /-- The unique monoid homomorphism `FreeMonoid α →* FreeMonoid β` that sends
each `of x` to `of (f x)`. -/
@[to_additive "The unique additive monoid homomorphism `FreeAddMonoid α →+ FreeAddMonoid β`
that sends each `of x` to `of (f x)`."]
def map (f : α → β) : FreeMonoid α →* FreeMonoid β 
goal: FreeMonoid α →* FreeMonoid β

full_name: FreeAddMonoid.map_of
code: @[to_additive (attr := simp)]
theorem map_of (f : α → β) (x : α) : map f (of x) = of (f x) 
goal: (FreeAddMonoid.map f) (FreeAddMonoid.of x) = FreeAddMonoid.of (f x)

full_name: FreeMonoid.map_of
code: @[to_additive (attr := simp)]
theorem map_of (f : α → β) (x : α) : map f (of x) = of (f x) 
goal: (FreeMonoid.map f) (FreeMonoid.of x) = FreeMonoid.of (f x)

full_name: FreeMonoid.toList_map
code: @[to_additive]
theorem toList_map (f : α → β) (xs : FreeMonoid α) : toList (map f xs) = xs.toList.map f 
goal: FreeMonoid.toList ((FreeMonoid.map f) xs) = List.map f (FreeMonoid.toList xs)

full_name: FreeAddMonoid.toList_map
code: @[to_additive]
theorem toList_map (f : α → β) (xs : FreeMonoid α) : toList (map f xs) = xs.toList.map f 
goal: FreeAddMonoid.toList ((FreeAddMonoid.map f) xs) = List.map f (FreeAddMonoid.toList xs)

full_name: FreeMonoid.ofList_map
code: @[to_additive]
theorem ofList_map (f : α → β) (xs : List α) : ofList (xs.map f) = map f (ofList xs) 
goal: FreeMonoid.ofList (List.map f xs) = (FreeMonoid.map f) (FreeMonoid.ofList xs)

full_name: FreeAddMonoid.ofList_map
code: @[to_additive]
theorem ofList_map (f : α → β) (xs : List α) : ofList (xs.map f) = map f (ofList xs) 
goal: FreeAddMonoid.ofList (List.map f xs) = (FreeAddMonoid.map f) (FreeAddMonoid.ofList xs)

full_name: FreeAddMonoid.lift_of_comp_eq_map
code: @[to_additive]
theorem lift_of_comp_eq_map (f : α → β) : (lift fun x ↦ of (f x)) = map f 
goal: (FreeAddMonoid.lift fun x => FreeAddMonoid.of (f x)) = FreeAddMonoid.map f

full_name: FreeMonoid.lift_of_comp_eq_map
code: @[to_additive]
theorem lift_of_comp_eq_map (f : α → β) : (lift fun x ↦ of (f x)) = map f 
goal: (FreeMonoid.lift fun x => FreeMonoid.of (f x)) = FreeMonoid.map f

full_name: FreeMonoid.map_comp
code: @[to_additive]
theorem map_comp (g : β → γ) (f : α → β) : map (g ∘ f) = (map g).comp (map f) 
goal: FreeMonoid.map (g ∘ f) = (FreeMonoid.map g).comp (FreeMonoid.map f)

full_name: FreeAddMonoid.map_comp
code: @[to_additive]
theorem map_comp (g : β → γ) (f : α → β) : map (g ∘ f) = (map g).comp (map f) 
goal: FreeAddMonoid.map (g ∘ f) = (FreeAddMonoid.map g).comp (FreeAddMonoid.map f)

full_name: FreeMonoid.map_id
code: @[to_additive (attr := simp)]
theorem map_id : map (@id α) = MonoidHom.id (FreeMonoid α) 
goal: FreeMonoid.map id = MonoidHom.id (FreeMonoid α)

full_name: FreeAddMonoid.map_id
code: @[to_additive (attr := simp)]
theorem map_id : map (@id α) = MonoidHom.id (FreeMonoid α) 
goal: FreeAddMonoid.map id = AddMonoidHom.id (FreeAddMonoid α)

full_name: FreeAddMonoid.uniqueAddUnits
code: /-- The only invertible element of the free monoid is 1; this instance enables `units_eq_one`. -/
@[to_additive]
instance uniqueUnits : Unique (FreeMonoid α)ˣ 
goal: Unique (AddUnits (FreeAddMonoid α))

full_name: FreeMonoid.uniqueUnits
code: /-- The only invertible element of the free monoid is 1; this instance enables `units_eq_one`. -/
@[to_additive]
instance uniqueUnits : Unique (FreeMonoid α)ˣ 
goal: Unique (FreeMonoid α)ˣ