
inside $\mathrm{Gr}_{n,k}(\mathbb{R})\times \shapesp{n-k}$ when $\mathrm{disc}(q) \to \infty$. The condition $\mathrm{disc}(q) \to \infty$ here is not sufficient; for instance, when $q$ represents $1$ and $Q$ represents $1$ only on, say, $\pm v \in \mathbb{Z}^n$ then any primitive representation of $q$ by $Q$ must contain $\pm v$. However, the subspaces in $\mathrm{Gr}_{n,k}(\mathbb{R})$ containing $\pm v$ form a Zariski closed subset.
Assuming that the minimal value represented by $q$ goes to infinity, the above question is very strongly related to results of Ellenberg and Venkatesh \cite{localglobalEV} as are indeed our techniques in this article.
In principle, these techniques should apply to show that under congruence conditions as in Theorems~\ref{thm:jointwithshapes} and~\ref{thm:equidistrmoduli} the pairs in \eqref{eq:EVpairs} are equidistributed when $q_i$ is a sequence of quadratic forms primitively representable by $Q$ whose minimal values tend to infinity.

As alluded to in Remark~\ref{rem:gridsIlya} it would be interesting to know if Khayutin's technique applies to show the analogue of Theorem~\ref{thm:equidistrmoduli} when, say, $(k,n) = (2,5),(2,4)$.
The two cases are from a dynamical perspective quite different as noted in Remark~\ref{rem:congcond}.

Furthermore, the extension of this paper to indefinite forms should also be of interest. 
Let $Q$ be an indefinite integral quadratic form on $\mathbb{Q}^n$ of signature $(r,s)$.
Here, we observe that $\mathrm{SO}_Q(\mathbb{R})$ does not act transitively on $\mathrm{Gr}_{n,k}(\mathbb{R})$. Indeed, the degenerate subspaces form a Zariski closed subset (the equation being $\mathrm{disc}(Q|_L) = 0$).
The complement is a disjoint union of finitely many open sets on which $\mathrm{SO}_Q(\mathbb{R})$ acts transitively; for each tuple $(r',s')$ with $r'+s'= k$ and $r' \leq r,\ s' \leq s$ such an open set is given by the subspaces $L$ for which $Q|_L$ has signature $(r',s')$.
The analogue of the above conjectures and theorems can then be formulated by replacing $\mathrm{Gr}_{n,k}(\mathbb{R})$ with one of these open sets.
The proofs generalize without major difficulties to this case; we refrain from doing so here for simplicity of the exposition.
\bigskip

\textbf{Acknowledgments}
The authors would like to thank Michael Bersudsky, Manfred Einsiedler and Manuel Luethi for useful discussions. Many ideas of this article were born on a train ride of the first and last named author with the Deutsche Bahn; we would like to thank them for providing the necessary relaxed atmosphere.



\subsection{Organization of the paper}
The paper is organized as follows:
\begin{enumerate}
\item[$\bullet$] In \S\ref{SEC:stabilisers}, we study properties (of variations) of the acting group $\mathbf{H}_L$, particularly addressing maximality and strong isotropicity of such groups.
\item[$\bullet$] In \S\ref{SEC:quadratic_forms}, we study discriminants of various objects associated to rational subspaces including the discriminant of the orthogonal complement. In particular, one wishes to control the discriminant of the primitive integral forms in the lines through $Q|_{L(\mathbb{Z})}$ and (essentially) $Q|_{L^\perp(\mathbb{Z})}$ for $L \in \mathrm{Gr}_{n,k}(\mathbb{Q})$. 
As a crucial new tool in this context, we use the concept of a glue group which to some extent generalizes the discriminant and (as the name suggests) serves as a 'bridge' from the subspace to the orthogonal complement.
\item[$\bullet$] In \S\ref{sec:moduli}, we state a refinement of Theorem \ref{thm:equidistrmoduli} and illustrate how this theorem and Theorem \ref{thm:jointwithshapes} can be deduced from the refinement (see also Remark~\ref{rem:comparisonconj}).
\item[$\bullet$] In \S\ref{sec:dimatleast4}, we prove a statement concerning weak${}^\ast$ limits of orbit measures on a specific adelic homogenous space, which may be viewed as a dynamical version of Theorem \ref{thm:equidistrmoduli}. The key ingredient of our proof is an $S$-arithmetic extension of a theorem of Mozes and Shah \cite{mozesshah} proven by Gorodonik and Oh \cite{gorodnikoh}. The arguments used in this section only work when the dimension and codimension (i.e. $k$ and $n-k$) are at least 3.
\item[$\bullet$] In \S\ref{sec:proof arithmetic}, we deduce Theorem \ref{thm:equidistrmoduli} from the dynamical version proved in \S\ref{sec:dimatleast4} when the dimension and codimension of the subspaces are at least three. 
The technique here is by now standard -- we interpret the sets in Theorem~\ref{thm:equidistrmoduli} as projections of the adelic orbits in \S\ref{sec:dimatleast4}.
\item[$\bullet$] In \S\ref{SEC: two_dim_thm}, we prove Theorem \ref{thm:equidistrmoduli} for two dimensional subspaces (i.e.~for $k=2$). 
As in \S\ref{sec:proof arithmetic}, the theorem follows from an equidistribution results of adelic orbits.
However, contrary to the case of dimension and codimension at least 3, the groups whose dynamics we use are not semisimple (see Remark~\ref{rem:congcond}). In particular, the theorem of Gorodonik and Oh \cite{gorodnikoh} is not sufficient and more subtle arguments, relying on Duke's Theorem \cite{duke88} and the trick mentioned in Remark~\ref{rem:disjointness}, are required.
\item[$\bullet$] In Appendix~\ref{sec:appendix}, we discuss non-emptiness conditions for the set $\mathcal{H}^{n,k}_Q(D)$ when the quadratic form $Q$ is the sum of squares. In particular, we prove by completely elementary methods that $\mathcal{H}^{n,k}_Q(D) \neq \emptyset$ for all $n \geq 5$. The techniques here are completely elementary and we do not provide any counting results.
\end{enumerate}

\subsection{Notation}
Let $V_\mathbb{Q}$ be the set of places of $\mathbb{Q}$ and denote by $\mathbb{Q}_v$ for any $v \in V_\mathbb{Q}$ the completion at $v$.
Given a subset $S \subset V_\mathbb{Q}$ we define the ring $\mathbb{Q}_S$ to be the restricted direct product of $\mathbb{Q}_p$ for $p \in S$ with respect to the subgroups $\mathbb{Z}_p$ for $p \in S\setminus\{\infty\}$.  
Moreover, we set $\mathbb{Z}^S := \mathbb{Z}[\frac{1}{p} : p \in S\setminus \{\infty\} \}$.
When $S = V_\mathbb{Q}$ we denote $\mathbb{Q}_S$ by $\mathbb{A}$ and call it the ring of \emph{adeles}.
When instead $S= V_\mathbb{Q} \setminus \{\infty\}$ we denote $\mathbb{Q}_S$ by $\mathbb{A}_f$ and call it the ring of \emph{finite adeles}. Finally, we let $\hat{\mathbb{Z}} = \prod_{p \in V_\mathbb{Q} \setminus \{\infty\}} \mathbb{Z}_p$.

Let $\mathbf{G}< \mathrm{SL}_N$ be an algebraic group defined over $\mathbb{Q}$.
We identify $\mathbf{G}(\mathbb{Z}^S) = \mathbf{G}(\mathbb{Q}_S) \cap \mathrm{SL}_N(\mathbb{Z}^S)$ with its diagonally embedded copy in $\mathbf{G}(\mathbb{Q}_S)$.
If $\mathbf{G}$ has no non-trivial $\mathbb{Q}$-characters (for instance when the radical of $\mathbf{G}$ is unipotent), the Borel-Harish-Chandra Theorem (see  \cite[Thm.~5.5]{platonov}) yields that $\mathbf{G}(\mathbb{Z}^S)$ is a lattice in $\mathbf{G}(\mathbb{Q}_S)$ whenever $\infty \in S$. In particular, the quotient $\mathbf{G}(\mathbb{Q}_S)/\mathbf{G}(\mathbb{Z}^S)$ is a finite volume homogeneous space.