They could just write down "overqualified" or "lacking social skills" or "doesn't get along with others" as reasons and not even mention a mental illness.
If one tells a lie when being deposed, it is perjury.
You assume the interviewer will tell the truth in court, he/she will lie and make up a different reason why they didn't hire you to avoid being fired or covering things up.
You almost have to record them saying it, or having a letter or email where they say it. It is really hard to prove. It comes down to your word against theirs.
They aren't stupid enough to write down "This guy has a mental illness I refuse to hire him" they will make up other reasons to cover up the fact that they don't want to hire a mentally ill person.
I've been through this many times, filed with the EEOC, talked to lawyers, ended up on disability because I couldn't get a job. They never say they rejected you because you are mentally ill. Always "not a good fit", "overqualified", "not a team player", "lack of social skills", whatever they decide to write down even if it is not true.
Lawyers would not take the case because it was hard to prove.
If someone is mentally ill such that it's obvious to folks around them, and they communicate poorly compared to another candidate who is in other ways equal, then is it discrimination not to hire them? (not saying this description applies to anyone here; I'm just asking a hypothetical to get a sense of what's meant by discrimination)
If you interview a person and say to yourself, "This guy is kind of strange. I'm not sure he'll pick up on social cues, so he might make people in the office uncomfortable. Sometimes he doesn't communicate well. He can't explain what he's thinking, and his words are a jumble. I'm not sure he could publicly speak, like give a presentation, and I sure wouldn't want him to represent my company to customers." Is it discrimination to pass and choose another candidate who is comparable in other ways, and not hindered in those communication and interpersonal ways?