Yours, Etc.: Origins and Uses of 8 Sign-Offs
"prison," c.1700, a cant slang word of unknown origin; perhaps a variant of quad in the "building quadrangle" sense.
A phrase used to signal that a proof has just been completed. From Latin, meaning “that which was to be demonstrated.”
[1700+; perhaps fr quadrangle; perhaps fr Romany quaid, ''prison'']