AFTD Auto-Formalizing Theoretical Domains

bipartite_matchings

def

For a bipartite graph with left vertices Fin n and right vertices Fin n whose edge set is E (a finite set of pairs (left, right)), the finite set of its matchings: the subsets M of E in which any two edges sharing a left endpoint or sharing a right endpoint are equal.

Statement

def bipartite_matchings (n : ℕ) (E : Finset (Fin n × Fin n)) : Finset (Finset (Fin n × Fin n))
Source
Defined for OP-1789 (size-priority matching noise phase transition), building on arXiv:2601.20502 (Optimal matching under size priority), Section 1.
Verified
17 Nov 2026
Axioms
none listed
Used by 3
  • is_size_priority_optimalGiven the bipartite graph on Fin n + Fin n with edge set E and real edge costs w, a set M of pairs is size-priority optimal when it is a…
  • size_priority_matching_specFor every edge set E of the bipartite graph on Fin n + Fin n and all real costs w, size_priority_matching n E w is size-priority optimal:…
  • size_priority_matching_card_leFor every n, every edge set E ⊆ Fin n × Fin n, and every real cost function w, the size-priority optimal matching size_priority_matching n…

Lean source view module on GitHub

def bipartite_matchings (n : ℕ) (E : Finset (Fin n × Fin n)) : Finset (Finset (Fin n × Fin n)) :=
  E.powerset.filter (fun M => ∀ e ∈ M, ∀ f ∈ M, (e.1 = f.1 ∨ e.2 = f.2) → e = f)
See it in the graphDiscuss this resultChallenge it