Krull dimension vs. Dimension in Zariski topology for a field that is not algebraically closed I'm new to algebraic geometry and struggle with the notion of the dimension of an affine variety. In Robin Hartshorne's book Algebraic Geometry the dimension is introduced using the Zariski topology:
 Definition: Let $X$ be a topological space, we define its dimension as the supremum over all integers $n$ s.t. there exists an ascending chain of closed irreducible components (w.r.t. the topology) $Z_0 \subset Z_1 \subset \dots \subset Z_n\subseteq X$. The dimension of an affine variety is then defined to be the dimension as its topological space.
Then he shows that for an affine variety $V \subseteq K^n$ the Krull dimension of the coordinate ring $K[x]/\mathcal{I}(V)$ (defined as the supremum of heights of prime ideals) equals the dimension of $V$ as defined above.
Question 1: My understanding is that Hartshorne assumes the field $K$ to be algebraically closed throughout the book and I'm wondering whether this particular result changes when using e.g. $K=\mathbb{R}$. My understanding from quickly going through section 3.3 in https://perso.univ-rennes1.fr/michel.coste/polyens/SAG.pdf is that this should indeed hold. Can anyone help me out or ideally refer to some literature about this?
Question 2: I stumbled upon the supposed counter-example $\mathcal{V}(\sum_{i=1}^n x_i^2)\subseteq K^n$, which I don't quite understand. My reasoning is as follows:

Let $f=\sum_{i=1}^n x_i^2\subseteq \mathbb{R}[x_1,\dots,x_n]$, then $V:=\mathcal{V}(f)\subseteq \mathbb{R}^n=\{(0,\dots,0)\}$ should have dimension 0 in the Zariski topology.

The coordinate ring is given by
$$ \mathbb{R}[x_1,\dots,x_n]/\mathcal{I}(V) = \{[f]:f\in \mathbb{R}[x_1,\dots,x_n]\} $$
with $g\in[f] \iff f-g\in \mathcal{I}(V)$. Here we have that $h\in\mathcal{I}(V) \iff h(0,\dots,0)=0$, which happens if the constant part of $h$ denoted by $a_0^h$ is zero (because $h(0,\dots,0)=a_0^h$). Thus, two polynomials are in the same equivalence class if they have the same constant part, i.e. $g\in[f] \iff a_0^g = a_0^f$. Since $\forall f\in \mathbb{R}[x_1,\dots,x_n] : a^f_0\in\mathbb{R}$ we have $\mathbb{R}[x_1,\dots,x_n]/\mathcal{I}(V) =\mathbb{R}$. If I'm not mistaken, the Krull dimension of $\mathbb{R}$ as a ring should also be 0.

Is there anything that I have missed?
 A: Question 1: Hartshorne does not actually assume $K = \overline{K}$ throughout his book, only in chapter 1. For an affine variety $X$ with coordinate ring $R$, whether or not $\dim X = \dim R$ holds depends on your definition of $X$.
Question 2: This counter example actually does work. To simplify things, consider the vanshing set $X = V(x^2 + y^2)$ over $\mathbb R$ and its coordinate ring $R = \mathbb R[x,y]/(x^2 + y^2)$. The Zariski topology on $\mathbb R^2$ still makes sense in the absence of algebraic closure, and as you noted, $X$ is simply the origin and thus has dimension $0$.
However, the coordinate ring $R$ does not have Krull dimension $0$, it has Krull dimension $1$. Recall that Krull dimension is defined as the maximmum length of chains of prime ideals. By the correspondence theorem, the prime ideals of $R$ are precisely the prime ideals of $\mathbb R[x,y]$ which contain the ideal $(x^2 + y^2)$:
$$\operatorname{Spec}(R) = \left\{\mathfrak p \subseteq \mathbb{R}[x,y] ~:~ \mathfrak p \text{ is prime and } x^2 + y^2 \in \mathfrak p\right\}.$$
Since $\mathbb R[x,y]$ is a UFD, ideals generated by irreducible polynomials are prime, and hence the ideal $(x^2 + y^2)$ is prime in $\mathbb R[x,y]$. It corresponds to the prime ideal $(0)$ in $R$. The element $x^2 + y^2$ is also contained in the maximal ideal $(x,y) \subseteq \mathbb R[x,y]$, so $(x,y)$ corresponds to a prime in $R$ which strictly contains $0$. This implies that
$$ (0) \subsetneq (x,y)$$
is a chain of prime ideals in $R$, and since it has length 1, we conclude that $\dim R \geq 1$ (there might be a longer chain of primes than the one we found), which for our purposes is enough. Your proposed counter example does actually work.
Is there a fix to this? As I said, whether or not Krull dimension and Zariski dimension agree for affine varieties more generally depends on your definition of "variety", and indeed, the failure of these two notions to agree for non-algebraically closed fields might motivate you to look for a better definition. In chapter 2, Hartshorne introduces the notion of a scheme as a replacement for varieties which, among many other things, frees us from assuming all fields are algebraically closed. In fact, it allows us to consider affine variety-like objects over not just fields, but arbitrary rings as well. It turns out that topological dimension and Krull dimension always agree for affine schemes.
