It is completely normal to include in your thesis work that was done in collaboration. Almost every PhD thesis in STEM subjects includes at least some collaborative work, simply because your PhD itself is a collaboration between you and your advisor.
Usually, you just need to clearly state what work in your thesis was done in collaboration and with whom. It may also be expected that joint work should be put in your own words, rather than just copied from the paper. That's good practice anyway, since it's a great way to make sure you really understand the work. And you'll need to understand it because you can be examined on anything that's in your thesis.
Check your individual university's regulations for the precise details. And ask your advisor – this stuff is literally their job.
Assume that while being a student, you collaborate with Prof. X, and you write a paper together. In this paper, the work was split 50-50, so that half of the results belong to Prof. X.
That simply isn't how collaboration works in mathematics. The results "belong to" all the authors, because they came from a creative process that heavily involved all of them. Of course, some parts of the work will be solely by one person sitting in their office with a cup of coffee until they figure it out on their own, but it's mostly not like that. And usually, even these "solo results" receive at least some contributions from the other authors as the paper gets written and rewritten. And, very often, even if it was Author A who came up with the actual proof, Authors B and C were part of the process that led to that particular technique being chosen, and so on.
Of course, there are some exceptions. Sometimes, an author joins a collaboration late because their expertise on some area is needed. In computer science, papers are often released first as a shortened conference version (which is a peer-reviewed publication, unlike in mathematics) and later, the full version appears in a journal. I'm aware of papers where extra authors have been added to the journal version because of specific contributions they made after the conference. I guess the closest analogue in mathematics would be a paper going up on the ArXiv and then acquiring extra authors. If an author in that situation was a PhD student, I'd expect their thesis to include only a high-level summary of the material that existed before they joined the project.
The fundamental rule is honesty. If you can put your hand on your heart and say that you made significant contributions to the work and you're clear about who else contributed, it's almost certainly fine. If you're including big chunks of stuff that you made no significant contribution to, I'd hope you already know that it's wrong to say "I did this."