  In this paper we consider the Ideal Membership Problem (IMP for short), in
which we are given real polynomials $f_0,f_1,\dots, f_k$ and the question is to
decide whether $f_0$ belongs to the ideal generated by $f_1,\dots,f_k$. In the
more stringent version the task is also to find a proof of this fact. The IMP
underlies many proof systems based on polynomials such as Nullstellensatz,
Polynomial Calculus, and Sum-of-Squares. In the majority of such applications
the IMP involves so called combinatorial ideals that arise from a variety of
discrete combinatorial problems. This restriction makes the IMP significantly
easier and in some cases allows for an efficient algorithm to solve it.
  The first part of this paper follows the work of Mastrolilli [SODA'19] who
initiated a systematic study of IMPs arising from Constraint Satisfaction
Problems (CSP) of the form $CSP(\Gamma)$, that is, CSPs in which the type of
constraints is limited to relations from a set $\Gamma$. We show that many CSP
techniques can be translated to IMPs thus allowing us to significantly improve
the methods of studying the complexity of the IMP. We also develop universal
algebraic techniques for the IMP that have been so useful in the study of the
CSP. This allows us to prove a general necessary condition for the tractability
of the IMP, and three sufficient ones. The sufficient conditions include IMPs
arising from systems of linear equations over $GF(p)$, $p$ prime, and also some
conditions defined through special kinds of polymorphisms.
  Our work has several consequences and applications in terms of bit complexity
of sum-of-squares (SOS) proofs and their automatizability, and studying
(construction of) theta bodies of combinatorial problems.
