The areas / V30. Combinatorics
Mathlib.Combinatorics.HalesJewett
84 declarations. Mathlib docs · Source
The Hales-Jewett theorem
We prove the Hales-Jewett theorem. We deduce Van der Waerden's theorem and the multidimensional Hales-Jewett theorem as corollaries.
The Hales-Jewett theorem is a result in Ramsey theory dealing with combinatorial lines. Given
an 'alphabet' α : Type* and a b : α, an example of a combinatorial line in α^5 is
{ (a, x, x, b, x) | x : α }. See Combinatorics.Line for a precise general definition. The
Hales-Jewett theorem states that for any fixed finite types α and κ, there exists a (potentially
huge) finite type ι such that whenever ι → α is κ-colored (i.e. for any coloring
C : (ι → α) → κ), there exists a monochromatic line. We prove the Hales-Jewett theorem using
the idea of color focusing and a product argument. See the proof of
Combinatorics.Line.exists_mono_in_high_dimension' for details.
Combinatorial subspaces are higher-dimensional analogues of combinatorial lines. See
Combinatorics.Subspace. The multidimensional Hales-Jewett theorem generalises the statement above
from combinatorial lines to combinatorial subspaces of a fixed dimension.
The version of Van der Waerden's theorem in this file states that whenever a commutative monoid M
is finitely colored and S is a finite subset, there exists a monochromatic homothetic copy of S.
This follows from the Hales-Jewett theorem by considering the map (ι → S) → M sending v
to ∑ i : ι, v i, which sends a combinatorial line to a homothetic copy of S.
Main results
Combinatorics.Line.exists_mono_in_high_dimension: The Hales-Jewett theorem.Combinatorics.Subspace.exists_mono_in_high_dimension: The multidimensional Hales-Jewett theorem.Combinatorics.exists_mono_homothetic_copy: A generalization of Van der Waerden's theorem.
Implementation notes
For convenience, we work directly with finite types instead of natural numbers. That is, we write
α, ι, κ for (finite) types where one might traditionally use natural numbers n, H, c. This
allows us to work directly with α, Option α, (ι → α) → κ, and ι ⊕ ι' instead of Fin n,
Fin (n+1), Fin (c^(n^H)), and Fin (H + H').
TODO
-
Prove a finitary version of Van der Waerden's theorem (either by compactness or by modifying the current proof).
-
One could reformulate the proof of Hales-Jewett to give explicit upper bounds on the number of coordinates needed.
Tags
combinatorial line, Ramsey theory, arithmetic progression
References
- https://en.wikipedia.org/wiki/Hales%E2%80%93Jewett_theorem
def Combinatorics.Line.ctorIdx E1 #
{α : Type u_5} → {ι : Type u_6} → Combinatorics.Line α ι → ℕ
theorem Combinatorics.Line.mk.inj E1 #
∀ {α : Type u_5} {ι : Type u_6} {idxFun : ι → Option α} {proper : ∃ i, idxFun i = none} {idxFun_1 : ι → Option α}
{proper_1 : ∃ i, idxFun_1 i = none},
{ idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := proper_1 } → idxFun = idxFun_1
theorem Combinatorics.Line.ColorFocused.mk.injEq E0 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ}
(lines : Multiset (Combinatorics.Line.AlmostMono C)) (focus : ι → Option α)
(is_focused : ∀ p ∈ lines, ↑p.line none = focus)
(distinct_colors : (Multiset.map Combinatorics.Line.AlmostMono.color lines).Nodup)
(lines_1 : Multiset (Combinatorics.Line.AlmostMono C)) (focus_1 : ι → Option α)
(is_focused_1 : ∀ p ∈ lines_1, ↑p.line none = focus_1)
(distinct_colors_1 : (Multiset.map Combinatorics.Line.AlmostMono.color lines_1).Nodup),
({ lines := lines, focus := focus, is_focused := is_focused, distinct_colors := distinct_colors } =
{ lines := lines_1, focus := focus_1, is_focused := is_focused_1, distinct_colors := distinct_colors_1 }) =
(lines = lines_1 ∧ focus = focus_1)
theorem Combinatorics.Line.mk.injEq E0 #
∀ {α : Type u_5} {ι : Type u_6} (idxFun : ι → Option α) (proper : ∃ i, idxFun i = none) (idxFun_1 : ι → Option α)
(proper_1 : ∃ i, idxFun_1 i = none),
({ idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := proper_1 }) = (idxFun = idxFun_1)
theorem Combinatorics.Subspace.mk.injEq E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} (idxFun : ι → α ⊕ η) (proper : ∀ (e : η), ∃ i, idxFun i = Sum.inr e)
(idxFun_1 : ι → α ⊕ η) (proper_1 : ∀ (e : η), ∃ i, idxFun_1 i = Sum.inr e),
({ idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := proper_1 }) = (idxFun = idxFun_1)
def Combinatorics.Subspace.ctorIdx E1 #
{η : Type u_5} → {α : Type u_6} → {ι : Type u_7} → Combinatorics.Subspace η α ι → ℕ
theorem Combinatorics.Subspace.mk.inj E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {idxFun : ι → α ⊕ η} {proper : ∀ (e : η), ∃ i, idxFun i = Sum.inr e}
{idxFun_1 : ι → α ⊕ η} {proper_1 : ∀ (e : η), ∃ i, idxFun_1 i = Sum.inr e},
{ idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := proper_1 } → idxFun = idxFun_1
def Combinatorics.Line.AlmostMono.ctorIdx E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Type u_7} → {C : (ι → Option α) → κ} → Combinatorics.Line.AlmostMono C → ℕ
theorem Combinatorics.Line.ColorFocused.mk.inj E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ}
{lines : Multiset (Combinatorics.Line.AlmostMono C)} {focus : ι → Option α}
{is_focused : ∀ p ∈ lines, ↑p.line none = focus}
{distinct_colors : (Multiset.map Combinatorics.Line.AlmostMono.color lines).Nodup}
{lines_1 : Multiset (Combinatorics.Line.AlmostMono C)} {focus_1 : ι → Option α}
{is_focused_1 : ∀ p ∈ lines_1, ↑p.line none = focus_1}
{distinct_colors_1 : (Multiset.map Combinatorics.Line.AlmostMono.color lines_1).Nodup},
{ lines := lines, focus := focus, is_focused := is_focused, distinct_colors := distinct_colors } =
{ lines := lines_1, focus := focus_1, is_focused := is_focused_1, distinct_colors := distinct_colors_1 } →
lines = lines_1 ∧ focus = focus_1
def Combinatorics.Line.ColorFocused.ctorIdx E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Type u_7} → {C : (ι → Option α) → κ} → Combinatorics.Line.ColorFocused C → ℕ
theorem Combinatorics.Line.mk.congr_simp E1 #
∀ {α : Type u_5} {ι : Type u_6} (idxFun idxFun_1 : ι → Option α) (e_idxFun : idxFun = idxFun_1)
(proper : ∃ i, idxFun i = none), { idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := ⋯ }
theorem Combinatorics.Line.AlmostMono.mk.injEq E0 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} (line : Combinatorics.Line (Option α) ι)
(color : κ) (has_color : ∀ (x : α), C (↑line (some x)) = color) (line_1 : Combinatorics.Line (Option α) ι)
(color_1 : κ) (has_color_1 : ∀ (x : α), C (↑line_1 (some x)) = color_1),
({ line := line, color := color, has_color := has_color } =
{ line := line_1, color := color_1, has_color := has_color_1 }) =
(line = line_1 ∧ color = color_1)
theorem Combinatorics.Line.AlmostMono.mk.congr_simp E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} (line line_1 : Combinatorics.Line (Option α) ι)
(e_line : line = line_1) (color color_1 : κ) (e_color : color = color_1)
(has_color : ∀ (x : α), C (↑line (some x)) = color),
{ line := line, color := color, has_color := has_color } = { line := line_1, color := color_1, has_color := ⋯ }
theorem Combinatorics.Subspace.mk.congr_simp E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} (idxFun idxFun_1 : ι → α ⊕ η) (e_idxFun : idxFun = idxFun_1)
(proper : ∀ (e : η), ∃ i, idxFun i = Sum.inr e),
{ idxFun := idxFun, proper := proper } = { idxFun := idxFun_1, proper := ⋯ }
theorem Combinatorics.Line.AlmostMono.mk.inj E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} {line : Combinatorics.Line (Option α) ι}
{color : κ} {has_color : ∀ (x : α), C (↑line (some x)) = color} {line_1 : Combinatorics.Line (Option α) ι}
{color_1 : κ} {has_color_1 : ∀ (x : α), C (↑line_1 (some x)) = color_1},
{ line := line, color := color, has_color := has_color } =
{ line := line_1, color := color_1, has_color := has_color_1 } →
line = line_1 ∧ color = color_1
structure Combinatorics.Subspace E1 #
Type u_5 → Type u_6 → Type u_7 → Type (max (max u_5 u_6) u_7)
The type of combinatorial subspaces. A subspace l : Subspace η α ι in the hypercube ι → α
defines a function (η → α) → ι → α from η → α to the hypercube, such that for each coordinate
i : ι and direction e : η, the function fun x ↦ l x i is either fun x ↦ x e for some
direction e : η or constant. We require subspaces to be non-degenerate in the sense that, for
every e : η, fun x ↦ l x i is fun x ↦ x e for at least one i.
Formally, a subspace is represented by a word l.idxFun : ι → α ⊕ η which says whether
fun x ↦ l x i is fun x ↦ x e (corresponding to l.idxFun i = Sum.inr e) or constantly a
(corresponding to l.idxFun i = Sum.inl a).
When α has size 1 there can be many elements of Subspace η α ι defining the same function.
theorem Combinatorics.Subspace.ext E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {x y : Combinatorics.Subspace η α ι}, x.idxFun = y.idxFun → x = y
theorem Combinatorics.Subspace.ext_iff E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {x y : Combinatorics.Subspace η α ι}, x = y ↔ x.idxFun = y.idxFun
ctor Combinatorics.Subspace.mk E0 #
{η : Type u_5} →
{α : Type u_6} →
{ι : Type u_7} → (idxFun : ι → α ⊕ η) → (∀ (e : η), ∃ i, idxFun i = Sum.inr e) → Combinatorics.Subspace η α ι
abbrev Combinatorics.Subspace.idxFun E1 #
{η : Type u_5} → {α : Type u_6} → {ι : Type u_7} → Combinatorics.Subspace η α ι → ι → α ⊕ η
The word representing a combinatorial subspace. l.idxfun i = Sum.inr e means that
l x i = x e for all x and l.idxfun i = some a means that l x i = a for all x.
theorem Combinatorics.Subspace.proper E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} (self : Combinatorics.Subspace η α ι) (e : η),
∃ i, self.idxFun i = Sum.inr e
We require combinatorial subspaces to be nontrivial in the sense that fun x ↦ l x i is
fun x ↦ x e for at least one coordinate i.
instance Combinatorics.Subspace.instInhabited E0 #
{α : Type u_6} → {ι : Type u_7} → Inhabited (Combinatorics.Subspace ι α ι)
The combinatorial subspace corresponding to the identity embedding (ι → α) → (ι → α).
def Combinatorics.Subspace.toFun E1 #
{η : Type u_5} → {α : Type u_6} → {ι : Type u_7} → Combinatorics.Subspace η α ι → (η → α) → ι → α
Consider a subspace l : Subspace η α ι as a function (η → α) → ι → α.
instance Combinatorics.Subspace.instCoeFun E0 #
{η : Type u_5} → {α : Type u_6} → {ι : Type u_7} → CoeFun (Combinatorics.Subspace η α ι) fun x ↦ (η → α) → ι → α
theorem Combinatorics.Subspace.coe_apply E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} (l : Combinatorics.Subspace η α ι) (x : η → α) (i : ι),
↑l x i = Sum.elim id x (l.idxFun i)
theorem Combinatorics.Subspace.coe_injective E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} [Nontrivial α], Function.Injective Combinatorics.Subspace.toFun
theorem Combinatorics.Subspace.apply_def E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} (l : Combinatorics.Subspace η α ι) (x : η → α) (i : ι),
↑l x i = Sum.elim id x (l.idxFun i)
theorem Combinatorics.Subspace.apply_inl E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {l : Combinatorics.Subspace η α ι} {x : η → α} {i : ι} {a : α},
l.idxFun i = Sum.inl a → ↑l x i = a
theorem Combinatorics.Subspace.apply_inr E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {l : Combinatorics.Subspace η α ι} {x : η → α} {i : ι} {e : η},
l.idxFun i = Sum.inr e → ↑l x i = x e
def Combinatorics.Subspace.IsMono E1 #
{η : Type u_5} → {α : Type u_6} → {ι : Type u_7} → {κ : Type u_8} → ((ι → α) → κ) → Combinatorics.Subspace η α ι → Prop
Given a coloring C of ι → α and a combinatorial subspace l of ι → α, l.IsMono C
means that l is monochromatic with regard to C.
def Combinatorics.Subspace.reindex E1 #
{η : Type u_5} →
{α : Type u_6} →
{ι : Type u_7} →
{η' : Type u_9} →
{α' : Type u_10} →
{ι' : Type u_11} → Combinatorics.Subspace η α ι → η ≃ η' → α ≃ α' → ι ≃ ι' → Combinatorics.Subspace η' α' ι'
Change the index types of a subspace.
theorem Combinatorics.Subspace.reindex_apply E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {η' : Type u_9} {α' : Type u_10} {ι' : Type u_11}
(l : Combinatorics.Subspace η α ι) (eη : η ≃ η') (eα : α ≃ α') (eι : ι ≃ ι') (x : η' → α') (i : ι'),
↑(l.reindex eη eα eι) x i = eα (↑l (⇑eα.symm ∘ x ∘ ⇑eη) (eι.symm i))
theorem Combinatorics.Subspace.reindex_isMono E0 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {κ : Type u_8} {l : Combinatorics.Subspace η α ι} {η' : Type u_9}
{α' : Type u_10} {ι' : Type u_11} {eη : η ≃ η'} {eα : α ≃ α'} {eι : ι ≃ ι'} {C : (ι' → α') → κ},
Combinatorics.Subspace.IsMono C (l.reindex eη eα eι) ↔
Combinatorics.Subspace.IsMono (fun x ↦ C (⇑eα ∘ x ∘ ⇑eι.symm)) l
theorem Combinatorics.Subspace.IsMono.reindex E1 #
∀ {η : Type u_5} {α : Type u_6} {ι : Type u_7} {κ : Type u_8} {l : Combinatorics.Subspace η α ι} {η' : Type u_9}
{α' : Type u_10} {ι' : Type u_11} {eη : η ≃ η'} {eα : α ≃ α'} {eι : ι ≃ ι'} {C : (ι → α) → κ},
Combinatorics.Subspace.IsMono C l →
Combinatorics.Subspace.IsMono (fun x ↦ C (⇑eα.symm ∘ x ∘ ⇑eι)) (l.reindex eη eα eι)
structure Combinatorics.Line E1 #
Type u_5 → Type u_6 → Type (max u_5 u_6)
The type of combinatorial lines. A line l : Line α ι in the hypercube ι → α defines a
function α → ι → α from α to the hypercube, such that for each coordinate i : ι, the function
fun x ↦ l x i is either id or constant. We require lines to be nontrivial in the sense that
fun x ↦ l x i is id for at least one i.
Formally, a line is represented by a word l.idxFun : ι → Option α which says whether
fun x ↦ l x i is id (corresponding to l.idxFun i = none) or constantly y (corresponding to
l.idxFun i = some y).
When α has size 1 there can be many elements of Line α ι defining the same function.
theorem Combinatorics.Line.ext E1 #
∀ {α : Type u_5} {ι : Type u_6} {x y : Combinatorics.Line α ι}, x.idxFun = y.idxFun → x = y
theorem Combinatorics.Line.ext_iff E0 #
∀ {α : Type u_5} {ι : Type u_6} {x y : Combinatorics.Line α ι}, x = y ↔ x.idxFun = y.idxFun
ctor Combinatorics.Line.mk E0 #
{α : Type u_5} → {ι : Type u_6} → (idxFun : ι → Option α) → (∃ i, idxFun i = none) → Combinatorics.Line α ι
abbrev Combinatorics.Line.idxFun E1 #
{α : Type u_5} → {ι : Type u_6} → Combinatorics.Line α ι → ι → Option α
The word representing a combinatorial line. l.idxfun i = none means that
l x i = x for all x and l.idxfun i = some y means that l x i = y.
theorem Combinatorics.Line.proper E1 #
∀ {α : Type u_5} {ι : Type u_6} (self : Combinatorics.Line α ι), ∃ i, self.idxFun i = none
We require combinatorial lines to be nontrivial in the sense that fun x ↦ l x i is id for
at least one coordinate i.
def Combinatorics.Line.toFun E1 #
{α : Type u_2} → {ι : Type u_3} → Combinatorics.Line α ι → α → ι → α
Consider a line l : Line α ι as a function α → ι → α.
instance Combinatorics.Line.instCoeFun E0 #
{α : Type u_2} → {ι : Type u_3} → CoeFun (Combinatorics.Line α ι) fun x ↦ α → ι → α
theorem Combinatorics.Line.coe_apply E0 #
∀ {α : Type u_2} {ι : Type u_3} (l : Combinatorics.Line α ι) (x : α) (i : ι), ↑l x i = (l.idxFun i).getD x
theorem Combinatorics.Line.coe_injective E0 #
∀ {α : Type u_2} {ι : Type u_3} [Nontrivial α], Function.Injective Combinatorics.Line.toFun
def Combinatorics.Line.IsMono E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Sort u_7} → ((ι → α) → κ) → Combinatorics.Line α ι → Prop
A line is monochromatic if all its points are the same color.
def Combinatorics.Line.toSubspaceUnit E1 #
{α : Type u_2} → {ι : Type u_3} → Combinatorics.Line α ι → Combinatorics.Subspace Unit α ι
Consider a line as a one-dimensional subspace.
theorem Combinatorics.Line.toSubspaceUnit_apply E0 #
∀ {α : Type u_2} {ι : Type u_3} (l : Combinatorics.Line α ι) (a : Unit → α), ↑l.toSubspaceUnit a = ↑l (a ())
theorem Combinatorics.Line.toSubspaceUnit_isMono E0 #
∀ {α : Type u_2} {ι : Type u_3} {κ : Type u_4} {l : Combinatorics.Line α ι} {C : (ι → α) → κ},
Combinatorics.Subspace.IsMono C l.toSubspaceUnit ↔ Combinatorics.Line.IsMono C l
theorem Combinatorics.Line.IsMono.toSubspaceUnit E1 #
∀ {α : Type u_2} {ι : Type u_3} {κ : Type u_4} {l : Combinatorics.Line α ι} {C : (ι → α) → κ},
Combinatorics.Line.IsMono C l → Combinatorics.Subspace.IsMono C l.toSubspaceUnit
Alias of the reverse direction of Combinatorics.Line.toSubspaceUnit_isMono.
def Combinatorics.Line.toSubspace E1 #
{η : Type u_1} → {α : Type u_2} → {ι : Type u_3} → Combinatorics.Line (η → α) ι → Combinatorics.Subspace η α (ι × η)
Consider a line in ι → η → α as a η-dimensional subspace in ι × η → α.
theorem Combinatorics.Line.toSubspace_apply E0 #
∀ {η : Type u_1} {α : Type u_2} {ι : Type u_3} (l : Combinatorics.Line (η → α) ι) (a : η → α) (ie : ι × η),
↑l.toSubspace a ie = ↑l a ie.1 ie.2
theorem Combinatorics.Line.toSubspace_isMono E0 #
∀ {η : Type u_1} {α : Type u_2} {ι : Type u_3} {κ : Type u_4} {l : Combinatorics.Line (η → α) ι} {C : (ι × η → α) → κ},
Combinatorics.Subspace.IsMono C l.toSubspace ↔
Combinatorics.Line.IsMono
(fun x ↦
C fun x_1 ↦
match x_1 with
| (i, e) => x i e)
l
theorem Combinatorics.Line.IsMono.toSubspace E1 #
∀ {η : Type u_1} {α : Type u_2} {ι : Type u_3} {κ : Type u_4} {l : Combinatorics.Line (η → α) ι} {C : (ι × η → α) → κ},
Combinatorics.Line.IsMono
(fun x ↦
C fun x_1 ↦
match x_1 with
| (i, e) => x i e)
l →
Combinatorics.Subspace.IsMono C l.toSubspace
Alias of the reverse direction of Combinatorics.Line.toSubspace_isMono.
def Combinatorics.Line.diagonal E1 #
(α : Type u_5) → (ι : Type u_6) → [Nonempty ι] → Combinatorics.Line α ι
The diagonal line. It is the identity at every coordinate.
instance Combinatorics.Line.instInhabitedOfNonempty E0 #
(α : Type u_5) → (ι : Type u_6) → [Nonempty ι] → Inhabited (Combinatorics.Line α ι)
structure Combinatorics.Line.AlmostMono E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Type u_7} → ((ι → Option α) → κ) → Type (max (max u_5 u_6) u_7)
The type of lines that are only one color except possibly at their endpoints.
ctor Combinatorics.Line.AlmostMono.mk E0 #
{α : Type u_5} →
{ι : Type u_6} →
{κ : Type u_7} →
{C : (ι → Option α) → κ} →
(line : Combinatorics.Line (Option α) ι) →
(color : κ) → (∀ (x : α), C (↑line (some x)) = color) → Combinatorics.Line.AlmostMono C
abbrev Combinatorics.Line.AlmostMono.line E1 #
{α : Type u_5} →
{ι : Type u_6} →
{κ : Type u_7} → {C : (ι → Option α) → κ} → Combinatorics.Line.AlmostMono C → Combinatorics.Line (Option α) ι
The underlying line of an almost monochromatic line, where the coordinate dimension α is
extended by an additional symbol none, thought to be marking the endpoint of the line.
abbrev Combinatorics.Line.AlmostMono.color E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Type u_7} → {C : (ι → Option α) → κ} → Combinatorics.Line.AlmostMono C → κ
The main color of an almost monochromatic line.
theorem Combinatorics.Line.AlmostMono.has_color E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} (self : Combinatorics.Line.AlmostMono C)
(x : α), C (↑self.line (some x)) = self.color
The proposition that the underlying line of an almost monochromatic line assumes its main color except possibly at the endpoints.
instance Combinatorics.Line.instInhabitedAlmostMonoDefaultOfNonempty E0 #
{α : Type u_5} →
{ι : Type u_6} →
{κ : Type u_7} → [Nonempty ι] → [inst : Inhabited κ] → Inhabited (Combinatorics.Line.AlmostMono fun x ↦ default)
structure Combinatorics.Line.ColorFocused E1 #
{α : Type u_5} → {ι : Type u_6} → {κ : Type u_7} → ((ι → Option α) → κ) → Type (max (max u_5 u_6) u_7)
The type of collections of lines such that
- each line is only one color except possibly at its endpoint
- the lines all have the same endpoint
- the colors of the lines are distinct.
Used in the proof exists_mono_in_high_dimension.
ctor Combinatorics.Line.ColorFocused.mk E0 #
{α : Type u_5} →
{ι : Type u_6} →
{κ : Type u_7} →
{C : (ι → Option α) → κ} →
(lines : Multiset (Combinatorics.Line.AlmostMono C)) →
(focus : ι → Option α) →
(∀ p ∈ lines, ↑p.line none = focus) →
(Multiset.map Combinatorics.Line.AlmostMono.color lines).Nodup → Combinatorics.Line.ColorFocused C
abbrev Combinatorics.Line.ColorFocused.lines E1 #
{α : Type u_5} →
{ι : Type u_6} →
{κ : Type u_7} →
{C : (ι → Option α) → κ} → Combinatorics.Line.ColorFocused C → Multiset (Combinatorics.Line.AlmostMono C)
The underlying multiset of almost monochromatic lines of a color-focused collection.
abbrev Combinatorics.Line.ColorFocused.focus E1 #
{α : Type u_5} →
{ι : Type u_6} → {κ : Type u_7} → {C : (ι → Option α) → κ} → Combinatorics.Line.ColorFocused C → ι → Option α
The common endpoint of the lines in the color-focused collection.
theorem Combinatorics.Line.ColorFocused.is_focused E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} (self : Combinatorics.Line.ColorFocused C),
∀ p ∈ self.lines, ↑p.line none = self.focus
The proposition that all lines in a color-focused collection have the same endpoint.
theorem Combinatorics.Line.ColorFocused.distinct_colors E1 #
∀ {α : Type u_5} {ι : Type u_6} {κ : Type u_7} {C : (ι → Option α) → κ} (self : Combinatorics.Line.ColorFocused C),
(Multiset.map Combinatorics.Line.AlmostMono.color self.lines).Nodup
The proposition that all lines in a color-focused collection of lines have distinct colors.
instance Combinatorics.Line.instInhabitedColorFocused E0 #
{α : Type u_5} →
{ι : Type u_6} → {κ : Type u_7} → (C : (ι → Option α) → κ) → Inhabited (Combinatorics.Line.ColorFocused C)
def Combinatorics.Line.map E1 #
{α : Type u_5} → {α' : Type u_6} → {ι : Type u_7} → (α → α') → Combinatorics.Line α ι → Combinatorics.Line α' ι
A function f : α → α' determines a function line α ι → line α' ι. For a coordinate i
l.map f is the identity at i if l is, and constantly f y if l is constantly y at i.
def Combinatorics.Line.vertical E1 #
{α : Type u_5} → {ι : Type u_6} → {ι' : Type u_7} → (ι → α) → Combinatorics.Line α ι' → Combinatorics.Line α (ι ⊕ ι')
A point in ι → α and a line in ι' → α determine a line in ι ⊕ ι' → α.
def Combinatorics.Line.horizontal E1 #
{α : Type u_5} → {ι : Type u_6} → {ι' : Type u_7} → Combinatorics.Line α ι → (ι' → α) → Combinatorics.Line α (ι ⊕ ι')
A line in ι → α and a point in ι' → α determine a line in ι ⊕ ι' → α.
def Combinatorics.Line.prod E1 #
{α : Type u_5} →
{ι : Type u_6} → {ι' : Type u_7} → Combinatorics.Line α ι → Combinatorics.Line α ι' → Combinatorics.Line α (ι ⊕ ι')
One line in ι → α and one in ι' → α together determine a line in ι ⊕ ι' → α.
theorem Combinatorics.Line.apply_def E0 #
∀ {α : Type u_2} {ι : Type u_3} (l : Combinatorics.Line α ι) (x : α), ↑l x = fun i ↦ (l.idxFun i).getD x
theorem Combinatorics.Line.apply_none E1 #
∀ {α : Type u_5} {ι : Type u_6} (l : Combinatorics.Line α ι) (x : α) (i : ι), l.idxFun i = none → ↑l x i = x
theorem Combinatorics.Line.apply_some E1 #
∀ {α : Type u_2} {ι : Type u_3} {l : Combinatorics.Line α ι} {i : ι} {a x : α}, l.idxFun i = some a → ↑l x i = a
theorem Combinatorics.Line.map_apply E0 #
∀ {α : Type u_5} {α' : Type u_6} {ι : Type u_7} (f : α → α') (l : Combinatorics.Line α ι) (x : α),
↑(Combinatorics.Line.map f l) (f x) = f ∘ ↑l x
theorem Combinatorics.Line.vertical_apply E0 #
∀ {α : Type u_5} {ι : Type u_6} {ι' : Type u_7} (v : ι → α) (l : Combinatorics.Line α ι') (x : α),
↑(Combinatorics.Line.vertical v l) x = Sum.elim v (↑l x)
theorem Combinatorics.Line.horizontal_apply E0 #
∀ {α : Type u_5} {ι : Type u_6} {ι' : Type u_7} (l : Combinatorics.Line α ι) (v : ι' → α) (x : α),
↑(l.horizontal v) x = Sum.elim (↑l x) v
theorem Combinatorics.Line.prod_apply E0 #
∀ {α : Type u_5} {ι : Type u_6} {ι' : Type u_7} (l : Combinatorics.Line α ι) (l' : Combinatorics.Line α ι') (x : α),
↑(l.prod l') x = Sum.elim (↑l x) (↑l' x)
theorem Combinatorics.Line.diagonal_apply E0 #
∀ {α : Type u_5} {ι : Type u_6} [inst : Nonempty ι] (x : α), ↑(Combinatorics.Line.diagonal α ι) x = fun x_1 ↦ x
theorem Combinatorics.Line.exists_mono_in_high_dimension E3 #
∀ (α : Type u) [Finite α] (κ : Type v) [Finite κ], ∃ ι x, ∀ (C : (ι → α) → κ), ∃ l, Combinatorics.Line.IsMono C l
The Hales-Jewett theorem: For any finite types α and κ, there exists a finite type ι
such that whenever the hypercube ι → α is κ-colored, there is a monochromatic combinatorial
line.
theorem Combinatorics.exists_mono_homothetic_copy E3 #
∀ {M : Type u_5} {κ : Type u_6} [inst : AddCommMonoid M] (S : Finset M) [Finite κ] (C : M → κ),
∃ a > 0, ∃ b c, ∀ s ∈ S, C (a • s + b) = c
A generalization of Van der Waerden's theorem: if M is a finitely colored commutative
monoid, and S is a finite subset, then there exists a monochromatic homothetic copy of S.
theorem Combinatorics.Subspace.exists_mono_in_high_dimension E3 #
∀ (α : Type u_5) (κ : Type u_6) (η : Type u_7) [Finite α] [Finite κ] [Finite η],
∃ ι x, ∀ (C : (ι → α) → κ), ∃ l, Combinatorics.Subspace.IsMono C l
The multidimensional Hales-Jewett theorem, aka extended Hales-Jewett theorem: For any
finite types η, α and κ, there exists a finite type ι such that whenever the hypercube
ι → α is κ-colored, there is a monochromatic combinatorial subspace of dimension η.
theorem Combinatorics.Subspace.exists_mono_in_high_dimension_fin E2 #
∀ (α : Type u_5) (κ : Type u_6) (η : Type u_7) [Finite α] [Finite κ] [Finite η],
∃ n, ∀ (C : (Fin n → α) → κ), ∃ l, Combinatorics.Subspace.IsMono C l
A variant of the extended Hales-Jewett theorem exists_mono_in_high_dimension where the
returned type is some Fin n instead of a general fintype.