FpSubgroup(G, gens, normal) is the subgroup of the FpGroup or free
group G generated by gens (or the normal closure, if normal).
fps_contains() tests membership (by Stallings foldings in a free group
and by coset enumeration or rewriting in an FpGroup), fps_order()
gives the order and fps_to_FpGroup() a presentation.
Examples
g <- free_group("x, y")
x <- g[[2]]; y <- g[[3]]
f <- FpGroup(g[[1]], list(x^4, y^2, x * y * x^-1 * y))
S <- FpSubgroup(f, list(x * y))
fps_contains(S, (x * y)^-3)
#> [1] TRUE
fps_order(S)
#> 4