When do you use "a priori", and when "a fortiori" in a formal proof? I am not sure I understand whether the term "a priori" or "a fortiori" is needed in proofs of the following form:
"Let $(S, \circ)$ be a group.
Then because a group is defined as a semigroup with and identity and in which every element has an inverse, $(S, \circ)$ is also a semigroup."
... which I would like to replace with either
"Then $(S, \circ)$ is a fortiori a semigroup."
... or
"Then $(S, \circ)$ is a priori a semigroup."
I believe "a fortiori" is the correct one to use here, but is this technically correct?
And in what context does one use the other one?
 A: A good rule of thumb is not to use words and phrases that you don't understand as you are likely to confuse your reader :)
That said; a fortiori is Latin for with stronger reason and so can be used anywhere you would use the English term.  The phrase a priori means reasoning from what is prior (logically or chronologically) and so can be used whenever you are referring back to things presented earlier in the proof.  Both of these definitions come directly from Chambers Dictionary which is generally a reliable resource for English.  (If you're in North America you may prefer something like the American Heritage Dictionary or Merriam-Webster.)
So, so you can use a fortiori as in your example: because $S$ is a group, which is a stronger structural requirement, it is a fortiori a semigroup.  In order to use a priori you would have had to have reasoned (i.e. proved) that any group is automatically a semigroup; then you could say that $S$ is a priori a semigroup.
Finally, it might be worth noting that neither of these expressions are terribly common in modern mathematics.  When writing, the aim is to communicate to the reader as clearly as possible, and if you don't know that your audience will know your Latin terms (100 years ago you could have taken that as a certainty) then it might be better to use plain English.
