The Machinist (2004)
FAQAdd to FAQ
One answer is that his insomnia was causing things such as paranoia, delusions, hypochondria and OCD, as how he spent hours cleaning everything. Another answer is that in the back of his mind he knew he killed the young boy and he metaphorically had blood on his hands he was constantly trying to wash off with the bleach. Edit
A lot of the time, yes. Trevor has apparently buried the memory of his crime, although some events seem to trigger a flash-back, such as the car cigarette lighter, clocks turning to 1:30, the cowboy boots and the carnival ride called Route 666. His subconscious guilt is the source of Trevor's insomnia, and this causes hallucinations of increasing intensity. The accidents at his work and the spilling of blood from his fridge are real, as these events are referenced by other people, but Ivan is a complete figment of his imagination; nobody else can see him or knows anything about him. The red car that Ivan is driving is revealed to have once belonged to Trevor before it was rendered total-loss in the accident. Trevor has entire conversations with Marie the waitress, and takes her and her son to the carnival. We later learn that these are all imagined; he always sits at the bar drinking coffee without saying a word, and the waitress is an entirely different lady in reality. So the events with either Ivan, Marie or Nicholas occur mostly or completely in his mind, whereas the encounters with other people (Stevie, his colleagues, the police) are real for the most part. Edit
Ivan is a character created by Trevor in his imaginary world. He could be summarily seen as the manifestation of Trevor's bad conscience - his strange, somewhat unnerving appearance (long teeth, deformed hand) reflects the suppressed ugliness in Trevor's past that Ivan's appearance heralds. These hallucinations go as far as Trevor not recognizing himself on a picture, he sees only Ivan in his place, implying that Ivan is the 'guilty' side of Trevor hidden inside of him. 'Ivan' is most likely also responsible for the yellow post-it messages that Trevor finds in his house (unless the landlady did it, which seems unlikely), but Trevor simply represses the memories of putting them there; and it was probably 'Ivan' (i.e. Trevor himself) who turned on the machine which nearly cost him his hand. Trevor even kills Ivan, and when he does, his bad conscience is gone which means there is nothing in the way for him to turn himself in. He turns himself in and is able to sleep after he has accepted his crime.