leanprover-community / leanprover-community/mathlib4

Graph theory def: Maximal/maximum matchings

Open
#34,957 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help-wanted t-combinatorics
Dominant language
Lean
Stars
4.2k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Matchings in simple graphs exist as SimpleGraph.Subgraph.IsMatching.

I suggest we're missing the following defs for maximal matchings and maximum matchings:

open Cardinal

def Subgraph.IsMaximalMatching (M : G.Subgraph) : Prop :=
  Maximal IsMatching M

def Subgraph.IsMaximumMatching (M : G.Subgraph) : Prop :=
  MaximalFor IsMatching (#·.edgeSet) M

and basic API for them, including:

/-- A maximum matching is a maximal matching. -/
theorem IsMaximumMatching.isMaximalMatching {M : G.Subgraph} (hfin : M.edgeSet.Finite)
    (h : M.IsMaximumMatching) : M.IsMaximalMatching := by
  refine h.maximal_of_strictMonoOn <| mk_strictMonoOn.comp IsMatching.strictMonoOn_edgeSet ?_
  exact fun _ h' ↦ hfin.finite_of_encard_le <| toENat.monotone' <| h.le h'

/-- A perfect matching is a maximum matching. -/
theorem IsPerfectMatching.isMaximumMatching {M : G.Subgraph} (h : M.IsPerfectMatching) :
    M.IsMaximumMatching := sorry

/-- A perfect matching is a maximal matching. -/
theorem IsPerfectMatching.isMaximalMatching {M : G.Subgraph} (h : M.IsPerfectMatching) :
    M.IsMaximalMatching := sorry

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing SimpleGraph.Subgraph.IsMatching definition and API in Mathlib/Combinatorics/SimpleGraph/Matching.html. Define the proposed maximal and maximum predicates, then use the stated theorem signatures to guide the API, including the relationships with finite and perfect matchings. Done means the definitions and basic lemmas are added with proofs rather than sorry.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.