You guess incorrectly. Look up Gödel's incompleteness theorems. In particular they imply that there is no decision procedure for mathematical truth. This applies to LLMs as much as anything.