# Decomposition of a primitive ideal of a quadratic order

Let $K$ be a quadratic number field. Let $\mathcal{O}_K$ be the ring of algebraic integers in $K$. Let $R$ be an order of $K$, $D$ its discriminant. I am interested in the ideal theory on $R$ because it has a deep connection with the theory of binary quadratic forms as shown in this. By this question, $1, \omega = \frac{(D + \sqrt D)}{2}$ is a basis of $R$ as a $\mathbb{Z}$-module.

Let $x_1,\cdots, x_n$ be a sequence of elements of $R$. We denote by $[x_1,\cdots,x_n]$ the $\mathbb{Z}$-submodule of $R$ generated by $x_1,\cdots, x_n$.

Let $I$ be a non-zero ideal of $R$. I am interested in a decomposition of $I$ into a product of ideals. By this question, there exist unique rational integers $a, b, c$ such that $I = [a, b + c\omega], a \gt 0, c \gt 0, 0 \le b \lt a, a \equiv 0$ (mod $c$), $b \equiv 0$ (mod $c$). If $c = 1$, we say $I$ is a primitive ideal. Let $a = ca'$, $b = cb'$. Then $I = cJ$, where $J = [a', b' + \omega]$. Clearly $J$ is a primitive ideal. So the decomposition problem can be reduced to the case when $I$ is primitive.

Let $\frak{f}$ $= \{x \in R | x\mathcal{O}_K \subset R\}$. Let $I$ be a non-zero ideal of $R$. If $I + \mathfrak{f} = R$, we call $I$ regular. For the properties of regular ideals, see this. We call a non-zero ideal $J$ totally non-regular if every prime ideal containing $J$ is non-regular. I came up with the following proposition.

Proposition Let $I = [a, r + \omega]$ be a primitive ideal of $R$, where $a \gt 0$ and $r$ are rational integers. Then $I$ can be uniquely decomposed into $I = JM$, where $J$ is a regular ideal and $M$ is a totally non-regular ideal. Moreover there exist rational integers $g \gt 0, h \gt 0$ such that $a = gh$ and $J = [g, r + \omega], M = [h, r + \omega]$.

Outline of my proof I used the results of this question and mimicked my proof of this question.

My Question How do you prove the proposition? I would like to know other proofs based on different ideas from mine. I welcome you to provide as many different proofs as possible. I wish the proofs would be detailed enough for people who have basic knowledge of introductory algebraic number theory to be able to understand.

It is easy to see that there exist unique positive rational integers $g, h$ such that $a = gh$ and gcd$(g, f) = 1$ and every prime divisor of $h$ is a prime divisor of $f$.
Let $\sigma$ be the unique non-identity automorphism of $K/\mathbb{Q}$. Since $\omega + \sigma(\omega) = D$, $\sigma(\omega) \in R$. Hence $N_{K/\mathbb{Q}}(r + \omega) = (r + \omega)(r + \sigma(\omega)) \in I$. Since $N_{K/\mathbb{Q}}(r + \omega) \in \mathbb{Z}$, it is divisible by $a$. Hence it is divisible by $g$ and $h$. Hence by this question, $J = [g, r + \omega]$ and $M = [h, r + \omega]$ are ideals of $R$. By this question, $J$ is regular. We claim that $M$ is totally non-regular. Let $P$ be a prime ideal of $R$ containing $M$. It suffices to prove that $P$ is not regular. Let $p$ be the unique prime number contained in $P$. Since $h \in P$, $h$ is divisible by $p$. Since $f$ is divisible by $p$, $f \in P$. Hence $P$ is not regular by Lemma 4 of my answer to this question.
Next we prove that $I = JM$. Let $\theta = r + \omega$. Then $JM = (g, \theta)(h, \theta) = (gh, g\theta, h\theta, \theta^2) \subset I$. It is easy to see that $N(I) = a$. Similarly $N(J) = g, N(M) = h$. Hence $N(I) = N(J)N(M)$. Since $J$ is regular, $N(J)N(M) = N(JM)$ by this question. Hence $I = JM$.
It remains to prove the uniqueness of the decomposition $I = JM$. Note that, by this question, $J$ is invertible and uniquely decomposed as a product of regular prime ideals. Let $I = J'M'$ be another such decomposition. Since $J$ is invertible, it suffices to prove that $J = J'$. Suppose $J \subset P^e$, $e \ge 1$ where $P$ is a prime ideal. It suffices to prove that $J' \subset P^e$. Since $J \subset P$ and $J$ is regular, $P$ is also regular. Hence $P$ does not contain $M'$. Hence $M' + P^e = R$. Hence there exist $\mu \in M'$ and $\pi \in P^e$ such that $\mu + \pi = 1$. Let $x \in J'$. Since $x = \mu x + \pi x$ and $M'J' \subset P^e$, $x \in P^e$. Hence $J' \subset P^e$ as desired.