TITLE: When do automorphisms on open subsets extend
QUESTION [7 upvotes]: Let $X$ be a normal affine variety of dimension at least two over $\mathbb{C}$ and let $U\subset X$ be  a dense open. Assume that $\mathrm{codim}(X\setminus U) \geq 2$.
I think Hartog's lemma implies that every automorphism of $U$ extends to an automorphism of $X$. Is that true?


Do we have a surjective homomorphism $\mathrm{Aut}(X) \to \mathrm{Aut}(U)$?

REPLY [3 votes]: The answer to your second question is no. Let $X$ be a three-dimensional algebraic torus, then the automorphism group of $X$ is the extension of $GL_3(\mathbb Z)$ by $X$ (acting by translations. Let $U$ be the complement of three points in general positionin a one-dimensional subtorus. Then the automorphism group of $U$ is the subgroup of $GL_3(\mathbb Z)$ fixing a vector. If there were a surjective homomorphism $Aut(X) \to Aut(U)$, the image of the torus would be a normal abelian subgroup, hence when sent to $GL_2(\mathbb Z)$ it would lie in $\pm 1$, but there is no surjective homomorphism $GL_3(\mathbb Z) \to PGL_2(\mathbb Z)$.