I think @Buffy's answer is generally excellent, as it seems so does the SE community.
However, I'ld like to suggest a supplemental caution/refinement.
I'm wondering; even "quite a theoretical problem" in "theoretical aspects of CS/ML" may turn out to have practical applications which lead to other events related to awards (with monetary and career-building impacts) and intellectual property filings later on, and later transactions related to said IP, which could be subject to becoming unexpectedly contested.
Those may not be specifically limited to this one result, but might also apply to some derivative work based on it.
While a bit of "generosity" can certainly be "profitable to all in the long run" in the academy, a lack of accuracy and/or clarity in a published attribution of effort may have unforeseen effects later on.
@Buffy says, correctly:
At a minimum they have earned a strong acknowledgement.
Acknowledgments offer the opportunity to define and constrain the nature and extent of the acknowledged contributions.
Some journals provide a space to outline the extent and nature of the contributions of each author beyond what we can infer from the ordering of the names. You can consider where you'd like to publish, and if it offers such a space and authorship is offered to others, it's best to agree upon the wording there at the same time, rather than surprising folks later and suddenly have a potential second-order disagreement on your hands.