Consider $2n$ coordinates $x\_1,\ldots,x\_n,y\_1,\ldots,y\_n$ and the quadratic form $q = \sum\_{i=1}^n x\_i y\_i$. Now call $O(q,A)$ (orthogonal group of $q$) the group of $(2n)\times(2n)$ matrices, with coefficients in a commutative ring $A$, which preserve $q$. (This is an algebraic group over $\mathop{\mathrm{Spec}}\mathbb{Z}$.) When $A$ is a field of characteristic $\neq 2$, the determinant restricted to $O(q,A)$ takes its values in $\{\pm 1\}$, its kernel $O(q,A) \cap SL(2n,A)$ defines a subgroup $SO(q,A)$ of index $2$. When $A$ is a field of characteristic $2$, the determinant is identically $1$ on $O(q,A)$ but there is still a subgroup of index $2$, which one might still denote $SO(q,A)$, defined by the so-called "[Dickson invariant](http://en.wikipedia.org/wiki/Orthogonal_group#The_Dickson_invariant)", also known as quasideterminant or pseudodeterminant, and it is relatively straightforward to give an explicit polynomial in the coefficients of $A$ which defines an equation of $SO(q,A)$ inside $O(q,A)$ (see, Dickson's book, [*Linear Groups*](http://archive.org/details/lineargroupswith00dickuoft), theorem 205 on page 206).


Now for an arbitrary ring $A$, there is still a subgroup $SO(q,A)$ of $O(q,A)$, which is the kernel of a morphism $\deg$ of $O(q,A)$ to the group $(\mathbb{Z}/2\mathbb{Z})(A)$ of idempotents of $A$ (so, when $A$ is connected, $SO(q,A)$ is a subgroup of order $2$) natural in $A$ and which coincides with $\frac{1}{2}(1-\det)$ when $2$ is invertible in $A$ and with Dickson's invariant when $2$ is zero in $A$. This is due to H. Bass ("Commutative Algebras and Spinor Norms over a Commutative Rings", Amer. J. Math. **96** (1974), 156–206).


Concretely, this means that there exists a polynomial $\deg$ in $4n^2$ variables over $\mathbb{Z}$ such that, modulo the ideal $I$ of relations defining $O(q,A)$, we have $\deg^2 = \deg$ and $\det = 1-2\deg$. And $I\_0 := I+(\deg)$ is the ideal defining $SO(q,A)$.


My question is: can one give an *explicit* expression of $\deg$ (as a polynomial in $4n^2$ variables), or perhaps an explicit set of equations of $SO(q,A)$ (e.g., Gröbner basis of $I\_0$ for some term order)? (At least for the particular quadratic form $q = \sum\_{i=1}^n x\_i y\_i$ if not in general.)



Explicit equation of Dickson invariant / quasideterminant / special orthogonal group over the integers
Hi Gro-Tsen ! The following is the outcome of a discussion with Olivier Taïbi.


Let V be the free module of rank $2n$ over $\mathbb{Z}$ with basis $f\_1,\dots,f\_n,g\_1,\dots,g\_n$ and equipped with the split quadratic form $q=\sum\_{i=1}^nx\_iy\_i$. Let $C(V,q)$ be the Clifford algebra of $(V,q)$ and $C^+(V,q)$ be its even part. The orthogonal group $O(V,q)$ acts on both. Moreover, $C^+(V,q)$ is the product of two matrix algebra, hence an element of the orthogonal group either preserves these factors or exchanges them. This gives a morphism $\deg:O(V,q)\to \mathbb{Z}/2\mathbb{Z}$ that is precisely the Dickson invariant we want to compute. [For all these facts, see for instance Conrad's notes <http://math.stanford.edu/~conrad/252Page/handouts/O(q).pdf>, Lemma 1.4 and around.]


Now, $C^+(V,q)$ has two non-trivial projectors (one on each factor), so that an element of the orthogonal group will have Dickson invariant $0$ (resp. $1$) if and only if it preserves these projectors (resp. it exchanges them). When $n=1$, it is not difficult to compute these projectors: one is given by $e=f\_1g\_1\in C^+(V,q)$ (and the other is $1-e$). It is then possible to compute inductively these projectors, using for instance the formula [SGA7 II Exp. XII (1.10.1)]. When $n=2$, one of the projectors is given by $e=f\_1g\_1+f\_2g\_2+2f\_1f\_2g\_1g\_2$ (and the other is $1-e$). By induction, it is possible to give a closed formula as follows. If $I=\{i\_1<\dots <i\_k\}$, let $f\_I:=f\_{i\_1}\dots f\_{i\_k}$ and $g\_I:=g\_{i\_1}\dots g\_{i\_k}$. Then one of the projectors is given by: $$e=-\sum\_{k\geq 1}(-1)^{\frac{k(k+1)}{2}}2^{k-1}\sum\_{I\subset\{1,\dots,n\},|I|=k}f\_Ig\_I.$$


To obtain a formula for the Dickson invariant of $u\in O(V,q)$, compute $u(e)$ in $C(V,q)$. By the above, it is equal to $e$ if $\deg(q)=0$ and $1-e$ if $\deg(q)=1$. Hence, it suffices to write down $u(e)$ in the basis $(f\_Ig\_J)$ of $C(V,q)$: the coefficient of $Id=f\_{\varnothing}g\_{\varnothing}$ will be $\deg(u)$. This gives an explicit polynomial expression for $\deg(u)$ in the matrix coefficients of $u$. 


In characteristic $2$, the fact that $e=\sum\_{i=1}^nf\_ig\_i$ allows to recover the very simple expression of the Dickson invariant in characteristic $2$. When $n=2$, it is not difficult to use this to write down by hand an expression for the Dickson invariant over $\mathbb{Z}$. If $a,b,c,\dots, n,o,p$ are the matrix coefficients of $u$ from left to right then up to bottom (sorry for the poor notations), the Dickson invariant $\deg(u)$ is given by: $$ic+mg+jd+nh+2[(ib+mf)(kd+oh)+(id+mh)(jc+ng)-(jd+nh)(ic+mg)].$$


It is also possible to obtain a (probably not very useful) closed formula from the procedure above by understanding how the $f\_Ig\_I$ term in the formula above contributes to the coefficient of $Id$ in $u(e)$. To write it down, let me introduce the following notation. If $I\subset\{1,\dots, n\}$ has $k$ elements, $\tilde{I}=I\cup(n+I)$ and $P\_I$ is the set of partitions of $\tilde{I}$ into $k$ pairs. To every such partition $P\in P\_I$, it is possible to associate a natural sign $\varepsilon(P)$. Then:
$$\deg(u)=-\sum\_{k\geq 1}(-1)^{\frac{k(k+1)}{2}}2^{k-1}\sum\_{I\subset\{1,\dots,n\},|I|=k}\bigg(\sum\_{P\in P\_I}\varepsilon(P)\prod\_{\{i<j\}\in P}\sum\_{k=1}^n u\_{n+k,i}u\_{k,j}\bigg).$$


