A Mathematical Formalization of Hierarchical Temporal Memory's Spatial Pooler