The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V05. Groups

Mathlib.Algebra.FreeMonoid.Basic

156 declarations and 50 deprecated aliases. Mathlib docs · Source

Free monoid over a given alphabet

Main definitions

  • FreeMonoid α: free monoid over alphabet α; defined as a one-field structure around List α with multiplication given by (++).
  • FreeMonoid.of: embedding α → FreeMonoid α sending each element x to [x];
  • FreeMonoid.lift: natural equivalence between α → M and FreeMonoid α →* M
  • FreeMonoid.map: embedding of α → β into FreeMonoid α →* FreeMonoid β given by List.map.

Length

Induction

map

reverse

theorem FreeMonoid.prodAux.match_1.congr_eq_2 E1 #

∀ {M : Type u_1} (motive : List M → Sort u_2) (x : List M) (h_1 : Unit → motive [])
  (h_2 : (x : M) → (xs : List M) → motive (x :: xs)) (x_1 : M) (xs : List M),
  x = x_1 :: xs →
    (match x with
      | [] => h_1 ()
      | x :: xs => h_2 x xs) ≍
      h_2 x_1 xs

theorem FreeMonoid.prodAux.match_1.congr_eq_1 E1 #

∀ {M : Type u_1} (motive : List M → Sort u_2) (x : List M) (h_1 : Unit → motive [])
  (h_2 : (x : M) → (xs : List M) → motive (x :: xs)),
  x = [] →
    (match x with
      | [] => h_1 ()
      | x :: xs => h_2 x xs) ≍
      h_1 ()

theorem FreeAddMonoid.sumAux.match_1.congr_eq_1 E1 #

∀ {M : Type u_1} (motive : List M → Sort u_2) (x : List M) (h_1 : Unit → motive [])
  (h_2 : (x : M) → (xs : List M) → motive (x :: xs)),
  x = [] →
    (match x with
      | [] => h_1 ()
      | x :: xs => h_2 x xs) ≍
      h_1 ()

theorem FreeAddMonoid.ofList.injEq E0 #

∀ {α : Type u_6} (toList toList_1 : List α), ({ toList := toList } = { toList := toList_1 }) = (toList = toList_1)

theorem FreeMonoid.ofList.inj E1 #

∀ {α : Type u_6} {toList toList_1 : List α}, { toList := toList } = { toList := toList_1 } → toList = toList_1

def FreeMonoid.ctorIdx E1 #

{α : Type u_6} → FreeMonoid α → ℕ

theorem FreeMonoid.ofList.injEq E0 #

∀ {α : Type u_6} (toList toList_1 : List α), ({ toList := toList } = { toList := toList_1 }) = (toList = toList_1)

theorem FreeAddMonoid.ofList.inj E1 #

∀ {α : Type u_6} {toList toList_1 : List α}, { toList := toList } = { toList := toList_1 } → toList = toList_1

def FreeAddMonoid.ctorIdx E1 #

{α : Type u_6} → FreeAddMonoid α → ℕ

theorem FreeAddMonoid.sumAux.match_1.congr_eq_2 E1 #

∀ {M : Type u_1} (motive : List M → Sort u_2) (x : List M) (h_1 : Unit → motive [])
  (h_2 : (x : M) → (xs : List M) → motive (x :: xs)) (x_1 : M) (xs : List M),
  x = x_1 :: xs →
    (match x with
      | [] => h_1 ()
      | x :: xs => h_2 x xs) ≍
      h_2 x_1 xs

structure FreeMonoid E1 #

Type u_6 → Type u_6

If α is a type, then FreeMonoid α is the free monoid generated by α. This is a monoid equipped with a function FreeMonoid.of : α → FreeMonoid α which has the following universal property: if M is any monoid, and f : α → M is any function, then this function is the composite of FreeMonoid.of and a unique monoid homomorphism FreeMonoid.lift f : FreeMonoid α →* M.

A typical element of FreeMonoid α is a formal product of elements of α. For example if x and y are terms of type α then x * y * y * x is a "typical" element of FreeMonoid α. In particular if α is empty then FreeMonoid α is isomorphic to the trivial monoid, and if α has one term then FreeMonoid α is isomorphic to Multiplicative ℕ. If α has two or more terms then FreeMonoid α is not commutative. One can think of FreeMonoid α as the type of lists of α, with multiplication given by concatenation.

theorem FreeMonoid.ext_iff E0 #

∀ {α : Type u_6} {x y : FreeMonoid α}, x = y ↔ x.toList = y.toList

theorem FreeMonoid.ext E1 #

∀ {α : Type u_6} {x y : FreeMonoid α}, x.toList = y.toList → x = y

ctor FreeMonoid.ofList E0 #

{α : Type u_6} → List α → FreeMonoid α

Convert a List α to a FreeMonoid α.

abbrev FreeMonoid.toList E1 #

{α : Type u_6} → FreeMonoid α → List α

The underlying list

structure FreeAddMonoid E1 #

Type u_6 → Type u_6

If α is a type, then FreeAddMonoid α is the free additive monoid generated by α. This is a monoid equipped with a function FreeAddMonoid.of : α → FreeAddMonoid α which has the following universal property: if M is any monoid, and f : α → M is any function, then this function is the composite of FreeAddMonoid.of and a unique monoid homomorphism FreeAddMonoid.lift f : FreeAddMonoid α →+ M.

A typical element of FreeAddMonoid α is a formal sum of elements of α. For example if x and y are terms of type α then x + y + y + x is a "typical" element of FreeAddMonoid α. In particular if α is empty then FreeAddMonoid α is isomorphic to the trivial monoid, and if α has one term then FreeAddMonoid α is isomorphic to ℕ. If α has two or more terms then FreeAddMonoid α is not commutative. One can think of FreeAddMonoid α as the type of lists of α, with addition given by concatenation.

theorem FreeAddMonoid.ext_iff E0 #

∀ {α : Type u_6} {x y : FreeAddMonoid α}, x = y ↔ x.toList = y.toList

theorem FreeAddMonoid.ext E1 #

∀ {α : Type u_6} {x y : FreeAddMonoid α}, x.toList = y.toList → x = y

ctor FreeAddMonoid.ofList E0 #

{α : Type u_6} → List α → FreeAddMonoid α

Convert a List α to a FreeAddMonoid α.

abbrev FreeAddMonoid.toList E1 #

{α : Type u_6} → FreeAddMonoid α → List α

The underlying list

theorem FreeMonoid.toList_ofList E0 #

∀ {α : Type u_1} (l : List α), { toList := l }.toList = l

theorem FreeAddMonoid.toList_ofList E0 #

∀ {α : Type u_1} (l : List α), { toList := l }.toList = l

theorem FreeMonoid.ofList_toList E0 #

∀ {α : Type u_1} (xs : FreeMonoid α), { toList := xs.toList } = xs

theorem FreeAddMonoid.ofList_toList E0 #

∀ {α : Type u_1} (xs : FreeAddMonoid α), { toList := xs.toList } = xs

theorem FreeAddMonoid.toList_symm E1 #

∀ {α : Type u_1} (xs : FreeAddMonoid α), { toList := xs.toList } = xs

Alias of FreeAddMonoid.ofList_toList.

theorem FreeAddMonoid.ofList_symm E1 #

∀ {α : Type u_1} (l : List α), { toList := l }.toList = l

Alias of FreeAddMonoid.toList_ofList.

theorem FreeAddMonoid.toList_comp_ofList E0 #

∀ {α : Type u_1}, FreeAddMonoid.toList ∘ FreeAddMonoid.ofList = id

theorem FreeMonoid.toList_comp_ofList E0 #

∀ {α : Type u_1}, FreeMonoid.toList ∘ FreeMonoid.ofList = id

theorem FreeAddMonoid.ofList_comp_toList E0 #

∀ {α : Type u_1}, FreeAddMonoid.ofList ∘ FreeAddMonoid.toList = id

theorem FreeMonoid.ofList_comp_toList E0 #

∀ {α : Type u_1}, FreeMonoid.ofList ∘ FreeMonoid.toList = id

instance FreeMonoid.instCancelMonoid E0 #

{α : Type u_1} → CancelMonoid (FreeMonoid α)

instance FreeAddMonoid.instAddCancelMonoid E0 #

{α : Type u_1} → AddCancelMonoid (FreeAddMonoid α)

instance FreeMonoid.instInhabited E0 #

{α : Type u_1} → Inhabited (FreeMonoid α)

instance FreeAddMonoid.instInhabited E0 #

{α : Type u_1} → Inhabited (FreeAddMonoid α)

instance FreeMonoid.instUniqueOfIsEmpty E0 #

{α : Type u_1} → [IsEmpty α] → Unique (FreeMonoid α)

instance FreeAddMonoid.instUniqueOfIsEmpty E0 #

{α : Type u_1} → [IsEmpty α] → Unique (FreeAddMonoid α)

theorem FreeAddMonoid.toList_zero E0 #

∀ {α : Type u_1}, FreeAddMonoid.toList 0 = []

theorem FreeMonoid.toList_one E0 #

∀ {α : Type u_1}, FreeMonoid.toList 1 = []

theorem FreeAddMonoid.ofList_nil E0 #

∀ {α : Type u_1}, { toList := [] } = 0

theorem FreeMonoid.ofList_nil E0 #

∀ {α : Type u_1}, { toList := [] } = 1

theorem FreeMonoid.toList_mul E0 #

∀ {α : Type u_1} (xs ys : FreeMonoid α), (xs * ys).toList = xs.toList ++ ys.toList

theorem FreeAddMonoid.toList_add E0 #

∀ {α : Type u_1} (xs ys : FreeAddMonoid α), (xs + ys).toList = xs.toList ++ ys.toList

theorem FreeMonoid.ofList_append E0 #

∀ {α : Type u_1} (xs ys : List α), { toList := xs ++ ys } = { toList := xs } * { toList := ys }

theorem FreeAddMonoid.ofList_append E0 #

∀ {α : Type u_1} (xs ys : List α), { toList := xs ++ ys } = { toList := xs } + { toList := ys }

theorem FreeAddMonoid.toList_sum E0 #

∀ {α : Type u_1} (xs : List (FreeAddMonoid α)), xs.sum.toList = (List.map FreeAddMonoid.toList xs).flatten

theorem FreeMonoid.toList_prod E0 #

∀ {α : Type u_1} (xs : List (FreeMonoid α)), xs.prod.toList = (List.map FreeMonoid.toList xs).flatten

theorem FreeAddMonoid.ofList_flatten E0 #

∀ {α : Type u_1} (xs : List (List α)), { toList := xs.flatten } = (List.map FreeAddMonoid.ofList xs).sum

theorem FreeMonoid.ofList_flatten E0 #

∀ {α : Type u_1} (xs : List (List α)), { toList := xs.flatten } = (List.map FreeMonoid.ofList xs).prod

def FreeMonoid.of E3 #

{α : Type u_1} → α → FreeMonoid α

Embeds an element of α into FreeMonoid α as a singleton list.

def FreeAddMonoid.of E1 #

{α : Type u_1} → α → FreeAddMonoid α

Embeds an element of α into FreeAddMonoid α as a singleton list.

theorem FreeAddMonoid.toList_of E0 #

∀ {α : Type u_1} (x : α), (FreeAddMonoid.of x).toList = [x]

theorem FreeMonoid.toList_of E0 #

∀ {α : Type u_1} (x : α), (FreeMonoid.of x).toList = [x]

theorem FreeMonoid.ofList_singleton E1 #

∀ {α : Type u_1} (x : α), { toList := [x] } = FreeMonoid.of x

theorem FreeAddMonoid.ofList_singleton E1 #

∀ {α : Type u_1} (x : α), { toList := [x] } = FreeAddMonoid.of x

theorem FreeAddMonoid.ofList_cons E0 #

∀ {α : Type u_1} (x : α) (xs : List α), { toList := x :: xs } = FreeAddMonoid.of x + { toList := xs }

theorem FreeMonoid.ofList_cons E0 #

∀ {α : Type u_1} (x : α) (xs : List α), { toList := x :: xs } = FreeMonoid.of x * { toList := xs }

theorem FreeAddMonoid.toList_of_add E1 #

∀ {α : Type u_1} (x : α) (xs : FreeAddMonoid α), (FreeAddMonoid.of x + xs).toList = x :: xs.toList

theorem FreeMonoid.toList_of_mul E1 #

∀ {α : Type u_1} (x : α) (xs : FreeMonoid α), (FreeMonoid.of x * xs).toList = x :: xs.toList

theorem FreeMonoid.of_injective E1 #

∀ {α : Type u_1}, Function.Injective FreeMonoid.of

theorem FreeAddMonoid.of_injective E1 #

∀ {α : Type u_1}, Function.Injective FreeAddMonoid.of

theorem FreeAddMonoid.forall E1 #

∀ {α : Type u_1} {p : FreeAddMonoid α → Prop}, (∀ (x : FreeAddMonoid α), p x) ↔ ∀ (l : List α), p { toList := l }

theorem FreeMonoid.forall E1 #

∀ {α : Type u_1} {p : FreeMonoid α → Prop}, (∀ (x : FreeMonoid α), p x) ↔ ∀ (l : List α), p { toList := l }

theorem FreeMonoid.exists E1 #

∀ {α : Type u_1} {p : FreeMonoid α → Prop}, (∃ x, p x) ↔ ∃ l, p { toList := l }

theorem FreeAddMonoid.exists E1 #

∀ {α : Type u_1} {p : FreeAddMonoid α → Prop}, (∃ x, p x) ↔ ∃ l, p { toList := l }

def FreeMonoid.toListEquiv E1 #

{α : Type u_1} → FreeMonoid α ≃ List α

The natural equivalence between FreeMonoid α and List α.

def FreeAddMonoid.toListEquiv E1 #

{α : Type u_1} → FreeAddMonoid α ≃ List α

The natural equivalence between FreeAddMonoid α and List α.

theorem FreeMonoid.of_ne_one E0 #

∀ {α : Type u_1} (a : α), FreeMonoid.of a ≠ 1

theorem FreeAddMonoid.of_ne_zero E0 #

∀ {α : Type u_1} (a : α), FreeAddMonoid.of a ≠ 0

theorem FreeMonoid.one_ne_of E0 #

∀ {α : Type u_1} (a : α), 1 ≠ FreeMonoid.of a

theorem FreeAddMonoid.zero_ne_of E0 #

∀ {α : Type u_1} (a : α), 0 ≠ FreeAddMonoid.of a

def FreeMonoid.mulRecOn E1 #

{α : Type u_1} →
  {motive : FreeMonoid α → Sort u_6} →
    (xs : FreeMonoid α) →
      motive 1 → ((x : α) → (xs : FreeMonoid α) → motive xs → motive (FreeMonoid.of x * xs)) → motive xs

Recursor for FreeMonoid using 1 and FreeMonoid.of x * xs.

def FreeAddMonoid.addRecOn E1 #

{α : Type u_1} →
  {motive : FreeAddMonoid α → Sort u_6} →
    (xs : FreeAddMonoid α) →
      motive 0 → ((x : α) → (xs : FreeAddMonoid α) → motive xs → motive (FreeAddMonoid.of x + xs)) → motive xs

Recursor for FreeAddMonoid using 0 and FreeAddMonoid.of x + xs.

theorem FreeAddMonoid.addRecOn_zero E0 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive xs → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addRecOn 0 zero of_add = zero

theorem FreeMonoid.mulRecOn_one E0 #

∀ {α : Type u_1} {motive : FreeMonoid α → Sort u_6} (one : motive 1)
  (of_mul : (x : α) → (xs : FreeMonoid α) → motive xs → motive (FreeMonoid.of x * xs)),
  FreeMonoid.mulRecOn 1 one of_mul = one

theorem FreeMonoid.mulRecOn_of_mul E0 #

∀ {α : Type u_1} {motive : FreeMonoid α → Sort u_6} (x : α) (xs : FreeMonoid α) (one : motive 1)
  (of_mul : (x : α) → (xs : FreeMonoid α) → motive xs → motive (FreeMonoid.of x * xs)),
  FreeMonoid.mulRecOn (FreeMonoid.of x * xs) one of_mul = of_mul x xs (FreeMonoid.mulRecOn xs one of_mul)

theorem FreeAddMonoid.addRecOn_of_add E0 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (x : α) (xs : FreeAddMonoid α) (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive xs → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addRecOn (FreeAddMonoid.of x + xs) zero of_add = of_add x xs (FreeAddMonoid.addRecOn xs zero of_add)

theorem FreeAddMonoid.recOn_zero E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive xs → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addRecOn 0 zero of_add = zero

Alias of FreeAddMonoid.addRecOn_zero.

theorem FreeAddMonoid.recOn_of_add E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (x : α) (xs : FreeAddMonoid α) (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive xs → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addRecOn (FreeAddMonoid.of x + xs) zero of_add = of_add x xs (FreeAddMonoid.addRecOn xs zero of_add)

Alias of FreeAddMonoid.addRecOn_of_add.

theorem FreeMonoid.inductionOn E1 #

∀ {α : Type u_1} {motive : FreeMonoid α → Prop} (z : FreeMonoid α),
  motive 1 →
    (∀ (x : α), motive (FreeMonoid.of x)) → (∀ (x y : FreeMonoid α), motive x → motive y → motive (x * y)) → motive z

An induction principle on free monoids, with cases for 1, FreeMonoid.of and *.

theorem FreeAddMonoid.inductionOn E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Prop} (z : FreeAddMonoid α),
  motive 0 →
    (∀ (x : α), motive (FreeAddMonoid.of x)) →
      (∀ (x y : FreeAddMonoid α), motive x → motive y → motive (x + y)) → motive z

An induction principle on free additive monoids, with cases for 0, FreeAddMonoid.of and +.

theorem FreeMonoid.inductionOn' E1 #

∀ {α : Type u_1} {motive : FreeMonoid α → Prop} (a : FreeMonoid α),
  motive 1 → (∀ (b : α) (a : FreeMonoid α), motive a → motive (FreeMonoid.of b * a)) → motive a

An induction principle for free monoids which mirrors induction on lists, with cases analogous to the empty list and cons.

theorem FreeAddMonoid.inductionOn' E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Prop} (a : FreeAddMonoid α),
  motive 0 → (∀ (b : α) (a : FreeAddMonoid α), motive a → motive (FreeAddMonoid.of b + a)) → motive a

An induction principle for free additive monoids which mirrors induction on lists, with cases analogous to the empty list and cons.

def FreeMonoid.mulCasesOn E1 #

{α : Type u_1} →
  {motive : FreeMonoid α → Sort u_6} →
    (xs : FreeMonoid α) → motive 1 → ((x : α) → (xs : FreeMonoid α) → motive (FreeMonoid.of x * xs)) → motive xs

A version of List.casesOn for FreeMonoid using 1 and FreeMonoid.of x * xs instead of [] and x :: xs.

def FreeAddMonoid.addCasesOn E1 #

{α : Type u_1} →
  {motive : FreeAddMonoid α → Sort u_6} →
    (xs : FreeAddMonoid α) →
      motive 0 → ((x : α) → (xs : FreeAddMonoid α) → motive (FreeAddMonoid.of x + xs)) → motive xs

A version of List.casesOn for FreeAddMonoid using 0 and FreeAddMonoid.of x + xs instead of [] and x :: xs.

theorem FreeAddMonoid.addCasesOn_zero E0 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addCasesOn 0 zero of_add = zero

theorem FreeMonoid.mulCasesOn_one E0 #

∀ {α : Type u_1} {motive : FreeMonoid α → Sort u_6} (one : motive 1)
  (of_mul : (x : α) → (xs : FreeMonoid α) → motive (FreeMonoid.of x * xs)), FreeMonoid.mulCasesOn 1 one of_mul = one

theorem FreeAddMonoid.addCasesOn_of_add E0 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (x : α) (xs : FreeAddMonoid α) (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addCasesOn (FreeAddMonoid.of x + xs) zero of_add = of_add x xs

theorem FreeMonoid.mulCasesOn_of_mul E0 #

∀ {α : Type u_1} {motive : FreeMonoid α → Sort u_6} (x : α) (xs : FreeMonoid α) (one : motive 1)
  (of_mul : (x : α) → (xs : FreeMonoid α) → motive (FreeMonoid.of x * xs)),
  FreeMonoid.mulCasesOn (FreeMonoid.of x * xs) one of_mul = of_mul x xs

theorem FreeAddMonoid.casesOn_zero E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addCasesOn 0 zero of_add = zero

Alias of FreeAddMonoid.addCasesOn_zero.

theorem FreeAddMonoid.casesOn_of_add E1 #

∀ {α : Type u_1} {motive : FreeAddMonoid α → Sort u_6} (x : α) (xs : FreeAddMonoid α) (zero : motive 0)
  (of_add : (x : α) → (xs : FreeAddMonoid α) → motive (FreeAddMonoid.of x + xs)),
  FreeAddMonoid.addCasesOn (FreeAddMonoid.of x + xs) zero of_add = of_add x xs

Alias of FreeAddMonoid.addCasesOn_of_add.

theorem FreeMonoid.hom_eq_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] {f g : FreeMonoid α →* M},
  f = g ↔ ∀ (x : α), f (FreeMonoid.of x) = g (FreeMonoid.of x)

theorem FreeAddMonoid.hom_eq E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] ⦃f g : FreeAddMonoid α →+ M⦄,
  (∀ (x : α), f (FreeAddMonoid.of x) = g (FreeAddMonoid.of x)) → f = g

theorem FreeMonoid.hom_eq E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] ⦃f g : FreeMonoid α →* M⦄,
  (∀ (x : α), f (FreeMonoid.of x) = g (FreeMonoid.of x)) → f = g

theorem FreeAddMonoid.hom_eq_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] {f g : FreeAddMonoid α →+ M},
  f = g ↔ ∀ (x : α), f (FreeAddMonoid.of x) = g (FreeAddMonoid.of x)

def FreeMonoid.prodAux E0 #

{M : Type u_6} → [Monoid M] → List M → M

A variant of List.prod that has [x].prod = x true definitionally. The purpose is to make FreeMonoid.lift_eval_of true by rfl.

def FreeAddMonoid.sumAux E0 #

{M : Type u_6} → [AddMonoid M] → List M → M

A variant of List.sum that has [x].sum = x true definitionally. The purpose is to make FreeAddMonoid.lift_eval_of true by rfl.

theorem FreeAddMonoid.sumAux_eq E0 #

∀ {M : Type u_4} [inst : AddMonoid M] (l : List M), FreeAddMonoid.sumAux l = l.sum

theorem FreeMonoid.prodAux_eq E0 #

∀ {M : Type u_4} [inst : Monoid M] (l : List M), FreeMonoid.prodAux l = l.prod

def FreeMonoid.lift E3 #

{α : Type u_1} → {M : Type u_4} → [inst : Monoid M] → (α → M) ≃ (FreeMonoid α →* M)

Equivalence between maps α → M and monoid homomorphisms FreeMonoid α →* M.

def FreeAddMonoid.lift E1 #

{α : Type u_1} → {M : Type u_4} → [inst : AddMonoid M] → (α → M) ≃ (FreeAddMonoid α →+ M)

Equivalence between maps α → A and additive monoid homomorphisms FreeAddMonoid α →+ A.

theorem FreeAddMonoid.lift_ofList E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : α → M) (l : List α),
  (FreeAddMonoid.lift f) { toList := l } = (List.map f l).sum

theorem FreeMonoid.lift_ofList E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : α → M) (l : List α),
  (FreeMonoid.lift f) { toList := l } = (List.map f l).prod

theorem FreeAddMonoid.lift_symm_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : FreeAddMonoid α →+ M),
  FreeAddMonoid.lift.symm f = ⇑f ∘ FreeAddMonoid.of

theorem FreeMonoid.lift_symm_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : FreeMonoid α →* M), FreeMonoid.lift.symm f = ⇑f ∘ FreeMonoid.of

theorem FreeAddMonoid.lift_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : α → M) (l : FreeAddMonoid α),
  (FreeAddMonoid.lift f) l = (List.map f l.toList).sum

theorem FreeMonoid.lift_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : α → M) (l : FreeMonoid α),
  (FreeMonoid.lift f) l = (List.map f l.toList).prod

theorem FreeMonoid.lift_comp_of E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : α → M), ⇑(FreeMonoid.lift f) ∘ FreeMonoid.of = f

theorem FreeAddMonoid.lift_comp_of E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : α → M), ⇑(FreeAddMonoid.lift f) ∘ FreeAddMonoid.of = f

theorem FreeMonoid.lift_eval_of E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : α → M) (x : α), (FreeMonoid.lift f) (FreeMonoid.of x) = f x

theorem FreeAddMonoid.lift_eval_of E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : α → M) (x : α),
  (FreeAddMonoid.lift f) (FreeAddMonoid.of x) = f x

theorem FreeMonoid.lift_restrict E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] (f : FreeMonoid α →* M), FreeMonoid.lift (⇑f ∘ FreeMonoid.of) = f

theorem FreeAddMonoid.lift_restrict E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] (f : FreeAddMonoid α →+ M),
  FreeAddMonoid.lift (⇑f ∘ FreeAddMonoid.of) = f

theorem FreeMonoid.comp_lift E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] {N : Type u_5} [inst_1 : Monoid N] (g : M →* N) (f : α → M),
  g.comp (FreeMonoid.lift f) = FreeMonoid.lift (⇑g ∘ f)

theorem FreeAddMonoid.comp_lift E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] {N : Type u_5} [inst_1 : AddMonoid N] (g : M →+ N) (f : α → M),
  g.comp (FreeAddMonoid.lift f) = FreeAddMonoid.lift (⇑g ∘ f)

theorem FreeMonoid.hom_map_lift E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Monoid M] {N : Type u_5} [inst_1 : Monoid N] (g : M →* N) (f : α → M)
  (x : FreeMonoid α), g ((FreeMonoid.lift f) x) = (FreeMonoid.lift (⇑g ∘ f)) x

theorem FreeAddMonoid.hom_map_lift E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : AddMonoid M] {N : Type u_5} [inst_1 : AddMonoid N] (g : M →+ N) (f : α → M)
  (x : FreeAddMonoid α), g ((FreeAddMonoid.lift f) x) = (FreeAddMonoid.lift (⇑g ∘ f)) x

def FreeMonoid.mkMulAction E1 #

{α : Type u_1} → {β : Type u_2} → (α → β → β) → MulAction (FreeMonoid α) β

Define a multiplicative action of FreeMonoid α on β.

def FreeAddMonoid.mkAddAction E1 #

{α : Type u_1} → {β : Type u_2} → (α → β → β) → AddAction (FreeAddMonoid α) β

Define an additive action of FreeAddMonoid α on β.

theorem FreeAddMonoid.vadd_def E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (l : FreeAddMonoid α) (b : β), l +ᵥ b = List.foldr f b l.toList

theorem FreeMonoid.smul_def E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (l : FreeMonoid α) (b : β), l • b = List.foldr f b l.toList

theorem FreeMonoid.ofList_smul E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (l : List α) (b : β), { toList := l } • b = List.foldr f b l

theorem FreeAddMonoid.ofList_vadd E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (l : List α) (b : β), { toList := l } +ᵥ b = List.foldr f b l

theorem FreeMonoid.of_smul E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (x : α) (y : β), FreeMonoid.of x • y = f x y

theorem FreeAddMonoid.of_vadd E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β → β) (x : α) (y : β), FreeAddMonoid.of x +ᵥ y = f x y

def FreeMonoid.map E3 #

{α : Type u_1} → {β : Type u_2} → (α → β) → FreeMonoid α →* FreeMonoid β

The unique monoid homomorphism FreeMonoid α →* FreeMonoid β that sends each of x to of (f x).

def FreeAddMonoid.map E1 #

{α : Type u_1} → {β : Type u_2} → (α → β) → FreeAddMonoid α →+ FreeAddMonoid β

The unique additive monoid homomorphism FreeAddMonoid α →+ FreeAddMonoid β that sends each of x to of (f x).

theorem FreeAddMonoid.map_of E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (x : α), (FreeAddMonoid.map f) (FreeAddMonoid.of x) = FreeAddMonoid.of (f x)

theorem FreeMonoid.map_of E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (x : α), (FreeMonoid.map f) (FreeMonoid.of x) = FreeMonoid.of (f x)

theorem FreeAddMonoid.mem_map E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {a : FreeAddMonoid α} {m : β},
  m ∈ (FreeAddMonoid.map f) a ↔ ∃ n ∈ a, f n = m

theorem FreeMonoid.mem_map E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {a : FreeMonoid α} {m : β}, m ∈ (FreeMonoid.map f) a ↔ ∃ n ∈ a, f n = m

theorem FreeMonoid.map_map E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {α₁ : Type u_6} {g : α₁ → α} {x : FreeMonoid α₁},
  (FreeMonoid.map f) ((FreeMonoid.map g) x) = (FreeMonoid.map (f ∘ g)) x

theorem FreeAddMonoid.map_map E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {α₁ : Type u_6} {g : α₁ → α} {x : FreeAddMonoid α₁},
  (FreeAddMonoid.map f) ((FreeAddMonoid.map g) x) = (FreeAddMonoid.map (f ∘ g)) x

theorem FreeAddMonoid.toList_map E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (xs : FreeAddMonoid α),
  ((FreeAddMonoid.map f) xs).toList = List.map f xs.toList

theorem FreeMonoid.toList_map E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (xs : FreeMonoid α), ((FreeMonoid.map f) xs).toList = List.map f xs.toList

theorem FreeAddMonoid.ofList_map E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (xs : List α),
  { toList := List.map f xs } = (FreeAddMonoid.map f) { toList := xs }

theorem FreeMonoid.ofList_map E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (xs : List α),
  { toList := List.map f xs } = (FreeMonoid.map f) { toList := xs }

theorem FreeMonoid.lift_of_comp_eq_map E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β), (FreeMonoid.lift fun x ↦ FreeMonoid.of (f x)) = FreeMonoid.map f

theorem FreeAddMonoid.lift_of_comp_eq_map E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β), (FreeAddMonoid.lift fun x ↦ FreeAddMonoid.of (f x)) = FreeAddMonoid.map f

theorem FreeAddMonoid.map_comp E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (g : β → γ) (f : α → β),
  FreeAddMonoid.map (g ∘ f) = (FreeAddMonoid.map g).comp (FreeAddMonoid.map f)

theorem FreeMonoid.map_comp E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (g : β → γ) (f : α → β),
  FreeMonoid.map (g ∘ f) = (FreeMonoid.map g).comp (FreeMonoid.map f)

theorem FreeAddMonoid.map_id E0 #

∀ {α : Type u_1}, FreeAddMonoid.map id = AddMonoidHom.id (FreeAddMonoid α)

theorem FreeMonoid.map_id E0 #

∀ {α : Type u_1}, FreeMonoid.map id = MonoidHom.id (FreeMonoid α)

theorem FreeAddMonoid.map_symm_apply_map_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {x : FreeAddMonoid α} (e : α ≃ β),
  (FreeAddMonoid.map ⇑e.symm) ((FreeAddMonoid.map ⇑e) x) = x

theorem FreeMonoid.map_symm_apply_map_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {x : FreeMonoid α} (e : α ≃ β), (FreeMonoid.map ⇑e.symm) ((FreeMonoid.map ⇑e) x) = x

theorem FreeMonoid.map_apply_map_symm_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {x : FreeMonoid β} (e : α ≃ β), (FreeMonoid.map ⇑e) ((FreeMonoid.map ⇑e.symm) x) = x

theorem FreeAddMonoid.map_apply_map_symm_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {x : FreeAddMonoid β} (e : α ≃ β),
  (FreeAddMonoid.map ⇑e) ((FreeAddMonoid.map ⇑e.symm) x) = x

instance FreeMonoid.instUniqueUnits E0 #

{α : Type u_1} → Unique (FreeMonoid α)ˣ

The only invertible element of the free monoid is 1; this instance enables units_eq_one.

instance FreeAddMonoid.instUniqueAddUnits E0 #

{α : Type u_1} → Unique (AddUnits (FreeAddMonoid α))

theorem FreeAddMonoid.map_surjective E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Function.Surjective ⇑(FreeAddMonoid.map f) ↔ Function.Surjective f

theorem FreeMonoid.map_surjective E0 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Function.Surjective ⇑(FreeMonoid.map f) ↔ Function.Surjective f

def FreeMonoid.freeMonoidCongr E1 #

{α : Type u_6} → {β : Type u_7} → α ≃ β → FreeMonoid α ≃* FreeMonoid β

Free monoids over isomorphic types are isomorphic.

def FreeAddMonoid.freeAddMonoidCongr E1 #

{α : Type u_6} → {β : Type u_7} → α ≃ β → FreeAddMonoid α ≃+ FreeAddMonoid β

Free additive monoids over isomorphic types are isomorphic.

theorem FreeMonoid.freeMonoidCongr_of E0 #

∀ {α : Type u_6} {β : Type u_7} (e : α ≃ β) (a : α),
  (FreeMonoid.freeMonoidCongr e) (FreeMonoid.of a) = FreeMonoid.of (e a)

theorem FreeAddMonoid.freeAddMonoidCongr_of E0 #

∀ {α : Type u_6} {β : Type u_7} (e : α ≃ β) (a : α),
  (FreeAddMonoid.freeAddMonoidCongr e) (FreeAddMonoid.of a) = FreeAddMonoid.of (e a)

theorem FreeMonoid.symm_freeMonoidCongr E0 #

∀ {α : Type u_6} {β : Type u_7} (e : α ≃ β), (FreeMonoid.freeMonoidCongr e).symm = FreeMonoid.freeMonoidCongr e.symm

theorem FreeAddMonoid.symm_freeAddMonoidCongr E0 #

∀ {α : Type u_6} {β : Type u_7} (e : α ≃ β),
  (FreeAddMonoid.freeAddMonoidCongr e).symm = FreeAddMonoid.freeAddMonoidCongr e.symm

Deprecated aliases

NameNew nameSince
FreeAddMonoid.freeAddMonoidCongr_symm_ofFreeAddMonoid.freeAddMonoidCongr_of2026-10-21
FreeAddMonoid.instMembership2026-10-23
FreeAddMonoid.length2026-10-23
FreeAddMonoid.length_addList.length_append2026-10-23
FreeAddMonoid.length_eq_fourList.length_eq_four2026-10-23
FreeAddMonoid.length_eq_oneList.length_eq_one_iff2026-10-23
FreeAddMonoid.length_eq_threeList.length_eq_three2026-10-23
FreeAddMonoid.length_eq_twoList.length_eq_two2026-10-23
FreeAddMonoid.length_eq_zeroList.length_eq_zero_iff2026-10-23
FreeAddMonoid.length_ofList.length_singleton2026-10-23
FreeAddMonoid.length_reverseList.length_reverse2026-10-23
FreeAddMonoid.length_surjective2026-10-23
FreeAddMonoid.length_zeroList.length_nil2026-10-23
FreeAddMonoid.mem2026-10-23
FreeAddMonoid.mem_add2026-10-23
FreeAddMonoid.mem_of2026-10-23
FreeAddMonoid.mem_of_self2026-10-23
FreeAddMonoid.notMem_zero2026-10-23
FreeAddMonoid.reverse2026-10-23
FreeAddMonoid.reverse_add2026-10-23
FreeAddMonoid.reverse_of2026-10-23
FreeAddMonoid.reverse_reverse2026-10-23
FreeMonoid.casesOn_of_mulFreeMonoid.mulCasesOn_of_mul2026-10-23
FreeMonoid.casesOn_oneFreeMonoid.mulCasesOn_one2026-10-23
FreeMonoid.freeMonoidCongr_symm_ofFreeMonoid.freeMonoidCongr_of2026-10-21
FreeMonoid.instMembership2026-10-23
FreeMonoid.length2026-10-23
FreeMonoid.length_eq_fourList.length_eq_four2026-10-23
FreeMonoid.length_eq_oneList.length_eq_one_iff2026-10-23
FreeMonoid.length_eq_threeList.length_eq_three2026-10-23
FreeMonoid.length_eq_twoList.length_eq_two2026-10-23
FreeMonoid.length_eq_zeroList.length_eq_zero_iff2026-10-23
FreeMonoid.length_mulList.length_append2026-10-23
FreeMonoid.length_ofList.length_singleton2026-10-23
FreeMonoid.length_oneList.length_nil2026-10-23
FreeMonoid.length_reverseList.length_reverse2026-10-23
FreeMonoid.length_surjective2026-10-23
FreeMonoid.mem2026-10-23
FreeMonoid.mem_mul2026-10-23
FreeMonoid.mem_of2026-10-23
FreeMonoid.mem_of_self2026-10-23
FreeMonoid.notMem_one2026-10-23
FreeMonoid.ofList_symmFreeMonoid.toList_ofList2026-10-23
FreeMonoid.recOn_of_mulFreeMonoid.mulRecOn_of_mul2026-10-23
FreeMonoid.recOn_oneFreeMonoid.mulRecOn_one2026-10-23
FreeMonoid.reverse2026-10-23
FreeMonoid.reverse_mul2026-10-23
FreeMonoid.reverse_of2026-10-23
FreeMonoid.reverse_reverse2026-10-23
FreeMonoid.toList_symmFreeMonoid.ofList_toList2026-10-23