Proof of the Gale-Shapley Algorithm

Objectives

We would like to :
  1. Argue that the Gale-Shapley algorithm produces a stable match.

Notes

  • The book proposes the following
    1. w remains engaged from the point at which she receives her first proposal: and the sequence of partners to which she is engaged gets better and better (in terms of her preference list).
    2. The sequence of women tho whom m proposes gets worse and worse (in terms of his preference list)
    3. The G-S algorithm terminates after at most n2 iterations of the while loop.
      • The book uses a bounding argument:
        There are at most n2 pairs (m,w), one selection from M and one selection from W that can be formed.
        
        Once a pair is rejected it will never be examined again (why?)
        
        Therefore the upper bound on this computation is n2
                 
      • Could we do this another way
        Construct a list where every woman prefers every man to m1
        Then as m1 proposes, every woman will accept him, but they will reject him when the next proposal comes along.
        
        Assume the algorithm always looks at m1 first, then m2 ...
        
        Therefore m1 will perform n proposals. 
        
        Can we do the same for m2?
        m2 will perform n-1 proposals
        ...
        So the total proposals will be
           T = n + n-1 + n-2 + ... + 2 + 1
             = n(n+1)/2 
             or approximately n2 proposals.  
    4. If m is free at some point in the execution of the algorithm, then there is a woman to whom he has not yet proposed.
      We will do this proof by contradiction.  IE Assume the negation of what we want to prove is true and show that leads to a contradiction.
      
      
      Assume that at some point in the execution of the algorithm there is a man m who is free, but m has proposed to  every woman.
      
      Since he is free, this means that every woman he has proposed to is paired with someone else (otherwise he would be paired with someone in line 6)
      
      But this means that n women are engaged to n men, none of which are man m (because he is free).
      
      Therefore there must be n+1 men, but that contradicts the conditions of the algorithm.
      
      Therefore there must be a free woman if there is a free man.
            
    5. The set S returned at termination is a perfect match.
       By definition of a perfect match
          1. A set of pairs where each man and each woman appears in exactly one match.
          2. Every man and woman is matched.
      
      We know that the set of engaged pairs always return a matching. ( condition 1 above) because each woman is only paired with exactly one man and each man is pared with exactly one woman.
      
      We know 2 because of item (4) above.  IE there can not be a free man and hence there can not be a free woman.
      
    6. Consider an execution of the G-S algorithm that returns a set of pairs S. The set S is a stable matching.
      From (5) we know it is a perfect match.
      We just need to show that there is not an instability.
      
      Assume that there is an instability
      Thus there exists (m,w) and (m',w')  such that 
      
      1. m prefers w' to w
      2. w' prefers m to m'
      We know that the final proposal of m was to w. Did he propose to w' If he didn't then he prefers w to w' so (a) above is false. If he did, then w' rejected him, or later replaced him, so w' prefers m' to m and (b) above is false. Therefore all pairs are stable and S is a stable matching.