Partitions, transversals and the partition into atomic types
Lax185574.Partitions · concepts/Lax185574/Partitions.lean · lax-185574
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
For two partitions 𝒫, 𝒬 of the same set, 𝒫 ≼ 𝒬 says that 𝒫 refines 𝒬, that is, each part of 𝒫 is contained in some part of 𝒬. For a partition 𝒫 of V and X ⊆ V, X/𝒫 is the set of parts of 𝒫 that meet X. The part of 𝒫 containing an element v is 𝒫(v). Further, ≡_𝒫 is the equivalence relation on V whose classes are the parts of 𝒫. A transversal of 𝒫 is a set that contains exactly one vertex of every part.
For a graph G and S ⊆ V(G), two vertices u, v have the same atomic type over S if and only if either u = v, or u, v ∉ S and N(u) ∩ S = N(v) ∩ S. The partition into atomic types 𝒫_S partitions S into singletons and the vertices of V(G) ∖ S according to their neighborhoods in S.
Concept map
In the paper
- page 12 of this submission's paper
Lean source view on GitHub
| 1 | import Lax185574.Encodings |
| 2 | import Mathlib.Data.Setoid.Basic |
| 3 | import Mathlib.Data.Set.Card |
| 4 | import Mathlib.Data.Fintype.Basic |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Partitions, transversals and the partition into atomic types |
| 9 | type: definition |
| 10 | --- |
| 11 | For two partitions 𝒫, 𝒬 of the same set, 𝒫 ≼ 𝒬 says that 𝒫 refines 𝒬, |
| 12 | that is, each part of 𝒫 is contained in some part of 𝒬. For a partition |
| 13 | 𝒫 of V and X ⊆ V, X/𝒫 is the set of parts of 𝒫 that meet X. The part of |
| 14 | 𝒫 containing an element v is 𝒫(v). Further, ≡_𝒫 is the equivalence |
| 15 | relation on V whose classes are the parts of 𝒫. A *transversal* of 𝒫 is |
| 16 | a set that contains exactly one vertex of every part. |
| 17 | |
| 18 | For a graph G and S ⊆ V(G), two vertices u, v have the same atomic type |
| 19 | over S if and only if either u = v, or u, v ∉ S and N(u) ∩ S = N(v) ∩ S. |
| 20 | The *partition into atomic types* 𝒫_S partitions S into singletons and |
| 21 | the vertices of V(G) ∖ S according to their neighborhoods in S. |
| 22 | |
| 23 | # Formalization notes |
| 24 | |
| 25 | A partition of V is an equivalence relation on V, a `Setoid V`. Its |
| 26 | parts are the equivalence classes, so ≡_𝒫 is the relation itself and |
| 27 | 𝒫 ≼ 𝒬 is the order `P ≤ Q` of setoids. The partition into singletons is |
| 28 | `⊥`, and the partition with one part is `⊤`. The number |X/𝒫| is the |
| 29 | number of classes of elements of X, `partCount`. It is the exact count |
| 30 | on a finite vertex type, which is the case in every statement that uses |
| 31 | it. |
| 32 | |
| 33 | The partition into atomic types is the kernel of the map |
| 34 | v ↦ (S ∩ {v}, S ∩ N(v)). Two vertices have the same image exactly when |
| 35 | they are equal, or both lie outside S and have the same neighborhood in |
| 36 | S. So this is the partition of the paper. It is also the partition |
| 37 | into types of quantifier rank 0 over S in the sense of |
| 38 | `Lax185574.FirstOrderTypes`, which the paper mentions as the definition. |
| 39 | |
| 40 | Algorithms exchange partitions of `Fin n` as the finite set of their |
| 41 | parts, each part a finite set of vertices, in the encodings of |
| 42 | `Lax185574.Encodings`. This is the instance below. |
| 43 | -/ |
| 44 | |
| 45 | namespace Lax185574.Partitions |
| 46 | |
| 47 | open Lax185574.Encoding |
| 48 | |
| 49 | universe z |
| 50 | |
| 51 | variable {V : Type z} |
| 52 | |
| 53 | /-- `|X/𝒫|`: the number of parts of `P` that meet `X`. -/ |
| 54 | noncomputable def partCount (P : Setoid V) (X : Set V) : ℕ := |
| 55 | (Quotient.mk P '' X).ncard |
| 56 | |
| 57 | /-- The part `𝒫(v)` of `P` that contains `v`. -/ |
| 58 | def part (P : Setoid V) (v : V) : Set V := {u | P u v} |
| 59 | |
| 60 | /-- `T` is a transversal of `P`: every part of `P` contains exactly one |
| 61 | vertex of `T`. -/ |
| 62 | def IsTransversal (P : Setoid V) (T : Set V) : Prop := |
| 63 | ∀ v : V, ∃! t : V, t ∈ T ∧ P t v |
| 64 | |
| 65 | /-- The partition `𝒫_S` into atomic types over `S`: vertices of `S` are |
| 66 | singletons, and vertices outside `S` are grouped by their neighborhood |
| 67 | in `S`. -/ |
| 68 | def atomicTypes (G : SimpleGraph V) (S : Set V) : Setoid V := |
| 69 | Setoid.ker fun v => (S ∩ {v}, S ∩ G.neighborSet v) |
| 70 | |
| 71 | /-- The parts of a partition of `Fin n`, as a finite set of finite |
| 72 | sets. -/ |
| 73 | noncomputable def parts {n : ℕ} (P : Setoid (Fin n)) : Finset (Finset (Fin n)) := |
| 74 | open Classical in Finset.univ.image fun v => Finset.univ.filter fun u => P u v |
| 75 | |
| 76 | /-- A partition of `Fin n` is encoded by the finite set of its parts. |
| 77 | A setoid is a relation, so the encoding is not derived. -/ |
| 78 | noncomputable instance {n : ℕ} : Encode (Setoid (Fin n)) where |
| 79 | encode P := encode (parts P) |
| 80 | |
| 81 | end Lax185574.Partitions |
| 82 |
Formalization notes
A partition of V is an equivalence relation on V, a . Its parts are the equivalence classes, so ≡_𝒫 is the relation itself and 𝒫 ≼ 𝒬 is the order of setoids. The partition into singletons is , and the partition with one part is . The number |X/𝒫| is the number of classes of elements of X, . It is the exact count on a finite vertex type, which is the case in every statement that uses it.
The partition into atomic types is the kernel of the map v ↦ (S ∩ {v}, S ∩ N(v)). Two vertices have the same image exactly when they are equal, or both lie outside S and have the same neighborhood in S. So this is the partition of the paper. It is also the partition into types of quantifier rank 0 over S in the sense of , which the paper mentions as the definition.
Algorithms exchange partitions of as the finite set of their parts, each part a finite set of vertices, in the encodings of . This is the instance below.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments