Based on what you have said, this seems to be a clear ethical violation.
I would send an email to your supervisor asking him/her if X has had a chance to look at section Y. This will force them to either state yes or no as to if X participated. Play dumb if you have to.
Has X had a chance to look at section Y in the project? As I remember, we discussed adding X as an author as long as X verified the results of section Y. I just want to be sure that I get the right authorship on this paper.
Getting written directions from your supervisor on this will document any unethical behavior that he/she is suggesting you participate in. Your supervisor will have to either directly tell you to add X even though they have not contributed to the paper, or they will be leveraged into conceding that X does not deserve authorship and should not be added.
If your supervisor still insists that X be given credit in spite of doing nothing, you have a few options:
- You can seek out the advice of your department chair or graduate coordinator.
- You can refuse to put X in as an author and make your supervisor mad with you.
- You can comply with your supervisor and chalk it up to yet another predatory, manipulative adviser taking advantage of students.
You decision here depends significantly on how receptive your department is to students and how much you are willing to risk losing if your supervisor tries to retaliate. I am understanding of the fact that you may or may not really have the leverage to directly turn your supervisor down on his/her demands. Such is the life of a student in academia. A small number of professors know you have no clout and routinely take advantage of students in these situations. And sometimes, it is better for your own sanity and career to let X and your supervisor commit ethical violations and publish your paper without further grief.