Counting Steiner trees
Lax280166.CountingSteinerTrees · concepts/Lax280166/CountingSteinerTrees.lean · lax-280166
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
On a finite graph with terminals and marked vertices, #Steiner Tree counts the sets of exactly non-terminal vertices which, with the terminals, induce a connected subgraph.
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.Steiner |
| 23 | import Mathlib.SetTheory.Cardinal.Finite |
| 24 | import Lax366625.CountingProblems |
| 25 | |
| 26 | /-! |
| 27 | --- |
| 28 | title: Counting Steiner trees |
| 29 | type: definition |
| 30 | --- |
| 31 | On a finite graph with terminals and marked vertices, #Steiner Tree counts |
| 32 | the sets of exactly non-terminal vertices which, with the terminals, |
| 33 | induce a connected subgraph. |
| 34 | -/ |
| 35 | |
| 36 | namespace Lax280166.CountingSteinerTrees |
| 37 | |
| 38 | open Lax799700.Steiner |
| 39 | |
| 40 | open FirstOrder |
| 41 | |
| 42 | open Language Structure |
| 43 | |
| 44 | section Generic |
| 45 | |
| 46 | variable {A B : Type} |
| 47 | |
| 48 | /-- The set `S` contains every terminal, is connected, and has exactly as many |
| 49 | non-terminals as the `Kp`-marked set has elements. -/ |
| 50 | def SteinerOfSizeOn (Adjp : A → A → Prop) (Term Kp : A → Prop) (S : A → Prop) : Prop := |
| 51 | (∀ x, Term x → S x) ∧ ConnectedOn Adjp S ∧ |
| 52 | {x | S x ∧ ¬Term x}.ncard = {x | Kp x}.ncard |
| 53 | |
| 54 | end Generic |
| 55 | |
| 56 | section Problem |
| 57 | |
| 58 | variable (A : Type) [steinerGraph.Structure A] |
| 59 | |
| 60 | /-- The set `S` is a connected set containing every terminal and using exactly |
| 61 | as many non-terminals as the marked set has elements, in a finite graph. -/ |
| 62 | def SteinerOfSize (S : A → Prop) : Prop := |
| 63 | Finite A ∧ SteinerOfSizeOn (fun a b : A => STAdj a b) (fun a => STTerminal a) |
| 64 | (fun a => STMarked a) S |
| 65 | |
| 66 | end Problem |
| 67 | |
| 68 | open Lax366625.CountingProblems |
| 69 | |
| 70 | /-- **#Steiner Tree**, as a counting problem. -/ |
| 71 | noncomputable def SharpSteinerTree : CountingProblem Lax799700.Steiner.steinerGraph := |
| 72 | CountingProblem.ofFun fun A _ => |
| 73 | Nat.card {S : A → Prop // SteinerOfSize A S} |
| 74 | |
| 75 | end Lax280166.CountingSteinerTrees |
| 76 |
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