Mathematical theorem prover