Counting feedback vertex and arc sets
Lax280166.CountingFeedbackSets · concepts/Lax280166/CountingFeedbackSets.lean · lax-280166
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
On a finite directed graph with marked vertices, #Feedback Vertex Set counts the sets of exactly vertices whose removal leaves no directed cycle. On a finite directed graph with a marked relation of pairs, #Feedback Arc Set counts the sets of exactly arcs whose removal leaves no directed cycle.
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 Mathlib.Data.Set.Finite.Lemmas |
| 23 | import Lax799700.CliqueFamily |
| 24 | import Lax799700.Feedback |
| 25 | import Mathlib.SetTheory.Cardinal.Finite |
| 26 | import Lax366625.CountingProblems |
| 27 | |
| 28 | /-! |
| 29 | --- |
| 30 | title: Counting feedback vertex and arc sets |
| 31 | type: definition |
| 32 | --- |
| 33 | On a finite directed graph with marked vertices, #Feedback Vertex Set |
| 34 | counts the sets of exactly vertices whose removal leaves no directed |
| 35 | cycle. On a finite directed graph with a marked relation of pairs, |
| 36 | #Feedback Arc Set counts the sets of exactly arcs whose removal leaves no |
| 37 | directed cycle. |
| 38 | -/ |
| 39 | |
| 40 | namespace Lax280166.CountingFeedbackSets |
| 41 | |
| 42 | open Lax799700.CliqueFamily Lax799700.Feedback |
| 43 | |
| 44 | open FirstOrder |
| 45 | |
| 46 | open Language Structure |
| 47 | |
| 48 | section Generic |
| 49 | |
| 50 | variable {A B : Type} |
| 51 | |
| 52 | /-- The removal of the set `C` leaves an acyclic digraph, and `C` has exactly |
| 53 | as many elements as the `Kp`-marked set. -/ |
| 54 | def FeedbackOfSizeOn (Adjp : A → A → Prop) (Kp : A → Prop) (C : A → Prop) : Prop := |
| 55 | AcyclicRel (SurvivingArc Adjp C) ∧ {x | C x}.ncard = {x | Kp x}.ncard |
| 56 | |
| 57 | end Generic |
| 58 | |
| 59 | section Problem |
| 60 | |
| 61 | variable (A : Type) [markedGraph.Structure A] |
| 62 | |
| 63 | /-- The set `C` is a feedback vertex set with exactly as many vertices as the |
| 64 | marked set, in a finite marked digraph. -/ |
| 65 | def FvsOfSize (C : A → Prop) : Prop := |
| 66 | Finite A ∧ FeedbackOfSizeOn (fun x y : A => MGAdj x y) (fun x => MGMarked x) C |
| 67 | |
| 68 | end Problem |
| 69 | |
| 70 | open FirstOrder |
| 71 | |
| 72 | open Language Structure |
| 73 | |
| 74 | section Generic |
| 75 | |
| 76 | variable {A B : Type} |
| 77 | |
| 78 | /-- The relation `F` is a set of arcs whose removal leaves an acyclic digraph, |
| 79 | with exactly as many pairs as the marked relation. -/ |
| 80 | def FasOfSizeOn (Adjp Kp : A → A → Prop) (F : A → A → Prop) : Prop := |
| 81 | (∀ a b, F a b → Adjp a b) ∧ AcyclicRel (UncutArc Adjp F) ∧ |
| 82 | {p : A × A | F p.1 p.2}.ncard = {p : A × A | Kp p.1 p.2}.ncard |
| 83 | |
| 84 | end Generic |
| 85 | |
| 86 | section Problem |
| 87 | |
| 88 | variable (A : Type) [markedArcGraph.Structure A] |
| 89 | |
| 90 | /-- The relation `F` is a feedback arc set with exactly as many arcs as the |
| 91 | marked relation has pairs, in a finite arc-marked digraph. -/ |
| 92 | def FasOfSize (F : A → A → Prop) : Prop := |
| 93 | Finite A ∧ FasOfSizeOn (fun a b : A => MAGAdj a b) (fun a b => MAGMarked a b) F |
| 94 | |
| 95 | end Problem |
| 96 | |
| 97 | open Lax366625.CountingProblems |
| 98 | |
| 99 | /-- **#Feedback Vertex Set**, as a counting problem. -/ |
| 100 | noncomputable def SharpFeedbackVertexSet : CountingProblem Lax799700.CliqueFamily.markedGraph := |
| 101 | CountingProblem.ofFun fun A _ => |
| 102 | Nat.card {C : A → Prop // FvsOfSize A C} |
| 103 | |
| 104 | /-- **#Feedback Arc Set**, as a counting problem. -/ |
| 105 | noncomputable def SharpFeedbackArcSet : CountingProblem Lax799700.Feedback.markedArcGraph := |
| 106 | CountingProblem.ofFun fun A _ => |
| 107 | Nat.card {F : A → A → Prop // FasOfSize A F} |
| 108 | |
| 109 | end Lax280166.CountingFeedbackSets |
| 110 |
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.Data.Set.Finite.LemmasMathlib.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