This is not an optimization problem to find invariant sets and controllers etc. You've completely misunderstood/not read some paper. These problems are initially infinite dimensional in x (for all x such that...), and the first step is to eliminate x, and get an optimization problem in, e.g., K and Q.