Unordered neighbourhood and exceptional-window tests
Lax977378.RecordTests · concepts/Lax977378/RecordTests.lean · lax-977378
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Lemma
A diagram enumerates a finite induced graph with its original unary predicates. The window condition says exactly which vertices are within a fixed radius of one of the marked vertices. A pointed type is a one-centre window with a distinguished root. A finite record can prescribe truncated type counts and require its distinguished rare vertices to be precisely those outside its list of frequent types, using the very same witnesses as its window.
Concept map
Lean source view on GitHub
| 1 | import Lax977378.OuterContexts |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Unordered neighbourhood and exceptional-window tests |
| 6 | type: lemma |
| 7 | --- |
| 8 | A diagram enumerates a finite induced graph with its original unary predicates. |
| 9 | The window condition says exactly which vertices are within a fixed radius |
| 10 | of one of the marked vertices. A pointed type is a one-centre window with |
| 11 | a distinguished root. A finite record can prescribe truncated type counts |
| 12 | and require its distinguished rare vertices to be precisely those outside |
| 13 | its list of frequent types, using the very same witnesses as its window. |
| 14 | -/ |
| 15 | namespace Lax977378.RecordTests |
| 16 | open Lax977378.Logic Lax977378.OuterContexts |
| 17 | |
| 18 | def Diagram {c : Nat} (W G : Graph c) (y : Fin W.size → Fin G.size) : Prop := |
| 19 | Function.Injective y ∧ (∀ i j, W.edge i j ↔ G.edge (y i) (y j)) ∧ |
| 20 | ∀ p i, W.pred p i ↔ G.pred p (y i) |
| 21 | |
| 22 | def Window {c : Nat} (W G : Graph c) (r : Nat) (marked : Finset (Fin W.size)) |
| 23 | (y : Fin W.size → Fin G.size) : Prop := |
| 24 | Diagram W G y ∧ ∀ x, (∃ i, y i = x) ↔ ∃ i ∈ marked, within G r (y i) x |
| 25 | |
| 26 | structure Pointed (c : Nat) where |
| 27 | pattern : Graph c |
| 28 | center : Fin pattern.size |
| 29 | |
| 30 | def Occurs {c : Nat} (t : Pointed c) (r : Nat) (G : Graph c) (x : Fin G.size) : Prop := |
| 31 | ∃ y, Window t.pattern G r {t.center} y ∧ y t.center = x |
| 32 | |
| 33 | def AtLeast {c : Nat} (t : Pointed c) (r k : Nat) (G : Graph c) : Prop := |
| 34 | ∃ xs : Fin k → Fin G.size, Function.Injective xs ∧ ∀ i, Occurs t r G (xs i) |
| 35 | |
| 36 | structure TestData (c : Nat) where |
| 37 | radius : Nat |
| 38 | windowRadius : Nat |
| 39 | windowGraph : Graph c |
| 40 | marked : Finset (Fin windowGraph.size) |
| 41 | rare : Finset (Fin windowGraph.size) |
| 42 | cap : Nat |
| 43 | counts : List (Pointed c × Nat) |
| 44 | frequent : List (Pointed c) |
| 45 | |
| 46 | def Passes {c : Nat} (D : TestData c) (G : Graph c) : Prop := |
| 47 | (∀ tv ∈ D.counts, tv.2 ≤ D.cap ∧ AtLeast tv.1 D.radius tv.2 G ∧ |
| 48 | (tv.2 < D.cap → ¬ AtLeast tv.1 D.radius (tv.2+1) G)) ∧ |
| 49 | ∃ y, Window D.windowGraph G D.windowRadius D.marked y ∧ |
| 50 | ∀ x, (∃ i ∈ D.rare, y i = x) ↔ ¬ ∃ t ∈ D.frequent, Occurs t D.radius G x |
| 51 | |
| 52 | axiom recordTest {c : Nat} (D : TestData c) : |
| 53 | ∃ f : Formula c, Plain [] f ∧ ∀ G, Unordered G f ↔ Passes D G |
| 54 | |
| 55 | end Lax977378.RecordTests |
| 56 |
Builds on
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments