Q.E.D. is an abbreviation for the Latin quod erat demonstrandum meaning ‘[that] which had to be demonstrated’.

‘Q.E.D.: a Mathematician’s way of saying “I win”.’ – Urban Dictionary

The abbreviation of the phrase is traditionally placed at the end of a mathematical proof or philosophical argument to denote the conclusion of the demonstration. The abbreviation thus signals the completion of the proof.

The phrase is a translation into Latin from the Greek ὅπερ ἔδει δεῖξαι ‘what was required to be proved’. The phrase was used by many early Greek mathematicians, including Euclid and Archimedes.

The phrase has also been used outside mathematics and philosophy for comic effect.

For instance, in Thomas Dolby’s 1988 song Airhead, he imagines a conversation with the titular young woman and says “quod erat demonstrandum, baby”, to which she squeals the eager reply “ohhh, you speak French!”

Also, in chapter six of Douglas Adams’ The Hitchhiker’s Guide to the Galaxy, the abbreviation is included in the following exchange:

The argument goes something like this: “I refuse to prove that I exist,” says God, “for proof denies faith, and without faith I am nothing.”
“But,” says Man, “the Babel fish is a dead giveaway, isn’t it? It could not have evolved by chance. It proves you exist, and so therefore, by your own arguments, you don’t. QED.
“Oh dear,” says God, “I hadn’t thought of that,” and promptly vanishes in a puff of logic.