How should I credit the advisor's help in my thesis?
Clearly your advisor thinks well of you and thinks you are ready to move to the next level professionally. You both missed the issue at an earlier stage. Had he found it then he might well have pointed you to a fix rather than providing it.
He is probably as pleased as you are that a fix was possible.
So thank him for support and guidance (perhaps &quot;particularly on Theorem X&quot;) and move on. Remember this incident when you advise your own students.