They’re the same person, they’ve just gone different ways. Moriarty has to match Sherlock, he has to be intelligent and quick-witted. He has to understand him. He has a total obsession with Sherlock, and I think Sherlock is obsessed with him, too. They need one another. People love the relationship between John and Sherlock because it’s about friendship, it’s about what it means to love someone else. Moriarty doesn’t have any friends, he doesn’t have anyone to love, that’s why he’s become sociopathic. I wanted to show little glimpses of Moriarty’s vulnerability. You can’t go down that road too much because that’s not what one’s job is when playing the main antagonist, but you got to see that towards the very end, when we realize he’s going to kill himself. He’s a very desolate, very lonely, very unhappy person.
Andrew Scott on Sherlock and Moriarty’s relationship, which is “as deep and complex as the relationship between Sherlock and John” ; Sherlock: The Casebook