Mathematics in pattern recognition