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.
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 := _, inv := has_inv.inv free_group.has_inv, mul_left_inv := _}
of x
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)]
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 β
. Note that this is the bare function; the
group homomorphism is to_group
.
Equations
- free_group.to_group.to_fun f = quot.lift (free_group.to_group.aux f) _
If β
is a group, then any function from α
to β
extends uniquely to a group homomorphism from
the free group over α
to β
Equations
Equations
Any function from α
to β
extends uniquely
to a group homomorphism from the free group
over α
to the free group over β
. Note that this is the bare function;
for the group homomorphism use map
.
Equations
- free_group.map.to_fun f x = quot.lift_on x (λ (L : list (α × bool)), free_group.mk (free_group.map.aux f L)) _
Any function from α
to β
extends uniquely
to a group homomorphism from the free group
ver α
to the free group over β
.
Equations
Equivalent types give rise to equivalent free groups.
Equations
- free_group.free_group_congr e = {to_fun := ⇑(free_group.map ⇑e), inv_fun := ⇑(free_group.map ⇑(e.symm)), left_inv := _, right_inv := _}
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
Equations
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) = 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.fintype = fintype.subtype (free_group.red.enum L₁).to_finset free_group.fintype._proof_1