### Abstract

This is a stepwise refinement and proof of the Gale-Shapley stable matching (or marriage) algorithm down to executable code. Both a purely functional implementation based on lists and a functional implementation based on efficient arrays (provided by the Collections Framework in the AFP) are developed. The latter implementation runs in time O(n2) where n is the cardinality of the two sets to be matched.

### License

BSD License

### Topics

- Computer science/Algorithms
- Mathematics/Games and economics

### Related publications

- Wikipedia

### Session Gale_Shapley

- Gale_Shapley1
- Gale_Shapley2

### Depends on

- Collections Framework
- List Index

### Auto-related entries

- Büchi Complementation
- Tree Automata

## Cite

×

Gale_Shapley-AFP

    @article{Gale_Shapley-AFP,
      author  = {Tobias Nipkow},
      title   = {Gale-Shapley Algorithm},
      journal = {Archive of Formal Proofs},
      month   = {December},
      year    = {2021},
      note    = {\url{https://isa-afp.org/entries/Gale_Shapley.html},
                 Formal proof development},
      ISSN    = {2150-914x},
    }

Download

## Download

× Download latest

Older releases:

- Sep 13, 2023 : Isabelle2023
- Oct 27, 2022 : Isabelle2022
- Jan 3, 2022 : Isabelle2021-1