Hom between 2 schemes

Why is the set $Hom(X,Y)$ between 2 schemes $X$ and $Y$ a scheme as well? Where can I read the construction? For example, $Hom(\mathbb{A}^1,\mathbb{A}^1)$ is the set of all polynomial, and what is the structure of scheme?

-
I heard it, but I don't know the construction. – user46336 Nov 30 '12 at 17:46

I am not sure that $Hom(\mathbb A^1, \mathbb A^1)$ is representable by a scheme.
If $X, Y$ are algebraic varieties (scheme of finite type) over a field $k$, consider the functor $$T \mapsto \mathrm{Hom}_T(X\times_k T, Y\times_k T)$$ from the category of $k$-schemes to the category of sets. When we say $\mathrm{Hom}_k(X,Y)$ is representable by a $k$-scheme $H$, we mean that the above functor is equivalent to the functor $$T \mapsto H(T)=\mathrm{Hom}_k(T, H).$$ In particular, taking $T=\mathrm{Spec}(k)$, we can identify canonically $\mathrm{Hom}_k(X,Y)$ with $H(k)$, the set of $k$-rational points of $H$.
The above Hom functor is known to be presentable when $X, Y$ are projective. The idea is that a morphism $X\to Y$ can be viewed, via its graph, as a subscheme of $X\times_k Y$. Now use Hilbert scheme to represent this functor. See Kollar: Rational curves on algebraic varieties, I, 1.9 for precise statements and proofs.
Is this the standard definition of Hom scheme? The definition that seems more natural to me (en.wikipedia.org/wiki/Exponential_object) is as a right adjoint to the product, which means we want to represent the functor $T \mapsto \text{Hom}_k(X \times_k T, Y)$. Or are these naturally equivalent? – Qiaochu Yuan Nov 30 '12 at 22:28
Because any morphism $X\times_k T\to Y$ induces canonically a morphism $X\times_k T\to Y\times_k T$ by the universal property of the product $Y\times_k T$. – user18119 Dec 1 '12 at 18:18