/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import Mathlib.Data.Finset.Powerset public import Mathlib.Order.Lattice.Nat public import Mathlib.Order.ConditionallyCompleteLattice.Finset public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Matching@[expose] public section

The saturation number of a graph.

Main definitions

    SimpleGraph.saturationNumber : the saturation number μ*(G), the minimum size of a maximal matching.

    SimpleGraph.computableSaturationNumber : a computable companion definition.

    SimpleGraph.saturationNumber_eq_computable : bridge equation saturationNumber G = computableSaturationNumber G.

namespace SimpleGraphvariable {α : Type*} [Fintype α] [DecidableEq α]

Saturation number

The saturation number μ*(G) (also called the lower matching number): the minimum number of edges in a maximal matching of G.

Every finite graph has a maximal matching (extend the empty matching greedily), so this set is nonempty and the infimum is a genuine minimum.

noncomputable def saturationNumber (G : SimpleGraph α) : ℕ := sInf {n | ∃ M : Finset (Sym2 α), G.IsMaximalEdgeMatching M ∧ M.card = n}

Computable saturation number via powerset enumeration over the edge set.

def computableSaturationNumber (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ := ((G.edgeFinset.powerset.filter fun M => G.IsMaximalEdgeMatching M).image Finset.card).min.getD 0

Saturation number equivalence

α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjs:Finset ℕ := Finset.image Finset.card ({M ∈ G.edgeFinset.powerset | G.IsMaximalEdgeMatching M})hset:{n | ∃ M, G.IsMaximalEdgeMatching M ∧ M.card = n} = ↑shs:s.Nonempty⊢ s.min' hs = Option.getD (↑(s.min' hs)) 0; All goals completed! 🐙end SimpleGraph