solution sets for equations over free groups are edt0l languages
Laura Ciobanu, Volker Diekert, Murray Elder 14 September 2015, GAGTA9, Luminy
edt0l A language L ⊆ A∗ is EDT0L if ∃ • C ⊇ A an extended alphabet (finite) • #∈C • R regular set of endomorphisms h : C∗ −→ C∗ so that L = {h(#) | h ∈ R}.
2
edt0l A language L ⊆ A∗ is EDT0L if ∃ • C ⊇ A an extended alphabet (finite) • #∈C • R regular set of endomorphisms h : C∗ −→ C∗ so that L = {h(#) | h ∈ R}.
regular
EDT0L
indexed
context-sensitive
context-free
2
equations
Problem: on input aXXb = YYbX find substitutions for X, Y by words in a, b, a−1 , b−1 so that both sides are equal in the free group on A+ = {a, b}.
3
equations
Problem: on input aXXb = YYbX find substitutions for X, Y by words in a, b, a−1 , b−1 so that both sides are equal in the free group on A+ = {a, b}. Easier problem: on input aXXb = YYbX find substitutions for X, Y by words in a, b so that both sides are equal in the free monoid {a, b}∗ .
3
equations Given an equation in a free group/free monoid: • decide if there is a solution
4
equations Given an equation in a free group/free monoid: • decide if there is a solution • find all solutions
4
equations Given an equation in a free group/free monoid: • decide if there is a solution • find all solutions • describe explicitly the set of all solutions in an easy way (as a formal language of low complexity)
4
equations Given an equation in a free group/free monoid: • decide if there is a solution • find all solutions • describe explicitly the set of all solutions in an easy way (as a formal language of low complexity) Why would we care?
4
equations Given an equation in a free group/free monoid: • decide if there is a solution • find all solutions • describe explicitly the set of all solutions in an easy way (as a formal language of low complexity) Why would we care? – Well studied problem, easy to state, difficult to answer
4
equations Given an equation in a free group/free monoid: • decide if there is a solution • find all solutions • describe explicitly the set of all solutions in an easy way (as a formal language of low complexity) Why would we care? – Well studied problem, easy to state, difficult to answer – Related to other problems in mathematics • Tarski Problem: first order theory of free groups • Hilbert10: solvability of Diophantine equations
4
previous results
Makanin 1977: algorithm to decide if an equation in a free monoid has a solution.
5
previous results
Makanin 1977: algorithm to decide if an equation in a free monoid has a solution. Makanin 1982: algorithm to decide if an equation in a free group has a solution.
5
previous results
Makanin 1977: algorithm to decide if an equation in a free monoid has a solution. Makanin 1982: algorithm to decide if an equation in a free group has a solution. Razborov 1987: description of all solutions to an equation in a free group.
5
previous results
Makanin 1977: algorithm to decide if an equation in a free monoid has a solution. Makanin 1982: algorithm to decide if an equation in a free group has a solution. Razborov 1987: description of all solutions to an equation in a free group. Algorithms very complicated.
5
more results
Plandowski, Plandowski and Rytter 1998-9: algorithm to solve equations over free monoids in PSPACE
6
more results
Plandowski, Plandowski and Rytter 1998-9: algorithm to solve equations over free monoids in PSPACE Gutierrez 2000: algorithm for free groups in PSPACE
6
more results
Plandowski, Plandowski and Rytter 1998-9: algorithm to solve equations over free monoids in PSPACE Gutierrez 2000: algorithm for free groups in PSPACE Jeż 2013: new recompression technique
6
more results
Plandowski, Plandowski and Rytter 1998-9: algorithm to solve equations over free monoids in PSPACE Gutierrez 2000: algorithm for free groups in PSPACE Jeż 2013: new recompression technique Diekert, Jeż and Plandowski 2014: NSPACE(n2 ) algorithm
6
our result Theorem (Ciobanu, Diekert, Elder 2015) Let n = |A+ | + |UV| where U = V is an equation over a free group FA+ .
7
our result Theorem (Ciobanu, Diekert, Elder 2015) Let n = |A+ | + |UV| where U = V is an equation over a free group FA+ . We construct in NSPACE(n log n) a finite direct labeled graph where • nodes are modified versions of the equation • edges are labeled by letter homomorphisms • every solution is encoded by some path from an initial to final node in the graph.
7
our result Theorem (Ciobanu, Diekert, Elder 2015) Let n = |A+ | + |UV| where U = V is an equation over a free group FA+ . We construct in NSPACE(n log n) a finite direct labeled graph where • nodes are modified versions of the equation • edges are labeled by letter homomorphisms • every solution is encoded by some path from an initial to final node in the graph. Then we can describe the set {(u1 , . . . , uk ) | Xi −→ ui is a solution} as an EDT0L language.
7
aspects of our proof
• solve free group equations via free monoids with involution and constraints
8
aspects of our proof
• solve free group equations via free monoids with involution and constraints • algebraic control of constraints (via morphisms to a finite monoid with involution)
8
aspects of our proof
• solve free group equations via free monoids with involution and constraints • algebraic control of constraints (via morphisms to a finite monoid with involution) • algebraic structure of modified equations and edges
8
aspects of our proof
• solve free group equations via free monoids with involution and constraints • algebraic control of constraints (via morphisms to a finite monoid with involution) • algebraic structure of modified equations and edges • proving the graph we construct encodes precisely all solutions
8
aspects of our proof
• solve free group equations via free monoids with involution and constraints • algebraic control of constraints (via morphisms to a finite monoid with involution) • algebraic structure of modified equations and edges • proving the graph we construct encodes precisely all solutions • proving we can construct the graph in NSPACE(n log n)
8
aspects of our proof
• solve free group equations via free monoids with involution and constraints • algebraic control of constraints (via morphisms to a finite monoid with involution) • algebraic structure of modified equations and edges • proving the graph we construct encodes precisely all solutions • proving we can construct the graph in NSPACE(n log n)
8
groups to monoids
We convert the problem of finding solutions as reduced words in a free group over A+ to finding solutions to a new equation in a free monoid with involution over A = {a, a | a ∈ A+ } so that solutions satisfy certain constraints (for example, solutions may not contain factors aa).
9
groups to monoids
We convert the problem of finding solutions as reduced words in a free group over A+ to finding solutions to a new equation in a free monoid with involution over A = {a, a | a ∈ A+ } so that solutions satisfy certain constraints (for example, solutions may not contain factors aa). We then build a graph which encodes all solutions to an equation in a free monoid with involution over A = {a, a | a ∈ A+ } which obey the given constraints.
9
preview
Here is a naïve first attempt. • Input: XaYbaXa = bYb3 ZP equation in a free monoid. • Guess the first letter of some variable, and replace. Eg: Y −→ aY. • Guess Y −→ 1. • Repeat. If there is a solution, this method will find it!
10
preview
Here is a naïve first attempt. • Input: XaYbaXa = bYb3 ZP equation in a free monoid. • Guess the first letter of some variable, and replace. Eg: Y −→ aY. • Guess Y −→ 1. • Repeat. If there is a solution, this method will find it! Issues: • if there is no solution, we will never stop.
10
preview
Here is a naïve first attempt. • Input: XaYbaXa = bYb3 ZP equation in a free monoid. • Guess the first letter of some variable, and replace. Eg: Y −→ aY. • Guess Y −→ 1. • Repeat. If there is a solution, this method will find it! Issues: • if there is no solution, we will never stop. • Y −→ aY increases the length of the equation (there is no cancellation) — can get arbitrarily long.
10
preview
To keep the equation length bounded, we can try to compress constants using new constants. Eg: ab −→ c, aa −→ d, aa −→ a.
11
preview
To keep the equation length bounded, we can try to compress constants using new constants. Eg: ab −→ c, aa −→ d, aa −→ a. Issues: • might need many new constants.
11
preview
To keep the equation length bounded, we can try to compress constants using new constants. Eg: ab −→ c, aa −→ d, aa −→ a. Issues: • might need many new constants. • aa −→ d means that ad = da, so we are no longer in a free monoid.
11
preview
To keep the equation length bounded, we can try to compress constants using new constants. Eg: ab −→ c, aa −→ d, aa −→ a. Issues: • might need many new constants. • aa −→ d means that ad = da, so we are no longer in a free monoid. • aa −→ a only works if all blocks of a have even length
11
building the graph
Edges correspond to making one of the following moves on an equation pop
compress
• X −→ aX, X −→ X a
• aa −→ a, a a −→ a
• X −→ 1, X −→ 1
• aa −→ c, a a −→ c
split
• ab −→ c, b a −→ c
• X −→ X′ X, X −→ X X′
12
nodes Each node is an extended equation (B, X , θ, P = Q, µ) where • • • •
B, X are sets with involution; A ⊆ B θ tells us which letters in B ∪ X commute P = Q is the modified equation; P, Q ∈ B ∪ X µ controls that solutions are in reduced words
13
nodes Each node is an extended equation (B, X , θ, P = Q, µ) where • • • •
B, X are sets with involution; A ⊆ B θ tells us which letters in B ∪ X commute P = Q is the modified equation; P, Q ∈ B ∪ X µ controls that solutions are in reduced words
An initial node has the form (A, X , ∅, U = V, µ) A final node has the form (B, ∅, ∅, P = P, µ) 13
key idea
We make the graph finite by fixing a set with involution C of size 58n, and only allowing nodes where B ⊆ C and |PQ| ≤ 58n. In doing so, it could be that there are solutions that we cannot find subject to these restrictions.
14
key idea
We make the graph finite by fixing a set with involution C of size 58n, and only allowing nodes where B ⊆ C and |PQ| ≤ 58n. In doing so, it could be that there are solutions that we cannot find subject to these restrictions. The key part of the proof is to establish the following. Proposition For every solution, there exists a path inside our graph from initial to final encoding this solution.
14
proof We know the solution, so we could just pop variables letter by letter using X −→ aX, X −→ X a until the entire solution is substituted in the equation. If the solution is longer than 58n we will fall out of the graph. So some clever alternation of pop and compress moves is needed.
15
proof We know the solution, so we could just pop variables letter by letter using X −→ aX, X −→ X a until the entire solution is substituted in the equation. If the solution is longer than 58n we will fall out of the graph. So some clever alternation of pop and compress moves is needed. 1. Assume |PQ| ≤ 27n. 2. Pop the first and last letters of each variable. After this |PQ| ≤ 29n. 3. If we can get back to an equation of length at most 27n (using compression), we can iterate. Guaranteed to terminate since each step gets us closer to the solution we know. 15
example Suppose we start with the equation XaYbaXa = bYb3 ZP and that we know a solution X −→ b5 , Y −→ b4 a, Z −→ bab, P −→ ab5 a.
16
example Suppose we start with the equation XaYbaXa = bYb3 ZP and that we know a solution X −→ b5 , Y −→ b4 a, Z −→ bab, P −→ ab5 a. We depict the situation as follows: X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a | {z } | {z }| {z } Y
Z
P
16
example Suppose we start with the equation XaYbaXa = bYb3 ZP and that we know a solution X −→ b5 , Y −→ b4 a, Z −→ bab, P −→ ab5 a. We depict the situation as follows: X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a | {z } | {z }| {z } Y
Z
P
Step 1 – pop first and last letters of each variable: X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a |{z} | {z } | {z } Y
Z
P
16
how to get back to 27n
Block compression: compress all blocks of the same letter using aa −→ a moves, so afterwards equation has no aa factor visible.
17
how to get back to 27n
Block compression: compress all blocks of the same letter using aa −→ a moves, so afterwards equation has no aa factor visible. Issues: • could have an odd number of a’s in a block • could have baa . . . aX and the solution we know has X −→ ai w (with i odd)
17
example continued: block compression
X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a | {z } |{z} | {z } Y
Z
P
18
example continued: block compression
X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a | {z } |{z} | {z } Y
Z
P
.. .
c5 a c4 a b a c5 a |{z} |{z} Z
P
18
example continued: block compression
X
Y
X
z }| { z }| { z }| { b b b b b a b b b b a b a b b b b b a | {z } |{z} | {z } Y
Z
P
.. .
c5 a c4 a b a c5 a |{z} |{z} Z
P
c5 ac4 abac5 a = c5 ac4 ZbaPa
18
block compression
We prove that at all times in the process, the equation length and number of letters in use is never more than 58n, and at the end of the process the equation length is not more than 29n.
19
block compression
We prove that at all times in the process, the equation length and number of letters in use is never more than 58n, and at the end of the process the equation length is not more than 29n. After block compression, we have no factors aa visible in the equation.
19
are we there yet? Now, maybe block compression is very successful and the equation shrinks back down to length at most 27n. If so, great, one round is done.
20
are we there yet? Now, maybe block compression is very successful and the equation shrinks back down to length at most 27n. If so, great, one round is done. So assume we are at an equation P = Q with no visible aa factors and length between 27n and 29n. Now we want to compress pairs ab −→ c with a ̸= b. We want to compress as many pairs as we can in this step (we have to reduce length by 2n).
20
are we there yet? Now, maybe block compression is very successful and the equation shrinks back down to length at most 27n. If so, great, one round is done. So assume we are at an equation P = Q with no visible aa factors and length between 27n and 29n. Now we want to compress pairs ab −→ c with a ̸= b. We want to compress as many pairs as we can in this step (we have to reduce length by 2n). Issues: • compress ab −→ c and bd −→ e, but what if we have a factor abd? • could have aX and Xb in the equation, so pop to expose pairs, but don’t want to pop more than once. 20
pair compression
1. Partition letters of B into L and R: for all b ∈ B, b ∈ L ⇐⇒ b ∈ R. Here we assume B has no self-involuting letters. Choose some random partition.
21
pair compression
1. Partition letters of B into L and R: for all b ∈ B, b ∈ L ⇐⇒ b ∈ R. Here we assume B has no self-involuting letters. Choose some random partition. 2. If X has solution starting with R or ending in L, pop. After this all LR pairs are visible without overlap, and the equation has length at most 31n.
21
pair compression
1. Partition letters of B into L and R: for all b ∈ B, b ∈ L ⇐⇒ b ∈ R. Here we assume B has no self-involuting letters. Choose some random partition. 2. If X has solution starting with R or ending in L, pop. After this all LR pairs are visible without overlap, and the equation has length at most 31n. 3. Apply ab −→ c, b a −→ c to all a ∈ L, b ∈ R pairs.
21
example continued: pair compression
Choose b, c5 ∈ L, a, c4 ∈ R. c5 a c4 a b a c5 a |{z} |{z} Z
P
22
example continued: pair compression
Choose b, c5 ∈ L, a, c4 ∈ R. c5 a c4 a b a c5 a |{z} |{z} Z
P
Pop Z, P since they start/end with a letter in R/L respectively.
22
example continued: pair compression
Choose b, c5 ∈ L, a, c4 ∈ R. c5 a c4 a b a c5 a |{z} |{z} Z
P
Pop Z, P since they start/end with a letter in R/L respectively. Apply moves c5 a −→ d, ba −→ e: d c4 a e d
22
pair compression Maybe we chose our partition badly, and hardly any pairs are compressed.
23
pair compression Maybe we chose our partition badly, and hardly any pairs are compressed. We compute the expected length as follows. 1. start with the equation P = Q of length between 27n and 29n
23
pair compression Maybe we chose our partition badly, and hardly any pairs are compressed. We compute the expected length as follows. 1. start with the equation P = Q of length between 27n and 29n 2. write the equation as x0 u1 x1 · · · um xm where • |ui | = 3 and have no variables • |x0 · · · xm | ≤ 3n (contains all the variables)
23
pair compression Maybe we chose our partition badly, and hardly any pairs are compressed. We compute the expected length as follows. 1. start with the equation P = Q of length between 27n and 29n 2. write the equation as x0 u1 x1 · · · um xm where • |ui | = 3 and have no variables • |x0 · · · xm | ≤ 3n (contains all the variables)
3. since 27n < |x0 · · · xm | + 3m we get 8n < m
23
pair compression Maybe we chose our partition badly, and hardly any pairs are compressed. We compute the expected length as follows. 1. start with the equation P = Q of length between 27n and 29n 2. write the equation as x0 u1 x1 · · · um xm where • |ui | = 3 and have no variables • |x0 · · · xm | ≤ 3n (contains all the variables)
3. since 27n < |x0 · · · xm | + 3m we get 8n < m 4. After popping, we have y0 u1 · · · um ym with |y0 · · · ym | ≤ |x0 · · · xm | + 2n 23
pair compression 5. each ui = abc with a ̸= b ̸= c. With probability 21 , b ∈ L, and in this case with probability 21 , c ∈ R. Else with probability 21 , b ∈ R, and in this case with probability 21 , a ∈ L. So E(|ui |) =
1 4
·2+
1 4
·3+
1 4
·2+
1 4
·3=
5 2
24
pair compression 5. each ui = abc with a ̸= b ̸= c. With probability 21 , b ∈ L, and in this case with probability 21 , c ∈ R. Else with probability 21 , b ∈ R, and in this case with probability 21 , a ∈ L. So E(|ui |) =
1 4
·2+
1 4
·3+
1 4
·2+
1 4
·3=
5 2
6. By linearity of expectation, the expected length of u1 · · · um after the process is 52 m.
24
pair compression 5. each ui = abc with a ̸= b ̸= c. With probability 21 , b ∈ L, and in this case with probability 21 , c ∈ R. Else with probability 21 , b ∈ R, and in this case with probability 21 , a ∈ L. So E(|ui |) =
1 4
·2+
1 4
·3+
1 4
·2+
1 4
·3=
5 2
6. By linearity of expectation, the expected length of u1 · · · um after the process is 52 m. So there is some choice of partition so that the length of P = Q after the process at most |y0 · · · ym | + 52 m ≤ |x1 · · · xm | + 2n + 52 m = |PQ| − 3m + 2n + 52 m = |PQ| −
m 2
+ 2n ≤ 29n −
8n 2
+ 2n = 27n. 24
summary
If you know a solution to an equation: 1. Start at an equation of length at most 27n. (The initial equation has length less than n.)
25
summary
If you know a solution to an equation: 1. Start at an equation of length at most 27n. (The initial equation has length less than n.) 2. Pop first and last letters of all variables.
25
summary
If you know a solution to an equation: 1. Start at an equation of length at most 27n. (The initial equation has length less than n.) 2. Pop first and last letters of all variables. 3. Apply block then pair compression procedures, to bring the length back to at most 27n.
25
summary
If you know a solution to an equation: 1. Start at an equation of length at most 27n. (The initial equation has length less than n.) 2. Pop first and last letters of all variables. 3. Apply block then pair compression procedures, to bring the length back to at most 27n. 4. Iterate steps 2 and 3.
25
summary
If you know a solution to an equation: 1. Start at an equation of length at most 27n. (The initial equation has length less than n.) 2. Pop first and last letters of all variables. 3. Apply block then pair compression procedures, to bring the length back to at most 27n. 4. Iterate steps 2 and 3. 5. Each iteration reveals more of the solution in each variable, so eventually each variable will be replaced by 1, and we reach a final node.
25
Thank you
26