The set of numbers that the linear form represents is completely determined by an invariant called the gcd of and , . Two of these linear forms represent the same set of numbers (are "equivalent") if the gcd of the two numbers is the same.
To better understand the binary quadratic forms it would be good to define a notion of equivalence and try to find an invariant. The invariant is called the discriminant of the form and even though it doesn't tell apart every single QF it is a key object in the theory.
Originally I wanted to define two forms to be equivalent if they represent the same set of numbers. It turns out this isn't the correct notion of equivalence. All the texts on quadratic forms define equivalence as the forms being related by a "change of variables", technically a linear transform with determinant 1. With that definition it's obvious that equivalent forms represent the same set of numbers - but the converse does not hold. I'll write about that at the end.
The determinant of the matrix is an obvious invariant, scale it up by to make it an integer and we have the discriminant of the form: .
Take the forms:
they have different discriminants (the discriminant of is 3 and the discriminant of is 12) so they can never be equivalent.. but they represent the same numbers e.g.
first so can represent everything can. Now to prove that can represent everything can let and (we can assume are coprime by dividing out the square of their gcd) then there are 3 cases to consider:
where , .
rewriting like this:
suggests
this completes the proof that the forms take on all the same values.
For testing I coded up the isomorphism and checked it really worked for many small values
q1 x y = x^2 + x*y + y^2 q2 u v = u^2 + 3*v^2 alg1 x y = (g * u, g * v) where n = q1 x y g = gcd x y (x', y', n') = (x `div` g, y `div` g, n `div` (g^2)) (u, v) = case () of () | even x' && odd y' -> (y' + x' `div` 2, x' `div` 2) () | odd x' && even y' -> (x' + y' `div` 2, y' `div` 2) () | odd x' && odd y' -> ((x' - y') `div` 2, (x' + y') `div` 2) test ns = [ (x,y) | x <- ns, y <- ns, (u, v) <- [alg1 x y], q1 x y /= q2 u v ]
This was a really unexpected result to me. Now I have a lot more interesting stuff to learn about quadratic forms!