Free groups #
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
: the free group associated to a typeα
defined as the words overa : α × bool
modulo the relationa * x * x⁻¹ * b = a * b
.free_group.mk
: the canonical quotient maplist (α × bool) → free_group α
.free_group.of
: the canoical injectionα → free_group α
.free_group.lift f
: the canonical group homomorphismfree_group α →* G
given a groupG
and a functionf : α → G
.
Main statements #
free_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
.
Tags #
free group, Newman's diamond lemma, Church-Rosser theorem
Reflexive-transitive closure of red.step
Predicate asserting that word w₁
can be reduced to w₂
in one step, i.e. there are words
w₃ w₄
and letter x
such that w₁ = w₃xx⁻¹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.
The empty word []
only reduces to itself.
A letter only reduces to itself.
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
and y
are distinct letters and w₁ w₂
are words such that xw₁
reduces to yw₂
, then
w₁
reduces to x⁻¹yw₂
.
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 canonical map from list (α × bool)
to the free group on α
.
Equations
- free_group.mk L = quot.mk free_group.red.step L
Equations
Equations
- free_group.inhabited = {default := 1}
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_group.has_inv = {inv := λ (x : free_group α), quot.lift_on x (λ (L : list (α × bool)), free_group.mk (list.map (λ (x : α × bool), (x.fst, !x.snd)) L).reverse) 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 := _}
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, tt)]
The canonical injection 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 := _}
Two homomorphisms out of a free group are equal if they are equal on generators.
Any function from α
to β
extends uniquely
to a group homomorphism from the free group
ver α
to the free group over β
.
Equations
- free_group.map f = 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' := _}
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 sum
.
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 free group on the empty type, and a type with one element.
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 () ^ x, left_inv := free_group.free_group_unit_equiv_int._proof_1, right_inv := free_group.free_group_unit_equiv_int._proof_2}
Equations
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 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.
If a word reduces to another word, then they have a common maximal reduction.
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 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.
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 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₁, _⟩
Equations
- free_group.decidable_eq = function.injective.decidable_eq free_group.decidable_eq._proof_1
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) = is_false _
- free_group.red.decidable_rel list.nil list.nil = is_true free_group.red.decidable_rel._main._proof_1
- free_group.red.decidable_rel._match_2 x1 b1 tl1 x2 b2 tl2 h (is_true H) = is_true _
- free_group.red.decidable_rel._match_2 x1 b1 tl1 x2 b2 tl2 h (is_false H) = is_false _
- free_group.red.decidable_rel._match_3 x1 b1 tl1 x2 b2 tl2 h (is_true H) = is_true _
- free_group.red.decidable_rel._match_3 x1 b1 tl1 x2 b2 tl2 h (is_false H) = is_false _
- free_group.red.decidable_rel._match_1 x b tl (is_true H) = is_true _
- free_group.red.decidable_rel._match_1 x b tl (is_false H) = 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