Canonical: https://knowlpedia.com/linear-algebra/proper-equivalence-binary-quadratic-forms/

# Proper equivalence of binary quadratic forms

Equivalence under determinant-one integral changes of the two variables.

Two [integral binary quadratic forms](https://knowlpedia.com/linear-algebra/integral-binary-quadratic-form/) \(f,g\) are **properly equivalent** if there is a matrix
\[
\gamma=\begin{pmatrix}r&s\\t&u\end{pmatrix}\in\operatorname{SL}_2(\mathbb Z)
\]
such that \(g(x,y)=f(rx+sy,tx+uy)\). Thus a proper form class is an orbit for determinant-one integral changes of variables. Allowing determinant \(-1\) as well gives a different, coarser equivalence relation.

## Preserved data

The discriminant changes by the square of the determinant of the substitution matrix, so proper equivalence preserves it. Primitivity is preserved because both the matrix and its inverse have integer entries. Positive definiteness is preserved by invertible real substitution.

## Quadratic ideals

For a negative fundamental discriminant \(D\), proper classes of primitive positive definite forms correspond to [ideal classes](https://knowlpedia.com/algebra-fields-galois/ideal-class-group/) of the quadratic field of discriminant \(D\). The construction sends \((a,b,c)\) to the ideal
\[
a\mathbb Z+\frac{-b+\sqrt D}{2}\mathbb Z.
\]
For nonfundamental discriminants the corresponding setting is the [proper invertible ideals](https://knowlpedia.com/algebra-commutative/proper-ideal-of-order/) of the quadratic order, rather than all ideals of its [maximal order](https://knowlpedia.com/algebra-rings/maximal-order/).

## References

1. Andrew V. Sutherland, *18.785 Number Theory*, Fall 2018, [Problem Set 7](https://math.mit.edu/classes/18.785/2018fa/ProblemSet7.pdf), Problem 4(b)–(c), for fundamental discriminants.
2. David A. Cox, *Primes of the Form x² + ny²*, [§7.B, Theorem 7.7](https://www.math.utoronto.ca/~ila/Cox-Primes_of_the_form_x2%2Bny2.pdf), general imaginary quadratic orders.
