Scarf's combinatorial lemma #
This file develops the combinatorial core behind Scarf's lemma. It introduces the
IndexedLOrder class of families of linear orders indexed by a finite set, the
notions of dominant sets, cells, rooms and doors, and the colorful/nearly-colorful
machinery used in the parity (door-counting) argument that culminates in
IndexedLOrder.Scarf: every coloring of a finite indexed linear order admits a
colorful room.
A family of linear orders on T indexed by I.
- IST : I → LinearOrder T
The linear order on
Tat indexi.
Instances
Equations
- instFunLikeIndexedLOrderLinearOrder = { coe := fun (a : IndexedLOrder I T) => IndexedLOrder.IST, coe_injective := ⋯ }
Strict order at index i for an IndexedLOrder: lt a b for the linear
order IST i.
Equations
- IndexedLOrder.ltAt i a b = (a < b)
Instances For
Non-strict order at index i for an IndexedLOrder: le a b for the linear
order IST i.
Equations
- IndexedLOrder.leAt i a b = (a ≤ b)
Instances For
σ is dominant for C: every point is dominated at some index of C.
Equations
- IndexedLOrder.isDominant σ C = ∀ (y : T), ∃ i ∈ C, ∀ x ∈ σ, IndexedLOrder.leAt i y x
Instances For
The minimum of σ in the linear order at index i.
Equations
- IndexedLOrder.mini h2 i = σ.min' h2
Instances For
A cell: σ is dominant for C.
Equations
Instances For
A room: a cell whose color and goods sets have equal size.
Equations
- IndexedLOrder.isRoom σ C = (IndexedLOrder.isCell σ C ∧ C.card = σ.card)
Instances For
A door: a cell whose color set is one larger than its goods set.
Equations
- IndexedLOrder.isDoor σ C = (IndexedLOrder.isCell σ C ∧ C.card = σ.card + 1)
Instances For
The relation that one cell is a door of another room.
- idoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {τ : Finset T} {D : Finset I} {σ : Finset T} {C : Finset I} (h0 : isCell σ C) (h1 : isDoor τ D) (x : T) : x ∉ τ → ∀ (h2 : insert x τ = σ) (h3 : D = C), isDoorof τ D σ C
- odoor {T : Type u_1} {I : Type u_2} [IST : IndexedLOrder I T] [DecidableEq T] [DecidableEq I] {τ : Finset T} {D : Finset I} {σ : Finset T} {C : Finset I} (h0 : isCell σ C) (h1 : isDoor τ D) (j : I) : j ∉ C → ∀ (h2 : τ = σ) (h3 : D = insert j C), isDoorof τ D σ C
Instances For
An outside door: a door whose goods part is empty.
Equations
- IndexedLOrder.isOutsideDoor τ D = (IndexedLOrder.isDoor τ D ∧ τ = Finset.empty)
Instances For
An internal door: a door that is not an outside door.
Equations
- IndexedLOrder.isInternalDoor τ D = (IndexedLOrder.isDoor τ D ∧ τ.Nonempty)
Instances For
The set of points maximizing the dominance condition at a missing index.
Equations
- IndexedLOrder.mSet τ D i h_nonempty = {y : T | ∀ k ∈ D, k ≠ i → IndexedLOrder.ltAt k (IndexedLOrder.mini h_nonempty k) y}
Instances For
m is maximal in the mSet of the given data.
Equations
- IndexedLOrder.isMaximalInMSet τ D i h_nonempty x = (x ∈ IndexedLOrder.mSet τ D i h_nonempty ∧ ∀ y ∈ IndexedLOrder.mSet τ D i h_nonempty, IndexedLOrder.leAt i y x)
Instances For
A chosen maximal element of the mSet.
Equations
- IndexedLOrder.mElement τ D i h_nonempty h = (IndexedLOrder.mSet τ D i h_nonempty).toFinset.max' ⋯
Instances For
Two-rooms conclusion when both mSets are nonempty.
Two-rooms conclusion when the first mSet is empty but the second is nonempty.
Two-rooms conclusion when the first mSet is nonempty but the second is empty.
A colorful cell: the image of the coloring on σ equals C.
Equations
- IndexedLOrder.isColorful c σ C = (IndexedLOrder.isCell σ C ∧ Finset.image c σ = C)
Instances For
A nearly colorful cell: exactly one color of C is missing.
Equations
- IndexedLOrder.isNearlyColorful c σ C = (IndexedLOrder.isCell σ C ∧ (C \ Finset.image c σ).card = 1)
Instances For
A nearly colorful cell whose missing color is exactly i.
Equations
- IndexedLOrder.isTypedNC c i σ C = (IndexedLOrder.isCell σ C ∧ C \ Finset.image c σ = {i})
Instances For
A chosen point of the goods set of a colorful room.
Equations
Instances For
The set of nearly colorful doors of a given room.
Equations
- IndexedLOrder.NCdoors c σ C = {(τ, D) : Finset T × Finset I | IndexedLOrder.isNearlyColorful c τ D ∧ IndexedLOrder.isDoorof τ D σ C}
Instances For
The two doors of a nearly colorful room, when the coloring is injective on σ.
The unordered colliding pair equals {x, y} for a repeated coloring.
The colliding pair {a, b} of a repeated coloring coincides with {x, y}.
A nearly colorful room has a unique missing color in C.
The two doors of a nearly colorful room, when one color of σ is repeated.
The finset of colorful rooms of a coloring.
Equations
- IndexedLOrder.colorful c = {x : Finset T × Finset I | IndexedLOrder.isColorful c x.1 x.2}
Instances For
The set used for the double-counting parity argument of typed doors.
Equations
- IndexedLOrder.dbcountingset c i = {x : (Finset T × Finset I) × Finset T × Finset I | IndexedLOrder.isTypedNC c i x.1.1 x.1.2 ∧ IndexedLOrder.isDoorof x.1.1 x.1.2 x.2.1 x.2.2}