The membership problem for right-angled Artin groups and mapping class groups
We prove that the membership problem in a right-angled Artin group $G(Γ)$ is decidable if and only if $G(Γ)$ is coherent, i.e. $Γ$ does not have induced $m$-cycles as subgraphs, for $m\ge 4$. More precisely, we show that any right-angled Artin group (raag) defined by an $n$-cycle of length $n\ge 5$ contains a fixed finitely generated free subgroup with undecidable membership problem. Consequently the membership problem in the mapping class group $M=\Mod(S)$ is decidable only if $M$ is virtually free or $S$ is the twice-punctured Klein bottle. In every other case, $M$ contains a fixed finitely generated free subgroup with undecidable membership problem.