# The coproduct (a.k.a. the free product) of groups or monoids #

Given an ι-indexed family M of monoids, we define their coproduct (a.k.a. free product) Monoid.CoprodI M. As usual, we use the suffix I for an indexed (co)product, leaving Coprod for the coproduct of two monoids.

When ι and all M i have decidable equality, the free product bijects with the type Monoid.CoprodI.Word M of reduced words. This bijection is constructed by defining an action of Monoid.CoprodI M on Monoid.CoprodI.Word M.

When M i are all groups, Monoid.CoprodI M is also a group (and the coproduct in the category of groups).

## Main definitions #

• Monoid.CoprodI M: the free product, defined as a quotient of a free monoid.
• Monoid.CoprodI.of {i} : M i →* Monoid.CoprodI M.
• Monoid.CoprodI.lift : (∀ {i}, M i →* N) ≃ (Monoid.CoprodI M →* N): the universal property.
• Monoid.CoprodI.Word M: the type of reduced words.
• Monoid.CoprodI.Word.equiv M : Monoid.CoprodI M ≃ word M.
• Monoid.CoprodI.NeWord M i j: an inductive description of non-empty words with first letter from M i and last letter from M j, together with an API (singleton, append, head, tail, to_word, Prod, inv). Used in the proof of the Ping-Pong-lemma.
• Monoid.CoprodI.lift_injective_of_ping_pong: The Ping-Pong-lemma, proving injectivity of the lift. See the documentation of that theorem for more information.

## Remarks #

There are many answers to the question "what is the coproduct of a family M of monoids?", and they are all equivalent but not obviously equivalent. We provide two answers. The first, almost tautological answer is given by Monoid.CoprodI M, which is a quotient of the type of words in the alphabet Σ i, M i. It's straightforward to define and easy to prove its universal property. But this answer is not completely satisfactory, because it's difficult to tell when two elements x y : Monoid.CoprodI M are distinct since Monoid.CoprodI M is defined as a quotient.

The second, maximally efficient answer is given by Monoid.CoprodI.Word M. An element of Monoid.CoprodI.Word M is a word in the alphabet Σ i, M i, where the letter ⟨i, 1⟩ doesn't occur and no adjacent letters share an index i. Since we only work with reduced words, there is no need for quotienting, and it is easy to tell when two elements are distinct. However it's not obvious that this is even a monoid!

We prove that every element of Monoid.CoprodI M can be represented by a unique reduced word, i.e. Monoid.CoprodI M and Monoid.CoprodI.Word M are equivalent types. This means that Monoid.CoprodI.Word M can be given a monoid structure, and it lets us tell when two elements of Monoid.CoprodI M are distinct.

There is also a completely tautological, maximally inefficient answer given by MonCat.Colimits.ColimitType. Whereas Monoid.CoprodI M at least ensures that (any instance of) associativity holds by reflexivity, in this answer associativity holds because of quotienting. Yet another answer, which is constructively more satisfying, could be obtained by showing that Monoid.CoprodI.Rel is confluent.

## References #

[van der Waerden, Free products of groups][MR25465]

inductive Monoid.CoprodI.Rel {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
FreeMonoid ((i : ι) × M i)FreeMonoid ((i : ι) × M i)Prop

A relation on the free monoid on alphabet Σ i, M i, relating ⟨i, 1⟩ with 1 and ⟨i, x⟩ * ⟨i, y⟩ with ⟨i, x * y⟩.

Instances For
def Monoid.CoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
Type (max u_1 u_2)

The free product (categorical coproduct) of an indexed family of monoids.

Equations
• = ().Quotient
Instances For
instance instMonoidCoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
Equations
• = id inferInstance
instance instInhabitedCoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
Equations
• = { default := 1 }
theorem Monoid.CoprodI.Word.ext_iff {ι : Type u_1} {M : ιType u_2} :
∀ {inst : (i : ι) → Monoid (M i)} (x y : ), x = y x.toList = y.toList
theorem Monoid.CoprodI.Word.ext {ι : Type u_1} {M : ιType u_2} :
∀ {inst : (i : ι) → Monoid (M i)} (x y : ), x.toList = y.toListx = y
structure Monoid.CoprodI.Word {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
Type (max u_1 u_2)

The type of reduced words. A reduced word cannot contain a letter 1, and no two adjacent letters can come from the same summand.

• toList : List ((i : ι) × M i)

A Word is a List (Σ i, M i), such that 1 is not in the list, and no two adjacent letters are from the same summand

• ne_one : lself.toList, l.snd 1

A reduced word does not contain 1

• chain_ne : List.Chain' (fun (l l' : (i : ι) × M i) => l.fst l'.fst) self.toList

Adjacent letters are not from the same summand.

Instances For
theorem Monoid.CoprodI.Word.ne_one {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (self : ) (l : (i : ι) × M i) :
l self.toListl.snd 1

A reduced word does not contain 1

theorem Monoid.CoprodI.Word.chain_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (self : ) :
List.Chain' (fun (l l' : (i : ι) × M i) => l.fst l'.fst) self.toList

Adjacent letters are not from the same summand.

def Monoid.CoprodI.of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} :
M i →*

The inclusion of a summand into the free product.

Equations
• Monoid.CoprodI.of = { toFun := fun (x : M i) => ().mk' (FreeMonoid.of i, x), map_one' := , map_mul' := }
Instances For
theorem Monoid.CoprodI.of_apply {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) :
Monoid.CoprodI.of m = ().mk' (FreeMonoid.of i, m)
theorem Monoid.CoprodI.ext_hom {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [] (f : ) (g : ) (h : ∀ (i : ι), f.comp Monoid.CoprodI.of = g.comp Monoid.CoprodI.of) :
f = g

See note [partially-applied ext lemmas].

@[simp]
theorem Monoid.CoprodI.lift_symm_apply {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [] (f : ) (i : ι) :
Monoid.CoprodI.lift.symm f i = f.comp Monoid.CoprodI.of
def Monoid.CoprodI.lift {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [] :
((i : ι) → M i →* N) ()

A map out of the free product corresponds to a family of maps out of the summands. This is the universal property of the free product, characterizing it as a categorical coproduct.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Monoid.CoprodI.lift_comp_of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [] (fi : (i : ι) → M i →* N) (i : ι) :
(Monoid.CoprodI.lift fi).comp Monoid.CoprodI.of = fi i
@[simp]
theorem Monoid.CoprodI.lift_of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [] (fi : (i : ι) → M i →* N) {i : ι} (m : M i) :
(Monoid.CoprodI.lift fi) (Monoid.CoprodI.of m) = (fi i) m
@[simp]
theorem Monoid.CoprodI.lift_comp_of' {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [] (f : ) :
(Monoid.CoprodI.lift fun (i : ι) => f.comp Monoid.CoprodI.of) = f
@[simp]
theorem Monoid.CoprodI.lift_of' {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
(Monoid.CoprodI.lift fun (i : ι) => Monoid.CoprodI.of) =
theorem Monoid.CoprodI.of_leftInverse {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [] (i : ι) :
Function.LeftInverse (Monoid.CoprodI.lift (Pi.mulSingle i (MonoidHom.id (M i)))) Monoid.CoprodI.of
theorem Monoid.CoprodI.of_injective {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (i : ι) :
Function.Injective Monoid.CoprodI.of
theorem Monoid.CoprodI.mrange_eq_iSup {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [] (f : (i : ι) → M i →* N) :
MonoidHom.mrange (Monoid.CoprodI.lift f) = ⨆ (i : ι), MonoidHom.mrange (f i)
theorem Monoid.CoprodI.lift_mrange_le {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [] (f : (i : ι) → M i →* N) {s : } :
MonoidHom.mrange (Monoid.CoprodI.lift f) s ∀ (i : ι), MonoidHom.mrange (f i) s
@[simp]
theorem Monoid.CoprodI.iSup_mrange_of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
⨆ (i : ι), MonoidHom.mrange Monoid.CoprodI.of =
@[simp]
theorem Monoid.CoprodI.mclosure_iUnion_range_of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
Submonoid.closure (⋃ (i : ι), Set.range Monoid.CoprodI.of) =
theorem Monoid.CoprodI.induction_left {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {C : } (m : ) (one : C 1) (mul : ∀ {i : ι} (m : M i) (x : ), C xC (Monoid.CoprodI.of m * x)) :
C m
theorem Monoid.CoprodI.induction_on {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {C : } (m : ) (h_one : C 1) (h_of : ∀ (i : ι) (m : M i), C (Monoid.CoprodI.of m)) (h_mul : ∀ (x y : ), C xC yC (x * y)) :
C m
instance Monoid.CoprodI.instInv {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] :
Equations
• = { inv := MulOpposite.unop (Monoid.CoprodI.lift fun (i : ι) => (MonoidHom.op Monoid.CoprodI.of).comp (MulEquiv.inv' (G i)).toMonoidHom) }
theorem Monoid.CoprodI.inv_def {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] (x : ) :
x⁻¹ = ((Monoid.CoprodI.lift fun (i : ι) => (MonoidHom.op Monoid.CoprodI.of).comp (MulEquiv.inv' (G i)).toMonoidHom) x).unop
instance Monoid.CoprodI.instGroup {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] :
Equations
theorem Monoid.CoprodI.lift_range_le {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] {N : Type u_5} [] (f : (i : ι) → G i →* N) {s : } (h : ∀ (i : ι), (f i).range s) :
(Monoid.CoprodI.lift f).range s
theorem Monoid.CoprodI.range_eq_iSup {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] {N : Type u_5} [] (f : (i : ι) → G i →* N) :
(Monoid.CoprodI.lift f).range = ⨆ (i : ι), (f i).range
@[simp]
theorem Monoid.CoprodI.Word.empty_toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
Monoid.CoprodI.Word.empty.toList = []
def Monoid.CoprodI.Word.empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :

The empty reduced word.

Equations
• Monoid.CoprodI.Word.empty = { toList := [], ne_one := , chain_ne := }
Instances For
instance Monoid.CoprodI.Word.instInhabited {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
Equations
• Monoid.CoprodI.Word.instInhabited = { default := Monoid.CoprodI.Word.empty }
def Monoid.CoprodI.Word.prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : ) :

A reduced word determines an element of the free product, given by multiplication.

Equations
• w.prod = (List.map (fun (l : (i : ι) × M i) => Monoid.CoprodI.of l.snd) w.toList).prod
Instances For
@[simp]
theorem Monoid.CoprodI.Word.prod_empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
Monoid.CoprodI.Word.empty.prod = 1
def Monoid.CoprodI.Word.fstIdx {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : ) :

fstIdx w is some i if the first letter of w is ⟨i, m⟩ with m : M i. If w is empty then it's none.

Equations
Instances For
theorem Monoid.CoprodI.Word.fstIdx_ne_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {w : } {i : ι} :
w.fstIdx some i lw.toList.head?, i l.fst
theorem Monoid.CoprodI.Word.Pair.ext {ι : Type u_1} {M : ιType u_2} :
∀ {inst : (i : ι) → Monoid (M i)} {i : ι} (x y : ), x.head = y.headx.tail = y.tailx = y
theorem Monoid.CoprodI.Word.Pair.ext_iff {ι : Type u_1} {M : ιType u_2} :
∀ {inst : (i : ι) → Monoid (M i)} {i : ι} (x y : ), x = y x.head = y.head x.tail = y.tail
structure Monoid.CoprodI.Word.Pair {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] (i : ι) :
Type (max u_1 u_2)

Given an index i : ι, Pair M i is the type of pairs (head, tail) where head : M i and tail : Word M, subject to the constraint that first letter of tail can't be ⟨i, m⟩. By prepending head to tail, one obtains a new word. We'll show that any word can be uniquely obtained in this way.

An element of M i, the first letter of the word.

• tail :

The remaining letters of the word, excluding the first letter

• fstIdx_ne : self.tail.fstIdx some i

The index first letter of tail of a Pair M i is not equal to i

Instances For
theorem Monoid.CoprodI.Word.Pair.fstIdx_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (self : ) :
self.tail.fstIdx some i

The index first letter of tail of a Pair M i is not equal to i

instance Monoid.CoprodI.Word.instInhabitedPair {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] (i : ι) :
Equations
• = { default := { head := 1, tail := Monoid.CoprodI.Word.empty, fstIdx_ne := } }
@[simp]
theorem Monoid.CoprodI.Word.cons_toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : ) (hmw : w.fstIdx some i) (h1 : m 1) :
(Monoid.CoprodI.Word.cons m w hmw h1).toList = i, m :: w.toList
def Monoid.CoprodI.Word.cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : ) (hmw : w.fstIdx some i) (h1 : m 1) :

Construct a new Word without any reduction. The underlying list of cons m w _ _ is ⟨_, m⟩::w

Equations
Instances For
def Monoid.CoprodI.Word.rcons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} (p : ) :

Given a pair (head, tail), we can form a word by prepending head to tail, except if head is 1 : M i then we have to just return Word since we need the result to be reduced.

Equations
Instances For
@[simp]
theorem Monoid.CoprodI.Word.prod_rcons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} (p : ) :
.prod = Monoid.CoprodI.of p.head * p.tail.prod
theorem Monoid.CoprodI.Word.rcons_inj {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} :
Function.Injective Monoid.CoprodI.Word.rcons
theorem Monoid.CoprodI.Word.mem_rcons_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} {j : ι} (p : ) (m : M j) :
j, m .toList j, m p.tail.toList m 1 ∃ (h : i = j), m = hp.head
@[simp]
theorem Monoid.CoprodI.Word.fstIdx_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : ) (hmw : w.fstIdx some i) (h1 : m 1) :
(Monoid.CoprodI.Word.cons m w hmw h1).fstIdx = some i
@[simp]
theorem Monoid.CoprodI.Word.prod_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (i : ι) (m : M i) (w : ) (h1 : m 1) (h2 : w.fstIdx some i) :
(Monoid.CoprodI.Word.cons m w h2 h1).prod = Monoid.CoprodI.of m * w.prod
def Monoid.CoprodI.Word.consRecOn {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Sort u_4} (w : ) (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : ) → (h1 : w.fstIdx some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
motive w

Induct on a word by adding letters one at a time without reduction, effectively inducting on the underlying List.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Monoid.CoprodI.Word.consRecOn_empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Sort u_4} (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : ) → (h1 : w.fstIdx some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
Monoid.CoprodI.Word.consRecOn Monoid.CoprodI.Word.empty h_empty h_cons = h_empty
@[simp]
theorem Monoid.CoprodI.Word.consRecOn_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Sort u_4} (i : ι) (m : M i) (w : ) (h1 : w.fstIdx some i) (h2 : m 1) (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : ) → (h1 : w.fstIdx some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
Monoid.CoprodI.Word.consRecOn (Monoid.CoprodI.Word.cons m w h1 h2) h_empty h_cons = h_cons i m w h1 h2 (Monoid.CoprodI.Word.consRecOn w h_empty h_cons)
def Monoid.CoprodI.Word.equivPair {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] (i : ι) :

The equivalence between words and pairs. Given a word, it decomposes it as a pair by removing the first letter if it comes from M i. Given a pair, it prepends the head to the tail.

Equations
• = { toFun := fun (w : ) => , invFun := Monoid.CoprodI.Word.rcons, left_inv := , right_inv := }
Instances For
theorem Monoid.CoprodI.Word.equivPair_symm {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] (i : ι) (p : ) :
theorem Monoid.CoprodI.Word.equivPair_eq_of_fstIdx_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {w : } (h : w.fstIdx some i) :
= { head := 1, tail := w, fstIdx_ne := h }
theorem Monoid.CoprodI.Word.mem_equivPair_tail_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {j : ι} {w : } (m : M i) :
i, m ().tail.toList i, m w.toList.tail i j ∃ (h : w.toList []), w.toList.head h = i, m
theorem Monoid.CoprodI.Word.mem_of_mem_equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {j : ι} {w : } (m : M i) :
i, m ().tail.toListi, m w.toList
theorem Monoid.CoprodI.Word.equivPair_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {w : } :
().head = if h : ∃ (h : w.toList []), (w.toList.head h).fst = i then (w.toList.head ).snd else 1
instance Monoid.CoprodI.Word.summandAction {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] (i : ι) :
MulAction (M i)
Equations
instance Monoid.CoprodI.Word.instMulAction {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] :
Equations
• Monoid.CoprodI.Word.instMulAction = MulAction.ofEndHom (Monoid.CoprodI.lift fun (x : ι) => MulAction.toEndHom)
theorem Monoid.CoprodI.Word.smul_def {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (m : M i) (w : ) :
m w = Monoid.CoprodI.Word.rcons (let __src := ; { head := m * ().head, tail := __src.tail, fstIdx_ne := })
theorem Monoid.CoprodI.Word.of_smul_def {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] (i : ι) (w : ) (m : M i) :
Monoid.CoprodI.of m w = Monoid.CoprodI.Word.rcons (let __src := ; { head := m * ().head, tail := __src.tail, fstIdx_ne := })
theorem Monoid.CoprodI.Word.equivPair_smul_same {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (m : M i) (w : ) :
(Monoid.CoprodI.of m w) = { head := m * ().head, tail := ().tail, fstIdx_ne := }
@[simp]
theorem Monoid.CoprodI.Word.equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (p : ) :
p.tail = { head := 1, tail := p.tail, fstIdx_ne := }
theorem Monoid.CoprodI.Word.smul_eq_of_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (m : M i) (w : ) :
m w = Monoid.CoprodI.of m w
theorem Monoid.CoprodI.Word.mem_smul_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {j : ι} {m₁ : M i} {m₂ : M j} {w : } :
i, m₁ (Monoid.CoprodI.of m₂ w).toList ¬i = j i, m₁ w.toList m₁ 1 ∃ (hij : i = j), i, m₁ w.toList.tail (∃ (m' : M j), j, m' w.toList.head? m₁ = (m₂ * m')) w.fstIdx some j m₁ = m₂
theorem Monoid.CoprodI.Word.mem_smul_iff_of_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {j : ι} (hij : i j) {m₁ : M i} {m₂ : M j} {w : } :
i, m₁ (Monoid.CoprodI.of m₂ w).toList i, m₁ w.toList
theorem Monoid.CoprodI.Word.cons_eq_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} {m : M i} {ls : } {h1 : ls.fstIdx some i} {h2 : m 1} :
Monoid.CoprodI.Word.cons m ls h1 h2 = Monoid.CoprodI.of m ls
theorem Monoid.CoprodI.Word.rcons_eq_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (p : ) :
@[simp]
theorem Monoid.CoprodI.Word.equivPair_head_smul_equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {i : ι} (w : ) :
theorem Monoid.CoprodI.Word.equivPair_tail_eq_inv_smul {ι : Type u_1} [] {G : ιType u_4} [(i : ι) → Group (G i)] [(i : ι) → DecidableEq (G i)] {i : ι} (w : ) :
theorem Monoid.CoprodI.Word.smul_induction {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] {C : } (h_empty : C Monoid.CoprodI.Word.empty) (h_smul : ∀ (i : ι) (m : M i) (w : ), C wC (Monoid.CoprodI.of m w)) (w : ) :
C w
@[simp]
theorem Monoid.CoprodI.Word.prod_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] (m : ) (w : ) :
(m w).prod = m * w.prod
def Monoid.CoprodI.Word.equiv {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] :

Each element of the free product corresponds to a unique reduced word.

Equations
• Monoid.CoprodI.Word.equiv = { toFun := fun (m : ) => m Monoid.CoprodI.Word.empty, invFun := fun (w : ) => w.prod, left_inv := , right_inv := }
Instances For
instance Monoid.CoprodI.Word.instDecidableEq {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] :
Equations
• Monoid.CoprodI.Word.instDecidableEq =
instance Monoid.CoprodI.Word.instDecidableEq_1 {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [] :
Equations
• Monoid.CoprodI.Word.instDecidableEq_1 = Monoid.CoprodI.Word.equiv.decidableEq
inductive Monoid.CoprodI.NeWord {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
ιιType (max u_1 u_2)

A NeWord M i j is a representation of a non-empty reduced words where the first letter comes from M i and the last letter comes from M j. It can be constructed from singletons and via concatenation, and thus provides a useful induction principle.

• singleton: {ι : Type u_1} → {M : ιType u_2} → [inst : (i : ι) → Monoid (M i)] → {i : ι} → (x : M i) → x 1
• append: {ι : Type u_1} → {M : ιType u_2} → [inst : (i : ι) → Monoid (M i)] → {i j k l : ι} → j k
Instances For
def Monoid.CoprodI.NeWord.toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : ) :
List ((i : ι) × M i)

The list represented by a given NeWord

Equations
• ().toList = [x, x_3]
• (w₁.append _hne w₂).toList = w₁.toList ++ w₂.toList
Instances For
theorem Monoid.CoprodI.NeWord.toList_ne_nil {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) :
w.toList []
def Monoid.CoprodI.NeWord.head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : ) :
M i

The first letter of a NeWord

Equations
Instances For
def Monoid.CoprodI.NeWord.last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : ) :
M j

The last letter of a NeWord

Equations
• ().last = x_3
• (w₁.append _hne w₂).last = w₂.last
Instances For
@[simp]
theorem Monoid.CoprodI.NeWord.toList_head? {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) :
@[simp]
theorem Monoid.CoprodI.NeWord.toList_getLast? {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) :
w.toList.getLast? = some j, w.last
def Monoid.CoprodI.NeWord.toWord {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) :

The Word M represented by a NeWord M i j

Equations
• w.toWord = { toList := w.toList, ne_one := , chain_ne := }
Instances For
theorem Monoid.CoprodI.NeWord.of_word {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : ) (h : w Monoid.CoprodI.Word.empty) :
∃ (i : ι) (j : ι) (w' : ), w'.toWord = w

Every nonempty Word M can be constructed as a NeWord M i j

def Monoid.CoprodI.NeWord.prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) :

A non-empty reduced word determines an element of the free product, given by multiplication.

Equations
• w.prod = w.toWord.prod
Instances For
@[simp]
theorem Monoid.CoprodI.NeWord.singleton_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
@[simp]
theorem Monoid.CoprodI.NeWord.singleton_last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
@[simp]
theorem Monoid.CoprodI.NeWord.prod_singleton {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
(Monoid.CoprodI.NeWord.singleton x hne_one).prod = Monoid.CoprodI.of x
@[simp]
theorem Monoid.CoprodI.NeWord.append_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : } {hne : j k} {w₂ : } :
@[simp]
theorem Monoid.CoprodI.NeWord.append_last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : } {hne : j k} {w₂ : } :
(w₁.append hne w₂).last = w₂.last
@[simp]
theorem Monoid.CoprodI.NeWord.append_prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : } {hne : j k} {w₂ : } :
(w₁.append hne w₂).prod = w₁.prod * w₂.prod
def Monoid.CoprodI.NeWord.replaceHead {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (x : M i) (_hnotone : x 1) (_w : ) :

One can replace the first letter in a non-empty reduced word by an element of the same group

Equations
Instances For
@[simp]
theorem Monoid.CoprodI.NeWord.replaceHead_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (x : M i) (hnotone : x 1) (w : ) :
def Monoid.CoprodI.NeWord.mulHead {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) (x : M i) (hnotone : x * w.head 1) :

One can multiply an element from the left to a non-empty reduced word if it does not cancel with the first element in the word.

Equations
Instances For
@[simp]
theorem Monoid.CoprodI.NeWord.mulHead_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) (x : M i) (hnotone : x * w.head 1) :
@[simp]
theorem Monoid.CoprodI.NeWord.mulHead_prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : ) (x : M i) (hnotone : x * w.head 1) :
(w.mulHead x hnotone).prod = Monoid.CoprodI.of x * w.prod
def Monoid.CoprodI.NeWord.inv {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (_w : ) :

The inverse of a non-empty reduced word

Equations
• ().inv =
• (w₁.append h w₂).inv = w₂.inv.append w₁.inv
Instances For
@[simp]
theorem Monoid.CoprodI.NeWord.inv_prod {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : ) :
w.inv.prod = w.prod⁻¹
@[simp]
theorem Monoid.CoprodI.NeWord.inv_head {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : ) :
@[simp]
theorem Monoid.CoprodI.NeWord.inv_last {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : ) :
theorem Monoid.CoprodI.lift_word_ping_pong {ι : Type u_1} {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [] (X : ιSet α) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} {k : ι} (w : ) (hk : j k) :
(Monoid.CoprodI.lift f) w.prod X k X i
theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_other_i {ι : Type u_1} {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} {k : ι} (w : ) (hhead : k i) (hlast : k j) :
(Monoid.CoprodI.lift f) w.prod 1
theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_head_eq_last {ι : Type u_1} [hnontriv : ] {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} (w : ) :
(Monoid.CoprodI.lift f) w.prod 1
theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_head_card {ι : Type u_1} [hnontriv : ] {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} (w : ) (hcard : 3 Cardinal.mk (H i)) (hheadtail : i j) :
(Monoid.CoprodI.lift f) w.prod 1
theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_not_empty {ι : Type u_1} [hnontriv : ] {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} (w : ) :
(Monoid.CoprodI.lift f) w.prod 1
theorem Monoid.CoprodI.empty_of_word_prod_eq_one {ι : Type u_1} [hnontriv : ] {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {w : } (h : (Monoid.CoprodI.lift f) w.prod = 1) :
w = Monoid.CoprodI.Word.empty
theorem Monoid.CoprodI.lift_injective_of_ping_pong {ι : Type u_1} [hnontriv : ] {G : Type u_4} [] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [] (X : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) :
Function.Injective (Monoid.CoprodI.lift f)

The Ping-Pong-Lemma.

Given a group action of G on X so that the H i acts in a specific way on disjoint subsets X i we can prove that lift f is injective, and thus the image of lift f is isomorphic to the free product of the H i.

Often the Ping-Pong-Lemma is stated with regard to subgroups H i that generate the whole group; we generalize to arbitrary group homomorphisms f i : H i →* G and do not require the group to be generated by the images.

Usually the Ping-Pong-Lemma requires that one group H i has at least three elements. This condition is only needed if # ι = 2, and we accept 3 ≤ # ι as an alternative.

def Monoid.CoprodI.FreeGroupBasis.coprodI {ι : Type u_4} {X : ιType u_5} {G : ιType u_6} [(i : ι) → Group (G i)] (B : (i : ι) → FreeGroupBasis (X i) (G i)) :
FreeGroupBasis ((i : ι) × X i) ()

Given a family of free groups with distinguished bases, then their free product is free, with a basis given by the union of the bases of the components.

Equations
• One or more equations did not get rendered due to their size.
Instances For
instance Monoid.CoprodI.instIsFreeGroup {ι : Type u_4} (G : ιType u_5) [(i : ι) → Group (G i)] [∀ (i : ι), IsFreeGroup (G i)] :

The free product of free groups is itself a free group.

Equations
• =
@[simp]
theorem freeGroupEquivCoprodI_apply {ι : Type u_1} (a : ) :
freeGroupEquivCoprodI a = (FreeGroup.lift fun (i : ι) => Monoid.CoprodI.of ) a
@[simp]
theorem freeGroupEquivCoprodI_symm_apply {ι : Type u_1} (a : Monoid.CoprodI fun (x : ι) => ) :
freeGroupEquivCoprodI.symm a = (Monoid.CoprodI.lift fun (i : ι) => FreeGroup.lift fun (x : Unit) => ) a
def freeGroupEquivCoprodI {ι : Type u_1} :
≃* Monoid.CoprodI fun (x : ι) =>

A free group is a free product of copies of the free_group over one generator.

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem FreeGroup.injective_lift_of_ping_pong {ι : Type u_1} [] {G : Type u_1} [] (a : ιG) {α : Type u_4} [] (X : ιSet α) (Y : ιSet α) (hXnonempty : ∀ (i : ι), (X i).Nonempty) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hYdisj : Pairwise fun (i j : ι) => Disjoint (Y i) (Y j)) (hXYdisj : ∀ (i j : ι), Disjoint (X i) (Y j)) (hX : ∀ (i : ι), a i (Y i) X i) (hY : ∀ (i : ι), a⁻¹ i (X i) Y i) :
Function.Injective (FreeGroup.lift a)

The Ping-Pong-Lemma.

Given a group action of G on X so that the generators of the free groups act in specific ways on disjoint subsets X i and Y i we can prove that lift f is injective, and thus the image of lift f is isomorphic to the free group.

Often the Ping-Pong-Lemma is stated with regard to group elements that generate the whole group; we generalize to arbitrary group homomorphisms from the free group to G and do not require the group to be generated by the elements.