A Novel Mathematical Framework for the Analysis of Neural Networks