Equivalence and Reduction of Binary Forms
How many genuinely different binary quadratic forms represent exactly the same integers? How would you ever check that two forms like and are secretly "the same"? This question sounds combinatorial but conceals deep arithmetic. Forms of a fixed discriminant fall into finitely many classes. Gauss's theory of reduction gives an algorithm for this. From any positive definite form, it produces a canonical representative of its class. This happens in finitely many steps. This matters because the class number — the number of such classes — encodes delicate information. It relates to factorization in Quadratic Fields and to the representability of primes. It generalizes the two-square and Pell-type phenomena that Fermat and Euler discovered by hand. The right notion of "same form" is equivalence under the action of . This is the group of integer matrices with determinant . It acts on forms by linear substitution of variables. This action preserves the discriminant. It also preserves exactly which integers are represented. So it is the natural symmetry group for the theory built in Binary Quadratic Forms: Introduction. The subtlety is that is infinite. So a priori a single equivalence class could be infinite. It might seem an unwieldy set of forms with no obvious finite description. Gauss's resolution is reduction theory. Among all forms equivalent to a given positive definite form, one is distinguished. This is the reduced form. It is singled out by simple inequalities on its coefficients. Every equivalence class contains at least one reduced form. Coincidences of more than one are rare and controlled. This converts an infinite orbit into a finite search. To test equivalence of two forms of the same discriminant, reduce both and compare. The reduction algorithm itself is a Euclidean-style descent. It belongs to the same circle of ideas that computes continued fraction expansions. This foreshadows the tight connection between forms, continued fractions, and Pell's Equation and Continued Fractions. This article develops the -action rigorously. It defines reduced positive definite forms. It proves that every class has a reduced representative. It also shows that, apart from an explicit boundary ambiguity, this representative is unique. From this we deduce the classical finiteness of the class number. Along the way we prove sharp coefficient bounds. These make reduction a genuinely terminating, hand-computable algorithm.
- acts on binary quadratic forms by variable substitution; this action preserves the discriminant and the set of represented integers.
- Two forms are equivalent if one is carried to the other by this action; equivalence classes partition all forms of a fixed discriminant.
- A positive definite form is reduced if , with whenever or .
- Every class of positive definite forms contains a reduced form, found by a terminating Euclidean-style descent.
- Reduced forms of a given discriminant are unique in each class except for an explicit boundary pairing, so there are only finitely many classes.
- Key idea: reduction turns the infinite symmetry group into a finite, checkable classification via coefficient inequalities.
Where this lives today
Reduction of positive definite binary quadratic forms is the concrete engine behind computing the class number of the imaginary quadratic field , since the class group of that field is isomorphic to the group of -classes of primitive forms of discriminant under Gauss composition — a bridge that turns purely elementary coefficient inequalities into deep statements about factorization of ideals in Quadratic Fields. The same reduction algorithm, run in reverse for indefinite forms, becomes the continued fraction algorithm for computing fundamental solutions of the Pell equation, the subject taken up next in Pell's Equation and Continued Fractions. In computational number theory and cryptography, reduced binary forms of large negative discriminant give a concrete, efficiently manipulable model of class groups used in cryptographic protocols (form-class-group based schemes, analogous in spirit to elliptic curve groups), while in the geometry of numbers, reduction generalizes to Minkowski-reduced bases of lattices in higher dimensions, feeding into lattice-based cryptography and the LLL algorithm. Finally, the reduced representative realizing the minimal value gives explicit, sharp bounds used whenever one needs to bound the smallest integer represented by a given quadratic form, a recurring lemma throughout the theory built on Binary Quadratic Forms: Introduction.
Ask the tutor: Can you walk through Gauss composition of two reduced forms of the same discriminant to see how the class set becomes a group?
A binary quadratic form is with , written , with discriminant . Assume throughout and , so that is positive definite: for all . The group
acts on forms by the substitution
Two forms are equivalent, written , if for some . A positive definite form is reduced if
Intuition
Think of a positive definite form as an ellipse: traces an ellipse in the plane for each , and the values represented by are exactly the levels at which some lattice point lies on that ellipse. Changing variables by does not change the lattice at all — it only relabels which pair of integers we call "" — so it cannot change which values are hit. Equivalence of forms is thus the statement that the same quadratic shape, viewed through two different integer bases of the same lattice, produces two algebraically different-looking formulas and . Reduction picks out, among all bases of that lattice, the one made from the two shortest linearly independent vectors, ordered and oriented in a fixed way. Concretely, is the squared length (in the metric defined by ) of the first basis vector, of the second, and measures their "angle." The condition says the first vector is at least as short as the second; says the angle between them is at least -ish (no shorter vector can be built by adding/subtracting one basis vector from the other); the sign convention on removes the last two-fold ambiguity (reflection). This is exactly Gauss's reduction of positive definite quadratic forms, the two-dimensional case of Minkowski reduction of lattices.
The central theorem
Let . Every -equivalence class of positive definite binary quadratic forms of discriminant contains at least one reduced form. Consequently, the number of equivalence classes of discriminant is finite.
If via then and have the same discriminant, and an integer is represented by (i.e. for some ) if and only if it is represented by .
Write and let with . Set , so .
Discriminant. In matrix form, with , one has and the substitution corresponds to . Taking determinants, since . Since , we get .
Representation. The map , , is a bijection of onto itself: its inverse is given by the matrix (using ), which again has integer entries. Hence as ranges over all of , so does , and by definition . Therefore
so and represent exactly the same set of integers (with the same multiplicities, in fact, though we only need the set equality here).
∎(Proof of the theorem.) We use the method of descent: given a positive definite form, we show that unless it already satisfies the defining inequalities, an explicit elementary equivalence strictly decreases the coefficient (or leaves fixed while making progress), and since is a positive integer this process must terminate. Step 1: Two elementary moves. For any , the matrix lies in (determinant ), and
Indeed . Also the matrix (determinant ) gives
since . Step 2: Descent argument. Let be positive definite of discriminant ; in particular and (since ) also (as forces to have the same sign as ). Among all forms equivalent to , choose one, say again by abuse of notation, that minimizes over the (nonempty) set of first coefficients occurring in the equivalence class; such a minimum exists because ranges over a set of positive integers (positive definiteness forces every form in the class to have positive leading coefficient, by the Lemma applied to carried across equivalences — more directly, for any positive definite ). Call this minimizing form . Claim: . Choose with as small in absolute value as possible; since we can pick so that (division-with-remainder: write choosing so that the remainder ... concretely, since consecutive multiples of are spaced apart, some multiple of lies within of , i.e. some makes ). Applying replaces by with , and leaves unchanged (the first coefficient of is still ). Since was already minimal in the class, this new form (where ) still has first coefficient , consistent with minimality, and now satisfies . Rename ; we now have a minimizing representative with . Claim: . Since and , we get
and moreover
If we had , then applying to gives the equivalent form , whose first coefficient is — contradicting the minimality of in the class. Hence . Step 3: Fix the sign of at the boundary. We now have . If , apply suitably: from , applying gives , an equivalent form with replaced by ; this does not change or and does not affect the inequality . Likewise if and , apply : , again equivalent, unchanged , now with . Performing whichever of these sign-fixes applies, we obtain an equivalent form with
which is precisely the definition of reduced. This proves every equivalence class contains a reduced form. Step 4: Finiteness of . It remains to show only finitely many reduced forms have a given discriminant . If is reduced then , so
giving
Thus ranges over finitely many positive integers. For each such , ranges over the finite set (finitely many values), and once are fixed, is determined by . Hence there are only finitely many reduced forms of discriminant , and since every class contains at least one, .
∎If is a reduced positive definite form of discriminant , then is the smallest positive integer represented by the form, and
By the theorem's Step 4, . To see is the minimal represented value: for with , for . For , complete the square:
Using one checks when ; a slightly more careful case analysis (splitting on vs and using integrality) shows in fact for all , with equality at . We omit the elementary but slightly fussy verification of the sharp constant, which is standard; the qualitative fact that realizes the minimum over the reduced form's own representations is the content used later, e.g. in class number computations and the connection to Pell's Equation and Continued Fractions.
∎Worked examples
Example 1 — Reducing an asymmetric form. Take , i.e. . First compute the discriminant:
Check positive definiteness: and , so yes. We follow the descent algorithm. Currently , so the coefficient is not yet minimal in position; apply , which sends :
Check: this should have the same discriminant. . Good, matches . Now : we need , but . Apply with chosen so has smallest absolute value; try : , and . Good, take .
Check discriminant: . Correct. Now : check reduced conditions. . Since and , the boundary sign condition is vacuous. This form is reduced.
Verification of equivalence directly: the composite matrix is . Compute
determinant , confirming . Direct check: with , . Compute
This does not match — because the correct composition order for iterated substitution is applied as corresponds to the matrix product acting via ; let us redo this carefully with the correct order first, then : the composite substitution is , i.e. matrix as above, but the action convention means we apply then reading right to left on vectors, matching . Let's just verify numerically instead: with , so , we get exactly as above, giving — discriminant , consistent, but not equal to . The resolution is that composition of the form action reverses matrix order: if and , then , so . We performed first () and then (), so , matrix product , not . Recompute:
With :
This matches exactly. So indeed via , and is the reduced form of this class.
Example 2 — A discriminant with two classes. Let . By the corollary, any reduced form satisfies , so . Case : then so ; reducedness requires when , so is excluded, leaving . From : if , , giving , and , valid, reduced (boundary conditions: , and , vacuous). If : , discard. Case : , ; reduced requires when , excluding ; and when requires (relevant if ). From , i.e. :
- : , not integer.
- : , not integer.
- : . Check : valid. Form , reduced (since we needed : satisfied).
- : , not integer.
So the reduced forms of discriminant are exactly and , giving
As a sanity check on distinctness: represents , but the minimum nonzero value of is (by the Corollary), so can never represent ; since represented sets are equivalence invariants (Lemma), the two forms are genuinely inequivalent, confirming is correct and not an artifact of the coefficient search.
The reduction theorem crucially assumes (positive definiteness). If instead — an indefinite form — the descent argument collapses and reduced forms are not even unique up to a finite ambiguity in the naive sense; worse, there can be infinitely many inequivalent-looking "small" representatives, or conversely genuinely different reduction chains cycling forever, tied directly to the infinitude of solutions of Pell's equation. Concretely take , so consider : discriminant . This form is indefinite: but , so it takes both signs and there is no notion of " forces positive definiteness" to run Step 2 of the descent (indeed here, so the key inequality chain used to conclude in the proof fails: here , consistent, but negative, so and need not share a sign). Now apply repeatedly: . As ranges over , this produces infinitely many distinct equivalent forms , all with the same leading coefficient — so the descent's key move (strictly decreasing when ) never triggers a termination the way it does for , because there is no lower bound forcing pinning things down; the sequence of -values is unbounded, and no finite search over bounds anything since stays fixed while . The orbit under just the 's alone already fails to be finite-looking without a wholly different (and genuinely more delicate) indefinite reduction theory, tied to continued fractions of and to the automorphism group of the form containing solutions of the Pell equation . This is exactly the phenomenon that reappears in Pell's Equation and Continued Fractions: indefinite forms have infinite automorphism groups, positive definite forms (generically) do not, and this dichotomy is precisely why the finiteness argument in the theorem needed throughout (used to force and to bound , both meaningless or false for ).
Scope, edge cases & common traps
| Situation | What happens | Why |
|---|---|---|
| , (primitive form) | Reduction theory applies verbatim; class number usually restricted to primitive classes in deeper theory | Primitivity is preserved by -equivalence since of coefficients is an invariant |
| , | Boundary case; sign convention needed to avoid double-counting via | Without the sign fix, and would look like two reduced forms in one class |
| , | Boundary case; sign convention needed since identifies | Same reasoning: without fixing sign, uniqueness of the reduced representative fails |
| (indefinite) | This reduction theory does not apply; automorphism group is infinite (Pell solutions) | See counterexample above |
| not | No integral form has this discriminant |
The mathematician behind it
Origins · 1 minCarl Friedrich Gauss and how this was discovered
Gauss developed the full theory of binary quadratic form equivalence and reduction in Disquisitiones Arithmeticae (1801), including the composition law that makes the set of classes into a finite abelian group — a structure not fully abstracted as a "group" until decades later. His reduction algorithm for positive definite forms, essentially the descent argument given above, was one of the first genuinely algorithmic classification theorems in number theory, and it directly inspired later reduction theories for lattices and quadratic forms in higher dimensions (Hermite, Minkowski).
Why must we require rather than ?
Matrices of determinant , such as , are integer-invertible bijections of and do preserve the set of represented integers, so one could build a coarser equivalence using (determinant ). Gauss's classical theory uses the finer -equivalence because it interacts correctly with the orientation built into the composition law on classes, turning the set of classes into a group; using can merge a form with its "mirror image," collapsing some of this structure. Both conventions appear in the literature, so when comparing sources it is essential to check which group is intended, especially near the boundary cases or addressed by the sign convention.
Is the reduced form always unique in its equivalence class?
Almost always, yes; the only failures occur exactly at the boundary inequalities. If is reduced and none of , , or hold in a degenerate combined way, it is the unique reduced form in its class. The genuinely ambiguous coincidences are precisely those handled by the sign convention in the definition: forms with or come in equivalent sign-flipped pairs, and the convention picks one representative from each such pair, restoring uniqueness. A full uniqueness proof requires checking that and (and their combinations) cannot connect two forms both satisfying the strict reduced inequalities unless they are equal — a short case-check often included alongside the existence proof.
How does this connect to sums of two squares and similar classical representation problems?
The form has discriminant ; running the coefficient bound forces , and one checks is the only reduced form, so . This single-class phenomenon is exactly why " is a sum of two squares" has a clean multiplicative characterization (Fermat's two-square theorem) with no extra correction terms from inequivalent forms of the same discriminant. Discriminants with , like from the worked example, correspondingly have representation problems that split according to which class a prime falls into — a phenomenon fully explained once Gauss composition and genus theory are introduced.
Can a reduced form fail to exist, or can the descent loop forever, for some positive definite form?
No — the theorem's proof shows termination is guaranteed for every positive definite form of every discriminant . The key structural reason is that positive definiteness forces the leading coefficient to remain a positive integer throughout, and the two elementary moves either strictly decrease (when is invoked because ) or leave fixed while shrinking into the range (a one-time correction, since is then stable). A positive integer sequence that is non-increasing and strictly decreases infinitely often cannot exist, forcing termination in finitely many steps.
Does every discriminant actually occur, and is ever zero?
An integer is the discriminant of some integral binary quadratic form if and only if or , because and squares mod are only or . Whenever this congruence condition holds, at least the form or (depending on parity of ) exists and is positive definite for , so always in the admissible cases; never occurs for admissible negative .
How is this reduction theory related to continued fractions?
For indefinite forms (), the analogous reduction process is driven by the continued fraction expansion of the root of the associated quadratic, and cycles of reduced indefinite forms correspond exactly to the eventually-periodic continued fraction expansion of quadratic irrationals — the same periodicity that produces the fundamental solution of Pell's equation. For positive definite forms the process terminates rather than cycling, but the elementary moves (translation) and (inversion) used here are literally the same building blocks as the continued fraction algorithm, which is why this article's descent is often called the "Euclidean algorithm for forms."
Why do we need considerations at all if the theorem doesn't mention primitivity?
The existence-of-reduced-form theorem as proved here holds for all positive definite forms, primitive or not — it never used . However, when one wants the class number to match the ideal class number of exactly, one restricts to primitive forms (those with ), since imprimitive forms are just integer multiples of primitive ones of a different discriminant and would otherwise be double-counted or misattributed. The finiteness proof itself is unaffected either way.