The Machinist

Trevor Reznik is a machinist whose insomnia has led to his becoming emaciated. His appearance and behavior keeps his coworkers away, and they eventually turn against him when he is involved in an accident that causes his coworker, Miller, to lose his left arm. Trevor, who was distracted by an unfamiliar co-worker named Ivan, is blamed for the accident. No one at the factory knows of Ivan and there are no records of him. Trevor seems to find peace only with Stevie, a prostitute with genuine affection for him, and with Maria, a waitress at an airport diner he frequents. He is haunted by brief flashes of recurring imagery, and things such as his car cigarette lighter take on a menacing air. A mysterious series of post-it notes appear on his refrigerator, depicting a game of hangman.
These vague incidents send him further into paranoia, but he nonetheless attempts to establish a relationship with Maria. Meeting her at an amusement park, Trevor goes with her son Nicholas on a funhouse ride called "Route 666", whose flashing lights cause Nicholas to suffer an epileptic seizure. No longer able to think clearly, Trevor suspects that the bizarre events are a concerted effort to drive him insane. These ideas are fed to him in small random clues. One of them is a picture of Ivan fishing with Trevor's coworker Reynolds, which he discovers in Ivan's wallet when it's left behind in a pub. Another near-accident at work causes Trevor to lash out in rage at his co-workers; as a result, he is immediately fired. Increasingly distracted and alienated, Trevor forgets to pay his utility bills and his electricity is disconnected. A dark, viscous liquid begins trickling out of the freezer, coating the fridge door with streaks of what appears to be blood.
After several attempts to confront Ivan, Trevor tries to trace his license plate. He follows Ivan's car to read its license plate, but runs out of gas during the pursuit. When a DMV clerk insists that personal information cannot be released unless a crime has been committed, Trevor throws himself in front of a car in order to accuse Ivan of committing a hit and run. He files a police report with Ivan's plate number on it, only to be baffled when he is told that the car in question is his own; he had reported the vehicle totaled one year ago. He runs from the policemen and goes to Stevie, who clothes and washes him, but he finds the photo of Ivan and Reynolds framed in her home and accuses her of conspiring against him. Confused, Stevie says the picture is of Reynolds and Trevor, but he refuses to look at it and is thrown out after a verbal conflict. He goes to the airport diner, but is told by an unfamiliar waitress that they've never had an employee named Maria. The waitress has served Trevor every day for a year, Trevor saying so little the waitress began to think he was a mute.
In the film's climax, Trevor sees Ivan take Nicholas into Trevor's apartment and, fearing the worst, sneaks inside. Nicholas is nowhere to be seen and doesn't respond to Trevor's calls. He confronts Ivan in the bathroom and kills him after a struggle. He pulls back the shower curtain, only to find the bathtub empty. He goes to the refrigerator and opens it to find rotting fish and other spoiled food tumble out. His mind then flashes back to the fishing photo, which actually shows a healthy Trevor with Reynolds, just as Stevie claimed. Ivan being in the photo was part of Trevor's delusion. The scene returns to one that occurred during the opening credits, in which he tries to dispose of someone's corpse - presumably Ivan's - by rolling it in a rug and casting it into the ocean. When the rug unravels, there is nothing inside. Ivan, alive as ever, appears holding a flashlight and laughs.
The scene then cuts to Trevor staring into a mirror at home, repeating the words "I know who you are". It is revealed that one year ago, Trevor ran over and killed a boy identical to Nicholas after taking his eyes off the road to use the car's cigarette lighter, which was witnessed by the boy's mother, identical to Maria. He decided to drive away, and the resulting guilt became the deep-seated cause of his insomnia, emaciation and repressed memory. He fills the missing letters of the hangman note to spell "killer". He briefly considers going to the airport and escaping, but instead drives to police headquarters, signifying his "road to salvation", a recurring theme in the film. He is accompanied by a silent but encouraging Ivan, who bids him an approving farewell outside the station. At the police station's front desk, he confesses to the hit and run. Two police officers escort Trevor to a cell, where he states his intention to sleep and does so for the first time in a year.

Question: What is the main character's name?
Answer: Trevor Reznik