ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 15 Aug 2021 03:37:18 +0200How to properly implement free product with amalgamationhttps://ask.sagemath.org/question/58470/how-to-properly-implement-free-product-with-amalgamation/Say I have a group G, and homomorphisms from G to H and K. I want to define a new group as the free product over H and K quotiented by the images of the generators of G into each group. In other words, if f: G -> H and g: G -> K, I want the group (H*K)/[f(x)=g(x)] for all generators x of G. I have this (sort of) working, but it's very hacky, and only works in my specific case because I know the general structure of all the groups involved. Here's what I do:
def get_tietze(word, generators):
tietze = list(word.Tietze())
new_tietze = []
for num in tietze:
g = str(word.parent().gen(abs(num)-1))
for index, gen in enumerate(generators):
if g == str(gen):
new_tietze.append(-index - 1 if num < 0 else index + 1)
break
return new_tietze
H = ab.simplification_isomorphism() # ab, ag already defined groups
K = ag.simplification_isomorphism()
print(H)
print(K)
print(G) # G is already defined as above
relations = []
fg = FreeGroup(list(ab.gens()) + list(ag.gens()))
for gen in G.gens():
relations.append(fg(get_tietze(H(gen), gens))*fg(get_tietze(K(gen), gens))^-1)
This gives the output:
Generic morphism:
From: Finitely presented group < x0, x1, x2, x3, x4, x5, x6, x7, y0, y1, y2, y3, y4, y5, y6, y7 | x0*y0^-1, x1^-1*x2*x1*y1^-1*y2^-1*y1, x1^-1*x3^-1*x4^-1*x3*x1*y1^-1*y3*y1, x1^-1*x3^-1*x5*x3*x1*y1^-1*y4^-1*y1, x1^-1*x3^-1*x6^-1*x3*x1*y1^-1*y5*y1, x1^-1*x3^-1*x7*x3*x1*y1^-1*y6^-1*y1, x1^-1*x3^-1*x1*y1^-1*y7*y1, x1^-1*y1, x0*x1, x2*x3, x4*x5, x6*x7, y0*y1, y2*y3, y4*y5, y6*y7 >
To: Finitely presented group < x0, x2 | >
Defn: x0 |--> x0
x1 |--> x0^-1
x2 |--> x2
x3 |--> x2^-1
x4 |--> x2^-1
x5 |--> x2
x6 |--> x2^-1
x7 |--> x2
y0 |--> x0
y1 |--> x0^-1
y2 |--> x2
y3 |--> x2^-1
y4 |--> x2
y5 |--> x2^-1
y6 |--> x2
y7 |--> x2^-1
Generic morphism:
From: Finitely presented group < x0, x1, x2, x3, x4, x5, x6, x7, z0, z1, z2, z3, z4, z5, z6, z7 | x0*z0*z1^-1*z2*z1*z0*(z1^-1*z2^-1*z1*z0^-1)^2, x1^-1*x2*x1*z0*z1^-1*z2*z1*z0^-1*z1^-1*z2^-1*z1*z0^-1, x1^-1*x3^-1*x4^-1*x3*x1*z1^-1*z3^-1*z4*z3*z1, x1^-1*x3^-1*x5*x3*x1*z1^-1*z6^-1*z1, x1^-1*x3^-1*x6^-1*x3*x1*z1^-1*z6^-1*z3*z6*z1, x1^-1*x3^- *x7*x3*x1*z1^-1*z6^-1*z5^-1*z6*z1, x1^-1*x3^-1*x1*z7*z1*z7^-1, x1^-1*z7*z1*z7*z1^-1*z7^-1, x0*x1, x2*x3, x4*x5, x6*x7, z0*z1, z2*z3, z4*z5, z6*z7 >
To: Finitely presented group < x4, z0 | z0*x4^-1*z0*x4*z0^-2*x4*z0^-1*x4^-1*z0 >
Defn: x0 |--> x4*z0^-1*x4^-1*z0*x4^-1
x1 |--> x4*z0^-1*x4*z0*x4^-1
x2 |--> x4*z0^-1*x4*(z0*x4^-1)^2
x3 |--> (x4*z0^-1)^2*x4^-1*z0*x4^-1
x4 |--> x4
x5 |--> x4^-1
x6 |--> x4
x7 |--> x4^-1
z0 |--> z0
z1 |--> z0^-1
z2 |--> x4^-1
z3 |--> x4
z4 |--> x4
z5 |--> x4^-1
z6 |--> x4^-1
z7 |--> x4
Free Group on generators {x0, x1, x2, x3, x4, x5, x6, x7}
So you can see that H is generated by x_i and y_i, while K is generated by x_i and z_i, and G is generated by just the x_i. I want to use these simplifying isomorphisms to see where the x_i map to, then construct this word in the free group on the combined x_i, y_i, z_i, and right now the only way I can figure out how to do it is with this clunky `get_tietze` function that compares string representations of generators.
Is there a more general way to do this computation? It looks like the technical term is "free group with amalgamation" ([see here](https://en.wikipedia.org/wiki/Free_product#Generalization:_Free_product_with_amalgamation)), and I can't find a direct way to do it in Sage. I'm trying to get this to work for more general groups, and having this `get_tietze` function makes it really limiting how I can use it.cgodfreySun, 15 Aug 2021 03:37:18 +0200https://ask.sagemath.org/question/58470/