hcju/stacksqa huggingface dataset:
The functors $j_!$, $j_*$ and $j^{-1}$ are defined in Sites, Lemma \ref{sites-lemma-relocalize} where it is also shown that $j = j_{S/S'}$ is the localization of $(\Sch/S')_{fppf}$ at the object $S/S'$. Hence all of the material on localization functors is available for $j$. The formula in (1) is Sites, Lemma \ref{sites-lemma-describe-j-shriek-good-site}. By definition $j_!$ is the left adjoint to restriction $j^{-1}$, hence $j_!$ is right exact. By Sites, Lemma \ref{sites-lemma-j-shriek-commutes-equalizers-fibre-products} it also commutes with fibre products and equalizers. By Sites, Lemma \ref{sites-lemma-describe-j-shriek-representable} we see that $j_!h_X = h_{j(X)}$ hence (2) holds. If $F$ is an algebraic space over $S$, then we can write $F = U/R$ (Lemma \ref{lemma-space-presentation}) and we get $$ j_!F = j(U)/j(R) $$ because $j_!$ being right exact commutes with coequalizers, and moreover $j(R) = j(U) \times_{j_!F} j(U)$ as $j_!$ commutes with fibre products. Since the morphisms $j(s), j(t) : j(R) \to j(U)$ are simply the morphisms $s, t : R \to U$ (but viewed as morphisms of schemes over $S'$), they are still \'etale. Thus $(j(U), j(R), s, t)$ is an \'etale equivalence relation. Hence by Theorem \ref{theorem-presentation} we conclude that $j_!F$ is an algebraic space. \medskip\noindent Proof of (4), (5), and (6). The description of $j^{-1}$ is in Sites, Section \ref{sites-section-localize}. The restriction of the representable sheaf associated to $X'/S'$ is the representable sheaf associated to $X'_S = S \times_{S'} Y'$ by Sites, Lemma \ref{sites-lemma-localize-given-products}. The restriction functor $j^{-1}$ is exact, hence $j^{-1}F' = U'_S/R'_S$. Again by exactness the sheaf $R'_S$ is still an equivalence relation on $U'_S$. Finally the two maps $R'_S \to U'_S$ are \'etale as base changes of the \'etale morphisms $R' \to U'$. Hence $j^{-1}F' = U'_S/R'_S$ is an algebraic space by Theorem \ref{theorem-presentation} and we win.
Let $F$ be an algebraic space over $S$. The functor from left to right assigns the pair $(j_!F, j_!F \to S)$ ot $F$ which is an object of the right hand side by Lemma \ref{lemma-change-base-scheme}. Since this defines an equivalence of categories of sheaves by Sites, Lemma \ref{sites-lemma-essential-image-j-shriek} to finish the proof it suffices to show: if $F$ is a sheaf and $j_!F$ is an algebraic space, then $F$ is an algebraic space. To do this, write $j_!F = U'/R'$ as in Lemma \ref{lemma-space-presentation} with $U', R' \in \Ob((\Sch/S')_{fppf})$. Then the compositions $U' \to j_!F \to S$ and $R' \to j_!F \to S$ are morphisms of schemes over $S'$. Denote $U, R$ the corresponding objects of $(\Sch/S)_{fppf}$. The two morphisms $R' \to U'$ are morphisms over $S$ and hence correspond to morphisms $R \to U$. Since these are simply the same morphisms (but viewed over $S$) we see that we get an \'etale equivalence relation over $S$. As $j_!$ defines an equivalence of categories of sheaves (see reference above) we see that $F = U/R$ and by Theorem \ref{theorem-presentation} we see that $F$ is an algebraic space.
Suppose that $U$ is a scheme over $S$, and $U \to F$ is a surjective \'etale morphism. Denote $U'$ the scheme $U$ viewed as a scheme over $S'$. In Lemma \ref{lemma-change-base-scheme} we have seen that $U' \to F'$ is surjective \'etale. Since $$ j(T \times_{f, F} U) = T' \times_{f', F'} U' $$ the morphism of schemes $T \times_{f, F} U \to U$ is identified with the morphism of schemes $T' \times_{f', F'} U' \to U'$. It is the same morphism, just viewed over different base schemes. Hence the lemma follows from Lemma \ref{lemma-representable-morphisms-spaces-property}.
Let $I$ be a set and for $i \in I$ let $X_i$ be a quasi-compact topological space. Set $X = \prod X_i$. Let $\mathcal{B}$ be the set of subsets of $X$ of the form $U_i \times \prod_{i' \in I, i' \not = i} X_{i'}$ where $U_i \subset X_i$ is open. By construction this family is a subbasis for the topology on $X$. By Lemma \ref{lemma-subbase-theorem} it suffices to show that any covering $X = \bigcup_{j \in J} B_j$ by elements $B_j$ of $\mathcal{B}$ has a finite refinement. We can decompose $J = \coprod J_i$ so that if $j \in J_i$, then $B_j = U_j \times \prod_{i' \not = i} X_{i'}$ with $U_j \subset X_i$ open. If $X_i = \bigcup_{j \in J_i} U_j$, then there is a finite refinement and we conclude that $X = \bigcup_{j \in J} B_j$ has a finite refinement. If this is not the case, then for every $i$ we can choose an point $x_i \in X_i$ which is not in $\bigcup_{j \in J_i} U_j$. But then the point $x = (x_i)_{i \in I}$ is an element of $X$ not contained in $\bigcup_{j \in J} B_j$, a contradiction.
(See also the remark below.) If the map $f$ satisfies (1), it automatically satisfies (4) because any single point is quasi-compact. \medskip\noindent Assume map $f$ satisfies (4). We  will prove it is universally closed, i.e., (3) holds. Let $g : Z \to Y$ be a continuous map of topological spaces and consider the diagram $$ \xymatrix{ Z \times_Y X \ar[r]_{g'} \ar[d]_{f'} & X \ar[d]^f \\ Z \ar[r]^g & Y } $$ During the proof we will use that $Z \times_Y X \to Z \times X$ is a homeomorphism onto its image, i.e., that we may identify $Z \times_Y X$ with the corresponding subset of $Z \times X$ with the induced topology. The image of $f' : Z \times_Y X \to Z$ is $\Im(f') = \{z : g(z) \in f(X)\}$. Because $f(X)$ is closed, we see that $\Im(f')$ is a closed subspace of $Z$. Consider a closed subset $P \subset Z \times_Y X$. Let $z \in Z$, $z \not \in f'(P)$. If $z \not \in \Im(f')$, then $Z \setminus \Im(f')$ is an open neighbourhood which avoids $f'(P)$. If $z$ is in $\Im(f')$ then $(f')^{-1}\{z\} = \{z\} \times f^{-1}\{g(z)\}$ and $f^{-1}\{g(z)\}$ is quasi-compact by assumption. Because $P$ is a closed subset of $Z \times_Y X$, we have a closed $P'$ of $Z \times X$ such that $P = P' \cap Z \times_Y X$. Since $(f')^{-1}\{z\}$ is a subset of $P^c = P'^c \cup (Z \times_Y X)^c$, and since $(f')^{-1}\{z\}$ is disjoint from $(Z \times_Y X)^c$ we see that $(f')^{-1}\{z\}$ is contained in $P'^c$. We may apply the Tube Lemma \ref{lemma-tube} to $(f')^{-1}\{z\} = \{z\} \times f^{-1}\{g(z)\} \subset (P')^c \subset Z \times X$. This gives $V \times U$ containing $(f')^{-1}\{z\}$ where $U$ and $V$ are open sets in $X$ and $Z$ respectively and $V \times U$ has empty intersection with $P'$. Then the set $V \cap g^{-1}(Y-f(U^c))$ is open in $Z$ since $f$ is closed, contains $z$, and has empty intersection with the image of $P$. Thus $f'(P)$ is closed. In other words, the map $f$ is universally closed. \medskip\noindent The implication (3) $\Rightarrow$ (2) is trivial. Namely, given any topological space $Z$ consider the projection morphism $g : Z \times Y \to Y$. Then it is easy to see that $f'$ is the map $Z \times X \to Z \times Y$, in other words that $(Z \times Y) \times_Y X = Z \times X$. (This identification is a purely categorical property having nothing to do with topological spaces per se.) \medskip\noindent Assume $f$ satisfies (2). We will prove it satisfies (1). Note that $f$ is closed as $f$ can be identified with the map $\{pt\} \times X \to \{pt\} \times Y$ which is assumed closed. Choose any quasi-compact subset $K \subset Y$. Let $Z$ be any topological space. Because $Z \times X \to Z \times Y$ is closed we see the map $Z \times f^{-1}(K) \to Z \times K$ is closed (if $T$ is closed in $Z \times f^{-1}(K)$, write $T = Z \times f^{-1}(K) \cap T'$ for some closed $T' \subset Z \times X$). Because $K$ is quasi-compact, $K \times Z\to Z$ is closed by Lemma \ref{lemma-characterize-quasi-compact}. Hence the composition $Z \times f^{-1}(K)\to Z \times K \to Z$ is closed and therefore $f^{-1}(K)$ must be quasi-compact by Lemma \ref{lemma-characterize-quasi-compact} again.
Define an equivalence relation $\sim$ on points of $X$ by the rule $$ x \sim y \Leftrightarrow (\forall U \in \mathcal{B} : x \in U \Leftrightarrow y \in U) $$ Let $Y$ be the set of equivalence classes and $f : X \to Y$ the natural map. Part (2) holds by construction. The assumptions on $\mathcal{B}$ exactly mirror the assumptions in Lemma \ref{lemma-make-base} on the set of subsets $f(U)$, $U \in \mathcal{B}$. Hence there is a unique topology on $Y$ such that (3) holds. Then (1) is clear as well.
Let $T \subset Y$ be a connected component. Note that $T$ is closed, see Lemma \ref{lemma-connected-components}. The lemma follows if we show that $f^{-1}(T)$ is connected because any connected subset of $X$ maps into a connected component of $Y$ by Lemma \ref{lemma-image-connected-space}. Suppose that $f^{-1}(T) = Z_1 \amalg Z_2$ with $Z_1$, $Z_2$ closed. For any $t \in T$ we see that $f^{-1}(\{t\}) = Z_1 \cap f^{-1}(\{t\}) \amalg Z_2 \cap f^{-1}(\{t\})$. By (1) we see $f^{-1}(\{t\})$ is connected we conclude that either $f^{-1}(\{t\}) \subset Z_1$ or $f^{-1}(\{t\}) \subset Z_2$. In other words $T = T_1 \amalg T_2$ with $f^{-1}(T_i) = Z_i$. By (2) we conclude that $T_i$ is closed in $Y$. Hence either $T_1 = \emptyset$ or $T_2 = \emptyset$ as desired.
Proof of (1). If $X$ is Kolmogorov then so is $X_i$ for every $i\in I$ by Lemma \ref{lemma-sober-subspace}. Suppose $X_i$ is Kolmogorov for every $i\in I$. Let $x,y\in X$ with $\overline{\{x\}}=\overline{\{y\}}$. There exists $i\in I$ with $x\in X_i$. There exists an open subset $U\subset X$ such that $X_i$ is a closed subset of $U$. If $y\notin U$ we get the contradiction $x\in\overline{\{x\}}\cap U=\overline{\{y\}}\cap U=\emptyset$. Hence $y\in U$. It follows $y\in\overline{\{y\}}\cap U=\overline{\{x\}}\cap U\subset X_i$. This shows $y\in X_i$. It follows $\overline{\{x\}}\cap X_i=\overline{\{y\}}\cap X_i$. Since $X_i$ is Kolmogorov we get $x=y$. This shows $X$ is Kolmogorov. \medskip\noindent Proof of (2). If $X$ is quasi-sober then so is $X_i$ for every $i\in I$ by Lemma \ref{lemma-sober-subspace}. Suppose $X_i$ is quasi-sober for every $i\in I$. Let $Y$ be an irreducible closed subset of $X$. As $Y\neq\emptyset$ there exists $i\in I$ with $X_i\cap Y\neq\emptyset$. As $X_i$ is open in $X$ it follows $X_i\cap Y$ is non-empty and open in $Y$, hence irreducible and dense in $Y$. Thus $X_i\cap Y$ is an irreducible closed subset of $X_i$. As $X_i$ is quasi-sober there exists $x\in X_i\cap Y$ with $X_i\cap Y=\overline{\{x\}}\cap X_i\subset\overline{\{x\}}$. Since $X_i\cap Y$ is dense in $Y$ and $Y$ is closed in $X$ it follows $Y=\overline{X_i\cap Y}\cap Y\subset\overline{X_i\cap Y}\subset \overline{\{x\}}\subset Y$. Therefore $Y=\overline{\{x\}}$. This shows $X$ is quasi-sober. \medskip\noindent Proof of (3). Immediately from (1) and (2).
We point out that assumption (b) implies that $f$ is surjective (see Definition \ref{definition-irreducible-components}). Let $T \subset Y$ be an irreducible component. Note that $T$ is closed, see Lemma \ref{lemma-irreducible}. The lemma follows if we show that $f^{-1}(T)$ is irreducible because any irreducible subset of $X$ maps into an irreducible component of $Y$ by Lemma \ref{lemma-image-irreducible-space}. Note that $f^{-1}(T) \to T$ satisfies the assumptions of Lemma \ref{lemma-irreducible-on-top}. Hence we win.
Let $T \subset X$ be a subset of $X$. Let $T_1 \supset T_2 \supset \ldots$ be a descending chain of closed subsets of $T$. Write $T_i =  T \cap Z_i$ with $Z_i \subset X$ closed. Consider the descending chain of closed subsets $Z_1 \supset Z_1\cap Z_2 \supset Z_1 \cap Z_2 \cap Z_3 \ldots$ This stabilizes by assumption and hence the original sequence of $T_i$ stabilizes. Thus $T$ is Noetherian. \medskip\noindent Let $A$ be the set of closed subsets of $X$ which do not have finitely many irreducible components. Assume that $A$ is not empty to arrive at a contradiction. The set $A$ is partially ordered by inclusion: $\alpha \leq \alpha' \Leftrightarrow Z_{\alpha} \subset Z_{\alpha'}$. By the descending chain condition we may find a smallest element of $A$, say $Z$. As $Z$ is not a finite union of irreducible components, it is not irreducible. Hence we can write $Z = Z' \cup Z''$ and both are strictly smaller closed subsets. By construction $Z' = \bigcup Z'_i$ and $Z'' = \bigcup Z''_j$ are finite unions of their irreducible components. Hence $Z = \bigcup Z'_i \cup \bigcup Z''_j$ is a finite union of irreducible closed subsets. After removing redundant members of this expression, this will be the decomposition of $Z$ into its irreducible components (Lemma \ref{lemma-pick-irreducible-components}), a contradiction. \medskip\noindent Let $Z \subset X$ be an irreducible component of $X$. Let $Z_1, \ldots, Z_n$ be the other irreducible components of $X$. Consider $U = Z \setminus (Z_1\cup\ldots\cup Z_n)$. This is not empty since otherwise the irreducible space $Z$ would be contained in one of the other $Z_i$. Because $X = Z \cup Z_1 \cup \ldots Z_n$ (see Lemma \ref{lemma-irreducible}), also $U = X \setminus (Z_1\cup\ldots\cup Z_n)$ and hence open in $X$. Thus $Z$ contains a nonempty open of $X$.
Let $x \in X$. Let $E$ be a neighbourhood of $x$. We have to find a connected neighbourhood of $x$ contained in $E$. By assumption there exists a neighbourhood $E'$ of $x$ which is Noetherian. Then $E \cap E'$ is Noetherian, see Lemma \ref{lemma-Noetherian}. Let $E \cap E' = Y_1 \cup \ldots \cup Y_n$ be the decomposition into irreducible components, see Lemma \ref{lemma-Noetherian}. Let $E'' = \bigcup_{x \in Y_i} Y_i$. This is a connected subset of $E \cap E'$ containing $x$. It contains the open $E \cap E' \setminus (\bigcup_{x \not \in Y_i} Y_i)$ of $E \cap E'$ and hence it is a neighbourhood of $x$ in $X$. This proves the lemma.
It is clear that $\dim(X) \geq \dim_x(X)$ for all $x \in X$ (see discussion following Definition \ref{definition-Krull}). Thus an inequality in one direction. For the converse, let $n \geq 0$ and suppose that $\dim(X) \geq n$. Then we can find a chain of irreducible closed subsets $Z_0 \subset Z_1 \subset \ldots \subset Z_n \subset X$. Pick $x \in Z_0$. Then we see that every open neighbourhood $U$ of $x$ has a chain of irreducible closed subsets $Z_0 \cap U \subset Z_1 \cap U \subset \ldots Z_n \cap U \subset U$. In this way we see that $\dim_x(X) \geq n$ which proves the other inequality.
Consider the set $$ \mathcal{T} = \{Z \subset X \mid Z = \overline{\{x\}} \text{ for some }x \in X\} $$ of all closures of singletons in $X$. It is nonempty since $X$ is nonempty. Make $\mathcal{T}$ into a partially ordered set using the relation of inclusion. Suppose $Z_\alpha$, $\alpha \in A$ is a totally ordered subset of $\mathcal{T}$. By Lemma \ref{lemma-intersection-closed-in-quasi-compact} we see that $\bigcap_{\alpha \in A} Z_\alpha \not = \emptyset$. Hence there exists some $x \in \bigcap_{\alpha \in A} Z_\alpha$ and we see that $Z = \overline{\{x\}}\in \mathcal{T}$ is a lower bound for the family. By Zorn's lemma there exists a minimal element $Z \in \mathcal{T}$. As $X$ is Kolmogorov we conclude that $Z = \{x\}$ for some $x$ and $x \in X$ is a closed point.
Let $X_0 = \bigcup U_{i, 0}$ be an open covering. Write $U_{i, 0} = X_0 \cap U_i$ for some open $U_i \subset X$. Consider the complement $Z$ of $\bigcup U_i$. This is a closed subset of $X$, hence quasi-compact (Lemma \ref{lemma-closed-in-quasi-compact}) and Kolmogorov. By Lemma \ref{lemma-quasi-compact-closed-point} if $Z$ is nonempty it would have a closed point which contradicts the fact that $X_0 \subset \bigcup U_i$. Hence $Z = \emptyset$ and $X = \bigcup U_i$. Since $X$ is quasi-compact this covering has a finite subcover and we conclude.
Let $T$ be the connected component containing $x$. Let $S = \bigcap_{\alpha \in A} Z_\alpha$ be the intersection of all open and closed subsets $Z_\alpha$ of $X$ containing $x$. Note that $S$ is closed in $X$. Note that any finite intersection of $Z_\alpha$'s is a $Z_\alpha$. Because $T$ is connected and $x \in T$ we have $T \subset S$. It suffices to show that $S$ is connected. If not, then there exists a disjoint union decomposition $S = B \amalg C$ with $B$ and $C$ open and closed in $S$. In particular, $B$ and $C$ are closed in $X$, and so quasi-compact by Lemma \ref{lemma-closed-in-quasi-compact} and assumption (1). By assumption (2) there exist quasi-compact opens $U, V \subset X$ with $B = S \cap U$ and $C = S \cap V$ (details omitted). Then $U \cap V \cap S = \emptyset$. Hence $\bigcap_\alpha U \cap V \cap Z_\alpha = \emptyset$. By assumption (3) the intersection $U \cap V$ is quasi-compact. By Lemma \ref{lemma-intersection-closed-in-quasi-compact} for some $\alpha' \in A$ we have $U \cap V \cap Z_{\alpha'} = \emptyset$. Since $X \setminus (U \cup V)$ is disjoint from $S$ and closed in $X$ hence quasi-compact, we can use the same lemma to see that $Z_{\alpha''} \subset U \cup V$ for some $\alpha'' \in A$. Then $Z_\alpha = Z_{\alpha'} \cap Z_{\alpha''}$ is contained in $U \cup V$ and disjoint from $U \cap V$. Hence $Z_\alpha = U \cap Z_\alpha \amalg V \cap Z_\alpha$ is a decomposition into two open pieces, hence $U \cap Z_\alpha$ and $V \cap Z_\alpha$ are open and closed in $X$. Thus, if $x \in B$ say, then we see that $S \subset U \cap Z_\alpha$ and we conclude that $C = \emptyset$.
Let $T$ be the connected component containing $x$. Let $S = \bigcap_{\alpha \in A} Z_\alpha$ be the intersection of all open and closed subsets $Z_\alpha$ of $X$ containing $x$. Note that $S$ is closed in $X$. Note that any finite intersection of $Z_\alpha$'s is a $Z_\alpha$. Because $T$ is connected and $x \in T$ we have $T \subset S$. It suffices to show that $S$ is connected. If not, then there exists a disjoint union decomposition $S = B \amalg C$ with $B$ and $C$ open and closed in $S$. In particular, $B$ and $C$ are closed in $X$, and so quasi-compact by Lemma \ref{lemma-closed-in-quasi-compact}. By Lemma \ref{lemma-quasi-compact-in-Hausdorff} there exist disjoint opens $U, V \subset X$ with $B \subset U$ and $C \subset V$. Then $X \setminus U \cup V$ is closed in $X$ hence quasi-compact (Lemma \ref{lemma-closed-in-quasi-compact}). It follows that $(X \setminus U \cup V) \cap Z_\alpha = \emptyset$ for some $\alpha$ by Lemma \ref{lemma-intersection-closed-in-quasi-compact}. In other words, $Z_\alpha \subset U \cup V$. Thus $Z_\alpha = Z_\alpha \cap V \amalg Z_\alpha \cap U$ is a decomposition into two open pieces, hence $U \cap Z_\alpha$ and $V \cap Z_\alpha$ are open and closed in $X$. Thus, if $x \in B$ say, then we see that $S \subset U \cap Z_\alpha$ and we conclude that $C = \emptyset$.
It is clear that (a) implies (b). Assume (b). Let $x \in X$, $x \not \in T$. Let $x \in C \subset X$ be the connected component of $X$ containing $x$. By Lemma \ref{lemma-connected-component-intersection} we see that $C = \bigcap V_\alpha$ is the intersection of all open and closed subsets $V_\alpha$ of $X$ which contain $C$. In particular, any pairwise intersection $V_\alpha \cap V_\beta$ occurs as a $V_\alpha$. As $T$ is a union of connected components of $X$ we see that $C \cap T = \emptyset$. Hence $T \cap \bigcap V_\alpha = \emptyset$. Since $T$ is quasi-compact as a closed subset of a quasi-compact space (see Lemma \ref{lemma-closed-in-quasi-compact}) we deduce that $T \cap V_\alpha = \emptyset$ for some $\alpha$, see Lemma \ref{lemma-intersection-closed-in-quasi-compact}. For this $\alpha$ we see that $U_\alpha = X \setminus V_\alpha$ is an open and closed subset of $X$ which contains $T$ and not $x$. The lemma follows.
Suppose $X = \bigcup U_i$ is an open covering of $X$ indexed by the set $I$ which does not have a refinement by a finite open covering. Choose $i_1, i_2, \ldots $ elements of $I$ inductively in the following way: Choose $i_{n + 1}$ such that $U_{i_{n + 1}}$ is not contained in $U_{i_1} \cup \ldots \cup U_{i_n}$. Thus we see that $X \supset (X \setminus U_{i_1}) \supset (X \setminus U_{i_1} \cup U_{i_2}) \supset \ldots$ is a strictly decreasing infinite sequence of closed subsets. This contradicts the fact that $X$ is Noetherian. This proves the first assertion. The second assertion is now clear since every subset of $X$ is Noetherian by Lemma \ref{lemma-Noetherian}.
Let $X$ be a Hausdorff space. Let $x \in X$ and let $x \in E \subset X$ be a quasi-compact neighbourhood. Then $E$ is closed by Lemma \ref{lemma-quasi-compact-in-Hausdorff}. Suppose that $x \in U \subset X$ is an open neighbourhood of $x$. Then $Z = E \setminus U$ is a closed subset of $E$ not containing $x$. Hence we can find a pair of disjoint open subsets $W, V \subset E$ of $E$ such that $x \in V$ and $Z \subset W$, see Lemma \ref{lemma-quasi-compact-in-Hausdorff}. It follows that $\overline{V} \subset E$ is a closed neighbourhood of $x$ contained in $E \cap U$. Also $\overline{V}$ is quasi-compact as a closed subset of $E$ (Lemma \ref{lemma-closed-in-quasi-compact}). In this way we obtain a fundamental system of quasi-compact neighbourhoods of $x$.
After replacing $U_n$ by $\bigcap_{i = 1, \ldots, n} U_i$ we may assume that $U_1 \supset U_2 \supset \ldots$. Let $x \in X$. We will show that $x$ is in the closure of $\bigcap_{n \geq 1} U_n$. Thus let $E$ be a neighbourhood of $x$. To show that $E \cap \bigcap_{n \geq 1} U_n$ is nonempty we may replace $E$ by a smaller neighbourhood. After replacing $E$ by a smaller neighbourhood, we may assume that $E$ is quasi-compact. \medskip\noindent Set $x_0 = x$ and $E_0 = E$. Below, we will inductively choose a point $x_i \in E_{i - 1} \cap U_i$ and a quasi-compact neighbourhood $E_i$ of $x_i$ with $E_i \subset E_{i - 1} \cap U_i$. Because $X$ is Hausdorff, the subsets $E_i \subset X$ are closed (Lemma \ref{lemma-quasi-compact-in-Hausdorff}). Since the $E_i$ are also nonempty we conclude that $\bigcap_{i \geq 1} E_i$ is nonempty (Lemma \ref{lemma-intersection-closed-in-quasi-compact}). Since $\bigcap_{i \geq 1} E_i \subset E \cap \bigcap_{n \geq 1} U_n$ this proves the lemma. \medskip\noindent The base case $i = 0$ we have done above. Induction step. Since $E_{i - 1}$ is a neighbourhood of $x_{i - 1}$ we can find an open $x_{i - 1} \in W \subset E_{i - 1}$. Since $U_i$ is dense in $X$ we see that $W \cap U_i$ is nonempty. Pick any $x_i \in W \cap U_i$. By definition of locally quasi-compact spaces we can find a quasi-compact neighbourhood $E_i$ of $x_i$ contained in $W \cap U_i$. Then $E_i \subset E_{i - 1} \cap U_i$ as desired.
Let $x \in X$. Choose an $i(x) \in I$ such that $x \in U_{i(x)}$. Since $X \setminus U_{i(x)}$ and $\{x\}$ are disjoint closed subsets of $X$, by Lemmas \ref{lemma-closed-in-quasi-compact} and \ref{lemma-quasi-compact-in-Hausdorff} there exists an open neighbourhood $U_x$ of $x$ whose closure is disjoint from $X \setminus U_{i(x)}$. Thus $\overline{U_x} \subset U_{i(x)}$. Since $X$ is quasi-compact, there is a finite list of points $x_1, \ldots, x_m$ such that $X = U_{x_1} \cup \ldots \cup U_{x_m}$. Setting $V_i = \bigcup_{i = i(x_j)} U_{x_j}$ the proof is finished.