[math-fun] General formulation for Rupertability, & linear/not