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
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.