User:EverlastingDeadMan

Commutative Algebra

 * Rings and hypersurfaces. Consider a ring $$R$$ and an ideal $$ I\subseteq R[t_1,\cdots,t_n]$$, then we define the following set (set $$\mathbb A^n_R=\mathbb A^n$$, the $$n$$-affine space)$$V( I)=\{x\in\mathbb A^n:f(x)=0\text{ for all }f\in I\}$$which we call (affine) varieties. Finally, let $$\mathcal O_{I}=R[t_1,\cdots,t_n]/ I$$ the space of functionals on $$V( I)$$.
 * Spectrum of a ring. Given a ring $$R$$, we define the prime spectrum of a ring $$\textbf{Spec}R=\{\mathfrak I\text{ prime ideal of }R\}$$We also define the maximal spectrum as the space $$\mathbf{mSpec}R$$ as the collection of all maximal ideals. Given a morphism $$f:S\longrightarrow R$$ and an ideal $$\mathfrak p\in \mathbf{Spec}R$$, the ideal $$f^{-1}(\mathfrak p)$$ is also prime, so $$f$$ induces a morphism $$f_*:\mathbf{Spec}R\longrightarrow\mathbf{Spec}S,\qquad f_*\mathfrak p=f^{-1}(\mathfrak p)$$In particular, the projection $$R\twoheadrightarrow R/I$$ onto the quotient by an ideal $$I$$, induces a map $$\mathbf{Spec}R/I \rightarrow\mathbf{Spec}R$$, whose image is the set of prime ideals containing $$I$$. Also, given multiplicative set $$S$$, the inclusion $$j:R\longrightarrow S^{-1}R$$ induces a map $$j_*:\mathbf{Spec}S^{-1}R\longrightarrow\mathbf{Spec}R$$(where $$S^{-1}R$$ is the localization of $$R$$ to $$S$$). The image of $$j_*$$ are those ideals that are disjoint from $$S$$.
 * Radical and nilpotent elements. A nilpotent element $$s\in R$$ is one such that $$s^n=0$$ for some $$n$$. Let $$\mathfrak{rad}R=\{s\in R\text{ nilpotent element}\}$$If $$s\notin\mathfrak{rad}R$$, the set $$\{1,\cdots,s^n,\cdots\}$$ is a multiplicative set, so using the result about prime ideals in $$S^{-1}R$$, we can conclude that $$\mathfrak{rad}R$$ is the intersection of all prime ideals in $$R$$.
 * Local rings. A ring $$R$$ is a local ring if has a unique maximal ideal $$\mathfrak m$$. Let $$R/\mathfrak m$$be the residue field. It's easy to prove that every non-unit element $$u\in R$$ belongs to a maximal ideal (consider $$uR$$ and the Prime Ideal Theorem), therefore $$\mathfrak m$$ is the ideal of all non-unit elements and every $$1-u$$ is a unit, with $$u\in\mathfrak m$$.

Noetherian Rings

 * Ascending chain condition. Given a ring $$R$$, a $$R$$-module $$M$$ is Noetherian if every family of submodules has a maximal element. Consider now a submodule $$N\hookrightarrow M$$ in a Noetherian module, then the family $$\{N\supseteq J\text{ finitely-generated submodule of }M\}$$has a maximal element $$J$$, which must be equal to $$N$$, therefore in a Noetherian module every submodule is finitely generated. On the other hand, a module where every submodule is finitely generated, is Noetherian.

Tensor product
(M,R)$$first, it's immediate that since $$q$$ is onto, then $$q_*$$ is 1-1, so the first short sequence is exact. Then, $$p_*q_*=(qp)_*=0$$, so $$\mathbf{im}q_*\subseteq\mathbf{ker}p_*$$. On the other hand, consider $$\phi\in\mathbf{ker}p_*$$, which means that $$\phi p=0\longrightarrow\mathbf{ker}q=\mathbf{im}p\subseteq\mathbf{ker}\phi$$, so we have the following sequence of maps$$Q\longrightarrow^\simeq N/\mathbf{ker}q=N/\mathbf{im}p\longrightarrow N/\mathbf{ker}\phi\longrightarrow R$$ (where the first map is the inverse of the canonical isomorphism $$N/\mathbf{ker}q\longrightarrow^\simeq q(N)=Q$$), all the previous compositions define a morphism $$\varphi:Q\longrightarrow R$$ such that $$q_*(\varphi)= \phi$$, thus $$\mathbf{ker}p_*\subseteq\mathbf{im}q_*$$ and the sequence of Hom modules is exact. On the other hand, suppose that the Hom sequence is exact for all $$R$$, then take $$R=Q/\mathbf{im}q$$, it's easy to see that $$q_*(\pi)=0=q_*(0)$$(where $$\pi$$ is the canonical projection $$Q\twoheadrightarrow Q/\mathbf{im}q$$), thus by exactness of the Hom sequence (in particular, $$q_*$$ is 1-1), we conclude that $$\pi=0\longrightarrow \mathbf{im}q=Q$$ and $$q$$ is onto. Now, since $$q$$ is onto, we have an isomorphism $$j:N/\mathbf{ker}q\longrightarrow Q$$ such that $$q=j\rho$$ (where $$\rho$$ is the canonical projection), then $$\rho=j^{-1}q=q_*(j^{-1})\longrightarrow \rho\in\mathbf{im}q_*=\mathbf{ker}p_*$$so $$\rho p=p_*(\rho)=0\longrightarrow\mathbf{im}p\subseteq\mathbf{ker}\rho=\mathbf{ker}q$$. On the other hand, if $$\rho$$ is instead the canonical projection $$N\longrightarrow N/\mathbf{im}p$$, then $$\rho\in\mathbf{ker}p_*\longrightarrow \rho=kq,\text{ for some }k \longrightarrow\mathbf{ker}q\subseteq\mathbf{ker}\rho=\mathbf{im}p$$so the original sequence is exact if and only if the Hom sequence is exact for every $$R$$. \mathbf{Hom}(M,\mathbf{Hom}(A,B))$$therefore the isomorphic sequence $$0\longrightarrow\mathbf{Hom}(Q\otimes A,B)\longrightarrow^{(q\otimes1)_*}\mathbf{Hom}(N\otimes A,B) \longrightarrow^{(p\otimes 1)_*}\mathbf{Hom}(M\otimes A,B)$$is exact for every $$B$$, which implies (for the previous result), that the sequence $$M\otimes A \longrightarrow^{p\otimes1}N\otimes A\twoheadrightarrow^{q\otimes1}Q\otimes A$$is exact for every module $$S$$. In particular, consider the exact sequence $$I \longrightarrow R \twoheadrightarrow R/I$$for an ideal $$I$$, and a $$R$$-module $$M$$, then it's easy to prove that $$IM\simeq I\otimes_RM$$, so we have the following exact sequence $$IM\longrightarrow^\varphi M\twoheadrightarrow M\otimes R/I$$which means $$M\otimes R/I\simeq M/\mathbf{im}\varphi=M/IM$$ (since $$\varphi$$ is the inclusion $$IM\hookrightarrow M$$).
 * Exactness of Hom. Consider an exact sequence of modules $$M\longrightarrow^pN\twoheadrightarrow^q Q$$ and, for a general module $$R$$, the induced sequence $$0\longrightarrow\mathbf{Hom}(Q,R)\longrightarrow^{q_*}\mathbf{Hom}(N,R)\longrightarrow^{p_*}\mathbf{Hom}
 * Exactness of Tensor product. By definition, $$\mathbf{Hom}(M\otimes N,R)\simeq\mathbf{Hom}(M,\mathbf{Hom}(N,R)) $$, so given a exact sequence $$M\longrightarrow^pN \twoheadrightarrow^qQ$$then for every pair $$A,B$$ of modules, the induced Hom sequence is exact$$0\longrightarrow\mathbf{Hom}(Q,\mathbf{Hom}(A,B))\longrightarrow^{q_*}\mathbf{Hom}(N,\mathbf{Hom}(A,B))\longrightarrow^{p_*}

Localization

 * Multiplicative set. Consider a ring $$R$$, a subset $$S$$ is multiplicative if $$1\in S$$ and $$a,b\in S \longrightarrow ab\in S$$. Thus a multiplicative set is simply a submonoid of $$R$$.
 * Localization. Consider a ring $$R$$ and a multiplicative set $$S$$, then let $$S^{-1}R$$ be the the quotient of $$R\times S$$ modulo the equivalence $$(r,s)\sim(r',s')\longleftrightarrow\text{there is }u\in S\text{ s.t. }u(rs'-sr')=0$$let $\frac{r}{s}$ be the equivalence class of the pair $$(r,s)$$, then we define the following operations $$\frac{r}{s}\frac{r'}{s'}=\frac{rr'}{ss'},\qquad \frac{r}{s}+\frac{r'}{s'}=\frac{rs'+sr'}{ss'}$$and also define the map $$j:R \longrightarrow S^{-1}R$$ as $$r\longmapsto \tfrac{r}{1}$$. Also, notice that $$j$$ maps to zero those elements that are zero divisors of elements in $$S$$ (that is, $$j(r)=0$$, then $$ur=0$$ for some $$u\in S$$). Notice that if $$R$$ is an integral domain, then $$S=R^*=R-\{0\}$$ is a multiplicative set and $$S^{-1}R=R_{(0)}=\mathbf{Frac}R$$the field of fractions of $$R$$. In case $$S=R-\mathfrak p$$ is the complement of some prime ideal $$\mathfrak p$$, we denote $$S^{-1}R$$ by $$R_\mathfrak{p}$$.
 * Properties of localization. Given a prime ideal $$\mathfrak p\hookrightarrow R$$ consider the localization $$R_\mathfrak p$$ and the ideal $$m_\mathfrak p=\{\tfrac{r}{e}|r\in\mathfrak p,e\notin\mathfrak p\}$$this ideal is maximal (since every ideal properly greater than $$m_\mathfrak p$$ contains an element $$\tfrac{u}{e}$$, with $$u\notin\mathfrak p$$, which is a unit with inverse $$\tfrac{e}{u}$$) and the unique maximal ideal of $$R_\mathfrak p$$, thus $$(R_\mathfrak p,m_\mathfrak p)$$ is a local ring.
 * Local property. A property of a ring is local if "true for the ring $$A$$" is equivalent to "true for $$A_\mathfrak p$$, for every prime ideal $$\mathfrak p$$".

Chain conditions and special elements
A\text{ finite iff there is an onto }R^n\longrightarrow A\\ A\text{ finite type iff there is an onto }R[t_1,\cdots,t_n]\longrightarrow A
 * Noetherian/Artinian ring. A ring $$R$$ is Noetherian if there is no strictly ascending infinite chain of ideals $$J_1\subset\cdots\subset J_n\subset \cdots$$The ring is called Artinian if there is no strictly descending infinite chain of ideals.
 * Finite algebras and finite type. Given a ring $$R$$, an algebra $$A$$ over said ring is defined as $$\begin{cases}

\end{cases}$$clearly $$R^n$$ is of finite type, thus every finite algebra is of finite type. Consider a Noetherian ring $$R$$ and an algebra $$A$$ of finite type, with a subalgebra $$B\hookrightarrow A$$ such that $$A$$ is finite as a $$B$$-algebra.
 * Prime/Irreducible elements. An element $$r\in R$$ in a ring is prime if $$(r)=rR$$ is a prime ideal (which means that if $$r|ab\longrightarrow r|a\vee r|b$$). An element $$r\in R$$ is irreducible if $$r\notin U$$ (where $$U$$ is the group of units in $$R$$) and $$r=ab$$ implies that either $$a\in U$$ or $$b\in U$$.

Integral ring extensions

 * Integral extension. A ring extension $$R \hookrightarrow S$$ is an integral extension if every element $$s\in S$$ is the zero of a monic polynomial, that is, in the form$$f=x^{n+1}+a_nx^n+\cdots+a_0\in R[x]$$
 * Noether normalization theorem. Given a field $$k$$ and a $$k$$-algebra $$A$$ that is of finite type (that is, it is a finitely generated $$k$$-algebra), then there are elements $$z_1,\cdots,z_n\in A$$ such that the canonical morphism $$k[x_1,\cdots,x_n]\longrightarrow R=k[z_1,\cdots,z_n],\qquad x_k\longmapsto z_k$$is an isomorphism and the ring extension $$R\hookrightarrow A$$ is integral. In particular, if $$A$$ is a field (thus we have a field extension $$k \hookrightarrow A$$), then $$R$$ is a field, since every element $$r\in R^*=R-\{0\}$$ has an inverse $$1/r\in A$$ which satisfies a polynomial $$\frac{1}{r^{n+1}}+\frac{a_n}{r^n}+\cdots a_0=0\longrightarrow 1+r(a_n+\cdots+a_0r^n)=0$$so, the inverse of $$r$$ is $$-(a_n+\cdots+a_0r^n)\in R$$ and $$R$$ is a field. But, a ring of polynomials can be a ring if and only if $$n=0$$ and thus the extension $$k\hookrightarrow A$$ is integral. Also, an integral $$k$$-algebra of finite type is finite as a $$k$$-vector space.
 * Hilbert Nullstellensatz. Given a proper ideal $$I\subset k[x_1,\cdots,x_n]$$, there is a maximal ideal $$\mathfrak m$$ containing $$I$$, thus the field extension $$k\hookrightarrow L=k[x_1,\cdots,x_n]/\mathfrak m$$is a finite field extension and $$(x_1+\mathfrak m,\cdots,x_n+\mathfrak m)$$ is an element in $$L^n$$ which is a zero of all polynomials in $$I$$. In particular, if $$k$$ is algebraically closed, then $$L=k$$ and every ideal $$I$$ has a zero in $$k^n$$.  Now, every point $$u\in k^n$$ induces a ring homomorphism $$k[x_1,\cdots,x_n] \longrightarrow k,\qquad f(x)\longmapsto f(u)$$and its kernel $$\mathfrak m_u$$ is a maximal ideal. Thus we have a map (where $$R=k[x_1,\cdots,x_n]$$)$$k^n\longrightarrow \mathbf{mSpec}R=\{\mathfrak m\subseteq k[x_1,\cdots,x_n]\text{ maximal ideal}\}$$This map is 1-1, but not necessarely onto. If $$k$$ is algebraically closed, then every maximal ideal $$\mathfrak m$$ is contained in (an thus equal to) an ideal in the form $$\mathfrak m_u$$, for some $$u\in k^n$$ (and this ideal is necessarely unique), therefore we have an inverse morphism $$\mathbf{mSpec}R \longrightarrow k^n$$Now, consider a field extension $$k \hookrightarrow L$$ that is the algebraic closure of $$k$$. This map induces a map $$k[x_1,\cdots,x_n]\rightarrow L[x_1,\cdots,x_n]$$ and so, for every point $$u\in L^n$$ we have a map$$k[x_1,\cdots,x_n]\longrightarrow L[x_1,\cdots,x_n]\longrightarrow L$$thus, we defined a map from $$L^n$$ to the space of maximal ideals of $$R=k[x_1,\cdots,x_n]$$$$\lambda:L^n \longrightarrow \mathbf{mSpec}R$$Now, the space $$L^n$$ comes equipped with an action by the group $$G=\mathbf{Gal}_kL$$ of $$k$$-linear ring automorphisms of $$L$$. Then the action of $$G$$ extends to $$L^n$$ as $$\phi\cdot(u_1,\cdots,u_n)=(\phi u_1,\cdots,\phi u_n)$$Then notice that for every polynomial $$f\in k[x_1,\cdots,x_n]$$ and $$u\in L^n$$, we have $$f(\phi\cdot u)=\phi\cdot f(u)$$, so two elements in $$L^n$$ with the same orbit under $$G$$, have the same image under $$\lambda$$.

Ideals

 * Radical of an ideal. Given an ideal $$I\subseteq R$$ in a commutative ring, we define the following $$\sqrt{I}=\{f\in R:f^n\in I\text{ for some }n\}$$In particular, $$\sqrt0$$ is the ideal of nilpotent elements in $$R$$, so $$\sqrt{I}$$ is the pullback of $$\sqrt0$$ in $$R/I$$ under the projection $$R\rightarrow R/I$$. It can be proven that if $$R=k[x_1,\cdots,x_n]$$ for an algebraically closed field $$k$$, then $$\sqrt I=\{f\in R:f(u)=0\text{ for all }u\in V(I)\}$$where $$V(I)=\{u\in k^n:I\subseteq\mathfrak m_u\}$$. Clearly $$\sqrt{\sqrt{I}}=\sqrt{I} $$.
 * Operations on ideals. Consider the ring $$R=k[x_1,\cdots,x_n]$$$$V(R)=0,\qquad V(0)=k^n$$also, given a family of ideals $$\{I_\alpha\}_\alpha$$, clearly $$V(\sum_\alpha I_\alpha)=\bigcap_\alpha V(I_\alpha)$$(since $I_\beta\subseteq\sum_\alpha I_\alpha$, the inclusion $$\subseteq $$ is obvious, while a point that is a zero for every element of every $$I_\alpha $$, is also a zero of every linear combination of elements from these ideals and such combinations are all the elements in $\sum_\alpha I_\alpha $ ). Now, given two ideals $$I,J $$ $$IJ=\{\sum^k_j f_jg_j|f_j\in I,g_j\in J,k\in\N \}\subseteq I,J $$then $$V(I)\cup V(J)\subseteq V(IJ) $$. On the other hand, if $$u $$ does not belong to $$V(I)\cup V(J) $$, there are $$f\in I,g\in J $$ such that $$f(u),g(u)\neq0 $$, thus $$fg\in IJ $$ and $$(fg)(u)\neq0 $$, so $$V(IJ)=V(I)\cup V(J) $$

Quasi-affine varieties and their dimensions
$$ such that $$f=(f_1,\cdots,f_m)$$Consider now $$U \subseteq Y$$ and $$\varphi\in\mathcal O(U)$$ and define $$(f^*\varphi)(x)=\varphi(f(x))$$. Now, consider $$x\in f^{-1}(U)$$ and $$y=f(x)$$, then there is $$V\subseteq U$$ and polynomials $$p,q$$ such that $$V(q)\cap V=\O$$ and $$\varphi|_V=\frac{p}{q}\rightarrow f^*\varphi|_{f^{-1}(V)}=\frac{p(f)}{q(f)}$$Now, there are open neighborhoods $$D_1,\cdots,D_n$$ of $$x$$ and polynomials $$p_1,\cdots p_n,q_1,\cdots,q_n$$ such that $$V(q_i)\cap D_i=\O$$ and $$f_i|_{D_i}=\frac{p_i}{q_i}\rightarrow f=\left(\frac{p_1}{q_1},\cdots,\frac{p_n}{q_n}\right)\text{ in }D=D_1\cap\cdots\cap D_n$$So, in the open neighborhood $$f^{-1}(V)\cap D$$ of $$x$$ $$f^*\varphi|_{f^{-1}(V)\cap D}=\frac{p(f_1,\cdots,f_n)}{q(f_1,\cdots,f_n)}= \frac{p\left(\frac{p_1}{q_1},\cdots,\frac{p_n}{q_n}\right)}{q\left(\frac{p_1}{q_1},\cdots,\frac{p_n}{q_n}\right)} $$Finally, we just need to collect all the $$q_i $$ at denominator, so that we are left with a quotient of polynomials multiplied by powers (eventually negative) of $$q_i $$'s. The result is that, Given a morphism $$f $$ of varieties, this induces a morphism between structure sheaves$$f^*:\mathcal O_Y\rightarrow\mathcal f^\sharp\mathcal O_X,\qquad (f^\sharp\mathcal O_X)(U)=\mathcal O_X(f^{-1}(U)) ,\qquad f^*\varphi=\varphi\circ f $$On the other hand, a function $$f:X \rightarrow Y$$ with the previous property is a morphism of varieties, since$$f=(f^*\pi_1,\cdots,f^*\pi_m)$$where $$\pi_i:Y\rightarrow k$$ is the $$i$$-th projection (which is equal to the polynomial $$x_i$$, therefore $$\pi_i\in\mathcal O(X)$$). In particular, a morphism $$f:X\rightarrow k$$ is regular if and only if it induces a map $$f^*:\mathcal O_Y\rightarrow f^\sharp\mathcal O_X$$. In particular, we have a morphism $$\mathbf{Hom}_\text{Var}(X,Y):=\{\text{morphisms of varieties }X \rightarrow Y\}\rightarrow \mathbf{Hom}_{k\text{alg}}(\mathcal O(Y), \mathcal O(X))$$At the same time, to a morphism $$\varphi:\mathcal O(Y)\rightarrow\mathcal O(X)$$ we can associate the map $$\varphi_*=(\varphi\pi_1,\cdots,\varphi\pi_m)$$ which is a map $$X\rightarrow k^m$$. Suppose $$Y=V(\mathfrak p)$$, for some prime $$\mathfrak p$$, (so $$Y$$ is an affine variety) and take $$g\in\mathfrak p$$, then given $$u\in X$$ $$g\varphi_*(u)=g(\varphi\pi_1(u),\cdots,\varphi\pi_m(u))=\varphi(g(\pi_1,\cdots,\pi_m))(u)=0$$since $$g(\pi_1,\cdots,\pi_m)=0$$ (because $$g\in\mathfrak p$$, thus $$g|_Y=0$$ by definition). Thus $$\varphi_*$$ is a morphism $$X\rightarrow Y$$. Clearly $$(f^*)_*=f$$ (since the $$i$$-th coordinate of $$(f^*)_*$$ is $$f^*\pi_i=\pi_if=f_i$$). On the other hand, $$(\varphi_*)^*\pi_i=\pi_i\varphi_*=\varphi\pi_i$$which means that $$(\varphi_*)^*=\varphi$$, since $$\pi_i$$ generate $$\mathcal O(Y)$$ as a $$k$$-algebra. Thus Given a variety $$Y$$ and quasi-variety $$X$$, there is an isomorphism $$\mathbf{Hom}_\text{Var}(X,Y)\longrightarrow\mathbf{Hom}_{k\text{alg}}(\mathcal O(Y),\mathcal O(X))$$Notice that every $$\mathcal O(X)$$ is an integral domain (since it is isomorphic to $$R/\mathfrak p$$, where $$X=V(\mathfrak p)$$ and $$\mathfrak p$$ is prime) and a $$k$$-algebra of finite type. On the other hand, given a $$k$$-algebra of finite type that is a domain $$k[x_1,\cdots,x_n]\rightarrow A$$the kernel $$\mathfrak p$$ is a prime ideal (since the quotient by the kernel is isomorphic to $$A$$, an integral domain), therefore $$A\simeq k[x_1,\cdots,x_n]/\mathfrak p\simeq\mathcal O(V(\mathfrak p))$$ So Every $$k$$-algebra of finite type that is an integral domain is isomorphic to an algebra $$\mathcal O(X)$$, for some affine variety $$X$$. This proves (together with the previous result) that the category $$k\text{AffVar}$$ of affine varieties is equivalent to the category of domains of finite type over $$k$$. $$Both maps are clearly morphisms of varieties (in particular, they are continuous) and are inverse of one another, therefore $$V(\mathfrak r)\simeq X-V(f)$$. Now, $$X-V(f)$$ is the open subspace of an irreducible space, therefore it is irreducible as well and so is $$V(\mathfrak r)$$, thus $$\mathfrak r$$ is prime and $$V(\mathfrak r)$$ is an affine variety. A quasi-affine variety $$V(\mathfrak p)-V(f)$$ is isomorphic to an affine variety $$V(\mathfrak r)$$
 * Zariski topology on $$k^n$$. Consider an algebraically closed field $$k$$, then for every ideal $$I$$, we call $$V(I)$$ Zariski-closed (or z-closed). By the properties of the correspondence $$I\longmapsto V(I) $$ we proved before, the collection of z-closed subsets of $$k^n $$ form the closed sets of a topology on $$k^n $$, called Zariski topology.  Since $$k $$ is algebraically closed, the correspondence $$I\longmapsto V(I) $$ is 1-1 between z-closed subspaces and ideals in $$R $$ such that $$\sqrt I $$.
 * Noetherian spaces. A topological space $$T $$ is Noetherian if one of the following equivalent conditions is satisfied
 * There is no infinite descending chain of closed subspaces $$T_0\supset T_1\supset\cdots\supset T_n\supset \cdots $$
 * Every non-empty collection of closed subspaces has a $$\subseteq $$-minimal element
 * Every open subset is quasi-compact
 * In particular, a sequence $$T_0\supset T_1\supset\cdots\supset T_n\supset \cdots $$ corresponds to an increasing sequence $$I_0\subset I_1\subset\cdots\subset I_n\subset \cdots $$, which cannot exists, since $$k[x_1,\cdots,x_n] $$ is a Noetherian ring, therefore $$k^n $$ with the Zariski topology is a Noetherian topologica space.
 * Irreducible spaces. A topological space $$T $$ is irreducible if one of the following two conditions holds
 * If $$T=A\cup B $$, with $$A,B $$ closed subspaces, either $$A=T $$ or $$B=T $$
 * Every two non-empty open subspaces have non-empty intersection
 * Every non-empty open subspace is dense
 * An irreducible subspace is a closed subspace which is irreducible in the subspace topology. Given an irreducible subspace $$V$$ and $$I=\{f\in R:f(u)=0\text{ for all }u\in V\}$$then, if $$f,g$$ are two polynomials such that $$fg\in I$$, then $$(f)(g)=(fg)\subseteq I$$ and thus $$V\subseteq V(f)\cup V(g)$$, therefore, by irreducibility, either $$V=V(f)$$ or, equivalently, $$V=V(g)$$, which implies that, assuming the first case $$f(u)=0\text{ for all }u\in V\longrightarrow f\in I$$therefore $$I$$ is a prime ideal. On the other hand, suppose $$I$$ is prime and that $$V(I)=V(J)\cup V(K)=V(JK)$$, then $$JK\subseteq I$$. If $$J\not\subseteq I$$ and $$K\not\subseteq I$$, then there are $$f\in J,g\in K$$ not in $$I$$ such that $$fg\in I$$, contrary to $$I$$ being prime. Therefore irreducible subspaces corresponds to prime ideals.
 * Codimension. Given an irreducible subspace $$A$$ of a Noetherian space $$X$$, we define its codimension as $$\dim(A,X)=\sup\{k\in\mathbb N:\exists\text{chain }A=T_1\subset \cdots\subset T_k\subseteq X\text{ of irreducible spaces}\}$$The value of the codimension can also be infinite. The dimension of $$X$$ is $$\dim X=\sup\{\dim(A,X):A\text{ irreducible subspace}\}$$
 * Quasi-affine varieties. An affine algebraic variety is an irreducible, z-closed subspace $$Z\subseteq k^n$$. A quasi-affine algebraic variety is a non-empty, z-open subset of an affine variety. So, a quasi-affine variety is one in the form $$A\cap Z\neq\O$$with $$A$$ a z-open in $$k^n$$ and $$Z$$ is an affine variety. A function $$\phi:Z \rightarrow k$$, for $$Z$$ a quasi-affine variety, is regular at $$x\in Z$$ if there is a neighborhood $$U\ni z$$ in $$Z$$ and polynomials $$f,g\in k[x_1,\cdots,x_n]$$ such that $$V(g)\cap U=\O$$ and $$\left.\phi\right|_U=\frac{f}{g}$$If $$\phi$$ is regular at every point, we call $$\phi$$ regular. Let $$\mathcal O(Z)$$ be the ring of regular functions on $$Z$$. In particular, every polynomial $$f\in k[x_1,\cdots,x_n]$$ is regular and if $$V(f)\cap Z=\O$$, then $$1/f\in\mathcal O(Z)$$. Now consider the case $$Z=V(\mathfrak p)$$, for a prime ideal $$\mathfrak p$$, and take the correspondence $$k[x_1,\cdots,x_n]=R\ni f\longmapsto f|_Z\in\mathcal O(Z)$$Clearly the kernel of this map is the ideal of polynomials that are zero over $$Z$$, which is, by what was proved before, to be $$\sqrt{\mathfrak p}=\mathfrak p$$ (the radical of a prime ideal is the ideal itself). So, we have a 1-1 map $$R/\mathfrak p \rightarrow \mathcal O(Z)$$. This map is not only 1-1, but also onto, so $$R/\mathfrak p\simeq\mathcal O(Z)$$To prove it, consider $$\phi\in\mathcal O(Z)$$, then for every point $$\zeta\in Z$$ there is an open $$U_\zeta$$ and polynomials $$f_\zeta,g_\zeta$$ such that $$V(g_\zeta)\cap U_\zeta=\O$$ and $$\left.\phi\right|_{U_\zeta}=\frac{f_\zeta}{g_\zeta}$$Since $$Z$$ is a subspace of a Noether space, it is Noether space itself and it is compact, so there are $$U_1,\cdots,U_\kappa$$ such that $$Z=U_1\cup\cdots\cup U_\kappa$$. Now, by definition $$\frac{f_i}{g_i}=\phi|_{U_i\cap U_j}=\frac{f_j}{g_j}\longrightarrow f_ig_j=g_if_j$$on the open subspace $$U_i\cap U_j$$. But, an open subspace of an irreducible space is dense, therefore $$f_ig_j=g_if_j$$ on all $$Z$$. By definition, every point $$z\in Z$$ belongs to the complement of some $$V(g_j)$$, therefore $$Z\cap\bigcap_j V(g_j)=V(\mathfrak p+(g_1)+\cdots+(g_\kappa))=\O$$But, by Hilbert's Nullstellensatz, if the ideal $$\mathfrak p+(g_1)+\cdots+(g_\kappa)$$ is proper, it would have a zero, contrary to the last equation, therefore it must be equal to $$R=k[x_1,\cdots,x_n]$$, so there is are $$a_1,\cdots,a_\kappa\in R,h\in\mathfrak p$$ such that $$a_1g_1+\cdots+a_\kappa g_\kappa +h=1$$which means that $$a_1g_1+\cdots+a_\kappa g_\kappa=1$$ over $$Z$$. Now, consider the polynomial $$f=a_1f_1+\cdots+a_\kappa f_\kappa $$, then for every $$j$$ and $$x\in U_j$$ $$g_j(x)\phi(x)=f_j(x)=\sum_i f_j(x)a_i(x)g_i(x)=\sum_ia_i(x)g_j(x)f_i(x)=g_j(x)\sum_i a_i(x)f_i(x)=g_j(x)f(x)$$so, since $$g_j(x)\neq0$$, we conclude that $$\phi(x)=f(x)$$ and, since the same can be done for every $$x\in Z$$, we conclude that $$\phi=f$$ in $$Z$$, proving surjectivity.
 * Morphism of varieties. Consider two quasi-affine varieties $$X\subseteq k^n,Y\subseteq k^m$$, then a function $$f:X\rightarrow Y$$ is a morphism of varieties if there are $$f_1,\cdots,f_m\in\mathcal O(X)
 * Isomorphism of affine and quasi-affine varieties. Consider an affine variety $$X=V(\mathfrak p)\subseteq k^n$$ and $$f\in R=k[x_1,\cdots,x_n]$$, then $$X-V(f)$$ is a quasi-affine variety defined as the locus of zeros of $$\mathfrak p$$ which are not zeros for $$f$$. Consider now the ideal $$\mathfrak r\subseteq k[x_1,\cdots,x_n,t]$$generated by $$\mathfrak p$$ and $$1-tg$$, where $$g(x_1,\cdots,x_n)$$ is a polynomial such that $$g\equiv f\text{ mod}\mathfrak p$$. Consider now the two maps $$V(\mathfrak r)\rightarrow X-V(f),\qquad (x_1,\cdots,x_n,t)\mapsto (x_1,\cdots,x_n)$$and $$X-V(f)\rightarrow V(\mathfrak r),\qquad (x_1,\cdots,x_n)\mapsto\left(x_1,\cdots,x_n,\frac{1}{g(x_1,\cdots,x_n)}\right)
 * In particular, consider a quasi-affine variety $$X=V(\mathfrak p)-V(\mathfrak r)$$ (by definition a quasi affine variety is the complement in an affine variety of an affine variety). For a point $$x\in X$$ there is a $$f\in\mathfrak r$$ such that $$f(x)\neq0$$, so $$x\in V(\mathfrak p)-V(f)\subseteq X$$and $$V(\mathfrak p)-V(f)$$ is isomorphic to an affine variety, thus Every point of a quasi-affine variety has a neighborhood isomorphic to an affine variety.

Spectrum and localization
\mathbf{Spec}R_\mathfrak p=\{(0)\}$$clearly the condition $$\mathfrak r\cap S=\O$$ is equivalent to $$\mathfrak{r\subseteq p}$$, so In an absolutely flat ring, there is no strict inclusion between prime ideals.    Suppose that every prime ideal is maximal. Given a prime ideal $$\mathfrak p\hookrightarrow R/\mathfrak N$$, we have the following chain of morphisms $$\mathbf{Spec}(R/\mathfrak N)_\mathfrak p\hookrightarrow \mathbf{Spec}R/\mathfrak N\longrightarrow^{\pi^*
 * Spectrum of a ring. Given a ring $$R$$, let $$\mathbf{Spec}R$$ be the collection of prime ideals in $$R$$, while let $$\mathbf{mSpec}R$$ be the collection of the maximal ideals. On $$\mathbf{Spec}R$$ we define the Zariski topology with closed spaces$$V(I)=\{\mathfrak p\in\mathbf{Spec}R:I\subseteq\mathfrak p\}$$for $$I$$ a generic ideal of $$R$$. Given a multiplicative set $$S$$ (i.e. $$1\in S$$ and $$s,t\in S \rightarrow st\in S$$), let $$S^{-1}R$$ be the localization of $$R$$ at $$S$$. We denote by $$f^{-1}R$$ the localization at $$S=\{1,f,\cdots,f^n,\cdots\}$$.
 * Absolutely flat rings. Let $$R$$ be absolutely flat (that is, for every $$x$$ there is $$a$$ such that $$x=ax^2$$). If $$R$$ is local, then $$x(1-ax)=0$$implies that either $$x$$ is a unit or that $$x$$ belongs to the unique maximal ideal $$\mathfrak m$$ of $$R$$, which implies that $$(1-ax)\notin\mathfrak m$$, which means that $$(1-ax)$$ is a unit and $$x=0$$, so An absolutely flat, local ring is a field.  In particular, if $$S$$ is a multiplicative subset, then $$S^{-1}R$$ is absolutely flat, so if we take $$S=R-\mathfrak p$$, we have that $$R_\mathfrak p=S^{-1}R$$ is an absolutely flat, local ring, therefore it is a field. So If $$R$$ is absolutely flat, then $$R_\mathfrak p$$ is a field, for every prime ideal $$\mathfrak p$$. On the other hand, $$((x)/(x^2))_\mathfrak p=(x)_\mathfrak p/(x^2)_\mathfrak p=0$$where the first equality comes from the isomorphism $$(M/N)_\mathfrak p\simeq M_\mathfrak p/ N_\mathfrak p$$, for $$R$$-modules $$M,N$$. In particular, $$( x)_\mathfrak p,(x^2)_\mathfrak p$$ are ideals in $$R_\mathfrak p$$, which is a field, so they are equal and their quotient zero. So $$((x)/(x^2))_\mathfrak p=0$$which implies $$(x)/(x^2)=0\rightarrow (x)=(x^2)$$. So $$R$$ is absolutely flat if and only if $$R_\mathfrak p$$ is a field, for every prime $$\mathfrak p$$.   Consider the canonical map $$j:R\longrightarrow S^{-1}R$$, the induced map $$j_*:\mathbf{Spec}S^{-1}R\longrightarrow\{\mathfrak p\in\mathbf{Spec}R|\mathfrak p\cap S=\O\}$$this map has an inverse, sending $$\mathfrak p$$ into $$S^{-1}\mathfrak p=\{\tfrac{r}{s}|r\in\mathfrak p,s\in S\}$$ (which is a prime ideal). The two maps are inverses of each other, thus they are 1-1 onto. In particular, consider $$R$$ absolutely flat and $$S=X-\mathfrak p$$, with $$\mathfrak p$$ prime, then $$\{\mathfrak r\in\mathbf{Spec}R|\mathfrak r\cap S=\O\}\simeq

}\mathbf{Spec}R $$the second map is an homeomorphism (easy to prove). The first map has image the prime ideals in $$R/\mathfrak N $$ contained in $$\mathfrak p $$, which are in 1-1 correspondence with the prime ideals contained in $$\pi^*(\mathfrak p) $$. But, by hypothesis, every prime ideal is maximal, thus $$\mathbf{Spec}(R/\mathfrak N)_\mathfrak p $$ has a unique element $$\mathfrak r=\left\{\frac{r}{s}|r\in\mathfrak p,s\notin\mathfrak p\right\} $$But, this means that the nilradical of $$(R/\mathfrak N)_\mathfrak p $$ is $$\mathfrak r $$ (since the nilradical is the intersection of all prime ideals), but the nilradical of $$A_\mathfrak m $$ is $$\mathfrak M_\mathfrak m $$, for $$\mathfrak M $$ the nilradical of $$A $$. In this case $$A=R/\mathfrak N\rightarrow\mathfrak M=0\rightarrow \mathfrak r=\mathfrak M_\mathfrak p=0 $$so $$(0) $$ is the unique prime ideal and $$(R/\mathfrak N)_\mathfrak p $$ is a field, for every prime $$\mathfrak p $$, so $$R/\mathfrak N $$ is absolutely flat. Since $$\mathbf{Spec}R\simeq\mathbf{Spec}(R/\mathfrak N) $$, we can assume that our ring has $$\mathfrak N=0 $$ and is thus absolutely flat. Then for $$f\in R $$ there is $$a\in R $$ such that $$f(1-af)=0 $$so $$V(f)\cap V(1-af)=\O $$ and $$V(f)\cup V({1-af})=\mathbf{Spec}R $$, so if the quotient $$R/\mathfrak N $$ is absolutely flat, then $$\mathbf{Spec}R  $$ is Hausdorff and totally disconnected. $$ and define $$T(M) $$, called torsion submodule, as the submodule of elements $$v\in M $$ such that $$\mathfrak{ann}v $$ is non zero. A module such that $$T(M)=0 $$ is called torsion free and $$M/T(M) $$ is one such modules. $$ such that $$B $$ is a flat $$A $$-algebra. Consider the following exact sequence $$0\longrightarrow \mathbf{ker}j\longrightarrow M\longrightarrow^jB\otimes_AM $$Tensoring with $$B $$ we still have an exact sequence (since $$B $$ is flat) $$0 \longrightarrow B\otimes\mathbf{ker}j\longrightarrow B\otimes M\longrightarrow^{1\otimes j}B\otimes B\otimes M $$but $$1\otimes j $$ is 1-1, since it has a retraction $$a\otimes b\otimes v\longmapsto ab\otimes v $$, so $$B\otimes\mathbf{ker}j\simeq\mathbf{ker}(1\otimes j)=0 $$. So, For a flat $$A $$-algebra $$B  $$, we have that the map $$j:M\rightarrow B\otimes_AM  $$ is 1-1 if and only if $$B\otimes_AM=0  $$ implies $$M=0  $$. On the other hand, suppose $$M\rightarrow B\otimes M $$ is 1-1, for every $$A $$-module $$M $$. Consider $$\mathfrak p $$ prime, then $$A\rightarrow^i B/\mathfrak pB=A\rightarrow^{\pi}A/\mathfrak p\rightarrow^j B\otimes A/\mathfrak p\simeq B/\mathfrak pB $$But $$j $$ is 1-1, so the kernel of $$i $$ (which is equal to $$\rho^{-1}(B\mathfrak p) $$) is equal to the kernel of $$\pi $$, so $$\mathfrak p=\rho^{-1}(B\mathfrak p) $$So if the map $$j:M\rightarrow B\otimes_AM $$ is 1-1, then $$\mathfrak p=\rho^{-1}(B\mathfrak p)  $$, for every prime ideal $$\mathfrak p\hookrightarrow A  $$. Now we show that $$\mathfrak p=\rho^{-1}(B\mathfrak p) $$ implies $$\mathfrak p=\rho^{-1}(\mathfrak r)  $$, for some $$\mathfrak r\in\mathbf{Spec}B  $$: Take $$S=\rho(A-\mathfrak p)\hookrightarrow B $$, then there is a prime ideal $$\mathfrak r\hookrightarrow B $$ disjoint from $$\rho(A-\mathfrak p) $$ and containing $$B\mathfrak p $$, so $$\mathfrak p\subseteq\rho^{-1}(\mathfrak r) $$ and $$\rho^{-1}(\mathfrak r)\cap(A-\mathfrak p)=\O $$, so $$\mathfrak p=\rho^{-1}(\mathfrak r) $$ and $$\rho^*:\mathbf{Spec}B\rightarrow\mathbf{Spec}A $$is onto. Now, clearly this implies that for every maximal ideal $$\mathfrak m $$, we have $$B\mathfrak m\subset B $$ (otherwise, for a prime ideal $$\mathfrak r\in(\rho^*)^{-1}(\mathfrak m) $$, it would imply that $$B=B\mathfrak m\subseteq\mathfrak r $$), so if $$\rho^* $$ is onto, then $$B\mathfrak m\subset B  $$ for every maximal ideal $$\mathfrak m  $$. Finally, suppose for a maximal ideal $$\mathfrak m $$, we have $$B\mathfrak m\subset B $$. Take a non zero $$v\in M $$, we have the following exact sequence $$0 \longrightarrow \mathfrak{ann}v\longrightarrow \mathfrak m\longrightarrow M $$where $$\mathfrak m $$ is a maximal ideal containing $$\mathfrak{ann}v $$ and the last map is $$a\mapsto av $$. Tensoring with $$B $$ we still have the exact sequence $$0 \longrightarrow B(\mathfrak{ann}v)\longrightarrow B\mathfrak m\longrightarrow B\otimes M $$if $$B\otimes M=0 $$, then $$B(\mathfrak{ann}v)= B\mathfrak m $$. But, $$B(\mathfrak{ann}v)= \mathfrak{ann}(1\otimes v)=B $$ (since $$1\otimes v=0$$), implying $$B\mathfrak m=B $$, absurd, so $$B\otimes_AM $$ is non zero. Therefore, ''if $$B\mathfrak m\subseteq B $$ for every maximal ideal $$\mathfrak m $$, then $$B\otimes_AM=0 $$ implies $$M=0 $$, for every $$A $$-module $$M $$''. If any of the previous equivalent conditions is verified by a flat $$A $$-algebra $$B $$, then we say that $$B $$ is a faithfully flat $$A $$-algebra.
 * Torsion module. Consider a module $$M
 * Faithfully flat rings. Consider $$\rho:A\rightarrow B

A_\mathfrak p$$therefore the fiber $$(f^*)^{-1}(\mathfrak p)$$ is homeomorphic to $$\mathbf{Spec}$$ of $$B_\mathfrak p/\mathfrak pB_\mathfrak p\simeq(B_\mathfrak p)\otimes_{A_\mathfrak p}k(\mathfrak p)\simeq (B\otimes_AA_\mathfrak p)\otimes_{A_\mathfrak p}k(\mathfrak p)\simeq B\otimes_A k(\mathfrak p)$$(where $$k(\mathfrak p)$$ is the residue field of $$A_\mathfrak p$$). Therefore, given a morphism $$A\rightarrow B$$, we call $$\mathbf{Spec}(B\otimes_Ak(\mathfrak p))$$ the fiber of $$f^*$$ over $$\mathfrak p$$.
 * Fibers. Consider a morphism $$f:A\rightarrow B$$ and a prime ideal $$\mathfrak p$$, then let $$B_\mathfrak p$$ be the localization at $$f(A-\mathfrak p)$$, so the map $$f^*$$ restricts to a map $$\mathbf{Spec}B_\mathfrak p\longrightarrow\mathbf{Spec}A_\mathfrak p$$(where we can identify $$\mathbf{Spec}A_\mathfrak p$$ with the ideals in $$\mathbf{Spec}A$$ contained in $$\mathfrak p$$). Now, given a morphism $$f:A\rightarrow B$$ and an ideal $$I$$, then the morphism $$f^*$$ restricts to $$\mathbf{Spec}B/BI\longrightarrow\mathbf{Spec}A/I$$(where we can identify $$\mathbf{Spec}A/I$$ with the ideals in $$\mathbf{Spec}A$$ containing $$\mathfrak p$$). Therefore, the map $$f^*:A\rightarrow B$$ restricts to a map $$\mathbf{Spec}B_\mathfrak p/\mathfrak pB_\mathfrak p\longrightarrow\mathbf{Spec}A_\mathfrak p/\mathfrak p

Grassmanian Manifold
\vdots\\ x^n\end{pmatrix}$$has rank $$k+1$$, meaning that the minors of order $$k+1$$ don't all have zero determinant$$\mathbb G_{n,k} \longrightarrow \mathbb P^{\binom{n+1}{k+1}-1},\qquad X\longmapsto[p_{i_0,\cdots,i_k}]$$where $$p_{i_0,\cdots,i_k}$$ is the minor of the previous matrix from the columns $$i_0<\cdots<i_k$$ (picking different points only changes the matrix by a constant factor, resulting in the same point in the projective space).
 * Grassmanian coordinates. Let $$\mathbb G_{n,k}$$ be the collection of $$k$$-dimensional subspaces of $$\mathbb P^n$$. From $$V\in\mathbb G_{n,k}$$ we take $$k+1$$ points $$x^j=[x^j{}_i]$$ which generate the subspace, then the matrix $$\begin{pmatrix}x^1\\

Sheave and Schemes

 * Sheaves. Given a functor $$p:C\rightarrow D$$, this induces a map $$p_*:[D,\mathbf{Set}]\rightarrow[C,\mathbf{Set}]$$ given by precomposition with $$p$$. Now, given an object $$d\in D$$ we define the category $$p/d$$ with objects the pairs $$(c,p(c)\rightarrow d)$$with a morphism $$(c,\phi)\rightarrow(e,\chi)$$ is a morphism $$f:c\rightarrow e$$ such that $$\chi\circ p(f)=\phi$$. Now, given a copresheaf $$\mathcal F:C\rightarrow \mathbf{Set}$$, we define the following diagram $$\mathcal F\circ\pi:p/d\rightarrow C\rightarrow\mathbf{Set}$$(where $$\pi$$ is the projection $$p/d\rightarrow C$$ onto the first component). Since $$\mathbf{Set}$$ is complete, assuming that the categories involved are small enough, the following definition makes sense$$(p^*\mathcal F)(d)=\text{colim}\mathcal F\circ\pi$$The functor $$p^*$$ is called inverse image functor. Now, given a natural transformation $$\delta:\mathcal G \rightarrow p_*\mathcal F$$ we can define for each $$d\in D$$ a cone $$\mathcal G\circ\pi\rightarrow \mathcal F(d)$$ by sending $$(c,\phi)$$ to the map $$\mathcal F(\phi)\circ\delta_c:\mathcal G(c)\rightarrow\mathcal F(p(c))\rightarrow \mathcal F(d)$$it easy to prove from the definition of morphism in $$p/d$$ that this is a cone, therefore there is a unique lift to a map $$(p^*\mathcal G)(d)\rightarrow\mathcal F(d)$$, with this is easy to prove that $$p^*:[C,\mathbf{Set}]\rightarrow[D,\mathbf{Set}]$$ extend to a functor which is a left adjoint to $$p_*$$.On the same vein, define the category $$d/p$$ and $$(p_!\mathcal F)(d)=\text{lim}\mathcal F\circ\pi$$where $$\pi:d/p\rightarrow C$$ is the projection like the one above. The functor $$p_!$$ is right adjoint to $$p_*$$, so that we have the following triple of adjunction $$p^*\dashv p_*\dashv p_!:[C,\mathbf{Set}]\rightarrow[D,\mathbf{Set}]$$we call this an effective geometric morphism between $$[C,\mathbf{Set}]$$ and $$[D,\mathbf{Set}]$$.
 * Geometric morphism for presheaves on topological spaces. Consider the case of a continuous map $$f:X\rightarrow Y$$ and set $$[X,\mathbf{Set}]:=[O(X)^{op},\mathbf{Set}]$$(with $$O(X)$$ the topology of the space $$X$$). The map $$f$$ induces a functor $$f^{-1}:O(Y)\rightarrow O(X)$$ between the categories of open subsets. This, in turn, define first a functor $$f_*:[X,\mathbf{Set}]\rightarrow[Y,\mathbf{Set}]$$and then, by the above construction (and the fact that $$O(X)$$ is always small, for every space), we other two functors, namely $$f_!,f^*$$. By unraveling the definition above, the two functors are defined as $$f^*\mathcal F:U\mapsto\text{colim}_{f(U)\hookrightarrow V}\mathcal F(V) $$In particular, we can induce another adjunction $$\mathbf{Sh}(X)\rightarrow\mathbf{Sh}(Y) $$ by restricting $$f_* $$ to $$\mathbf{Sh}(X) $$ ($$f_* $$ preserve sheaves), while restricting $$f^* $$ to $$\mathbf{Sh}(Y) $$ and the map $$f^*\mathcal F $$ to its associated sheaf.  In particular, given a point $$x:*\rightarrow X $$, we call $$x_*:\mathbf{Set}\rightarrow\mathbf{Sh}(X) $$ the skyscraper functor, while we call the functor $$x^*:\mathbf{Sh}(X)\rightarrow\mathbf{Set} $$ is called the stalk functor at $$x $$, we also indicate $$\mathcal F_x:=x^*(\mathcal F) $$.
 * Scheme. Consider a commutative ring $$A $$ and the corresponding spectrum $$\mathbf{Spec}A $$. Let $$A_\mathfrak p $$, for a point $$\mathfrak p\in\mathbf{Spec}A $$, the localization at the complement of $$\mathfrak p $$. Given $$U\subseteq \mathbf{Spec}A $$ open, we define $$\mathcal O(U) $$ as the space of the sections $$s $$ of the map $$\coprod_{\mathfrak p\in U}A_\mathfrak p\rightarrow U $$sending $$A_\mathfrak p $$ to $$\mathfrak p $$, such that for each there is a cover $$\{U_i\hookrightarrow U\}_i $$ and $$a_i\in A $$ and $$f_i\in A $$ such that $$f_i\notin\mathfrak p $$ for every $$\mathfrak p\in U_i $$ and $$s:\mathfrak p\longmapsto \frac{a_i}{f_i}\in A_\mathfrak p $$We call the pair $$(\mathbf{Spec}A,\mathcal O) $$ a spectrum. A ringed space is a pair $$(X,\mathcal O) $$ made of a topological space $$X $$ and a sheaf of rings $$\mathcal O\in \mathbf{Sh}(X) $$, then every affine scheme is a ringed space. A morphism of ringed spaces $$(X,\mathcal O_X)\rightarrow(Y,\mathcal O_Y) $$ is a continuous function $$f:X\rightarrow Y $$ and a sheaf homomorphism $$f^\sharp:\mathcal O_Y\rightarrow f_*\mathcal O_X $$The space $$(X,\mathcal O) $$ is called locally ringed space if the stalk $$\mathcal O_x $$ at every $$x\in X $$ is a local ring. A morphism of locally ringed spaces is a morphism of ringed spaces, such that, for each $$x\in X $$, the induced map on stalks $$\mathcal O_{Y,f(x)}\rightarrow\mathcal O_{X,x} $$is a map of local rings (that is, counterimage of the maximal ideal in $$\mathcal O_{X,x} $$ is the maximal ideal in $$\mathcal O_{Y,f(x)} $$). A ringed space $$(X,\mathcal O) $$ is an affine scheme if $$(X,\mathcal O)\simeq(\mathbf{Spec}A,\mathcal O_{\mathbf{Spec}A}) $$for some ring $$A $$. We call $$\mathcal O $$ the structure sheaf. Given a spectrum $$(\mathbf{Spec}A,\mathcal O)$$, notice there is a map, for every $$U$$ containing $$\mathfrak p$$$$\mathcal O(U)\rightarrow A_\mathfrak p,\qquad s\mapsto s(\mathfrak p)$$this map induces a morphism $$\mathcal O_\mathfrak p\rightarrow A_\mathfrak p$$ which is onto: For every $$a/f\in A_\mathfrak p$$, with $$f\notin \mathfrak p$$, take $$U=D(f)$$, then $$f\notin\mathfrak q$$ for every $$\mathfrak q\in U$$, by definition, so define $$s\in\mathcal O(U)$$ as constant $$=a/f\in A_\mathfrak q$$, then $$s(\mathfrak p)=a/f$$, proving surjectivity. As per injectivity, if $$s(\mathfrak p)=a/f=0$$, for $$s\in\mathcal O(U)$$, then there is $$g\notin \mathfrak p$$ such that $$gf=0$$, but then take $$V=D(g)\cap U'$$ (since $$g\notin \mathfrak p \rightarrow \mathfrak p\in D(g)$$, so $$\mathfrak p\in V$$), where $$U'$$ is an open neighborhood of $$\mathfrak p$$ such that $$s=a/f$$ in $$U'$$, thus $$g\notin \mathfrak q$$ for every $$\mathfrak q\in V$$, and so $$a/f=0$$ in every $$A_\mathfrak q$$. So $$\mathcal O_\mathfrak p\simeq A_\mathfrak p$$  In particular, notice that $$A_\mathfrak p$$ is a local ring, therefore $$\mathcal O_\mathfrak  p$$ is a local ring and $$(\mathbf{Spec}A,\mathcal O)$$ is a locally ringed space.   A scheme is a locally ringed space $$(X,\mathcal O) $$ for which there is a cover $$\{U_i\hookrightarrow X\}_i $$ such that $$(U,\mathcal O|_U) $$ is an affine scheme.