Citing a math theorem with errors
Given the situation as you describe it, in particular that there is evidence that the author could have corrected the presumably-small mistake themselves, I'd recommend that you quote the true assertion, and/while noting, literally, that there is an easily correctible error or typo in the proof as written.
Catching typos is important, but is not "research", of course. And, yes, once typos or silly mis-statements are pointed out, many authors can repair them without hesitation. So I myself generally consider "paper X" to be "paper X with all trivial typos and obvious blunders corrected". (Still, yes, sometimes the boundary of this is not clear...)
In particular, yes, I give credit to authors for obtaining a result who've slightly messed up the argument, both for observing what is true, and for at least approximating the proof.
I believe that paul garrett is pretty much correct here, but here's a way you can incorporate this into your paper:
Smith and Jones (1995) found that the area under the rhomboid apparatus was upper-bounded by the third order discriminant. While their final result is valid, a minor flaw was found in their proof. We provide a corrected proof in Appendix A. Given the established upper bound, we now show that the lower bound is negatively correlated to the complex derivative under the hyperspace gradient....
This approach gives your reader the "best of both worlds". You acknowledge the source upon which you build your own findings, acknowledge the minor flaw in that source, and provide a proof that your reader can rely on.
2) Say something like ... "the results are based off the ideas by author X" but don't give as much of a "these are author X's results" flavor. Author Y then after mentioning author X, proves the theorem themselves.
You’re missing the forest for the trees here. The result is author X’s result. A small mistake that anyone can correct cannot reasonably be said to change that fact. It would be rather small minded of you in such a situation to try to give the impression that author X does not deserve 100% of the credit but that someone like you had to come along and “prove the theorem themselves”. Depending on your precise phrasing, it can even come across as intellectually dishonest and/or insecure.
The best thing that you can do to serve both author X and your readers is give author X full credit for the result, while at the same time pointing out that their proof contained a small error (and as I said there is no inconsistency between saying those two things), and then explaining, in as much details as you feel is needed, how the error can be corrected.