May I cite an unpublished exercise from a lecture?
You always cite your source as best as you can. If your best citation is “unpublished solution to a lecture exercise”, then that is what you should cite. If you can find a better citation, fine. If not, cite it this way. 

Since you don’t want to rely on something unproven, you should include the proof. One reason to have a citation is to allow others to verify the result, so the proof should be somewhere where I can read it. If there’s no other place than your paper, that’s where it should be. 

And to avoid accusations of self-plagiarism you should probably mention how the proof was created.