Executable graph encodings and triangle-free approximation
Lax614640.Complexity · concepts/Lax614640/Complexity.lean · lax-614640
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Graphs are finite Boolean adjacency matrices with symmetry and looplessness certificates. Their machine word is the vertex count followed by the complete row-major matrix, with Booleans encoded by and . An approximation is a function certified polynomial-time by the Lax759944 finite-Turing model; its returned independent set is decoded from that certified function.
Concept map
Lean source view on GitHub
| 1 | import Lax614640.Machine |
| 2 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 3 | import Mathlib.Combinatorics.SimpleGraph.Clique |
| 4 | import Mathlib.Data.Finset.Card |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Executable graph encodings and triangle-free approximation |
| 9 | type: definition |
| 10 | --- |
| 11 | Graphs are finite Boolean adjacency matrices with symmetry and looplessness |
| 12 | certificates. Their machine word is the vertex count followed by the complete |
| 13 | row-major matrix, with Booleans encoded by and . An approximation is a |
| 14 | function certified polynomial-time by the Lax759944 finite-Turing model; its |
| 15 | returned independent set is decoded from that certified function. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | namespace Lax614640.Complexity |
| 21 | |
| 22 | open Lax614640.Machine |
| 23 | |
| 24 | export Lax614640.Machine |
| 25 | (BitString RandomSeed PolytimeProgram polynomialBound pairBits) |
| 26 | |
| 27 | /-- An executable simple graph on the labeled vertex set . -/ |
| 28 | structure GraphCode (n : ℕ) where |
| 29 | adjacent : Fin n → Fin n → Bool |
| 30 | loopless : ∀ vertex, adjacent vertex vertex = false |
| 31 | symmetric : ∀ left right, adjacent left right = adjacent right left |
| 32 | |
| 33 | /-- The mathematical simple graph represented by a Boolean adjacency matrix. -/ |
| 34 | def GraphCode.graph {n : ℕ} (code : GraphCode n) : SimpleGraph (Fin n) where |
| 35 | Adj left right := code.adjacent left right = true |
| 36 | symm := ⟨fun left right h ↦ (code.symmetric left right).symm.trans h⟩ |
| 37 | loopless := ⟨fun vertex h ↦ Bool.noConfusion ((code.loopless vertex).symm.trans h)⟩ |
| 38 | |
| 39 | /-- Vertex count followed by the row-major adjacency matrix. -/ |
| 40 | def GraphCode.bits {n : ℕ} (code : GraphCode n) : BitString := |
| 41 | n :: List.ofFn fun rank : Fin (n * n) ↦ |
| 42 | let vertex := finProdFinEquiv.symm rank |
| 43 | bitWord (code.adjacent vertex.1 vertex.2) |
| 44 | |
| 45 | /-- Decode the first output bits as a vertex set. -/ |
| 46 | def decodeVertexSet (n : ℕ) (bits : BitString) : Finset (Fin n) := |
| 47 | Finset.univ.filter fun vertex ↦ bits[vertex.1]? = some 1 |
| 48 | |
| 49 | /-- A polynomial-time executable approximation for triangle-free Max Independent Set. -/ |
| 50 | structure TriangleFreeMISApproximation (ε : ℝ) where |
| 51 | program : PolytimeProgram |
| 52 | correctness : ∀ (n : ℕ) (code : GraphCode n), |
| 53 | code.graph.CliqueFree 3 → |
| 54 | let set := decodeVertexSet n (program.output code.bits) |
| 55 | code.graph.IsIndepSet set ∧ |
| 56 | (code.graph.indepNum : ℝ) ≤ |
| 57 | Real.rpow n ((1 : ℝ) / 2 - ε) * set.card |
| 58 | |
| 59 | /-- Max Independent Set on triangle-free graphs admits a polynomial-time |
| 60 | -approximation. -/ |
| 61 | def TriangleFreeMISApproximable (ε : ℝ) : Prop := |
| 62 | Nonempty (TriangleFreeMISApproximation ε) |
| 63 | |
| 64 | end Lax614640.Complexity |
| 65 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments