Here's the breakdown:
* Alex Hunter is the protagonist and a detective investigating Lexi's murder. He becomes obsessed with the case and begins to assume Lexi's identity, even going so far as to take up residence in her apartment.
* Lexi was actually killed by a stalker, who was ultimately revealed to be a woman named Catherine Cleary.
* Alex, while in a delusional state, believed he had murdered Lexi during a struggle, but this was a false memory planted by Catherine Cleary, who manipulated him throughout the investigation.
Therefore, although Alex stabbed Lexi, it wasn't out of malicious intent. He was manipulated into believing he was the killer and acting in self-defense.