No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
Definition
Let be a set system on a finite ground set. A set crosses a total order whenever two consecutive elements lie on opposite sides of . Its crossing count is the number of such consecutive pairs, and the crossing number of the order is the largest crossing count over all sets in . A Welzl order of crossing number at most k is a total order whose crossing number is at most k.
Lean source view on GitHub
| 1 | import Mathlib.Data.Fin.Basic |
| 2 | import Mathlib.Data.Nat.Lattice |
| 3 | import Mathlib.Data.Set.Card |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Welzl orders |
| 8 | type: definition |
| 9 | --- |
| 10 | Let `𝓕` be a set system on a finite ground set. A set `X ∈ 𝓕` crosses |
| 11 | a total order whenever two consecutive elements lie on opposite sides of |
| 12 | `X`. Its crossing count is the number of such consecutive pairs, and the |
| 13 | crossing number of the order is the largest crossing count over all sets in |
| 14 | `𝓕`. A Welzl order of crossing number at most *k* is a total order whose |
| 15 | crossing number is at most *k*. |
| 16 | |
| 17 | # Formalization notes |
| 18 | |
| 19 | A total order of `Fin n` is represented by a permutation `π`, with `π v` the |
| 20 | position of `v`. Consecutive pairs are counted by their earlier endpoint: |
| 21 | `u` contributes exactly when some `v` has natural-number position |
| 22 | `(π u).val + 1` and precisely one of `u` and `v` lies in the set. Comparing |
| 23 | the natural values, rather than adding inside `Fin n`, avoids turning the |
| 24 | last and first positions into an artificial cyclic pair. |
| 25 | |
| 26 | The crossing number is a natural supremum. Every crossing count is at most |
| 27 | `n - 1`, so the set is bounded; for an empty family the natural convention |
| 28 | `sSup ∅ = 0` gives the expected crossing number zero. `IsWelzlOrder` is a |
| 29 | `Prop`-valued bound rather than a structure carrying data derivable from the |
| 30 | order and the set system. |
| 31 | |
| 32 | -/ |
| 33 | |
| 34 | namespace Lax195003.WelzlOrders |
| 35 | |
| 36 | /-- A set system on `α`: a family of subsets of the ground set `α`. -/ |
| 37 | abbrev SetSystem (α : Type*) := Set (Set α) |
| 38 | |
| 39 | /-- The number of consecutive pairs in the order `π` with exactly one |
| 40 | endpoint in `X`. -/ |
| 41 | noncomputable def crossingCount {n : ℕ} (π : Equiv.Perm (Fin n)) |
| 42 | (X : Set (Fin n)) : ℕ := |
| 43 | {u : Fin n | ∃ v : Fin n, |
| 44 | (π v).val = (π u).val + 1 ∧ (u ∈ X ↔ v ∉ X)}.ncard |
| 45 | |
| 46 | /-- The crossing number of `π` with respect to `𝓕`: the largest crossing |
| 47 | count of a member of the set system. -/ |
| 48 | noncomputable def crossingNumber {n : ℕ} (𝓕 : SetSystem (Fin n)) |
| 49 | (π : Equiv.Perm (Fin n)) : ℕ := |
| 50 | sSup {k : ℕ | ∃ X ∈ 𝓕, k = crossingCount π X} |
| 51 | |
| 52 | /-- The order `π` is a Welzl order of crossing number at most `k` for the |
| 53 | set system `𝓕`. -/ |
| 54 | def IsWelzlOrder {n : ℕ} (𝓕 : SetSystem (Fin n)) |
| 55 | (π : Equiv.Perm (Fin n)) (k : ℕ) : Prop := |
| 56 | crossingNumber 𝓕 π ≤ k |
| 57 | |
| 58 | end Lax195003.WelzlOrders |
| 59 |
Formalization notes
A total order of is represented by a permutation , with the position of . Consecutive pairs are counted by their earlier endpoint: contributes exactly when some has natural-number position and precisely one of and lies in the set. Comparing the natural values, rather than adding inside , avoids turning the last and first positions into an artificial cyclic pair.
The crossing number is a natural supremum. Every crossing count is at most , so the set is bounded; for an empty family the natural convention gives the expected crossing number zero. is a -valued bound rather than a structure carrying data derivable from the order and the set system.
Builds on
none
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments