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 fromM i
and last letter fromM 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 thelift
. 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]
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⟩
.
- of_one: ∀ {ι : Type u_1} {M : ι → Type u_2} [inst : (i : ι) → Monoid (M i)] (i : ι), Monoid.CoprodI.Rel M (FreeMonoid.of { fst := i, snd := 1 }) 1
- of_mul: ∀ {ι : Type u_1} {M : ι → Type u_2} [inst : (i : ι) → Monoid (M i)] {i : ι} (x y : M i), Monoid.CoprodI.Rel M (FreeMonoid.of { fst := i, snd := x } * FreeMonoid.of { fst := i, snd := y }) (FreeMonoid.of { fst := i, snd := x * y })
Instances For
The free product (categorical coproduct) of an indexed family of monoids.
Equations
Instances For
Equations
- instMonoidCoprodI M = id inferInstance
Equations
- instInhabitedCoprodI M = { default := 1 }
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)
- ne_one : ∀ l ∈ self.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
The inclusion of a summand into the free product.
Equations
- One or more equations did not get rendered due to their size.
Instances For
See note [partially-applied ext lemmas].
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
Equations
- One or more equations did not get rendered due to their size.
Equations
- Monoid.CoprodI.instGroupCoprodIToMonoidToDivInvMonoid G = Group.mk (_ : ∀ (m : Monoid.CoprodI G), m⁻¹ * m = 1)
The empty reduced word.
Equations
- Monoid.CoprodI.Word.empty = { toList := [], ne_one := (_ : ∀ a ∈ [], ¬a.snd = 1), chain_ne := (_ : List.Chain' (fun (l l' : (i : ι) × M i) => l.fst ≠ l'.fst) []) }
Instances For
Equations
- Monoid.CoprodI.Word.instInhabitedWord = { default := Monoid.CoprodI.Word.empty }
A reduced word determines an element of the free product, given by multiplication.
Equations
- Monoid.CoprodI.Word.prod w = List.prod (List.map (fun (l : (i : ι) × M i) => Monoid.CoprodI.of l.snd) w.toList)
Instances For
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
- Monoid.CoprodI.Word.fstIdx w = Option.map Sigma.fst (List.head? w.toList)
Instances For
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.
- head : M i
An element of
M i
, the first letter of the word. - tail : Monoid.CoprodI.Word M
The remaining letters of the word, excluding the first letter
- fstIdx_ne : Monoid.CoprodI.Word.fstIdx self.tail ≠ some i
The index first letter of tail of a
Pair M i
is not equal toi
Instances For
Equations
- One or more equations did not get rendered due to their size.
Construct a new Word
without any reduction. The underlying list of
cons m w _ _
is ⟨_, m⟩::w
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
- Monoid.CoprodI.Word.rcons p = if h : p.head = 1 then p.tail else Monoid.CoprodI.Word.cons p.head p.tail (_ : Monoid.CoprodI.Word.fstIdx p.tail ≠ some i) h
Instances For
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
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
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Monoid.CoprodI.Word.instMulActionCoprodIWordInstMonoidCoprodI = MulAction.ofEndHom (Monoid.CoprodI.lift fun (x : ι) => MulAction.toEndHom)
Each element of the free product corresponds to a unique reduced word.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Monoid.CoprodI.Word.instDecidableEqWord = Function.Injective.decidableEq (_ : ∀ (x y : Monoid.CoprodI.Word M), x.toList = y.toList → x = y)
Equations
- Monoid.CoprodI.Word.instDecidableEqCoprodI = Equiv.decidableEq Monoid.CoprodI.Word.equiv
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 → Monoid.CoprodI.NeWord M i i
- append: {ι : Type u_1} → {M : ι → Type u_2} → [inst : (i : ι) → Monoid (M i)] → {i j k l : ι} → Monoid.CoprodI.NeWord M i j → j ≠ k → Monoid.CoprodI.NeWord M k l → Monoid.CoprodI.NeWord M i l
Instances For
The list represented by a given NeWord
Equations
- Monoid.CoprodI.NeWord.toList (Monoid.CoprodI.NeWord.singleton x_3 a) = [{ fst := x, snd := x_3 }]
- Monoid.CoprodI.NeWord.toList (Monoid.CoprodI.NeWord.append w₁ _hne w₂) = Monoid.CoprodI.NeWord.toList w₁ ++ Monoid.CoprodI.NeWord.toList w₂
Instances For
The first letter of a NeWord
Equations
Instances For
The last letter of a NeWord
Equations
Instances For
The Word M
represented by a NeWord M i j
Equations
- One or more equations did not get rendered due to their size.
Instances For
A non-empty reduced word determines an element of the free product, given by multiplication.
Instances For
One can replace the first letter in a non-empty reduced word by an element of the same group
Equations
- Monoid.CoprodI.NeWord.replaceHead x_1 x_2 (Monoid.CoprodI.NeWord.singleton x_7 a) = Monoid.CoprodI.NeWord.singleton x_1 x_2
- Monoid.CoprodI.NeWord.replaceHead x_2 x_3 (Monoid.CoprodI.NeWord.append w₁ hne w₂) = Monoid.CoprodI.NeWord.append (Monoid.CoprodI.NeWord.replaceHead x_2 x_3 w₁) hne w₂
Instances For
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
- Monoid.CoprodI.NeWord.mulHead w x hnotone = Monoid.CoprodI.NeWord.replaceHead (x * Monoid.CoprodI.NeWord.head w) hnotone w
Instances For
The inverse of a non-empty reduced word
Equations
- Monoid.CoprodI.NeWord.inv (Monoid.CoprodI.NeWord.singleton x_4 h) = Monoid.CoprodI.NeWord.singleton x_4⁻¹ (_ : ¬x_4⁻¹ = 1)
- Monoid.CoprodI.NeWord.inv (Monoid.CoprodI.NeWord.append w₁ h w₂) = Monoid.CoprodI.NeWord.append (Monoid.CoprodI.NeWord.inv w₂) (_ : k ≠ j) (Monoid.CoprodI.NeWord.inv w₁)
Instances For
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.
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
The free product of free groups is itself a free group.
Equations
- (_ : IsFreeGroup (Monoid.CoprodI G)) = (_ : IsFreeGroup (Monoid.CoprodI fun (i : ι) => G i))
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
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.