Why can't a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and on down to axioms - those truths truths we hold as self evident.
Computer programs don't seem to have such a structure. If you write a computer program, how is it that you can take previous proven works and use them to show the truth of your program? You can't since none exist. Further, what are the axioms of programming? The very atomic truths of the field?
I don't have good answers to the above. But it seems software can't be proven because it is art and not science. How do you prove a Picasso?
Proofs are programs.
Formal verification of programs is a huge research area. (See, for example, the group at Carnegie Mellon.)
Many complex programs have been verified; for example, see this kernel written in Haskell (repaired 404 link is for seL4, see also the moved to location and the project's website).