The Matching Principle: A Geometric Theory of Loss Functions for Nuisance-Robust Representation Learning — ThinkLLM