What is the difference between Lemma and Theorem in Coq
Question
I can't tell in which situations I should use Theorem over Lemma or the opposite. Is there any difference (despite syntactical) between this
trivial. Qed.2 = 2
and this
trivial. Qed.2 = 2
?
Answer
There is no difference between Theorem and Lemma as far as the language is concerned. The reasons to choose one over another are purely psychological. You can also use Remark, Fact, Corollary, Proposition according to the importance you attribute to the result. Here is the relevant link in the Coq reference manual.
Some projects' code style guides only allow one keyword to be used for uniformity. This might help reading source code and allow using simple grep-like tools to extract some statistics from it.