Should all authors on a paper be comfortable explaining every aspect of the paper? Say I am person A who has built up some degree of expertise in mathematical topic X. Person B works on mathematical topic Y and realizes she needs a result from topic X. She asks me if I know how to prove this result. I work for a bit and prove this result, which person B works into their paper.

Now, I'm confident about my work on topic X, and am confident that person B is not manhandling its use for topic Y - i.e., they're very clear about the assumptions my result uses and what it implies. However, my knowledge of topic Y is not very deep, and it would take a significant amount of time for me to comfortably grasp exactly how the paper's use of topic Y works.

Is it then dishonest to proceed as an author? Is it expected that every author knows every aspect of the paper?
By most standards, authors of a scientific paper need to have made substantial intellectual contributions to the paper (e.g., coming up with the idea behind it, proving a required result, etc), made contributions to the write-up of the paper, and ultimately approve of the paper draft when it is submitted to a journal. As such, I think both you and your collaborator meet authorship criteria even though your grasp of topic Y is not as deep as your collaborator (and presumably your collaborator's grasp of topic X is not as deep as yours). At the very least, it is not dishonest to proceed as an author.

As for whether an author should be able to explain every aspect of a paper, I would think not necessarily. My field is very interdisciplinary, and it is not uncommon for clinicians to work with statisticians on papers. They are all experts in their respective fields, but their knowledge of the other person's field is almost guaranteed to be less than their collaborators. Yet, it is still possible for them to write papers together because their knowledge bases are complementary.