Ethereum - how is the output of a contract computation verified? This may be as simple as a pointer to some place in the docs I've missed, but how/where is the output of a contract's computation checked, or assured against a malicious miner with an intentionally corrupted VM implementation?

Trivial example:
My contract takes two inputs, A and B, and returns their sum.  A disreputable miner wants to collect txn fees and the ethereum for the gas for this contract without doing the work, and hacks his VM implementation to always return "4" to the caller.  Any one who tests with "2+2" will think the function works.  

Assume the miner succeeded in mining the block with a request for my contract, and returned "4" (so as to not waste their own compute power, and pocket the gas cost).  Block hashes for transaction accepted and ether transferred are all correct and checkable, the source and opcodes of the contract are all checkable and correct.  But how is the output of the computation checked for correctness?

I feel like I'm missing something obvious.  What stops a miner from short circuiting the requested work (whatever it is), claiming to have finished the job, while only returning something syntactically correct, but semantically dubious or wrong?

Thanks.
Other nodes do the same computation, in a deterministic fashion, and they compare their result to the result the miner got. That's why there's no function that returns random results - different nodes would come up with different numbers, and the chain would fork. All other miners verify your block, and the penalty for building an incorrect block is losing the block you mined.

But there's a related question: can you gain an advantage by improving the speed of the VM, or skipping computations somehow?

I think you could. For example, you could offload the computations to a GPU. Even though Dagger is GPU-resistant, the VMs require a small amount of memory and could probably be run on a GPU.

The advantage would be pretty slight, though.