Let $F = ax^2 + bxy + cy^2$ be a binary quadratic form over $\mathbb{Z}$. We say $D = b^2 - 4ac$ is the discriminant of $F$. If $D$ is not a square integer and gcd($a, b, c) = 1$, we say $ax^2 + bxy + cy^2$ is primitive. If $D < 0$ and $a > 0$, we say $ax^2 + bxy + cy^2$ is positive definite.
Let $K$ be a quadratic number field. Let $R$ be an order of $K$. Let $D$ be its discriminant. Let $I$ be a fractional ideal of $R$. If there exists a fractional ideal $J$ of $R$ such that $IJ = R$, $I$ is called an invertible fractional ideal of $R$. The set of invertible fractional ideals of $R$ forms a group $\mathfrak{I}(R)$ with the multiplications. We call $\mathfrak{I}(R)$ the group of invertible fractional ideals of $R$. We denote by $\mathfrak{P}(R)$ the group of principal fractional ideals of $R$. $\mathfrak{P}(R)$ is a subgroup of $\mathfrak{I}(R)$. We denote $\mathfrak{I}(R)/\mathfrak{P}(R)$ by $Cl(R)$. $Cl(R)$ is called the ideal class group of $R$. Let $\mathfrak{P}^+(R) = \{\alpha R; \alpha \in K, N_{K/\mathbb{Q}}(\alpha) > 0\}$. $\mathfrak{P}^+(R)$ is a subgroup of $\mathfrak{P}(R)$. We denote $\mathfrak{I}(R)/\mathfrak{P}^+(R)$ by $Cl^+(R)$. If $K$ is a imaginary quadratic field, $Cl(R) = Cl^+(R)$. We would like to establish a bijection between $Cl^+(R)$ and the set of classes of primitive binary quadratic forms of discriminant $D$.
Let $\alpha, \beta \in K$. We denote $\alpha\beta' - \alpha'\beta$ by $\Delta(\alpha, \beta)$, where $\alpha'$(resp. $\beta'$) is the conjugate of $\alpha$(resp. $\beta$). $\Delta(\alpha, \beta) \neq 0$ if and only if $\alpha, \beta$ are linearly independent over $\mathbb{Q}$.
If $D < 0$, we define $\sqrt{D}$ as i$\sqrt{|D|}$
Let $I \neq 0$ be a fractional ideal of $R$. Let $\{\alpha, \beta\}$ be $\mathbb{Z}$-basis of $I$. If $\Delta(-\alpha, \beta)/\sqrt{D} > 0$, we say the basis $\{\alpha, \beta\}$ is positively oriented. If $\Delta(-\alpha, \beta)/\sqrt{D} < 0$, we say the basis $\{\alpha, \beta\}$ is negatively oriented.
Suppose $\{\alpha, \beta\}$ and $\{\gamma, \delta\}$ are two positively oriented bases of $I$. There exist integers $p,q,r,s$ such that
$\alpha = p\gamma + q\delta$
$\beta = r\delta + s\delta$
It is easy to see that $ps - qr = 1$.
$I$ can be written as $I = J/\lambda$, where $J$ is an ideal of $R$ and $\lambda \in R$. We define the norm of $I$ as $N(I) = N(J)/N(\lambda R)$. It is easy to see that this is well defined.
Let $x, y$ be indeterminates. Let $\{\alpha, \beta\}$ be a positively oriented basis of $I$. We write $f(\alpha, \beta; x, y) = N_{K/\mathbb{Q}}(x\alpha - y\beta)/N(I)$. Namely $f(\alpha, \beta; x, y) = (x\alpha - y\beta)(x\alpha' - y\beta')/N(I)$. It is easy to see that $f(\alpha, \beta; x, y)$ is a binary quadratic form of discriminant $D$. It is also easy to see that $f(\alpha, \beta; x, y)$ is positive definite if $D < 0$.
Suppose $\{\alpha, \beta\}$ and $\{\gamma, \delta\}$ are two positively oriented bases of $I$. It is a routine to check that $f(\alpha, \beta; x, y)$ and $f(\gamma, \delta; x, y)$ are equivalent under the action of $SL_2(\mathbb{Z})$. By the corollary of proposition 2 of this question, if $I$ is invertible, $f(\alpha, \beta; x, y)$ is primitive.
Let $\{\alpha, \beta\}$ be a positively oriented basis of $I$. Let $\delta$ be an element of $K$ such that $N_{K/\mathbb{Q}}(\delta) > 0$. Then $\{\delta\alpha, \delta\beta\}$ is a positively oriented basis of the farctional ideal $\delta I$.
$f(\delta\alpha, \delta\beta; x, y) = N_{K/\mathbb{Q}}(x\delta\alpha - y\delta\beta)/N(\delta I) = (N_{K/\mathbb{Q}}(\delta)/|N_{K/\mathbb{Q}}(\delta)|)f(\alpha, \beta; x, y)$
Hence $f(\delta\alpha, \delta\beta; x, y) = f(\alpha, \beta; x, y)$
Hence we get a map $\psi\colon Cl^+(R) \rightarrow \mathfrak{F}^+_0(D)/SL_2(\mathbb{Z})$ if $D < 0$ and $\psi\colon Cl^+(R) \rightarrow \mathfrak{F}_0(D)/SL_2(\mathbb{Z})$ if $D > 0$, where $\mathfrak{F}_0(D)$ is the set of primitive binary quadratic forms of discriminant $D$ and $\mathfrak{F}^+_0(D)$ is the set of positive definate primitive binary quadratic forms of discriminant $D$.
My question Is the following proposition true? If yes, how do we prove it?
Proposition
(1) If $D < 0$,$\psi\colon Cl^+(R) \rightarrow \mathfrak{F}^+_0(D)/SL_2(\mathbb{Z})$ is a bijection. The inverse map $\phi$ is defined as follows. Let $F = ax^2 + bxy + cy^2 \in \mathfrak{F}^+_0(D)$.
$\phi([F]) = [\mathbb{Z}a + \mathbb{Z}\frac{(-b + \sqrt{D})}{2}]$.
(2) If $D > 0$, $\psi\colon Cl^+(R) \rightarrow \mathfrak{F}_0(D)/SL_2(\mathbb{Z})$ is a bijection. The inverse map $\phi$ is defined as follows. Let $F = ax^2 + bxy + cy^2 \in \mathfrak{F}_0(D)$.
$\phi([F]) = [\alpha(\mathbb{Z}a + \mathbb{Z}\frac{(-b + \sqrt{D})}{2})]$, where $\alpha$ is any element of $K$ such that $sgn(N_{K/\mathbb{Q}}(\alpha)) = sgn(a)$.