It means “That which was shown” or something similar, right?
In mathematical texts, it’s simply attached at the end. But that doesn’t make sense. After you prove something, would it be appropriate to write “That which was shown”? Not to me.
Quod erat demonstrandum: “which was to be proved.” In other words, I have completed the task I set for myself. (Perhaps you didn’t read the link Gyan9 gave closely enough? There is an important distinction between your incorrect translation, “that which was shown,” and “that which was to be shown.”)
It is, as you say, most commonly used at the conclusion of mathematical propositions or proofs, which Euclid formalized thusly: proposition, logical steps (based on previously stated definitions and axioms), conclusion.
I am guessing that the application of a Latin phrase to works originally written in Greek was the work of Victorian (or possibly earlier) editors of the texts.
Looking at my copy of Euclid (Dover, translated and edited by Sir Thomas L. Heath in 1908), I note that the first few propositions end with “(Being) what it was required to do,” which is presumably the translation of the Greek phrase Euclid used. I’m afraid I don’t have any Greek texts of Euclid, and my study of Ancient Greek more than 20 years ago has not remained with me well enough to give the original Greek.
First, I thought that it was intended as a dependent clause, “which was what we wanted to show”, not as an appositive, “the thing we wanted to show”. It makes a little more sense to me the first way.
Second, yes, it is a little flourishy. But it’s also a helpful way of reminding you that the proof’s over for a long proof, because by the time you’ve gotten through all the lemmas and whatnot it can be easy to lose sight of your objective. And it’s sort of a mathematical equivalent of “THE END”.
The first few propositions of Euclid are constructions ( the first, for example, asks for a construction of an equilateral triangle on a given line). These ended with QEF, quod erat faciendum, ‘which was to be done’.
Similarly, you will occasionally see QEI, quod erat inveniendum, ‘which was to be found’.
Most proofs today end with a little “box” symbol. (\box in TeX.) So the reader knows the proof is over (and what comes next is exposition, the next problem, etc.).
Nowadays I generally see “Q.E.D.” used to let people know that the proof is actually over, even though it might not seem like it. Those “gotcha” type proofs, etc. So the reader can think “Wow, that’s it? Done already. I’m impressed.”
Keep in mind that mistakes can be made, even in published papers. If the reader sees the box but doesn’t think the proof has been completed, they’ll assume there’s an error. A “Q.E.D.” can let them know to go back and verify there is nothing missing.
It can also be used as a shorthand for “there’s some more details but they’re so obvious anyone with a PhD in Math, 2 years as a post-doc and 8 years as a prof can probably fill it in.”
I should have been clearer. Jabba is right that Q.E.F. is the abbreviation for the phrase I quoted. But as I said, in the first three proofs (of my edition) the phrase is spelled out. Prop 4 ends “(Being) what it was required to prove.” In all subsequent props the abbreviations Q.E.F. or Q.E.D. are used.