A Foundational Theory for Decentralized Sensory Learning