Exhaustive search for small independent-set targets
Lax263307.ExhaustiveTargets · concepts/Lax263307/ExhaustiveTargets.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
For a small target , enumerate exactly the -element vertex sets and test independence. The first success has size exactly . If the search fails, every independent set has size less than . There are exactly candidates.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Lax263307.LinearRelaxation |
| 2 | import Mathlib.Data.List.FinRange |
| 3 | import Mathlib.Data.List.Sublists |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Exhaustive search for small independent-set targets |
| 8 | type: theorem |
| 9 | --- |
| 10 | For a small target , enumerate exactly the -element vertex sets and |
| 11 | test independence. The first success has size exactly . If the search |
| 12 | fails, every independent set has size less than . There are exactly |
| 13 | candidates. |
| 14 | |
| 15 | # Formalization notes |
| 16 | |
| 17 | The executable enumeration generates sublists of length , without |
| 18 | materializing all vertex subsets. The candidate count is separate from |
| 19 | the eventual RAM instruction bound. |
| 20 | |
| 21 | # Attribution |
| 22 | |
| 23 | Bonnet–Chang, the small-target branch of Algorithm 1. |
| 24 | -/ |
| 25 | |
| 26 | namespace Lax263307.ExhaustiveTargets |
| 27 | |
| 28 | /-- Enumerate the vertex sets of one prescribed cardinality. -/ |
| 29 | def candidates (n k : ℕ) : List (Finset (Fin n)) := |
| 30 | ((List.finRange n).sublistsLen k).map List.toFinset |
| 31 | |
| 32 | /-- Deterministic exact search at target `k`. -/ |
| 33 | def findIndependentSet {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] |
| 34 | (k : ℕ) : Option (Finset (Fin n)) := |
| 35 | (candidates n k).find? fun I => decide (G.IsIndepSet (I : Set (Fin n))) |
| 36 | |
| 37 | /-- Every size-`k` vertex set occurs, and no other cardinality occurs. -/ |
| 38 | axiom candidate_complete (n k : ℕ) (I : Finset (Fin n)) : |
| 39 | I ∈ candidates n k ↔ I.card = k |
| 40 | |
| 41 | /-- Exact candidate count and its bound by a power of the graph order. -/ |
| 42 | axiom candidate_count (n k : ℕ) : |
| 43 | (candidates n k).length = n.choose k ∧ (candidates n k).length ≤ n ^ k |
| 44 | |
| 45 | /-- Search success is exact; search failure excludes every larger independent set. -/ |
| 46 | axiom search_correct {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (k : ℕ) : |
| 47 | match findIndependentSet G k with |
| 48 | | some I => G.IsIndepSet (I : Set (Fin n)) ∧ I.card = k |
| 49 | | none => ∀ J : Finset (Fin n), G.IsIndepSet (J : Set (Fin n)) → J.card < k |
| 50 | |
| 51 | end Lax263307.ExhaustiveTargets |
| 52 |
Formalization notes
The executable enumeration generates sublists of length , without materializing all vertex subsets. The candidate count is separate from the eventual RAM instruction bound.
Attribution
Bonnet–Chang, the small-target branch of Algorithm 1.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments