# What's the relation between prime spectrum and affine space?

Let $$A$$ be a ring ,$$X$$ be the set of all prime ideal of $$A$$.For each subset $$E$$ of $$A$$,let $$V(E)$$ denoted the set of all prime ideals of $$A$$ which contain $$E$$.

we have:

• $$V(0)=X,V(1)=\emptyset$$

• $$V(\bigcap_{i \in I} E_i)=\bigcup_{i \in I} V(E_i)$$

• $$V(E)=V(a),\text{if a is the ideal in A generated by}~E$$

• $$V(ab)=V(a)\bigcup V(b) \text{for any ideals a,b in}~A$$

Let $$k$$ be any field,By $$\mathbb{A}^n(k)$$,we shall mean the cartesian product of k with itself n times.If $$F \in k[x_1,...,x_n]$$,the set of zeros of $$F$$ is called the hyper-surface,and is denoted by $$V(F)$$.

we have:

• $$V(0)=\mathbb{A}^n(k),V(1)=\emptyset$$

• $$V(\bigcap_{\alpha} E_{\alpha})=\bigcup_{\alpha} V(E_{\alpha})$$

• $$V(S)=V(I),\text{if I is the ideal in k[x_1,...,x_n] generated by }~S$$

• $$V(PQ)=V(P)\bigcup V(Q) \text{for any polynomials P,Q in k[x_1,...,x_n]}$$

It seem that prime spectrum and affine space are the same things,

then a polynomial can be regard as an ideal,

Zariski topology can be regard as affine algebraic set.

How to explain the hyper-surface and dimension in the algebraic view?and why they are look like a same thing.

This is exactly the viewpoint of modern algebraic geometry, although a prime spectrum is not quite the same thing as an affine space, even for $\mathbb{C}[X]$. This has one prime ideal other than $(X-z)$ for $z\in \mathbb{C}$, namely $(0)$. The set of primes containing $(0)$ is, of course, all of them, so the prime spectrum of $\mathbb{C}[X]$ is a very topological object from $\mathbb{A}^1(\mathbb{C})$. We call $(0)$ a generic point because its closure is all the spectrum of $\mathbb{C}[X]$. Such points are the most glaring difference between prime spectra and affine spaces. (In higher dimension one gets even more interesting points: think of the prime $(X^2-Y)$ in $k[X,Y]$. This is a single point associated to the whole curve $X^2=Y$!)
The natural notion of dimension in commutative rings is the Krull dimension, the length of the longest ascending chain of prime ideals. Considering that $0$ is the only prime of $\mathbb{C}$ and $0,(X-z)$ are the only primes of $\mathbb{C}[X]$, you might hypothesize that the Krull dimension of $\mathbb{C}[X_1...X_n]$ is $n$, and you'd be right. As to hypersurfaces, and indeed all subvarieties of affine space, they correspond in the algebraic picture to quotient rings: a variety $V\subset \mathbb{A}^n$ is associated to its ring of functions $k[V]=k[X_1...X_n]/I(V)$.
If you consider the prime spectrum of the ring of regular functions on an affine variety $X$, where by affine we mean the zeros of a collection of polynomials over an algebraically closed field, you almost get back the variety $X$ but not quite. The maximal spectrum will be the same as $X$ since by the nullstellensatz points in $X$ correspond to maximal ideals in the ring of regular functions on $X$. But in the prime spectrum you have additional points, which correspond to the irreducible subvarieties of $X$. These points are not closed, but rather their closure consists exactly of their irreducible subvarieties. You can think of the prime spectrum of a commutative ring as a generalization of affine varieties, which plays a very important role from the modern perspective of the theory.