Tuesday, May 6, 2014

Mathematics and programming collide

Mathematics is (by my definition) about thinking clearly about problems (that have been made sufficiently precise, sometimes by simplifying assumptions). Programming is about thinking clearly about algorithms.

So we see that programming should be a part of Mathematics. And, lo and behold, now that we finally understand how to do functional programming, it makes heavy use of concepts from Category Theory which is a modern unifying part of mathematics. It would be good if more of the best Mathematicians became interested in this very important application of modern Mathematics.

And this is likely to happen because, from the other direction, Mathematicians need computers to control the complexity of modern Mathematics. This is described by Vladimir Voevodsky (one of the world's top mathematicians) in a recent talk. You don't have to understand the mathematics to get the core message, that complex new Mathematics needs to be mechanically verified to be trusted. And it turns out that the proof assistants used for this mechanical verification are within a whisker of being programming languages.

Indeed the functional programming world seems to be most aware of this expanding intersection of Mathematics and programming. This is partly because proof assistants can sometimes be used to prove programs correct. So it was the Sydney Functional Programming society that recently held a "coq fight", which involved the live competitive generation of proofs using the coq proof assistant.

Here's something that I expect will flow from this cross pollination of Mathematics and programming. There will be emphasis on the precise definition of the problem. Often in the programming side there won't be any need to do more, because a large proportion of current programming activity just involves doing obvious things to create the web site or other program type. Computers should do those obvious things for us. Once we get past that hurdle, then the human programmer can spend more time where real creativity is needed, either artistic or algorithmic. And the many situations where Mathematics can help us will be much more accessible because mathematics will be organized so that those prepared to understand it can easily apply it.