----
Let $\mathsf{CRing}$ denote the [[category]] of [[commutative ring|commutative]] [[ring|rings]] and $\mathsf{Top}$ denote the [[category]] of [[topological space|topological spaces]]. Let $\mathsf{Aff}$ denote the [[category]] of [[affine scheme|affine schemes]]. For an [[affine scheme]] $\text{Spec }A$, $\mathcal{O}_{\text{Spec }A}$ denotes its [[structure sheaf on a ring spectrum|structure sheaf]].
> [!definition] Definition. ([[spec functor]])
> The [[contravariant functor]] $\mathsf{CRing} \to \mathsf{Top}$ defined [[prime ideal|here]] can be upgraded to a [[contravariant functor]] $\text{Spec}:\mathsf{CRing} \to \mathsf{Aff}$:
>
> **Objects.** A [[ring]] $A$ is sent to $(\text{Spec }A, \mathcal{O}_{\text{Spec }A})$.
>
> **Morphisms.** A [[ring homomorphism]] $A \xrightarrow{\varphi}B$ induces a [[morphism of locally ringed spaces]] $\text{Spec } \varphi=(f, f^{\sharp}): (\text{Spec } B, \mathcal{O}_{\text{Spec } B}) \to (\text{Spec }A, \mathcal{O}_{\text{Spec }A})$
> as follows.
> - The [[continuous|topological map]] $f:\text{Spec } B \to \text{Spec }A$ is given [[prime ideal|as before]] by [[contraction of an ideal|contraction]]: $f:=\varphi ^{-1}(\cdot)$.
>
> - To define the [[morphism of (pre)sheaves|sheaf morphism]] $f^{\sharp}:\mathcal{O}_{\text{Spec }A} \to f_{*}\mathcal{O}_{\text{Spec } B}$, first note that any $\mathfrak{p} \in \text{Spec }B$ gives rise to a natural [[homomorphism of local rings|local]] [[ring homomorphism]] $\varphi_{\mathfrak{p}}:A_{f(\mathfrak{p})} \to B_{\mathfrak{p}}$ making the following diagram commute:
>
> ```tikz
> \usepackage{tikz-cd}
> \usepackage{amsmath}
> \usepackage{amsfonts}
> \begin{document}
> % https://tikzcd.yichuanshen.de/#N4Igdg9gJgpgziAXAbVABwnAlgFyxMJZARgBoAGAXVJADcBDAGwFcYkQBBEAX1PU1z5CKAEwVqdJq3YAhHnxAZseAkTLEJDFm0ScA+sAA6hhgCc0ACywA9YAFpi3ABTGAtvRwWAZqfoBrYDRuAEpueX5lISIxDRotaV0ZAzcPb18AoLDeCMFVFHJxOKkdEGMzSxt7RxdDd08ff0CQ8MUBFWFkAtjJbXYy+nMrWwdnFPr0puCAAg5kkwGKqeHqsbTGoNCWpVyOgGZSbviS1YaM7imko1rU06ashW32on2qIt7dE4mgngkYKABzeBEUA+CCuJAFEA4CBIMg9BKleaDLAtUHgxBiKEwxD7eHHJEVOZ1NZnMI0Rj0ABGMEYAAU2lFdKYsP8LDhUaYwRCaNCkCJsiA0bCedjdgKhYgACwi7kgCwwehQdiQMBsclYVXsKAQHA4P4gclUmn0yJ5EAa7CwA14vqGODMSlwGDs8Wc9EAVhlGJo8sVyoIapAjA1JW1uv1bwRxntjud1op1LpDLNFqwVtdXMQAHYvXDfUrdCrA8HNbow3qlYbEyaduxU1bI-j7WgnS6FBLcbzEAA2H0KgvgAPxkNanUV+NGpOm4TmsCWwNHW3N1s-bhAA
> \begin{tikzcd}
> \varphi^{-1}(\mathfrak{p}) \arrow[r, "\subset" description, no head, dotted] & A \arrow[r, "\varphi"] \arrow[d] & B \arrow[d] & \mathfrak{p} \arrow[l, "\supset" description, no head, dotted] \\
> \varphi^{-1}(\mathfrak{p}) A_{\varphi ^{-1}(\mathfrak{p})} \arrow[r, "\subset" description, no head, dotted] & A_{\varphi^{-1}(\mathfrak{p})} \arrow[r, "\varphi_{\mathfrak{p}}"'] & B_{\mathfrak{p}} \arrow[r, "\supset" description, no head, dotted] & \mathfrak{p} B_{\mathfrak{p}}
> \end{tikzcd}
> \end{document}
> ```
>
> Explicitly, $\varphi_{\mathfrak{p}}\left( \frac{a}{s} \right)=\frac{\varphi(a)}{\varphi(s)}$. Then define $\begin{align}
> f^{\sharp}_{V}: \mathcal{O}_{\text{Spec } A}(V) &\to \mathcal{O}_{\text{Spec } B}\big( f ^{-1}(V) \big) \\
> \big(\mathfrak{p} \in V \mapsto s(\mathfrak{p} ) \in A_{\mathfrak{p}}\big) &\mapsto \big( \mathfrak{q} \in f ^{-1} (V) \mapsto \varphi_{\mathfrak{p}}(s(f(\mathfrak{q}))) \in B_{\mathfrak{q}} \big).
> \end{align}$
> ![[Pasted image 20250506104558.png]]
>
> We further have $f^{\sharp}_{\mathfrak{p}}= \varphi_{\mathfrak{p}},$
> a [[homomorphism of local rings]].
- [ ] extract the relevant parts of [[the category of affine schemes is dual to that of rings]] here
----
####
> [!basicproperties]
> - For $\varphi:A \to B$ and $g \in A$, $(\text{Spec }\varphi)^{-1}\big( D(g) \big)= D\big( \varphi(g) \big)$
> as [[subscheme|open subschemes]].
^properties
> [!proof] Proof of Basic Properties.
> Notation switch: $g$ is now $f$. Sorry.
Topologically one has $\begin{align}
(\text{Spec } \varphi)^{-1} \big( D(f) \big)&= \{ \mathfrak{b} \in \text{Spec } B: \varphi ^{-1}(\mathfrak{b}) \in D(f) \} \\
&= \{\mathfrak{b} \in \text{Spec }B: \varphi ^{-1}(\mathfrak{b}) \not \ni f \} \\
&= \{ \mathfrak{b} \in \text{Spec } B : \mathfrak{b} \not \ni \varphi(f)\} \\
&= D\big( \varphi(f)\big).
\end{align}$
> - [ ] checking what is going on at the level of schemes?
^proof
----
#### References
> [!backlink]
> ```dataview
> TABLE rows.file.link as "Further Reading"
> FROM [[]]
> FLATTEN file.tags as Tag
> WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom"
> GROUP BY Tag
> ```
> [!frontlink]
> ```dataview
> TABLE rows.file.link as "Further Reading"
> FROM outgoing([[]])
> FLATTEN file.tags as Tag
> WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom"
> GROUP BY Tag
> ```