Scatter types
Lax185574.ScatterTypes · concepts/Lax185574/ScatterTypes.lean · lax-185574
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Let G be a partial graph. A set S of vertices is r-scattered if all vertices of S have pairwise distance larger than r. Fix a linear order on V(G). For X ⊆ V(G) and r ∈ ℕ, S_r(X) is the inclusion-wise maximal r-scattered subset of X built by the greedy process that repeatedly adds the least available vertex.
The (k, q)-scatter type stp^G_{k,q} is the function with domain
{(r, tree_{k+i,q−i}(b)) | i ∈ [q], b ∈ V(G), r ∈ [9^{k+i} · ρ⁻(k+i, q−i)]}
given by stp^G_{k,q}(r, ν) = min(|S_r([ν]^G)|, k + q). For q = 0 the domain is empty. A scatter type is represented canonically as the sorted list of its triples (r, ν, stp_{k,q}(r, ν)), using the canonical representation of ν. Its size ‖stp_{k,q}‖ is the size of this list.
Concept map
In the paper
- page 45 of this submission's paper
Lean source view on GitHub
| 1 | import Lax185574.TypeTrees |
| 2 | import Mathlib.Data.List.FinRange |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Scatter types |
| 7 | type: definition |
| 8 | --- |
| 9 | Let G be a partial graph. A set S of vertices is *r-scattered* if all |
| 10 | vertices of S have pairwise distance larger than r. Fix a linear order |
| 11 | on V(G). For X ⊆ V(G) and r ∈ ℕ, S_r(X) is the inclusion-wise maximal |
| 12 | r-scattered subset of X built by the greedy process that repeatedly adds |
| 13 | the least available vertex. |
| 14 | |
| 15 | The *(k, q)-scatter type* stp^G_{k,q} is the function with domain |
| 16 | |
| 17 | {(r, tree_{k+i,q−i}(b)) | i ∈ [q], b ∈ V(G), |
| 18 | r ∈ [9^{k+i} · ρ⁻(k+i, q−i)]} |
| 19 | |
| 20 | given by stp^G_{k,q}(r, ν) = min(|S_r([ν]^G)|, k + q). For q = 0 the |
| 21 | domain is empty. A scatter type is represented canonically as the sorted |
| 22 | list of its triples (r, ν, stp_{k,q}(r, ν)), using the canonical |
| 23 | representation of ν. Its size ‖stp_{k,q}‖ is the size of this list. |
| 24 | |
| 25 | # Formalization notes |
| 26 | |
| 27 | The vertices are `Fin n`, ordered as numbers. The greedy process scans |
| 28 | the vertices in increasing order and adds a vertex of X when its |
| 29 | distance to every vertex added so far is larger than r. [k] = {1, …, k} |
| 30 | as in the paper, so i and r start at 1. The domain of stp^G_{k,q}, |
| 31 | written domain(stp_{k,q}) in the paper, is `domain G k q`. |
| 32 | |
| 33 | The scatter type is given by its graph, the finite set of the pairs |
| 34 | ((r, ν), stp_{k,q}(r, ν)) with (r, ν) in its domain. As a finite set it is |
| 35 | encoded as the sorted list of the words of these pairs, by |
| 36 | `Lax185574.Encodings`. The word of a pair is r, then the word of ν, |
| 37 | then the value. |
| 38 | -/ |
| 39 | |
| 40 | namespace Lax185574.ScatterTypes |
| 41 | |
| 42 | open Lax185574.PartialGraphs Lax185574.GaifmanGraph |
| 43 | open Lax185574.TypeTrees |
| 44 | open Lax3.DistFO (rhoMinus rhoPlus) |
| 45 | |
| 46 | variable {n : ℕ} |
| 47 | |
| 48 | /-- `S_r(X)`: the greedy maximal `r`-scattered subset of `X`, scanning |
| 49 | the vertices in increasing order. -/ |
| 50 | noncomputable def greedyScattered (G : PartialGraph (Fin n)) (r : ℕ) (X : Set (Fin n)) : |
| 51 | List (Fin n) := |
| 52 | open Classical in |
| 53 | (List.finRange n).foldl |
| 54 | (fun S v => if v ∈ X ∧ ∀ u ∈ S, ¬ WithinDist G.resolved r u v then S ++ [v] else S) [] |
| 55 | |
| 56 | /-- The domain `domain(stp_{k,q})` of the scatter type. -/ |
| 57 | def domain (G : PartialGraph (Fin n)) (k q : ℕ) : Set (ℕ × TypeTree) := |
| 58 | {p | ∃ (i : ℕ) (b : Fin n), 1 ≤ i ∧ i ≤ q ∧ 1 ≤ p.1 ∧ |
| 59 | p.1 ≤ 9 ^ (k + i) * rhoMinus (k + i) (q - i) ∧ |
| 60 | p.2 = tree G (k + i) (q - i) ![b]} |
| 61 | |
| 62 | /-- The value `min(|S_r([ν]^G)|, k + q)` at the pair `p = (r, ν)`. -/ |
| 63 | noncomputable def value (G : PartialGraph (Fin n)) (k q : ℕ) (p : ℕ × TypeTree) : ℕ := |
| 64 | min (greedyScattered G p.1 (realizations G p.2)).length (k + q) |
| 65 | |
| 66 | /-- The graph `{(x, f x) | x ∈ D}` of a function on a finite domain. -/ |
| 67 | noncomputable def graphOn {α β : Type*} (D : Set α) (f : α → β) : Finset (α × β) := |
| 68 | finsetOf {p | p.1 ∈ D ∧ p.2 = f p.1} |
| 69 | |
| 70 | /-- `stp^G_{k,q}`, as its graph: the pairs `((r, ν), stp(r, ν))` with |
| 71 | `(r, ν) ∈ domain(stp_{k,q})`. -/ |
| 72 | noncomputable def stp (G : PartialGraph (Fin n)) (k q : ℕ) : Finset ((ℕ × TypeTree) × ℕ) := |
| 73 | graphOn (domain G k q) (value G k q) |
| 74 | |
| 75 | end Lax185574.ScatterTypes |
| 76 |
Formalization notes
The vertices are , ordered as numbers. The greedy process scans the vertices in increasing order and adds a vertex of X when its distance to every vertex added so far is larger than r. [k] = {1, …, k} as in the paper, so i and r start at 1. The domain of stp^G_{k,q}, written domain(stp_{k,q}) in the paper, is .
The scatter type is given by its graph, the finite set of the pairs ((r, ν), stp_{k,q}(r, ν)) with (r, ν) in its domain. As a finite set it is encoded as the sorted list of the words of these pairs, by . The word of a pair is r, then the word of ν, then the value.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments