According to my calculation, in any case of a 3-way-tie involving Mauresmo and Rubin, Mauresmo has the edge and will go to the semifinal.
She currently has 2 sets advantage over Rubin, so no matter if they both win or both lose, Mauresmo will be ahead.
Dementieva has no chance to qualify, as she can't overtake Mauresmo. Even if she win in 2 sets and Mauresmo lose in 2 (which is not possible any more since she won a set against Kim), Mauresmo's 3-4 sets record beat 2-4.
For the same reason, Rubin couldn't overtake Klijsters.
So, the only possibility that Rubin qualifies is if Mauresmo lose to Klijsters and she beats Dementieva.
The only case in which Kim will be 2nd rather than first is if she lose to Mauresmo and Rubin lose to Dementieva, because the set she just won against Mauresmo ensures she would be at the top in a 3-way-tie situation.
Career high ranking: 6 (16/10/2005)
Current Ranking: 40, 789 pts, 35 tournaments
2007 race to the championship: 26, 293 pts, 8 tournaments
Year-end Ranking: 2006 - 46, 2005 - 8, 2004 - 63, 2003 - 146
Winner: 2006 - Beijing, 2005 - Sydney, Budapest, Hasselt
Runner-up: 2006 - Prague, 2005 - Hyderabad, Forest Hills, Los Angeles YEC
Semifinal: 2006 - Paris, Bogota, 2004 - Sopot
Quarterfinal: 2005 - Prague, Modena, 2004 - Indian Wells, Stockholm, Seoul, Filderstadt