This is a special post for quick takes by anaguma. Only they can create top-level comments. Comments here also appear on the Quick Takes page and All Posts page.
It's about who contributed significantly to the final solution in terms of developing the necessary mathematical ideas (and I believe it's unclear what to do if an AI did all the intellectual labor).
This is not something you can hand out. Clearly there's enough ambiguity so that different reasonable arrangements can benefit different people, so it's still possible to be more or less respectful when you go about creating outputs, but generosity is really the wrong frame. (In some cases, like if you're an advisor, and you invite your student to help on your work it could apply)