As crazy as the whole Arnoux-Frederick-Arnoux triangle (and then some) may seem, it was actually rooted in reality. Flaubert's reality, in fact. Turns out he was in love with a married woman, too: Elise Schlesinger (source).
Think there's a lot of sex in Sentimental Education? Try Flaubert's life. This guy had no qualms sharing the deets of his sex life with the world (source).