TITLE: How can the inverse map be a morphism of algebraic varieties?
QUESTION [5 upvotes]: This is a very basic questions about algebraic groups, which I'm just starting to learn a little bit about:
For an algebraic variety to be an algebraic group, the inverse map needs to be a morphism of algebraic varieties, but I don't see how this can be true. My understanding is that morphisms are locally polynomials. 
Specifically, I'm working on a problem involving the multiplicative group of the affine line, but I don't see how the inverse map is a morphism of the variety given that it's not a polynomial.

REPLY [5 votes]: Let $k$ be algebraically closed, and let $G$ be the closed set $Z = V(XY-1)$. This can be identified with $k^{\ast}$, via $t \mapsto (t, \frac{1}{t})$.  We want to show that the "inverse map" $\phi: Z \rightarrow Z$ given by $\phi(t,\frac{1}{t}) = (\frac{1}{t},t)$ is a morphism of varieties.  

Fact: let $Z_1 \subseteq k^n$ and $Z_2 \subseteq k^m$ be Zariski closed sets, and $\phi: Z_1 \rightarrow Z_2$ a function.  Then $\phi$ is a morphism if and only if there exist polynomials $f_i(X_1, ... , X_n) \in k[X_1, ... , X_n], 1 \leq i \leq n$ such that $$\phi(x_1, ... , x_n) = (f_1(x_1, ... , x_n), ... , f_m(x_1, ... , x_n))$$ for every $(x_1, ... , x_n)$.

Now take $Z_1 = Z_2 = Z$, and $n = m = 2$.  Let $f_1(X,Y) = Y$, and $f_2(X,Y) = X$.  Then clearly for $(x,y) \in Z$ (that is, for $(x,y) \in k^2$ satisfying $x= \frac{1}{y}$) $$\phi(x,y) =  (\frac{1}{x},\frac{1}{y}) = (y,x) = (f_1(x,y),f_2(x,y)) $$