# Thread: Hartshorne, corollary question

1. ## Hartshorne, corollary question

If $X, Y$ are two affine varieties, then $X$ and $Y$ are isomorphic if and only if $A(X)$ and $A(Y)$ are isomorphic as $k$-algebras.

In my textbook (Hartshorne), it says that this immediately follows from a proposition that states:

Let $X$ be any variety and let $Y$ be an affine variety. Then there is a natural bijective mapping of sets

$\alpha : \text{Hom}(X, Y) \overset{\sim}{\rightarrow} \text{Hom}(A(Y), \mathcal{O}(X))$

where the left $\text{Hom}$ means morphisms of varieties, and the right $\text{Hom}$ means homomorphisms of $k$-algebras.

How is the proof of this immediate from the proposition? I do not see why. Thanks.