Lean-verified mathematical reasoning with compiler-guided repair and lightweight Mathlib premise retrieval