Why does drawing $\square$ mean the end of a proof? To end a proof, I often write "as was to be shown" or "q.e.d". Both of these terms make sense to me as a reader. On the other hand, I feel a little strange to put down $\square$ although I  saw it many times here and there. In fact, I learned $\square$ notation here. I wonder if anyone could give me a brief explanation of $\square$ notation in mathematics. Where does it come from? More importantly, how does it logically mean "end" of a proof? Thank you.
 A: I have been told that it had a practical application.  When a referee has read through the proof and checked its accuracy they could check the box.
A: It just means the same thing as q.e.d. Its introduction is usually attributed to Paul Halmos:

"The symbol is definitely not my invention — it appeared in popular magazines (not mathematical ones) before I adopted it, but, once again, I seem to have introduced it into mathematics. It is the symbol that sometimes looks like ▯, and is used to indicate an end, usually the end of a proof. It is most frequently called the 'tombstone', but at least one generous author referred to it as the 'halmos'.", Paul R. Halmos, I Want to Be a Mathematician: An Automathography, 1985, p. 403.

(This is quoted in Wikipedia)
A: Perhaps it comes as a stretch, but consider the natural deduction proofs of Jaskowski.  You find a sequence of statements within boxes with the last statement outside of any of the boxes... see here.  So, you could interpret the box symbol as indicating the last statement as falling outside of the proof boxes, were the proof to get written in that style.  Or in other words, it indicates the last statement as a theorem.  This isn't to say that's a historically correct interpretation of this symbol though.
A: See

When typesetting was done by a compositor with letterpress printing, complex typography such as mathematics and foreign languages were called "penalty copy" (the author paid a "penalty" to have them typeset, as it was harder than plain text).[8] With the advent of systems such as LaTeX, mathematicians found their options more open, so there are several symbolic alternatives in use, either in the input, the output, or both. When creating TeX, Knuth provided the symbol ■ (solid black square), also called by mathematicians tombstone or Halmos symbol (after Paul Halmos, who pioneered its use). The tombstone is sometimes open: □ (hollow black square). 

http://en.wikipedia.org/wiki/Q.E.D.#Electronic_forms
A: I had always used QED (quod erat demonstrandum) at the end of a proof until I was introduced to using Halmos' symbol.  Since it was a 4-sided symbol, my mind has always associated this "quad" symbol with "quod".
