Let $k$ be a field and $I \subseteq k[x_1, \ldots, x_n]$ be an ideal.
Definition. A subset $ \underline{u} \subseteq \{ x_1, \ldots, x_n\} = \underline{x} $ of variables is independent modulo $I$ if $ I \cap k[\underline{u}] = (0)$. The independence complex of $I$ is the collection: $$ \Delta(I) = \{ \underline{u} \subseteq \underline{x} : \underline{u} \text{ is independent modulo } I\}.$$
$\Delta(I)$ is a simplicial complex, that is, it is closed under finite intersection and inclusions. In order to be a matroid, it should also satisfy the exchange property, that is, if $\underline{u_1}, \underline{u_2} \subseteq \underline{x}$ are indepedent modulo $I$ and $|\underline{u_1}| < |\underline{u_2}|$, then there is a $v \in \underline{u_2} \smallsetminus \underline{u_1}$ such that $\underline{u_1} \cup \{ v \}$ is independent modulo $I$.
However, this is not always true. In fact, from this, one could get that the maximally independent sets of variables modulo $I$ have all the same cardinality. But considering $I = (xy,xz)$, one has that $\{x\}$ and $\{y,z\}$ are maximally independent modulo $I$ but do not have the same cardinality.
I have been told during a course about Groebner bases and I have read on an article by Bernd Sturmfels that if $I$ is prime, however, $\Delta(I)$ is a matroid. Do you know how can I prove this only using the basic definition of a matroid and some Groebner bases tools?
Here is the proof of the fact that algebraic matroids can be represented via a prime ideal in a polynomial ring, i.e. if $I$ is a prime ideal in $k[x_1,\dots,x_n]$ then the collection $\{A\subset \{x_1,\dots,x_n\}\mid I\cap k[A]\neq\{0\}\}$ forms the collection of dependent sets in an algebraic matroid over $k$. It is what I believe to be the standard construction, however I should note that it uses no ideas from Gröbner bases (hence doesn't exactly answer your question).
Let $k$ be a field and $F$ a field extension of $k$. A finite subset $A\subset F$ is algebraically dependent over $k$ if there exists a non-zero polynomial over $k$ on which $A$ vanishes, and independent otherwise. The independent subsets of $F$ form an algebraic matroid. The standard references for this fact are Modern Algebra 1 by Van Der Waerden (chapter 10.3) and Matroid Theory by Welsh (chapter 11).
First, given a matroid $\mathcal M$ over $k$ with ground set $\{\alpha_1,\dots,\alpha_n\}\subset F$ we'll construct a prime ideal $I$ in $k[x_1,\dots,x_n]$ such that if $A\subset \{\alpha_1,\dots,\alpha_n\}$ is dependent, then $I\cap k[f^{-1}(A)]\neq \{0\}$ where $f\colon k[x_1,\dots,x_n]\to k(\alpha_1,\dots,\alpha_n)$ is the ring homomorphism that is identity on $k$ and sends $x_i$ to $\alpha_i$.
Let $\mathcal M$ be an algebraic matroid over $k$ with elements in $A$. Let $A\subset k(\alpha_1,\dots,\alpha_n)$ be a finite dependent set in $\mathcal M$. Assume for simplicity $A=\{\alpha_1,\dots,\alpha_k\}$ for some $k\leq n$. Then by definition there exists a polynomial $g$ in $k[x_1,\dots, x_k]$ vanishing on $A$. Let $f$ be the homomorphism $f\colon k[x_1,\dots,x_n]\to k(\alpha_1,\dots,\alpha_n)$ given by $a\mapsto a$ for $a\in k$ and $x_j\mapsto \alpha_j$. Then $f(g)=0$ so $g\in \ker{f}$. Therefore $\ker{f}\cap k[f^{-1}(A)]\neq \{0\}$ whenever $A$ is a dependent set in $\mathcal M$ and $\ker{f}\cap k[f^{-1}(A)]= \{0\}$ when $A$ is indepentent. Therefore, the collection of all $f^{-1}(A)\subset \{x_1,\dots,x_n\}$ for which $\ker{f}\cap k[f^{-1}(A)]\neq \{0\}$ is the collection of dependent sets of a matroid.
Furthermore, $\ker f$ is a prime ideal because $f$ is a ring homomorphism. This is a general fact which was not used so far. We will use it to prove the other direction, when we start with a prime ideal and show that it leads to an algebraic matroid.
Suppose that we are given a prime ideal $I$ of $k[x_1,\dots,x_n]$. Because $I$ is prime, the integral domain $k[x_1,\dots,x_n]/I$ is well defined and hence the fraction field $F=\operatorname{Frac}{(k[x_1,\dots,x_n]/I)}$ is well defined. Let $\varphi \colon k[x_1,\dots,x_n] \to \operatorname{Frac}(k[x_1,\dots,x_n]/I)$ be the canonical injection which sends elements of $k$ to themselves and $x_i \mapsto \overline{x_i}$, where $\overline {x_i}$ is the equivalence class in $\operatorname{Frac}{(k[x_1,\dots,x_n]/I)}$ represented by $x_i$.
Let now $A$ be a non-empty subset of $\{x_1,\dots,x_n\}$, which we can for simplicity take to be $\{x_1,\dots,x_i\}$ for some $i\leq n$. Let $\overline{A}$ be its image under $\varphi$. The set $\overline{A}$ is by definition algebraically dependent over $k$ if and only if there exists a non-zero polynomial in $g\in k[x_1,\dots,x_i]$ such that $g(\overline{x_1},\dots,\overline{x_i})=\overline{0}$. This happens if and only if $g(x_1,\dots,x_n)\in I$, that is if and only if $I\cap k[A]\neq \{0\}$.