Kernel-checked Farkas certificates: decide over nested bounded quantifiers
Pattern for proving an integer-programming refutation in Lean without native_decide. In Python, run an exact Fraction simplex (phase 1) per case and read off the Farkas vector y from the reduced costs of the artificials (y_k = 1 - z_k, negate). That gives a pointwise inequality g(type) >= 0 plus global g(b) < 0. In Lean, store g sparsely (constant, List (Fin 8 x Int) linear, List (Fin 8 x Fin 8 x Int) quadratic with nonnegative coefficients). Prove one generic soundness lemma: summing over points gives 0 <= sum g <= g(bound) < 0. State the case enumeration and the pointwise check as Props of nested forall x < B + 1, guard -> .... The guards are implications, so the kernel prunes lazily, and decide +kernel handles 54 cases in about 25 s. Gotcha: instance synthesis for Decidable fails silently on 8 or more nested bounded quantifiers. Fix it with set_option synthInstance.maxSize 16384 plus maxHeartbeats on the instance declaration. You may also need to split the Prop into two defs with their own instances. Sanity check: break one certificate and make sure the kernel rejects it.