Proper equivalence of binary quadratic forms (source code)

= Proper equivalence of binary quadratic forms
{title2=$g=f\circ M,\quad M\in\operatorname{SL}_2(\mathbb Z)$}

= Proper equivalence
{synonym}

Integral <binary quadratic forms> $f$ and $g$ are properly equivalent if
$$
g(x,y)=f(\alpha x+\beta y,\gamma x+\delta y),\qquad M=\begin{pmatrix}\alpha&\beta\\\gamma&\delta\end{pmatrix}\in\operatorname{SL}_2(\mathbb Z).
$$
The <matrix> $M$ has <integer> entries and <determinant> one. Its inverse $\begin{pmatrix}\delta&-\beta\\-\gamma&\alpha\end{pmatrix}$ also has integer entries, so the change is a <bijection> of the integer lattice. Consequently $f$ and $g$ represent the same <integers>, and the <discriminant of a binary quadratic form> is unchanged.

Allowing <determinant> minus one as well gives the broader equivalence under <unimodular matrices>. Proper equivalence retains <orientation>. For example, the shear $(x,y)\mapsto(x+y,y)$ is proper and takes $[1,0,1]$ to $[1,2,2]$. The reflection $(x,y)\mapsto(x,-y)$ instead has <determinant> minus one and takes $[a,b,c]$ to $[a,-b,c]$; those two forms need not be properly equivalent. This distinction matters when counting the <class number of a negative discriminant>.