Generalised Chinese Reminder Theorem - How to compute the cokernel? Let $R$ be a commutative ring of dimension one with minimal prime ideals $P_1,\ldots,P_n$. We have the canonical injective map
$$\phi_n: R/(P_1 \cap \ldots \cap P_n) \to \prod_{i=1}^n R/P_i.$$

My question is: Is there a formula for the cokernel of $\phi_n$? For instance as a product of rings again.

The case $n=2$ is well known and here $\operatorname{coker}(\phi_2) \cong R/(P_1+P_2)$. That this does not generalize to $\operatorname{coker}(\phi_n) \cong \prod_{i < j}^n R/(P_i+P_j)$ can be seen by a counter-example, see this answer.
I am grateful for any kind of insights, references and proofs!
 A: A more general version of your question was asked and answered on mathoverflow 9 years ago. When we specialize that answer to your setting, the family $\mathcal{F}$ is $\{P_1,\dots,P_n\}$, and the answer gives a sheaf-theoretic characterization of the cokernel of $\phi$, 
$$O(\mathcal{F}) = (\prod_{i=1}^n \limits R/P_i)/\phi(R/(P_1\cap\dots\cap P_n))$$
This paper also gives examples where the cokernel vanishes (i.e. the CRT isomorphism holds) and where it doesn't.
A: Let us first observe that $M \Doteq \text{coker}(\phi_n)$ is naturally an $R/\text{rad}(R)$-module with $$\text{rad}(R) \Doteq P_1 \cap \cdots \cap P_n.$$ So, there is no actual loss in generality if we suppose that $R$ is reduced, i.e., $\text{rad}(R) = \{0\}$: if there is a formula for $M$ as an $R/\text{rad}(R)$-module, we should be able to derive a formula for $M$ taken as an $R$-module by re-injecting $\text{rad}(R)$. 
Let us assume that $R$ is reduced and let us identify $R$ with its image by $\phi_n$.
There is of course a formula that expresses $M \Doteq \text{coker}(\phi_n) = \left(\prod_{i = 1}^nR/P_i\right)/R$ as a function of the ideals $P_i$. This is for instance the following presentation of $M$ over $R$
$$
M = \left\langle e_1, \dots, e_n \, \vert \, \sum_{j = 1}^n e_j = P_ie_i = 0,\quad i = 1, \dots, n \right\rangle
$$ 
where $e_i$ corresponds to the identity element of $R/P_i$.
You may object that it doesn't to tell much about the structure of $M$ and I would agree. Still, note that it makes clear that $M$ can be generated by $n - 1$ elements, so that if $n = 2$, we see almost immediately that $M$ is the cyclic $R$-module $R/(P_1 + P_2)$.
Now comes the bad news. In general, the $R$-module $M$ does not split as a direct sum of factor rings of $R$, or equivalently, cyclic submodules of $M$. Here is a counter-example:

Claim 1. Let $R$ be the integral group ring of $C_4$, the cyclic group with $4$ elements, that is, $R =  \mathbb{Z}[C_4] = \mathbb{Z}[X]/(X^4 - 1)$. Let $\tilde{R}$ be the integral closure of $R$, that is, $\tilde{R} = \mathbb{Z}[X]/(X - 1) \times \mathbb{Z}[X]/(X + 1) \times \mathbb{Z}[X]/(X^2 + 1) \simeq \mathbb{Z} \times \mathbb{Z} \times \mathbb{Z}[i]$. Then $M \Doteq \text{coker}(\phi_3) = \tilde{R}/R$ is a non-cyclic two-generated $R$-module which is indecomposable.

According to [1, pages 19--20], the integral group ring $R = \mathbb{Z}[G]$ of a finite Abelian group $G$ is always Gorenstein, but it is a Bass ring if and only if the cardinality $\vert G \vert$ of $G$ is square-free. By a Bass ring, we mean a Noetherian reduced commutative unital ring $R$ of Krull dimension one and such that $\tilde{R}/R$ is a cyclic $R$-module where $\tilde{R}$ is the integral closure of $R$. 
Thus the fact that the module $M$ of Claim 1 is not cyclic is already predicted by Bass's theorem, see [2, Theorem 2.1] and the rings $\mathbb{Z}[G]$ may yield further counter-examples. 

Proof of Claim 1. Let us denote by $x$ the image of $X$ in $R$ and set $P_1 = R(x - 1), P_2 = R(x + 1)$ and $P_3 = R(x^2 + 1)$. We denote by $\epsilon_i$ the identity element of $R/P_i$ and by $e_i$ its image in $M$ for $i = 1, 2, 3$. It is easily checked that $M \simeq \left(R/P_1 \times R/P_2 \right) /P_3(\epsilon_1 + \epsilon_2)$ and that $P_3(\epsilon_1 + \epsilon_2) = \mathbb{Z} \cdot 2(\epsilon_1 + \epsilon_2) + \mathbb{Z} \cdot 2(\epsilon_1 - \epsilon_2)$. As a result, $M$ has the following $R$-module presentation: $$M = \langle e_1, e_2 \, \vert \, 4e_1 = 4e_2 = 2(e_1 + e_2) = 0 \rangle.$$ 
  In particular $M$ is isomorphic to $\mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/4\mathbb{Z}$ as an Abelian group and we can take $e \Doteq e_1 + e_2$ as the canonical generator of $\mathbb{Z}/2\mathbb{Z}$ and any of $e_1$ or $e_2$ as the canonical generator of $\mathbb{Z}/4\mathbb{Z}$. 
Now we claim that: 
  
  
*
  
*$M$ is not a cyclic $R$-module.
  
*$Re_1, Re$ and $Re_2$ are the only $R$-submodules of $M$ with $4$ elements.
  
*$R \cdot 2e_1 = R \cdot 2e_2$ is the only $R$-submodule of $M$ with $2$ elements. 
  
  
  The fact that $R \cdot 2e_1$ is the unique minimal non-zero $R$-submodule of $M$  proves instantly that $M$ is indecomposable. For the first assertion, let us reason by contradiction, assuming that $M = Rf$ with $f = ae + be_1, a, b \in \mathbb{Z}$. Then $M$ is generated as a $\mathbb{Z}$-module by $f$ and $xf = -ae + (2a + b)e_1$, so that the $\mathbb{Z}$-module $M/(R \cdot 2e_1) \simeq_{\mathbb{Z}} \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ is generated by the image of $f$, a contradiction.
The last two assertions are routine. $\square$

Remark.
In the answer to your MSE post, the following example was considered.
Let $R = \mathbb{C}[X, Y]/XY(X - Y)$, with minimal primes $P_1 = Rx, P_2 = Ry$ and $P_3 = R(x - y)$ where $x, y$ are the images of $X$ and $Y$ in $R$. Then the integral closure of $R$ is $\tilde{R} = R/P_1 \times R/P_2 \times R/P_3$ and it is not difficult to show that $$\tilde{R}/R \simeq (R/(P_1 + P_2))^2.$$ Indeed, we have $\tilde{R}/R  \simeq \left(R/P_1 \times R/P_2 \right) /P_3(\epsilon_1 + \epsilon_2)$ and $P_3(\epsilon_1 + \epsilon_2) = P_2\epsilon_1 + P_1\epsilon_2$. Hence this $M \Doteq \tilde{R}/R $ does split as a direct sum of two indecomposable cyclic $R$-modules.
On the positive side, we have:

Claim 2. Assume that $M \Doteq \text{coker}(\phi_n)$ can be generated by $d \le n - 1$ over $R$. Then we have $\text{Fitt}_0(M) \subseteq \text{ann}(M)$ and $\text{ann}(M)^{d} \subseteq \text{Fitt}_0(M)$ where the Fitting ideal $\text{Fitt}_0(M)$ is given by 
  $$
\text{Fitt}_0(M) = \sum_{1 \le i_1 < \cdots < i_{n - 1} \le n} P_{i_1} \cdots P_{i_{n - 1}}.
$$
  In particular, $\text{ann}(M) = \text{Fitt}_0(M)$ if $M$ can be generated by one element over $R$.
Proof. This is [3, Proposition 20.7].


[1] H. Bass, "On the ubiquity of Gorenstein rings", 1963.
[2] L. Levy, R. Wiegand, "Dedekind-like behaviors of rings with $2$-generated ideals", 1985.
[3] D. Eisenbud, "Commutative Algebra with a View Toward Algebraic Geometry", 1995.  
