My own definition of mathematics for the sake of this comparison:
- If you can write a formal proof, starting from some assumptions and proving some result, it is mathematics. The assumptions are the axioms. Then you use logic, which is the same programming logic, and then you get to some result.
It can be an invariant in a programming function, it can be a more general result, if you can write a proof, it is mathematics. Most algorithms involve proofs, so they are mathematics.
- If you can write a formal proof, starting from some assumptions and proving some result, it is mathematics. The assumptions are the axioms. Then you use logic, which is the same programming logic, and then you get to some result.
It can be an invariant in a programming function, it can be a more general result, if you can write a proof, it is mathematics. Most algorithms involve proofs, so they are mathematics.