Rational subspaces

In $\mathbb{R}^n$, we say that a linear subspace is rational if it admits a basis in $\mathbb{Q}^n$ (or equivalently in $\mathbb{Z}^n$). This means that $E\cap \mathbb{Z}^n$ is a submodule of $\mathbb{Z}^n$ of rank equal to the dimension of the given subspace. By convention, we declare that $\{0\}$ is rational.

Now, if $E$ is any linear subspace of $\mathbb{R}^n$, we denote by $b(E)$ (resp. by $c(E)$) the dimension of the biggest rational subspace of $\mathbb{R}^n$ contained in $E$ (resp. of the smallest rational subspace of $\mathbb{R}^n$ containing $E$).

My questions:

1) How can one compute $b(E)$ and $c(E)$? I am mainly looking for an algorithm (if it is possible). My entries for the algorithm are either a basis of $E$, or a system of equations (or any equivalent characterization).

2) It is clear that $0\leq b(E)\leq \dim(E)\leq c(E)\leq n$. In an article, I have read that every case is possible. How can one construct examples of the different cases? I have some ideas but I am stuck in verifying because of the first question.

I would already be happy if someone can point me to a reference.

-
If $b(E)=\dim E$, then $c(E)=\dim E$ also. So, not all cases of the inequality in (2) can occur. – Felipe Voloch Oct 3 '12 at 9:55
Exact. Thank you for the remark. The article states that $E$ is rational iff $b(E)=c(E)$. Otherwise, $2+b(E)\leq c(E)$ and all cases can occur. – Taladris Oct 3 '12 at 13:53
What is this article you allude to darkly? – Igor Rivin Oct 4 '12 at 0:43
The article is "Foliations modelling nonrational simplicial toric varieties" by Battaglia and Zaffran (yet unpublished). ArXiv link: arxiv.org/abs/1108.1637 and the passage I am quoting is (similar to) the beginning of section 1. – Taladris Oct 4 '12 at 1:41

Given a matrix $M$ whose kernel is $E$, let $\{\alpha_1, \ldots, \alpha_k\}$ be a basis for the linear span over $\mathbb Q$ of the entries of $M$. Then $M = \sum_{j=1}^k \alpha_j M_k$ where $M_j$ are matrices with rational entries. Let $N$ be the matrix obtained by stacking the $M_j$ vertically.
Any member of $E \cap {\mathbb Q}^n$ is in the kernel of $N$, while the kernel of $N$ has a basis consisting of vectors in ${\mathbb Q}^n$. Thus $b(E)$ is the dimension of the kernel of $N$.
EDIT: In the other direction, consider the annihilator $E^\perp = \{y \in {\mathbb R}^n: y \cdot x = 0 \ \text{for all}\ x \in E\}$. Note that the annihilator of a rational subspace is rational (a basis in ${\mathbb Q}^n$ can be obtained using Gaussian elimination). It follows that the smallest rational subspace containing $E$ is the annihilator of the largest rational subspace contained in $E^\perp$. Thus $c(E) = n - b(E^\perp)$.