Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
There's a very nice paper Martin Kneser, "Composition of binary quadratic forms" Journal of Number Theory, Volume 15, 406-413 (1982) whch develops the Clifford algebra viewpoint on binary quadratic forms.
Fill in a size $n$ square matrix over $\mathbb{F}_2$ row by row. If the first $n-1$ rows are linearly independent, the whole matrix will have zero determinant. Otherwise the last row will cause the determinant to vanish if its entries satisfy a linear equation; this happens with conditional probability $1/2$.
For $\theta(1/t)=t\theta(t)$ read $\theta(1/t)=\sqrt{t}\theta(t)$. (Not that this helps much with the original question). So again, when can we edit comments?
This is a bit weaker than Petya's original question since there the entries in the lifted matrix are constrained to be 0, 1 or -1. For the proof of the surjectivity of $SL_n(\mathbf{Z})\to SL_n(\mathbf{Z}/N\mathbf{Z})$ my favoured argument goes roughly as follows. Show that $SL_n(\mathbf{Z}/N\mathbf{Z})$ is generated by elementary matrices of the form $I + E_{ij}$ where $E_{ij}$ is a matrix unit with $i\ne j$. As these matrices all lie in the image, the map is surjective. I haven't seen this argument in the textbooks :-)
Can't you get this slightly quicker by splitting into two pieces: from $(0,0)$ to the first visit to $(x_f,y_f)$, and a general path from $(x_f,y_f)$ to $(x,y)$ ?