----
> [!definition] Definition. ([[sheaf of rational functions]])
> Let $X$ be a [[scheme]]. We define the **sheaf of rational functions on $X$**, $\mathcal{K}_{X}$, to be the [[sheaf]] [[sheafification|associated to]] the [[presheaf]][^1] $U \mapsto S(U)^{-1} \Gamma(U, \mathcal{O}_{X}),$
> where the [[multiplicative subset of a ring|multiplicative set]] $S(U) \subset \Gamma(U,\mathcal{O}_{X})$ is the subset of elements of $\Gamma(U, \mathcal{O}_{X})$ whose [[(pre)sheaf stalk|germs]] in $\mathcal{O}_{X ,x}$ are non-[[zero-divisor|zero-divisors]] in $\mathcal{O}_{X, x}$, for each $x \in U$: $S(U):= \{ s \in \Gamma(U, \mathcal{O}_{X}): s_{x} \notin \text{zero-divisors}\big( \mathcal{O}_{X, x} \big) \text{ for all }x \in U\}.$
>
>
[^1]: The restriction maps are induced in the evident way. Namely, if $V \subset U$, then the $\mathcal{O}_{X}$ restriction map $\Gamma(U, \mathcal{O}_{X}) \xrightarrow{\text{res}_{UV}} \Gamma(V, \mathcal{O}_{X})$ induces a map $\begin{align}
S(U) ^{-1}\Gamma(U, \mathcal{O}_{X}) &\to S(V) ^{-1} \Gamma(V, \mathcal{O}_{X}) \\
\frac{a}{ s} & \mapsto \frac{\text{res}_{UV}(a)}{\text{res}_{UV}(s)},
\end{align}$
where $\text{res}_{UV}(s) \in S(V)$ (and so we can divide) because its germ is still $s_{x}$ and the restriction respects equivalence in localizations.
> [!basicexample] The most important example.
>
If $X$ is [[integral scheme|integral]], then $\mathcal{K}_{X}$ is the [[constant sheaf]] valued in the [[generic point of an integral scheme|function field]] $K(X)$. [[constant sheaf#^bea7f6|Because]] $X$ is irreducible (it's integral), this takes the form: $\mathcal{K}_{X}(U)=\begin{cases}
K(X) & U \neq \emptyset ; \\
0 & U = \emptyset.
\end{cases}$
Let $\eta$ be the unique [[generic point of an integral scheme|generic point]] of $X$. There is a [[ring isomorphism]] $\begin{align}
S(U) ^{-1} \Gamma(U , \mathcal{O}_{X})& \xrightarrow{\sim} K(X) \\
\frac{a}{b}&\mapsto a_{\eta} b _{\eta} ^{-1}
\end{align}$
This means at the [[presheaf]] level: $\mathcal{K}_{X}^{\text{pre}}(U) \cong K(X)$
and since $X$ is [[irreducible topological space|irreducible]] (see the examples in [[constant sheaf]]) the result follows.
----
####
Scratch:
Indeed, let $U \subset X$. The [[(pre)sheaf stalk|stalks]] $\mathcal{O}_{X, x}$ are [[integral domain|integral domains]], hence $S(U)=\{ s \in \Gamma(U, \mathcal{O}_{X}): s _{x} \neq 0 \text{ for all } x \in U \}.$
Now suppose $s \in \Gamma(U, \mathcal{O}_{X})$ is such that $s_{x}=0$ for some $x \in U$, i.e., there exists some open $V \subset U$ such that $s |_{V}=0$. Since $X$ is [[irreducible topological space|irreducible]] (it is [[integral scheme|integral]]), $V$ is [[dense]] in $U$. This implies $s_{y}=0 \in \mathcal{O}_{X,y}$ for all $y$: given $s_{y}=[W \ni y, s]$,
This means that if $[W \ni y,s]$ is a [[(pre)sheaf stalk|germ]] in $\mathcal{O}_{X, y}$, $y \in U$, that $V \cap W$
----
#### 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
> ```