Counting dominating sets
Lax280166.CountingDominatingSets · concepts/Lax280166/CountingDominatingSets.lean · lax-280166
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
On a finite marked graph with marked vertices, #Dominating Set counts the sets of exactly vertices such that every vertex is in the set or adjacent to one of its elements.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.Tactic.FinCases |
| 2 | import Mathlib.Order.PiLex |
| 3 | import Mathlib.Data.Prod.Lex |
| 4 | import Mathlib.Data.Fintype.EquivFin |
| 5 | import Mathlib.ModelTheory.Order |
| 6 | import Mathlib.ModelTheory.Semantics |
| 7 | import Mathlib.ModelTheory.Complexity |
| 8 | import Mathlib.Logic.Equiv.Fin.Basic |
| 9 | import Mathlib.Data.Fintype.Lattice |
| 10 | import Mathlib.Data.Finite.Sigma |
| 11 | import Mathlib.Order.Lattice.Nat |
| 12 | import Mathlib.Data.Set.Card |
| 13 | import Mathlib.Data.Fintype.Pigeonhole |
| 14 | import Mathlib.Dynamics.FixedPoints.Basic |
| 15 | import Mathlib.ModelTheory.Syntax |
| 16 | import Mathlib.Algebra.Order.BigOperators.Group.Finset |
| 17 | import Mathlib.Data.Fintype.Card |
| 18 | import Mathlib.SetTheory.Cardinal.Finite |
| 19 | import Mathlib.Data.Fintype.Sort |
| 20 | import Mathlib.Order.Hom.Set |
| 21 | import Mathlib.Logic.Equiv.Prod |
| 22 | import Lax799700.CliqueFamily |
| 23 | import Mathlib.SetTheory.Cardinal.Finite |
| 24 | import Lax366625.CountingProblems |
| 25 | |
| 26 | /-! |
| 27 | --- |
| 28 | title: Counting dominating sets |
| 29 | type: definition |
| 30 | --- |
| 31 | On a finite marked graph with marked vertices, #Dominating Set counts the |
| 32 | sets of exactly vertices such that every vertex is in the set or adjacent |
| 33 | to one of its elements. |
| 34 | -/ |
| 35 | |
| 36 | namespace Lax280166.CountingDominatingSets |
| 37 | |
| 38 | open Lax799700.CliqueFamily |
| 39 | |
| 40 | open FirstOrder |
| 41 | |
| 42 | open Language Structure |
| 43 | |
| 44 | section Generic |
| 45 | |
| 46 | variable {A B : Type} |
| 47 | |
| 48 | /-- The set `D` dominates every vertex and has exactly as many elements as the |
| 49 | `Kp`-marked set. -/ |
| 50 | def DomOfSizeOn (Adjp : A → A → Prop) (Kp : A → Prop) (D : A → Prop) : Prop := |
| 51 | (∀ v, D v ∨ ∃ u, D u ∧ Adjp u v) ∧ {v | D v}.ncard = {v | Kp v}.ncard |
| 52 | |
| 53 | end Generic |
| 54 | |
| 55 | section Solutions |
| 56 | |
| 57 | variable (A : Type) [markedGraph.Structure A] |
| 58 | |
| 59 | /-- The set `D` is a dominating set with exactly as many vertices as the marked |
| 60 | set, in a finite marked graph. -/ |
| 61 | def DomSetOfSize (D : A → Prop) : Prop := |
| 62 | Finite A ∧ DomOfSizeOn (fun u v : A => MGAdj u v) (fun v => MGMarked v) D |
| 63 | |
| 64 | end Solutions |
| 65 | |
| 66 | open Lax366625.CountingProblems |
| 67 | |
| 68 | /-- **#Dominating Set**, as a counting problem. -/ |
| 69 | noncomputable def SharpDominatingSet : CountingProblem Lax799700.CliqueFamily.markedGraph := |
| 70 | CountingProblem.ofFun fun A _ => |
| 71 | Nat.card {D : A → Prop // DomSetOfSize A D} |
| 72 | |
| 73 | end Lax280166.CountingDominatingSets |
| 74 |
Used by
Lax280166.CliqueCompleteLax280166.CliquesValuesLax280166.DirHamCircuitCompleteLax280166.DominatingSetCompleteLax280166.DominatingSetsValuesLax280166.ExactCoverCompleteLax280166.FeedbackArcSetCompleteLax280166.FeedbackSetsValuesLax280166.FeedbackVertexSetCompleteLax280166.HamCircuitCompleteLax280166.HamiltonCircuitsValuesLax280166.HittingSetCompleteLax280166.IndependentSetCompleteLax280166.KnapsackCompleteLax280166.KnapsacksValuesLax280166.OneInSATCompleteLax280166.SatVariantsValuesLax280166.SetCoverCompleteLax280166.SetFamiliesValuesLax280166.SetPackingCompleteLax280166.SteinerTreeCompleteLax280166.SteinerTreesValuesLax280166.ThreeSATCompleteLax280166.VertexCoverCompleteLax280166.ZeroOneIPComplete
From Mathlib
Mathlib.Algebra.Order.BigOperators.Group.FinsetMathlib.Data.Finite.SigmaMathlib.Data.Fintype.CardMathlib.Data.Fintype.EquivFinMathlib.Data.Fintype.LatticeMathlib.Data.Fintype.PigeonholeMathlib.Data.Fintype.SortMathlib.Data.Prod.LexMathlib.Data.Set.CardMathlib.Dynamics.FixedPoints.BasicMathlib.Logic.Equiv.Fin.BasicMathlib.Logic.Equiv.ProdMathlib.ModelTheory.ComplexityMathlib.ModelTheory.OrderMathlib.ModelTheory.SemanticsMathlib.ModelTheory.SyntaxMathlib.Order.Hom.SetMathlib.Order.Lattice.NatMathlib.Order.PiLexMathlib.SetTheory.Cardinal.FiniteMathlib.Tactic.FinCases
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments