A popular quote by Lain about memory is as follows:
A memory is only a record. You just have to rewrite that record.
This theme is clear in the text on the Visual Experiments Lain page on Layer 07 Society. This appears to be a journal entry written by Lain and shows evidence of the unreliability of her memory. It is reproduced here with the grammatical errors present in the original:
Last Sunday, I went out with my family. We went to our relative's house in Fujisawa by train. All of us together. We left at the time I usually leave for school. On our way to the station, my mother noticed that she forgot something, so we went back to the house. It was the first time we went to their house in Fujisawa--No. I was mistaken. We've been there several times. I just forget things sometime. Meeting my uncle and aunt. I greeted them saying "Nice to meet you" by mistake, and they laughed at me. I don't remember what happened while I was in the train. But I think I was hearing my father and mother talk quietly about the medicine all the way. I was hearing it absent-mindedly. Then I began to feel as if I was at school and I felt sick. I endured it all the way through. Meeting my uncle and aunt, I said "Hello." No, I said "Nice to meet you." Was my father and mother there? Last Sunday, I went out alone. I went to relative's house in Fujisawa alone.
There are several uncertainties in Lain's memory in what at first appears to be a simple account of a day out with the family. Firstly, she does not recall going to her relative's house in Fujisawa before, but she thinks this was not the first time. Next, she has the impression that she is at school rather than on a train. Then, she mistakes which sentence she greeted her relatives with. Finally, she takes the entire premise apart, stating that her parents were not there and she had gone out alone.
There is no way of knowing precisely what happened, as we only have an unreliable account to go by. This passage, therefore, shows how easily faulty memory can complicate the truth and one's perception of reality.
In the final episode, Yasuo makes a final reference to Proust's In Search of Lost Time when he says that he and Lain should have some tea with madeleines. The book uses madeleines to contrast voluntary and involuntary memory.