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)$?
> > 
> > 
> > 
> 
> 
> 



When do automorphisms on open subsets extend
I think you have an injective homomorphism the "other way around".


As you suspect, Hartog's Lemma implies that $Hom(U,X) = Hom(X,X)$. Now, $Aut(U)$ naturally injects into $Hom(U,X)$. Also, $Aut(X)$ naturally injects into $Hom(U,X)$. The image of $Aut(U)$ in $Hom(U,X)$ lands inside the image of $Aut(X)\to Hom(U,X)$. Thus, in this way, we see that


$Aut(U)$ is a subgroup of $Aut(X)$.


As abx's example shows: this really requires $X$ to be affine. (Otherwise, you just get an injective map $Aut(U) \to Hom(U,X)$.)


