Buchberger's criterion states
Theorem: Let $G=\{g_1,g_2,\dots g_r \}$ be a generating set of the ideal $I\trianglelefteq k[x_1,x_2,\dots,x_n]=R$, in the polynomial ring over field $k$ in $n$ variables. Let $>$ be a monomial order on $k[x_1,x_2,\dots ,x_n]$. Then $G$ is a Grobner basis iff $S(g_i,g_j):=\frac{\operatorname{lcm} (in_>g_i,in_>g_j)}{in_>g_i}g_i-\frac{\operatorname{lcm} (in_>g_i,in_>g_j)}{in_>g_j}g_j$ leaves remainder $0$ after applying the division algorithm w.r.t $(g_1,g_2,\dots,g_r)$. [For $f\in R$, $in_>f :=$ the leading term of $f$ with respect to the monomial order $>$]
Proof: I shall prove the relatively harder direction, namely if $S(g_i,g_j)$ leave remainder $0$ on division by $(g_1,g_2,\dots ,g_r)$, then $G$ is a Grobner basis. Let $f\in I$ be such that $in_>f\not \in \langle \{in_>g_i : i=1(1)r \} \rangle $. $\because f\in I$, we can get an expression of the form $\displaystyle{f=\sum_{i=1}^rh_ig_i}$ where $h_i$'s are from $R$. Among all such expressions, consider those so that $\displaystyle{}\max_{1\leq i\leq r}in_>(h_ig_i)$ is minimum, say $\mu$. Further choose an expression from above so that $\# \{i : in_> (h_ig_i)=\mu \}$ is minimum.
Let $f=\displaystyle{\sum_{i=1}^rh_ig_i}$ be one such expression. Then clearly we have $in_{>}f\leq \mu $. Moreover, since $in_> g_j \ | \ \mu $ for some $j$ whereas $in_>g_i \not | \ in_> f $ for any $i$ we get that $in_> f< \mu $. Thus $\exists$ at least $2$ $i$'s such that $in_{>}(h_ig_i)=\mu$. Say $j,k$ be $2$ such elements of $\{1,2,\dots, r \} $.
Set $\displaystyle{}L_j:=\frac{\operatorname{lcm} (in_>g_j,in_>g_k)}{in_>g_j}$ and define $L_k$ similarly. $S(g_{j},g_k)=L_jg_j-L_kg_k$. Let $\eta$ be such that $\eta \cdot \operatorname{lcm} (in_>g_j,in_>g_k)=\mu$.
Using the division algorithm and Buchberger's condition, we get an expression of the form $S(g_j,g_k)=\displaystyle{\sum_{i=1}^rp_ig_i}$ with $in_{>} p_ig_i\leq in_> f \ \forall \ i$. (the remainder term is $0$). It follows that $\displaystyle{}in_{>}S(g_i,g_j) =\max_{1\leq i \leq r}in_>( p_ig_i ) \implies in _> \left (\eta p_ig_i \right )\leq in _{>}\eta S(g_j,g_k)<\eta\operatorname{lcm} (in_>g_j,in_>g_k)=\mu $
Now $$f=\sum_{i=1}^rh_ig_i=\sum_{i=1}^rh_ig_i+\eta S(g_j,g_k)-\eta \sum_{i=1}^rp_ig_i= \sum_{i\neq j,k}(h_i-\eta p_i)g_i +(h_j +\eta L_j -\eta p_j)g_j+(h_k -\eta L_j -\eta p_k)g_k $$
If $i\neq j,k$, we see that $\displaystyle{}in_> (h_i-\eta p_i) \begin{matrix}=\mu & \text{if} & in_> (h_ig_i)=\mu \\ < \mu & \text{if} & in_> (h_ig_i)<\mu \end{matrix}$
Also $\displaystyle{}in_> (\eta L_jg_j)=\eta \frac{\operatorname{lcm} (in_>g_j,in_>g_k)}{in_>g_j}in_> g_j=\eta\operatorname{lcm} (in_>g_j,in_>g_k)=\mu $ and similarly for $in _>(\eta L_k g_k)$
It follows that $in _> (h_k-\eta L_k -\eta p_k )g_k< \mu $ and $in _> (h_j-\eta L_j -\eta p_j )g_j\not > \mu $.
Thus we get an expression $f=\displaystyle{\sum_{i=1}^r}h_i'g_i $ where $\#\{i : in_> (h_i'g_i)=\mu \}<\#\{i : in_> (h_ig_i)=\mu \}$ This contradicts the choice of the representation, $f=\displaystyle{\sum_{i=1}^rh_ig_i}$.
Thus we must have if $f\in I$, $in_>f \in \langle \{in_>g_i : i=1(1)r \} \rangle$
Our professor gave us a sketch of the proof along these lines and asked us to fill in the details. I shall be grateful if someone can point out if there are any gaps/mistakes. Alternative approaches/comments/simplifications etc are also most welcome.