I have a little dispute over co-authorship on a paper, and I would appreciate feedback on whether I am handling this appropriately (or if I am being an asshole or not).
I am a PhD student in applied mathematics, focusing on theoretical and methodological statistics. About a year and a half ago, I initiated a collaborative project with another PhD student from a different city. Our agreement was that I would handle the theoretical aspects (proofs and writing) while he would develop and code the algorithm. We agreed that I would be the first author.
I finished my part almost a year ago. Then he started working on his part. It took him almost a year and he did...something. But, in my opinion, it was not good. The algorithm he developed only worked under extremely restrictive assumptions that were not necessary and did not follow from the theory. I also had concerns that its occasional success might be coincidental as I more and more think the underlying idea does not make much sense.
So I looked into the 'algorithm' part myself in April. In April (took me about three weeks), I created a new algorithm and finished coding it (a completely different approach than his, no parts of his work used). It works provably better with no strong assumptions, and (yes, this is just my opinion and intuition) it beautifully matches the theory, and it makes sense that it works.
So I wrote it down in the manuscript what I did and I finalized the paper in the last few weeks, which does not include any of his contributions. Upon discussing authorship, my collaborator insists he should be a coauthor, arguing that this was a joint project from the start and he invested considerable time in it. I disagree, as I have spent immensely more time on it and all current ideas, code, and writing are mine.
We have scheduled a meeting with our PhD supervisors next week to discuss this issue. Am I justified in requesting his removal from the paper? I do not want to have bad reputation and bad personal relations with them, however I wouldn't feel comfortable with sharing credit for something that I created.
Note: There is something that I did wrong about this collaboration. I did not communicate well with him about how and what I was doing in the last month. I told him that I had another approach for the algorithm part, and when I finished the algorithm, I explained it to him (not in deep detail), and we both agreed that it was a better algorithm. Then we did not communicate for the last few weeks while I finished the rest (and yes, his part) of the paper. My rationale was that I did not see how he could help and I wanted to expedite the project's completion, especially since it always took him a long time to do stuff and I just wanted to have this project done and finished.
I appreciate any insights or advice you can provide on this matter. Note that this is just my point of view of the story, and maybe he sees it differently.