hcju/stacksqa huggingface dataset:
Part (1) is a special case of part (2). The second equality in (2) follows from Lemma \ref{lemma-universal-property-localization-module}. Choose a presentation $$ \bigoplus\nolimits_{j = 1, \ldots, m} R \longrightarrow \bigoplus\nolimits_{i = 1, \ldots, n} R \to M \to 0. $$ By Lemma \ref{lemma-hom-exact} this gives an exact sequence $$ 0 \to \Hom_R(M, N) \to \bigoplus\nolimits_{i = 1, \ldots, n} N \longrightarrow \bigoplus\nolimits_{j = 1, \ldots, m} N. $$ Inverting $S$ and using Proposition \ref{proposition-localization-exact} we get an exact sequence $$ 0 \to S^{-1}\Hom_R(M, N) \to \bigoplus\nolimits_{i = 1, \ldots, n} S^{-1}N \longrightarrow \bigoplus\nolimits_{j = 1, \ldots, m} S^{-1}N $$ and the result follows since $S^{-1}M$ sits in an exact sequence $$ \bigoplus\nolimits_{j = 1, \ldots, m} S^{-1}R \longrightarrow \bigoplus\nolimits_{i = 1, \ldots, n} S^{-1}R \to S^{-1}M \to 0 $$ which induces (by Lemma \ref{lemma-hom-exact}) the exact sequence $$ 0 \to \Hom_{S^{-1}R}(S^{-1}M, S^{-1}N) \to \bigoplus\nolimits_{i = 1, \ldots, n} S^{-1}N \longrightarrow \bigoplus\nolimits_{j = 1, \ldots, m} S^{-1}N $$ which is the same as the one above.
Assume (1) and choose an exact sequence $F_{-1} \to F_0 \to N \to 0$ with $F_i$ finite free. Then we have an exact sequence $$ 0 \to \Hom_R(N, M) \to \Hom_R(F_0, M) \to \Hom_R(F_{-1}, M) $$ functorial in the $R$-module $M$. The functors $\Hom_R(F_i, M)$ commute with filtered colimits as $\Hom_R(R^{\oplus n}, M) = M^{\oplus n}$. Since filtered colimits are exact (Lemma \ref{lemma-directed-colimit-exact}) we see that (2) holds. \medskip\noindent Assume (2). By Lemma \ref{lemma-module-colimit-fp} we can write $M = \colim M_i$ as a filtered colimit such that $M_i$ is of finite presentation for all $i$. Thus $\text{id}_M$ factors through $M_i$ for some $i$. This means that $M$ is a direct summand of a finitely presented $R$-module (namely $M_i$) and hence finitely presented.
A priori $M \otimes_A N$ is an $A$-module, but we can give it a $B$-module structure by letting $$ (x \otimes y)b = x \otimes yb, \quad x\in M, y\in N, b\in B $$ Thus $M \otimes_A N$ becomes an $(A, B)$-bimodule. Similarly for $N \otimes_B P$, and thus for $(M \otimes_A N)\otimes_B P$ and $M \otimes_A(N \otimes_B P)$. By Lemma \ref{lemma-transitive}, these two modules are isomorphic as both as $A$-module and $B$-module via the same mapping.
First proof. The functor $M' \mapsto M' \otimes_R N$ is left adjoint to the functor $N' \mapsto \Hom_R(N, N')$ by Lemma \ref{lemma-hom-from-tensor-product}. Thus $M' \mapsto M' \otimes_R N$ commutes with all colimits, see Categories, Lemma \ref{categories-lemma-adjoint-exact}. \medskip\noindent Second direct proof. Let $P = \colim (M_i \otimes N)$, $M = \colim M_i$. Then for all $i\leq j$, the following diagram commutes: $$ \xymatrix{ M_i \otimes N \ar[r]_{\mu_i \otimes 1} \ar[d]_{\mu_{ij} \otimes 1} & M \otimes N \ar[d]^{\text{id}} \\ M_j \otimes N \ar[r]^{\mu_j \otimes 1} & M \otimes N } $$ By Lemma \ref{lemma-homomorphism-limit}, these maps induce a unique homomorphism $\psi : P \to M \otimes N$, with $\lambda_i : M_i \otimes N \to P$ given by $\lambda_i = \pi \circ (\iota_i \otimes 1)$. \medskip\noindent To construct the inverse map, for each $i\in I$, there is the canonical $R$-bilinear mapping $g_i : M_i \times N \to M_i \otimes N$. This induces a unique mapping $\widehat{\phi} : M \times N \to P$ such that $\widehat{\phi} \circ (\mu_i \times 1) = \lambda_i \circ g_i$. It is $R$-bilinear. Thus it induces an $R$-linear mapping $\phi : M \otimes N \to P$. From the commutative diagram below: $$ \xymatrix{ M_i \times N \ar[r]^{g_i} \ar[d]^{\mu_i \times \text{id}} & M_i \otimes N\ar[r]_{\text{id}} \ar[d]_{\lambda_i} & M_i \otimes N \ar[d]_{\mu_i \otimes \text{id}} \ar[rd]^{\lambda_i} \\ M \times N \ar[r]^{\widehat{\phi}} & P \ar[r]^{\psi} & M \otimes N \ar[r]^{\phi} & P } $$ we see that $\psi\circ\widehat{\phi} = g$, the canonical $R$-bilinear mapping $g : M \times N \to M \otimes N$. So $\psi\circ\phi$ is identity on $M \otimes N$. From the right-hand square and triangle, $\phi\circ\psi$ is also identity on $P$.
We apply the functor $\Hom(-, \Hom(N, P))$ to the first exact sequence. We obtain $$ 0 \to \Hom(M_3, \Hom(N, P)) \to \Hom(M_2, \Hom(N, P)) \to \Hom(M_1, \Hom(N, P)) $$ By Lemma \ref{lemma-hom-from-tensor-product}, we have $$ 0 \to \Hom(M_3 \otimes N, P) \to \Hom(M_2 \otimes N, P) \to \Hom(M_1 \otimes N, P) $$ Using the pullback property again, we arrive at the desired exact sequence.
Suppose $M$ is finite. Then choose a presentation $0 \to K \to R^{\oplus n} \to M \to 0$. This gives an exact sequence $K \otimes_R N \to N^{\oplus n} \to M \otimes_R N \to 0$ by Lemma \ref{lemma-tensor-product-exact}. We conclude that if $N$ is finite too then $M \otimes_R N$ is a quotient of a finite module, hence finite, see Lemma \ref{lemma-extension}. Similarly, if both $N$ and $M$ are finitely presented, then we see that $K$ is finite and that $M \otimes_R N$ is a quotient of the finitely presented module $N^{\oplus n}$ by a finite module, namely $K \otimes_R N$, and hence finitely presented, see Lemma \ref{lemma-extension}.
We may use Lemma \ref{lemma-tensor-with-bimodule} and Lemma \ref{lemma-tensor-localization} repeatedly to see that these two $S^{-1}R$-modules are isomorphic, noting that $S^{-1}R$ is an $(R, S^{-1}R)$-bimodule: \begin{align*} S^{-1}(M \otimes_R N) & \cong S^{-1}R \otimes_R (M \otimes_R N)\\  & \cong S^{-1}M \otimes_R N\\  & \cong (S^{-1}M \otimes_{S^{-1}R}S^{-1}R)\otimes_R N\\  & \cong S^{-1}M \otimes_{S^{-1}R}(S^{-1}R \otimes_R N)\\  & \cong S^{-1}M \otimes_{S^{-1}R}S^{-1}N \end{align*} This isomorphism is easily seen to be the one stated in the lemma.
Proof of (1). Take a surjective, $S$-linear map $S^{\oplus n} \to M \to 0$. By Lemma \ref{lemma-flip-tensor-product} and \ref{lemma-tensor-product-exact} the result after tensoring with $R^\prime$ is a surjection ${S^\prime}^{\oplus n} \to M^\prime \rightarrow 0$, so $M^\prime$ is a finitely generated $S^\prime$-module. Proof of (2). Take a presentation $S^{\oplus m} \to S^{\oplus n} \to M \to 0$. By Lemma \ref{lemma-flip-tensor-product} and \ref{lemma-tensor-product-exact} the result after tensoring with $R^\prime$ gives a finite presentation ${S^\prime}^{\oplus m} \to {S^\prime}^{\oplus n} \to M^\prime \to 0$, of the $S^\prime$-module $M^\prime$. Proof of (3). This follows by the remark preceding the lemma as we can take $I$ to be finite by assumption. Proof of (4). This follows by the remark preceding the lemma as we can take $I$ and $J$ to be finite by assumption.
This can be proved directly, but it is also a consequence of Lemmas \ref{lemma-adjoint-hom-restrict} and \ref{lemma-hom-from-tensor-product}. Namely, we have \begin{align*} \Hom_R(M \otimes_S N, P) & = \Hom_S(M \otimes_S N, \Hom_R(S, P)) \\ & = \Hom_S(M, \Hom_S(N, \Hom_R(S, P))) \\ & = \Hom_S(M, \Hom_R(N, P)) \end{align*} as desired.
The result is true for $r = 1$. If $r = 2$, then let $x, y \in J$ with $x \not \in I_1$ and $y \not \in I_2$. We are done unless $x \in I_2$ and $y \in I_1$. Then the element $x + y$ cannot be in $I_1$ (since that would mean $x + y - y \in I_1$) and it also cannot be in $I_2$. \medskip\noindent For $r \geq 3$, assume the result holds for $r - 1$. After renumbering we may assume that $I_r$ is prime. We may also assume there are no inclusions among the $I_i$. Pick $x \in J$, $x \not \in I_i$ for all $i = 1, \ldots, r - 1$. If $x \not\in I_r$ we are done. So assume $x \in I_r$. If $J I_1 \ldots I_{r - 1} \subset I_r$ then $J \subset I_r$ (by Lemma \ref{lemma-product-ideals-in-prime}) a contradiction. Pick $y \in J I_1 \ldots I_{r - 1}$, $y \not \in I_r$. Then $x + y$ works.
Choose a surjection $R^{\oplus n - 1} \to M$. We may lift the map $f$ to a map $f' : R^{\oplus n} \to R^{\oplus n - 1}$ (Lemma \ref{lemma-lift-map}). It suffices to prove $f'$ has a nonzero kernel. The map $f' : R^{\oplus n} \to R^{\oplus n - 1}$ is given by a matrix $A = (a_{ij})$. If one of the $a_{ij}$ is not nilpotent, say $a = a_{ij}$ is not, then we can replace $R$ by the localization $R_a$ and we may assume $a_{ij}$ is a unit. Since if we find a nonzero kernel after localization then there was a nonzero kernel to start with as localization is exact, see Proposition \ref{proposition-localization-exact}. In this case we can do a base change on both $R^{\oplus n}$ and $R^{\oplus n - 1}$ and reduce to the case where $$ A = \left( \begin{matrix} 1 & 0 & 0 & \ldots \\ 0 & a_{22} & a_{23} & \ldots \\ 0 & a_{32} & \ldots \\ \ldots & \ldots \end{matrix} \right) $$ Hence in this case we win by induction on $n$. If not then each $a_{ij}$ is nilpotent. Set $I = (a_{ij}) \subset R$. Note that $I^{m + 1} = 0$ for some $m \geq 0$. Let $m$ be the largest integer such that $I^m \not = 0$. Then we see that $(I^m)^{\oplus n}$ is contained in the kernel of the map and we win.
Choose a surjective $R$-module map $R^{\oplus n} \to M$, given by $(a_1, \ldots, a_n) \mapsto \sum a_ix_i$ for some generators $x_i \in M$. Choose $(a_{i1}, \ldots, a_{in}) \in R^{\oplus n}$ such that $\varphi(x_i) = \sum a_{ij} x_j$. In other words the diagram $$ \xymatrix{ R^{\oplus n} \ar[d]_A \ar[r] & M \ar[d]^\varphi \\ R^{\oplus n} \ar[r] & M } $$ is commutative where $A = (a_{ij})$. By Lemma \ref{lemma-charpoly} there exists a monic polynomial $P$ such that $P(A) = 0$. Then it follows that $P(\varphi) = 0$.
Choose a surjective $R$-module map $R^{\oplus n} \to M$, given by $(a_1, \ldots, a_n) \mapsto \sum a_ix_i$ for some generators $x_i \in M$. Choose $(a_{i1}, \ldots, a_{in}) \in I^{\oplus n}$ such that $\varphi(x_i) = \sum a_{ij} x_j$. In other words the diagram $$ \xymatrix{ R^{\oplus n} \ar[d]_A \ar[r] & M \ar[d]^\varphi \\ I^{\oplus n} \ar[r] & M } $$ is commutative where $A = (a_{ij})$. By Lemma \ref{lemma-charpoly} the polynomial $P(t) = \det(t\text{id}_{n \times n} - A)$ has all the desired properties.
[First proof] Write $R' = R[x]$ and think of $M$ as a finite $R'$-module with $x$ acting via $\varphi$. Set $I = (x) \subset R'$. By our assumption that $\varphi$ is surjective we have $IM = M$. Hence we may apply Lemma \ref{lemma-charpoly-module-ideal} to $M$ as an $R'$-module, the ideal $I$ and the endomorphism $\text{id}_M$. We conclude that $(1 + a_1 + \ldots + a_n)\text{id}_M = 0$ with $a_j \in I$. Write $a_j = b_j(x)x$ for some $b_j(x) \in R[x]$. Translating back into $\varphi$ we see that $\text{id}_M = -(\sum_{j = 1, \ldots, n} b_j(\varphi)) \varphi$, and hence $\varphi$ is invertible.
Denote the right hand side of the arrow of the lemma by $D$. Choose a prime $\mathfrak p' \subset S^{-1}R$ and let $\mathfrak p$ the inverse image of $\mathfrak p'$ in $R$. Since $\mathfrak p'$ does not contain $1$ we see that $\mathfrak p$ does not contain any element of $S$. Hence $\mathfrak p \in D$ and we see that the image is contained in $D$. Let $\mathfrak p \in D$. By assumption the image $\overline{S}$ does not contain $0$. By basic notion (\ref{item-localization-zero}) $\overline{S}^{-1}(R/\mathfrak p)$ is not the zero ring. By basic notion (\ref{item-localize-ideal}) we see $S^{-1}R / S^{-1}\mathfrak p = \overline{S}^{-1}(R/\mathfrak p)$ is a domain, and hence $S^{-1}\mathfrak p$ is a prime. The equality of rings also shows that the inverse image of $S^{-1}\mathfrak p$ in $R$ is equal to $\mathfrak p$, because $R/\mathfrak p \to \overline{S}^{-1}(R/\mathfrak p)$ is injective by basic notion (\ref{item-localize-nonzerodivisors}). This proves that the map $\Spec(S^{-1}R) \to \Spec(R)$ is bijective onto $D$ with inverse as given. It is continuous by Lemma \ref{lemma-spec-functorial}. Finally, let $D(g) \subset \Spec(S^{-1}R)$ be a standard open. Write $g = h/s$ for some $h\in R$ and $s\in S$. Since $g$ and $h/1$ differ by a unit we have $D(g) = D(h/1)$ in $\Spec(S^{-1}R)$. Hence by Lemma \ref{lemma-spec-functorial} and the bijectivity above the image of $D(g) = D(h/1)$ is $D \cap D(h)$. This proves the map is open as well.
It suffices to prove that any covering of $\Spec(R)$ by standard opens can be refined by a finite covering. Thus suppose that $\Spec(R) = \cup D(f_i)$ for a set of elements $\{f_i\}_{i\in I}$ of $R$. This means that $\cap V(f_i) = \emptyset$. According to Lemma \ref{lemma-Zariski-topology} this means that $V(\{f_i \}) = \emptyset$. According to the same lemma this means that the ideal generated by the $f_i$ is the unit ideal of $R$. This means that we can write $1$ as a {\it finite} sum: $1 = \sum_{i \in J} r_i f_i$ with $J \subset I$ finite. And then it follows that $\Spec(R) = \cup_{i \in J} D(f_i)$.
The spectrum of a ring is quasi-compact, see Lemma \ref{lemma-quasi-compact}. It has a basis for the topology consisting of the standard opens $D(f) = \Spec(R_f)$ (Lemma \ref{lemma-standard-open}) which are quasi-compact by the first remark. The intersection of two standard opens is quasi-compact as $D(f) \cap D(g) = D(fg)$. Given any two quasi-compact opens $U, V \subset X$ we may write $U = D(f_1) \cup \ldots \cup D(f_n)$ and $V = D(g_1) \cup \ldots \cup D(g_m)$. Then $U \cap V = \bigcup D(f_ig_j)$ which is quasi-compact.
Let $R$ be a ring, and $\mathfrak m$ a maximal ideal. If $x \in R \setminus \mathfrak m$, and $x$ is not a unit then there is a maximal ideal $\mathfrak m'$ containing $x$. Hence $R$ has at least two maximal ideals. Conversely, if $\mathfrak m'$ is another maximal ideal, then choose $x \in \mathfrak m'$, $x \not \in \mathfrak m$. Clearly $x$ is not a unit. This proves the equivalence of (1) and (3). The equivalence (1) and (2) is tautological. If $R$ is local then (4) holds since $x$ is either in $\mathfrak m$ or not. If (4) holds, and $\mathfrak m$, $\mathfrak m'$ are distinct maximal ideals then we may choose $x \in R$ such that $x \bmod \mathfrak m' = 0$ and $x \bmod \mathfrak m = 1$ by the Chinese remainder theorem (Lemma \ref{lemma-chinese-remainder}). This element $x$ is not invertible and neither is $1 - x$ which is a contradiction. Thus (4) and (1) are equivalent.
Conditions (1) and (2) are equivalent by definition. If (3) holds then (2) holds. Conversely, if (2) holds, then $\varphi^{-1}(\mathfrak m_S)$ is a prime ideal containing the maximal ideal $\mathfrak m_R$, hence $\varphi^{-1}(\mathfrak m_S) = \mathfrak m_R$. Finally, (4) is the contrapositive of (2) by Lemma \ref{lemma-characterize-local-ring}.
If $f \in \text{rad}(R)$, then $f \in \mathfrak m$ for all maximal ideals $\mathfrak m$ of $R$. Hence $1 + f \not \in \mathfrak m$ for all maximal ideals $\mathfrak m$ of $R$. Thus the closed subset $V(1 + f)$ of $\Spec(R)$ is empty. This implies that $1 + f$ is a unit, see Lemma \ref{lemma-Zariski-topology}. \medskip\noindent Conversely, assume that $1 + f$ is a unit for all $f \in I$. If $\mathfrak m$ is a maximal ideal and $I \not \subset \mathfrak m$, then $I + \mathfrak m = R$. Hence $1 = f + g$ for some $g \in \mathfrak m$ and $f \in I$. Then $g = 1 + (-f)$ is not a unit, contradiction. \medskip\noindent For the final statement let $f \in R$ map to a unit in $R/I$. Then we can find $g \in R$ mapping to the multiplicative inverse of $f \bmod I$. Then $fg = 1 \bmod I$. Hence $fg$ is a unit of $R$ by (2) which implies that $f$ is a unit.
If $x$ is a unit, then so is $\varphi(x)$. Conversely, if $\varphi(x)$ is a unit, then $\varphi(x) \not \in \mathfrak q$ for all $\mathfrak q \in \Spec(S)$. Hence $x \not \in \varphi^{-1}(\mathfrak q) = \Spec(\varphi)(\mathfrak q)$ for all $\mathfrak q \in \Spec(S)$. Since $\Spec(\varphi)$ is surjective we conclude that $x$ is a unit by part (17) of Lemma \ref{lemma-Zariski-topology}.
Proof of (\ref{item-nakayama}). Choose generators $y_1, \ldots, y_m$ of $M$ over $R$. For each $i$ we can write $y_i = \sum z_{ij} y_j$ with $z_{ij} \in I$ (since $M = IM$). In other words $\sum_j (\delta_{ij} - z_{ij})y_j = 0$. Let $f$ be the determinant of the $m \times m$ matrix $A = (\delta_{ij} - z_{ij})$. Note that $f \in 1 + I$ (since the matrix $A$ is entrywise congruent to the $m \times m$ identity matrix modulo $I$). By Lemma \ref{lemma-matrix-left-inverse} (1), there exists an $m \times m$ matrix $B$ such that $BA = f 1_{m \times m}$. Writing out we see that $\sum_{i} b_{hi} a_{ij} = f \delta_{hj}$ for all $h$ and $j$; hence, $\sum_{i, j} b_{hi} a_{ij} y_j = \sum_{j} f \delta_{hj} y_j = f y_h$ for every $h$. In other words, $0 = f y_h$ for every $h$ (since each $i$ satisfies $\sum_j a_{ij} y_j = 0$). This implies that $f$ annihilates $M$. \medskip\noindent By Lemma \ref{lemma-contained-in-radical} an element of $1 + \text{rad}(R)$ is invertible element of $R$. Hence we see that (\ref{item-nakayama}) implies (2). We obtain (3) by applying (1) to $M/N$ which is finite as $N'$ is finite. We obtain (4) by applying (2) to $M/N$ which is finite as $N'$ is finite. We obtain (5) by applying (3) to $M$ and the submodules $\Im(N \to M)$ and $M$. We obtain (6) by applying (4) to $M$ and the submodules $\Im(N \to M)$ and $M$. We obtain (7) by applying (5) to the map $R^{\oplus n} \to M$, $(a_1, \ldots, a_n) \mapsto a_1x_1 + \ldots + a_nx_n$. We obtain (8) by applying (6) to the map $R^{\oplus n} \to M$, $(a_1, \ldots, a_n) \mapsto a_1x_1 + \ldots + a_nx_n$. \medskip\noindent Part (9) holds because if $M = IM$ then $M = I^nM$ for all $n \geq 0$ and $I$ being nilpotent means $I^n = 0$ for some $n \gg 0$. Parts (10), (11), and (12) follow from (9) by the arguments used above.
To show that $A \to B$ is surjective, we view it as a map of $A$-modules and apply Lemma \ref{lemma-NAK} (6). We conclude it suffices to show that $A/\mathfrak m_A \to B/\mathfrak m_AB$ is surjective. As $A/\mathfrak m_A = B/\mathfrak m_B$ it suffices to show that $\mathfrak m_AB \to \mathfrak m_B$ is surjective. View $\mathfrak m_AB \to \mathfrak m_B$ as a map of $B$-modules and apply Lemma \ref{lemma-NAK} (6). We conclude it suffices to see that $\mathfrak m_AB/\mathfrak m_A\mathfrak m_B \to \mathfrak m_B/\mathfrak m_B^2$ is surjective. This follows from assumption (4).
Write $1 = e_1 + e_2$ with $e_1 = (1, 0)$ and $e_2 = (0, 1)$. Note that $e_1$ and $e_2 = 1 - e_1$ are idempotents. We leave it to the reader to show that $R_1 = R_{e_1}$ is the localization of $R$ at $e_1$. Similarly for $e_2$. Thus the statement of the lemma follows from Lemma \ref{lemma-idempotent-spec} combined with Lemma \ref{lemma-standard-open}.
Let $U \subset \Spec(R)$ be open and closed. Since $U$ is closed it is quasi-compact by Lemma \ref{lemma-quasi-compact}, and similarly for its complement. Write $U = \bigcup_{i = 1}^n D(f_i)$ as a finite union of standard opens. Similarly, write $\Spec(R) \setminus U = \bigcup_{j = 1}^m D(g_j)$ as a finite union of standard opens. Since $\emptyset = D(f_i) \cap D(g_j) = D(f_i g_j)$ we see that $f_i g_j$ is nilpotent by Lemma \ref{lemma-Zariski-topology}. Let $I = (f_1, \ldots, f_n) \subset R$ and let $J = (g_1, \ldots, g_m) \subset R$. Note that $V(J)$ equals $U$, that $V(I)$ equals the complement of $U$, so $\Spec(R) = V(I) \amalg V(J)$. By the remark on nilpotency above, we see that $(IJ)^N = (0)$ for some sufficiently large integer $N$. Since $\bigcup D(f_i) \cup \bigcup D(g_j) = \Spec(R)$ we see that $I + J = R$, see Lemma \ref{lemma-Zariski-topology}. By raising this equation to the $2N$th power we conclude that $I^N + J^N = R$. Write $1 = x + y$ with $x \in I^N$ and $y \in J^N$. Then $0 = xy = x(1 - x)$ as $I^N J^N = (0)$. Thus $x = x^2$ is idempotent and contained in $I^N \subset I$. The idempotent $y = 1 - x$ is contained in $J^N \subset J$.  This shows that the idempotent $x$ maps to $1$ in every residue field $\kappa(\mathfrak p)$ for $\mathfrak p \in V(J)$ and that $x$ maps to $0$ in $\kappa(\mathfrak p)$ for every $\mathfrak p \in V(I)$. \medskip\noindent To see uniqueness suppose that $e_1, e_2$ are distinct idempotents in $R$. We have to show there exists a prime $\mathfrak p$ such that $e_1 \in \mathfrak p$ and $e_2 \not \in \mathfrak p$, or conversely. Write $e_i' = 1 - e_i$. If $e_1 \not = e_2$, then $0 \not = e_1 - e_2  = e_1(e_2 + e_2') - (e_1 + e_1')e_2 = e_1 e_2' - e_1' e_2$. Hence either the idempotent $e_1 e_2' \not = 0$ or $e_1' e_2 \not = 0$. An idempotent is not nilpotent, and hence we find a prime $\mathfrak p$ such that either $e_1e_2' \not \in \mathfrak p$ or $e_1'e_2 \not \in \mathfrak p$, by Lemma \ref{lemma-Zariski-topology}. It is easy to see this gives the desired prime.
By Nakayama's Lemma \ref{lemma-NAK} there exists an element $f = 1 + i$, $i \in I$ in $R$ such that $fI = 0$. It follows that $V(I) = D(f)$ by a simple argument. Also, $0 = fi = i + i^2$, and hence $f^2 = 1 + i + i + i^2 = 1 + i = f$, so $f$ is an idempotent. Consider the canonical map $R \to R_f$. It is surjective since $x/f^n = x/f = xf/f^2 = xf/f = x/1$ in $R_f$. Any element of $I$ is in the kernel since $fI = 0$. If $x \mapsto 0$ in $R_f$, then $f^nx = 0$ for some $n > 0$ and hence $(1 + i)x = 0$ hence $x \in I$.
By Lemma \ref{lemma-topology-spec} and Topology, Lemma \ref{topology-lemma-closed-union-connected-components} we see that (1) and (2) are equivalent. Assume (2) and write $T = \bigcap U_\alpha$ with $U_\alpha \subset \Spec(R)$ open and closed. Then $U_\alpha = D(e_\alpha)$ for some idempotent $e_\alpha \in R$ by Lemma \ref{lemma-disjoint-decomposition}. Then setting $I = (1 - e_\alpha)$ we see that $T = V(I)$, i.e., (3) holds. Finally, assume (3). Write $T = V(I)$ and $I = (e_\alpha)$ for some collection of idempotents $e_\alpha$. Then it is clear that $T = \bigcap V(e_\alpha) = \bigcap D(1 - e_\alpha)$. \medskip\noindent Suppose that $I$ is an ideal generated by idempotents. Let $e \in R$ be an idempotent such that $V(I) \subset V(e)$. Then by Lemma \ref{lemma-Zariski-topology} we see that $e^n \in I$ for some $n \geq 1$. As $e$ is an idempotent this means that $e \in I$. Hence we see that $I$ is generated by exactly those idempotents $e$ such that $T \subset V(e)$. In other words, the ideal $I$ is completely determined by the closed subset $T$ which proves uniqueness.
Let $\mathfrak p$ be a prime of $R$. By Lemma \ref{lemma-topology-spec} we have see that the hypotheses of Topology, Lemma \ref{topology-lemma-connected-component-intersection} are satisfied for the topological space $\Spec(R)$. Hence the connected component of $\mathfrak p$ in $\Spec(R)$ is the intersection of open and closed subsets of $\Spec(R)$ containing $\mathfrak p$. Hence it equals $V(I)$ where $I$ is generated by the idempotents $e \in R$ such that $e$ maps to $0$ in $\kappa(\mathfrak p)$, see Lemma \ref{lemma-disjoint-decomposition}. Any idempotent $e$ which is not in this collection clearly maps to $1$ in $R/I$.
Let $x \in M$ as in (1). Let $I = \{f \in R \mid fx = 0\}$. It is easy to see that $I$ is an ideal (it is the annihilator of $x$). Condition (1)(c) means that for all maximal ideals $\mathfrak m$ there exists an $f \in R \setminus \mathfrak m$ such that $fx =0$. In other words, $V(I)$ does not contain a closed point. By Lemma \ref{lemma-Zariski-topology} we see $I$ is the unit ideal. Hence $x$ is zero, i.e., (1)(a) holds. This proves (1). \medskip\noindent Part (2) follows by applying (1) to all elements of $M$ simultaneously. \medskip\noindent Proof of (3). Let $H$ be the homology of the sequence, i.e., $H = \Ker(M_2 \to M_3)/\Im(M_1 \to M_2)$. By Proposition \ref{proposition-localization-exact} we have that $H_\mathfrak p$ is the homology of the sequence $M_{1, \mathfrak p} \to M_{2, \mathfrak p} \to M_{3, \mathfrak p}$. Hence (3) is a consequence of (2). \medskip\noindent Parts (4) and (5) are special cases of (3). Part (6) follows formally on combining (4) and (5).