Coerce element of subgroup into ambient group
I constructed a group G and then its subgroup M. I would like to consider the elements of the subgroup M as elements of G because I want to do some computation with them in a group algebra.
sage: G = AbelianGroup( [2,2,2] )
sage: n, b, c = G.gens()
sage: M = G.subgroup( [n, b] )
sage: M.1 in G
True
sage: M.list()[1] in G
False
G(M.list()[1])
also does not work.
I'm working in Sage 9.7
Similar question: https://ask.sagemath.org/question/59558/