  Birkhoff's representation theorem (Birkhoff, 1937) defines a bijection
between elements of a distributive lattice and the family of upper sets of an
associated poset. Although not used explicitly, this result is at the backbone
of the combinatorial algorithm by Irving et al. (1987) for maximizing a linear
function over the set of stable matchings in Gale and Shapley's stable marriage
model (Gale and Shapley, 1962). In this paper, we introduce a property of
distributive lattices, which we term as affine representability, and show its
role in efficiently solving linear optimization problems over the elements of a
distributive lattice, as well as describing the convex hull of the
characteristic vectors of the lattice elements. We apply this concept to the
stable matching model with path-independent quota-filling choice functions,
thus giving efficient algorithms and a compact polyhedral description for this
model. To the best of our knowledge, this model generalizes all models from the
literature for which similar results were known, and our paper is the first
that proposes efficient algorithms for stable matchings with choice functions,
beyond classical extensions of the Deferred Acceptance algorithm.
