Free groups #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines free groups over a type. Furthermore, it is shown that the free group construction
is an instance of a monad. For the result that free_group
is the left adjoint to the forgetful
functor from groups to types, see algebra/category/Group/adjunctions
.
Main definitions #
free_group
/free_add_group
: the free group (resp. free additive group) associated to a typeα
defined as the words overa : α × bool
modulo the relationa * x * x⁻¹ * b = a * b
.free_group.mk
/free_add_group.mk
: the canonical quotient maplist (α × bool) → free_group α
.free_group.of
/free_add_group.of
: the canonical injectionα → free_group α
.free_group.lift f
/free_add_group.lift
: the canonical group homomorphismfree_group α →* G
given a groupG
and a functionf : α → G
.
Main statements #
free_group.church_rosser
/free_add_group.church_rosser
: The Church-Rosser theorem for word reduction (also known as Newman's diamond lemma).free_group.free_group_unit_equiv_int
: The free group over the one-point type is isomorphic to the integers.- The free group construction is an instance of a monad.
Implementation details #
First we introduce the one step reduction relation free_group.red.step
:
w * x * x⁻¹ * v ~> w * v
, its reflexive transitive closure free_group.red.trans
and prove that its join is an equivalence relation. Then we introduce free_group α
as a quotient
over free_group.red.step
.
For the additive version we introduce the same relation under a different name so that we can distinguish the quotient types more easily.
Tags #
free group, Newman's diamond lemma, Church-Rosser theorem
Reflexive-transitive closure of red.step
Instances for free_group.red
Reflexive-transitive closure of red.step
Predicate asserting that the word w₁
can be reduced to w₂
in one step, i.e. there are words
w₃ w₄
and letter x
such that w₁ = w₃ + x + (-x) + w₄
and w₂ = w₃w₄
Church-Rosser theorem for word reduction: If w1 w2 w3
are words such that w1
reduces
to w2
and w3
respectively, then there is a word w4
such that w2
and w3
reduce to w4
respectively. This is also known as Newman's diamond lemma.
Church-Rosser theorem for word reduction: If w1 w2 w3
are words such that w1
reduces
to w2
and w3
respectively, then there is a word w4
such that w2
and w3
reduce to w4
respectively. This is also known as Newman's diamond lemma.
If x
is a letter and w
is a word such that xw
reduces to the empty word, then w
reduces
to x⁻¹
If x
is a letter and w
is a word such that x + w
reduces to the empty word,
then w
reduces to -x
.
If x
and y
are distinct letters and w₁ w₂
are words such that xw₁
reduces to yw₂
, then
w₁
reduces to x⁻¹yw₂
.
If x
and y
are distinct letters and w₁ w₂
are words such that x + w₁
reduces to y + w₂
,
then w₁
reduces to -x + y + w₂
.
If w₁ w₂
are words such that w₁
reduces to w₂
,
then w₂
is a sublist of w₁
.
If w₁ w₂
are words such that w₁
reduces to w₂
, then w₂
is a sublist of w₁
.
The free group over a type, i.e. the words formed by the elements of the type and their formal inverses, quotient by one step reduction.
Equations
- free_group α = quot free_group.red.step
The free additive group over a type, i.e. the words formed by the elements of the type and their formal inverses, quotient by one step reduction.
Equations
The canonical map from list (α × bool)
to the free group on α
.
Equations
- free_group.mk L = quot.mk free_group.red.step L
The canonical map from list (α × bool)
to the free additive group on α
.
Equations
- free_add_group.mk L = quot.mk free_add_group.red.step L
Equations
Equations
Equations
Equations
- free_group.inhabited = {default := 1}
Equations
- free_add_group.has_add = {add := λ (x y : free_add_group α), quot.lift_on x (λ (L₁ : list (α × bool)), quot.lift_on y (λ (L₂ : list (α × bool)), free_add_group.mk (L₁ ++ L₂)) _) _}
Equations
- free_group.has_mul = {mul := λ (x y : free_group α), quot.lift_on x (λ (L₁ : list (α × bool)), quot.lift_on y (λ (L₂ : list (α × bool)), free_group.mk (L₁ ++ L₂)) _) _}
Equations
- free_add_group.has_neg = {neg := quot.map free_add_group.neg_rev free_add_group.has_neg._proof_1}
Equations
- free_group.has_inv = {inv := quot.map free_group.inv_rev free_group.has_inv._proof_1}
Equations
- free_group.group = {mul := has_mul.mul free_group.has_mul, mul_assoc := _, one := 1, one_mul := _, mul_one := _, npow := div_inv_monoid.npow._default 1 has_mul.mul free_group.group._proof_4 free_group.group._proof_5, npow_zero' := _, npow_succ' := _, inv := has_inv.inv free_group.has_inv, div := div_inv_monoid.div._default has_mul.mul free_group.group._proof_8 1 free_group.group._proof_9 free_group.group._proof_10 (div_inv_monoid.npow._default 1 has_mul.mul free_group.group._proof_4 free_group.group._proof_5) free_group.group._proof_11 free_group.group._proof_12 has_inv.inv, div_eq_mul_inv := _, zpow := div_inv_monoid.zpow._default has_mul.mul free_group.group._proof_14 1 free_group.group._proof_15 free_group.group._proof_16 (div_inv_monoid.npow._default 1 has_mul.mul free_group.group._proof_4 free_group.group._proof_5) free_group.group._proof_17 free_group.group._proof_18 has_inv.inv, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, mul_left_inv := _}
Equations
- free_add_group.add_group = {add := has_add.add free_add_group.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := sub_neg_monoid.nsmul._default 0 has_add.add free_add_group.add_group._proof_4 free_add_group.add_group._proof_5, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg free_add_group.has_neg, sub := sub_neg_monoid.sub._default has_add.add free_add_group.add_group._proof_8 0 free_add_group.add_group._proof_9 free_add_group.add_group._proof_10 (sub_neg_monoid.nsmul._default 0 has_add.add free_add_group.add_group._proof_4 free_add_group.add_group._proof_5) free_add_group.add_group._proof_11 free_add_group.add_group._proof_12 has_neg.neg, sub_eq_add_neg := _, zsmul := sub_neg_monoid.zsmul._default has_add.add free_add_group.add_group._proof_14 0 free_add_group.add_group._proof_15 free_add_group.add_group._proof_16 (sub_neg_monoid.nsmul._default 0 has_add.add free_add_group.add_group._proof_4 free_add_group.add_group._proof_5) free_add_group.add_group._proof_17 free_add_group.add_group._proof_18 has_neg.neg, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _}
of
is the canonical injection from the type to the free group over that type by sending each
element to the equivalence class of the letter that is the element.
Equations
- free_group.of x = free_group.mk [(x, bool.tt)]
of
is the canonical injection from the type to the free group over that type
by sending each element to the equivalence class of the letter that is the element.
Equations
- free_add_group.of x = free_add_group.mk [(x, bool.tt)]
The canonical map from the type to the additive free group is an injection.
The canonical map from the type to the free group is an injection.
If β
is a group, then any function from α
to β
extends uniquely to a group homomorphism from
the free group over α
to β
Equations
- free_group.lift = {to_fun := λ (f : α → β), monoid_hom.mk' (quot.lift (free_group.lift.aux f) _) _, inv_fun := λ (g : free_group α →* β), ⇑g ∘ free_group.of, left_inv := _, right_inv := _}
If β
is an additive group, then any function from α
to β
extends uniquely to an additive group homomorphism from
the free additive group over α
to β
Equations
- free_add_group.lift = {to_fun := λ (f : α → β), add_monoid_hom.mk' (quot.lift (free_add_group.lift.aux f) _) _, inv_fun := λ (g : free_add_group α →+ β), ⇑g ∘ free_add_group.of, left_inv := _, right_inv := _}
Two homomorphisms out of a free group are equal if they are equal on generators.
Two homomorphisms out of a free additive group are equal if they are equal on generators.
Any function from α
to β
extends uniquely
to a group homomorphism from the free group
over α
to the free group over β
.
Equations
- free_group.map f = monoid_hom.mk' (quot.map (list.map (λ (x : α × bool), (f x.fst, x.snd))) _) _
Any function from α
to β
extends uniquely to an additive group homomorphism
from the additive free group over α
to the additive free group over β
.
Equations
- free_add_group.map f = add_monoid_hom.mk' (quot.map (list.map (λ (x : α × bool), (f x.fst, x.snd))) _) _
Equivalent types give rise to multiplicatively equivalent free groups.
The converse can be found in group_theory.free_abelian_group_finsupp
,
as equiv.of_free_group_equiv
Equations
- free_group.free_group_congr e = {to_fun := ⇑(free_group.map ⇑e), inv_fun := ⇑(free_group.map ⇑(e.symm)), left_inv := _, right_inv := _, map_mul' := _}
Equivalent types give rise to additively equivalent additive free groups.
Equations
- free_add_group.free_add_group_congr e = {to_fun := ⇑(free_add_group.map ⇑e), inv_fun := ⇑(free_add_group.map ⇑(e.symm)), left_inv := _, right_inv := _, map_add' := _}
If α
is a group, then any function from α
to α
extends uniquely to a homomorphism from the
free group over α
to α
. This is the multiplicative
version of free_group.sum
.
Equations
If α
is an additive group, then any function from α
to α
extends uniquely to an additive homomorphism from the
additive free group over α
to α
.
Equations
If α
is a group, then any function from α
to α
extends uniquely to a homomorphism from the
free group over α
to α
. This is the additive
version of prod
.
Equations
- x.sum = ⇑free_group.prod x
The bijection between the additive free group on the empty type, and a type with one element.
Equations
- free_add_group.free_add_group_empty_equiv_add_unit = {to_fun := λ (_x : free_add_group empty), unit.star(), inv_fun := λ (_x : unit), 0, left_inv := free_add_group.free_add_group_empty_equiv_add_unit._proof_1, right_inv := free_add_group.free_add_group_empty_equiv_add_unit._proof_2}
The bijection between the free group on the empty type, and a type with one element.
Equations
- free_group.free_group_empty_equiv_unit = {to_fun := λ (_x : free_group empty), unit.star(), inv_fun := λ (_x : unit), 1, left_inv := free_group.free_group_empty_equiv_unit._proof_1, right_inv := free_group.free_group_empty_equiv_unit._proof_2}
The bijection between the free group on a singleton, and the integers.
Equations
- free_group.free_group_unit_equiv_int = {to_fun := λ (x : free_group unit), ((free_group.map (λ (_x : unit), 1)).to_fun x).sum, inv_fun := λ (x : ℤ), free_group.of unit.star() ^ x, left_inv := free_group.free_group_unit_equiv_int._proof_1, right_inv := free_group.free_group_unit_equiv_int._proof_2}
Equations
Equations
The maximal reduction of a word. It is computable
iff α
has decidable equality.
The maximal reduction of a word. It is computable
iff α
has decidable equality.
The first theorem that characterises the function
reduce
: a word reduces to its maximal reduction.
The first theorem that characterises the function
reduce
: a word reduces to its maximal reduction.
The second theorem that characterises the
function reduce
: the maximal reduction of a word
only reduces to itself.
The second theorem that characterises the
function reduce
: the maximal reduction of a word
only reduces to itself.
reduce
is idempotent, i.e. the maximal reduction
of the maximal reduction of a word is the maximal
reduction of the word.
reduce
is idempotent, i.e. the maximal reduction
of the maximal reduction of a word is the maximal
reduction of the word.
If a word reduces to another word, then they have a common maximal reduction.
If a word reduces to another word, then they have a common maximal reduction.
Alias of free_group.reduce.eq_of_red
.
Alias of free_add_group.reduce.eq_of_red
.
If two words correspond to the same element in the free group, then they have a common maximal reduction. This is the proof that the function that sends an element of the free group to its maximal reduction is well-defined.
If two words correspond to the same element in the additive free group, then they have a common maximal reduction. This is the proof that the function that sends an element of the free group to its maximal reduction is well-defined.
If two words have a common maximal reduction, then they correspond to the same element in the additive free group.
If two words have a common maximal reduction, then they correspond to the same element in the free group.
A word and its maximal reduction correspond to the same element of the free group.
A word and its maximal reduction correspond to the same element of the additive free group.
If words w₁ w₂
are such that w₁
reduces to w₂
,
then w₂
reduces to the maximal reduction of w₁
.
If words w₁ w₂
are such that w₁
reduces to w₂
,
then w₂
reduces to the maximal reduction of w₁
.
The function that sends an element of the additive free group to its maximal reduction.
Equations
- free_add_group.to_word = quot.lift free_add_group.reduce free_add_group.to_word._proof_1
The function that sends an element of the free group to its maximal reduction.
Equations
- free_group.to_word = quot.lift free_group.reduce free_group.to_word._proof_1
Constructive Church-Rosser theorem (compare church_rosser
).
Equations
- free_group.reduce.church_rosser H12 H13 = ⟨free_group.reduce L₁, _⟩
Constructive Church-Rosser theorem (compare church_rosser
).
Equations
- free_add_group.reduce.church_rosser H12 H13 = ⟨free_add_group.reduce L₁, _⟩
Equations
- free_group.decidable_eq = free_group.decidable_eq._proof_1.decidable_eq
Equations
- free_add_group.decidable_eq = free_add_group.decidable_eq._proof_1.decidable_eq
Equations
- free_group.red.decidable_rel ((x1, b1) :: tl1) ((x2, b2) :: tl2) = dite ((x1, b1) = (x2, b2)) (λ (h : (x1, b1) = (x2, b2)), free_group.red.decidable_rel._match_2 x1 b1 tl1 x2 b2 tl2 h (free_group.red.decidable_rel tl1 tl2)) (λ (h : ¬(x1, b1) = (x2, b2)), free_group.red.decidable_rel._match_3 x1 b1 tl1 x2 b2 tl2 h (free_group.red.decidable_rel tl1 ((x1, !b1) :: (x2, b2) :: tl2)))
- free_group.red.decidable_rel ((x, b) :: tl) list.nil = free_group.red.decidable_rel._match_1 x b tl (free_group.red.decidable_rel tl [(x, !b)])
- free_group.red.decidable_rel list.nil (hd2 :: tl2) = decidable.is_false _
- free_group.red.decidable_rel list.nil list.nil = decidable.is_true free_group.red.decidable_rel._main._proof_1
- free_group.red.decidable_rel._match_2 x1 b1 tl1 x2 b2 tl2 h (decidable.is_true H) = decidable.is_true _
- free_group.red.decidable_rel._match_2 x1 b1 tl1 x2 b2 tl2 h (decidable.is_false H) = decidable.is_false _
- free_group.red.decidable_rel._match_3 x1 b1 tl1 x2 b2 tl2 h (decidable.is_true H) = decidable.is_true _
- free_group.red.decidable_rel._match_3 x1 b1 tl1 x2 b2 tl2 h (decidable.is_false H) = decidable.is_false _
- free_group.red.decidable_rel._match_1 x b tl (decidable.is_true H) = decidable.is_true _
- free_group.red.decidable_rel._match_1 x b tl (decidable.is_false H) = decidable.is_false _
A list containing every word that w₁
reduces to.
Equations
- free_group.red.enum L₁ = list.filter (λ (L₂ : list (α × bool)), free_group.red L₁ L₂) L₁.sublists
Equations
- free_group.subtype.fintype = fintype.subtype (free_group.red.enum L₁).to_finset free_group.subtype.fintype._proof_1
The length of reduced words provides a norm on an additive free group.
The length of reduced words provides a norm on a free group.