[proofplan]
The theorem establishes an equivalence between a representation question — does some BQF of discriminant $d$ properly represent $n$? — and a purely congruential question — is $x^2 \equiv d \pmod{4n}$ soluble? The forward direction uses the normalisation lemma: proper representation of $n$ by a form $f$ lets us replace $f$ by an equivalent form $(n, b, c)$, at which point the discriminant identity $d = b^2 - 4nc$ reads off a solution to the congruence directly. The converse is constructive: given a solution $b$, we produce a form $(n, b, c)$ of discriminant $d$ that represents $n$ at $(1, 0)$.
[/proofplan]
[step:Forward direction: extract a congruence solution from a form representing $n$]
Suppose $n \geq 1$ is properly represented by some positive definite BQF $f$ of discriminant $d$. By the [lemma on proper representation and equivalence](/theorems/1733), there exists a BQF $g \sim f$ with leading coefficient $n$, say $g = (n, b, c)$ for some $b, c \in \mathbb{Z}$. Since equivalent forms have the same discriminant — this is the content of [Discriminant is an Invariant](/theorems/1726) — we have
\begin{align*}
d = \operatorname{disc}(g) = b^2 - 4nc.
\end{align*}
Reducing modulo $4n$:
\begin{align*}
b^2 \equiv d \pmod{4n}.
\end{align*}
Hence $x = b$ is a solution to $x^2 \equiv d \pmod{4n}$.
[guided]
Suppose $n \geq 1$ is properly represented by some positive definite BQF $f$ of discriminant $d$. The hypothesis "$n$ is properly represented by $f$" means there exist $\gamma, \delta \in \mathbb{Z}$ with $\gcd(\gamma, \delta) = 1$ and $f(\gamma, \delta) = n$. We want to extract an $x \in \mathbb{Z}$ satisfying $x^2 \equiv d \pmod{4n}$.
The strategy is a normalisation: replacing $f$ by an equivalent form whose leading coefficient is exactly $n$ converts the representation question into a statement about the form's coefficients. By the [lemma on proper representation and equivalence](/theorems/1733), whose hypothesis "$f$ properly represents $n$" is precisely our assumption, there exists a BQF $g \sim f$ with leading coefficient $n$, so $g = (n, b, c)$ for some $b, c \in \mathbb{Z}$.
Now why does this help? Equivalence preserves the discriminant: [Discriminant is an Invariant](/theorems/1726) tells us that if $g = Af$ for some $A \in \mathrm{SL}_2(\mathbb{Z})$, then $\operatorname{disc}(g) = \operatorname{disc}(f)$. The hypothesis of that theorem — equivalence via $\mathrm{SL}_2(\mathbb{Z})$ — is satisfied by construction. Thus
\begin{align*}
d = \operatorname{disc}(f) = \operatorname{disc}(g) = b^2 - 4nc.
\end{align*}
The right-hand side is a congruence identity in disguise: reducing modulo $4n$, the $-4nc$ term vanishes and we obtain
\begin{align*}
b^2 \equiv d \pmod{4n}.
\end{align*}
The key move is that the coefficient $b$ of $g$, which exists purely as an algebraic consequence of the normalisation, solves the congruence. This is the essential "form-to-congruence" passage.
[/guided]
[/step]
[step:Converse direction: build a form from a congruence solution]
Suppose $x^2 \equiv d \pmod{4n}$ is soluble; pick a specific integer solution $b \in \mathbb{Z}$, so $b^2 \equiv d \pmod{4n}$. Then $4n \mid b^2 - d$, and we define
\begin{align*}
c := \frac{b^2 - d}{4n} \in \mathbb{Z}.
\end{align*}
Consider the triple $(n, b, c)$, interpreted as the BQF
\begin{align*}
g : \mathbb{Z}^2 &\to \mathbb{Z}, \\
(x, y) &\mapsto nx^2 + bxy + cy^2.
\end{align*}
Its discriminant is $b^2 - 4nc = b^2 - (b^2 - d) = d$, matching the target discriminant.
We verify that $g$ properly represents $n$. Evaluating at $(1, 0)$:
\begin{align*}
g(1, 0) = n \cdot 1^2 + b \cdot 1 \cdot 0 + c \cdot 0^2 = n,
\end{align*}
and $\gcd(1, 0) = 1$, so this is a proper representation. We also check that $g$ is positive definite when $d < 0$: by the theorem [Discriminant Determines Definiteness](/theorems/1728), a BQF $(a, b, c)$ with discriminant $d < 0$ and $a > 0$ is positive definite; here $a = n \geq 1 > 0$, so $g$ is positive definite.
[guided]
Suppose $x^2 \equiv d \pmod{4n}$ is soluble, so there exists $b \in \mathbb{Z}$ with $b^2 \equiv d \pmod{4n}$. Our task is to construct a positive definite BQF of discriminant $d$ that properly represents $n$. The construction is direct: we will write down a triple $(a, b', c')$ whose discriminant is $d$ and whose evaluation at $(1, 0)$ equals $n$.
The natural first guess is $a = n$ and $b' = b$; then the discriminant condition $d = b^2 - 4nc'$ forces $c' = (b^2 - d)/(4n)$. The hypothesis $b^2 \equiv d \pmod{4n}$ is exactly what makes this $c'$ an integer: we have $4n \mid b^2 - d$, so
\begin{align*}
c := \frac{b^2 - d}{4n} \in \mathbb{Z}.
\end{align*}
This is where the congruence hypothesis is consumed — it is the integrality criterion for $c$.
Define the BQF
\begin{align*}
g : \mathbb{Z}^2 &\to \mathbb{Z}, \\
(x, y) &\mapsto nx^2 + bxy + cy^2.
\end{align*}
We check the two required properties.
**Discriminant**: $\operatorname{disc}(g) = b^2 - 4nc = b^2 - (b^2 - d) = d$, by construction.
**Proper representation**: $g(1, 0) = n \cdot 1 + b \cdot 0 + c \cdot 0 = n$, and $\gcd(1, 0) = 1$. So $(1, 0)$ is a primitive vector mapping to $n$ under $g$. By definition, $g$ properly represents $n$.
**Positive-definiteness** (needed if we want a positive definite representative): we invoke [Discriminant Determines Definiteness](/theorems/1728), whose hypotheses require $d < 0$ and $a > 0$, where $(a, b, c)$ is our form. The first hypothesis is given; the second holds because $a = n \geq 1$. The theorem's conclusion is that $g$ is positive definite. Hence $g$ is a positive definite BQF of discriminant $d$ properly representing $n$, completing the converse.
[/guided]
[/step]
[step:Combine the two directions]
We have shown both implications. In the forward direction, proper representation of $n$ by some positive definite BQF of discriminant $d$ yields $b$ with $b^2 \equiv d \pmod{4n}$. In the converse direction, a solution $b$ to $b^2 \equiv d \pmod{4n}$ yields the BQF $(n, b, (b^2 - d)/4n)$ of discriminant $d$ properly representing $n$. Together, these establish the equivalence as stated.
[/step]