# coercion into/from subgroup or Tietze of generator change

Hi there,

do you know of a function, which solves the Tietze for subgroups or converts elements from parentgroup to elements of subgroup and the other way round (if possible)? Neither of the commented codes work (but I hope it is clear what I want):

```
F.<a,b,c> = FreeGroup()
x=a*b/c
H=F.subgroup([a*b,b,b*c])
y=H.gens()[1]*H.gens()[0]
x in H
y in F
#F(y)
#F.coerce(y)
#H.coerce(x).Tietze()
#H(x)
```

I am using cocalc, if this is a version thing. I know something like that exists for quotient groups (s. http://doc.sagemath.org/html/en/refer... )

In my use-case I have a free group $F$ and an element $x \in F$ in it.
Now I want for a given list of generators (e.g. in above [ a*b, b, b*c ]) the $x$ as a word of these generators,
hence I would like to see $x$ as an element in $H$ and use x.Tietze().

Another solution to my problem would be to swap the generators, but I can't see a way to do that either?

Can we consider only the case when the subgroup $H$ is in fact the full free group $F$, and where the human hand can describe how to write the "gens" of the one group, as they are considered in sage, w.r.t. the "gens" of the other group (in bothe directions)?

Is it enough for the application to get the Tietze representation of a word in H, considered "as is" as a word in $F$ ?!

(I took a look into the code, the class of

`H`

is hard to understand and use, most of the time one gets more information from the gap-objects associated. But combining this information is hard.)Yes, we can consider $H$ to be the full free group $F$.

Per se it is possible to write the generators as words of the other ones and vice versa (meaning if I would do it by hand I could do it). The problem here is, that I don't know beforehand which generators will be passed, so in practise we only know how to write the generators (and hence any element) of $H$ as word of the generators of $F$.

I need a word of $F$ to be looked at, as if it was in $H$ and the Tietze of it in $H$.

So far I managed the coercing by $y=H(x.gap())$. The problem here is, that as a subgroup $H$ lacks the Tietze function... Currently I tried to translate it completly to gap (via sage) and solve it there , but I can't find the proper ...(more)