Bogus proof that every ideal in a Dedekind domain is principal Let $A$ be a Dedekind domain and $I$ a nonzero ideal of $A$. For every $a \in I$, $(a)$ is contained in $I$, so $I$ divides $(a)$ and there exists some ideal $J_a$ such that $(a)=IJ_a$. We have $$I=\bigcup_{a \in I}(a)=\bigcup_{a \in I}I J_{a}.$$
Now pick some $a'\neq 0$ in $I$. We have $$(a')=IJ_{a'}=\bigcup_{a \in I}I J_{a} J_{a'}=\bigcup_{a \in I}(a') J_{a}.$$ Therefore there exists some $x \in A$, $b \in I$ and $j \in J_{b}$ so that $$a'=xja',$$ so $xj=1$, $J_{b}=A$ and $(b)=I$.
But not every ideal of a Dedekind domain is principal. Where did I go wrong?
 A: Multiplication of an ideal $I$ with a set $S$ which generates an ideal $(S)=\sum_{s\in S}As$ is $IS=\{ \sum_j i_js_j,i_j\in I,s_j\in S\}$,  you don't have $I\{ S_1 \cup S_2\} = IS_1\cup IS_2$ but $I\{ S_1 \cup S_2\}= (IS_1\cup IS_2)$ and $I(S_1\cup S_2)=I\{S_1 \cup S_1\}\supset IS_1\cup IS_2$
You are right that it makes my argument in your previous question wrong (which was about finding, in a number field, an element $i\in I$ such that $(i)=IJ, (I,J)=(1)$)
A: A union of ideals is not necessarily an ideal. So instead of 
$$(a')=\bigcup_{a \in I}(a') J_{a}$$
we shall have 
$$(a')=\left<\bigcup_{a \in I}(a') J_{a}\right>,$$ the ideal generated by the union. Hence instead of $a'=xja'$, we obtain
$$a'=\sum_kx_kj_ka',$$ 
where $K$ is a finite set.
This shows that $\sum\limits_{k\in K}J_{b_k}=A$. This implies that $I=\left<b_k\mid k\in K\right>$, so $I$ is finitely generated, as expected.

Remark:
The product of an ideal is not distributive with respect to the union of ideals, but it is distributive with respect to the sum of ideals: $I(\sum J_k)=\sum_kIJ_k$. And the sum of ideals is just the ideal generated by the union of the ideals.

Hope this helps.
