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
Your statement is wide so it's catching lots of fish.
The bottom line is: some programs can definitely be proven correct. All programs can not be proven correct.
Here's a trivial example which, mind you, is exactly the same kind of proof that destroyed set theory back in the day: make a program which can determine whether itself is correct, and if it finds that it is correct, give an incorrect answer.
This is Gödel's theorem, plain and simple.
But this is not so problematic, since we can prove many programs.