fact stringlengths 6 3.84k | type stringclasses 11
values | library stringclasses 32
values | imports listlengths 1 14 | filename stringlengths 20 95 | symbolic_name stringlengths 1 90 | docstring stringlengths 7 20k ⌀ |
|---|---|---|---|---|---|---|
lineCount_eq_lineCount [Finite P] [Finite L] (p q : P) : lineCount L p = lineCount L q := by
cases nonempty_fintype P
cases nonempty_fintype L
obtain ⟨p₁, p₂, p₃, l₁, l₂, l₃, h₁₂, h₁₃, h₂₁, h₂₂, h₂₃, h₃₁, h₃₂, h₃₃⟩ := @exists_config P L _ _
have h := card_points_eq_card_lines P L
let n := lineCount L p₂
hav... | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | lineCount_eq_lineCount | null |
pointCount_eq_pointCount [Finite P] [Finite L] (l m : L) :
pointCount P l = pointCount P m := by
apply lineCount_eq_lineCount (Dual P)
variable {P} | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | pointCount_eq_pointCount | null |
lineCount_eq_pointCount [Finite P] [Finite L] (p : P) (l : L) :
lineCount L p = pointCount P l :=
Exists.elim (exists_point l) fun q hq =>
(lineCount_eq_lineCount L p q).trans <| by
cases nonempty_fintype P
cases nonempty_fintype L
exact HasLines.lineCount_eq_pointCount (card_points_eq_card_... | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | lineCount_eq_pointCount | null |
Dual.order [Finite P] [Finite L] : order (Dual L) (Dual P) = order P L :=
congr_arg (fun n => n - 1) (lineCount_eq_pointCount _ _)
variable {P} | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | Dual.order | null |
lineCount_eq [Finite P] [Finite L] (p : P) : lineCount L p = order P L + 1 := by
classical
obtain ⟨q, -, -, l, -, -, -, -, h, -⟩ := Classical.choose_spec (@exists_config P L _ _)
cases nonempty_fintype { l : L // q ∈ l }
rw [order, lineCount_eq_lineCount L p q, lineCount_eq_lineCount L (Classical.choose _... | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | lineCount_eq | null |
pointCount_eq [Finite P] [Finite L] (l : L) : pointCount P l = order P L + 1 :=
(lineCount_eq (Dual P) _).trans (congr_arg (fun n => n + 1) (Dual.order P L))
variable (L) | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | pointCount_eq | null |
one_lt_order [Finite P] [Finite L] : 1 < order P L := by
obtain ⟨p₁, p₂, p₃, l₁, l₂, l₃, -, -, h₂₁, h₂₂, h₂₃, h₃₁, h₃₂, h₃₃⟩ := @exists_config P L _ _
cases nonempty_fintype { p : P // p ∈ l₂ }
rw [← add_lt_add_iff_right 1, ← pointCount_eq _ l₂, pointCount, Nat.card_eq_fintype_card,
Fintype.two_lt_card_iff]
... | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | one_lt_order | null |
two_lt_lineCount [Finite P] [Finite L] (p : P) : 2 < lineCount L p := by
simpa only [lineCount_eq L p, Nat.succ_lt_succ_iff] using one_lt_order P L
variable (P) {L} | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | two_lt_lineCount | null |
two_lt_pointCount [Finite P] [Finite L] (l : L) : 2 < pointCount P l := by
simpa only [pointCount_eq P l, Nat.succ_lt_succ_iff] using one_lt_order P L
variable (L) | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | two_lt_pointCount | null |
card_points [Fintype P] [Finite L] : Fintype.card P = order P L ^ 2 + order P L + 1 := by
cases nonempty_fintype L
obtain ⟨p, -⟩ := @exists_config P L _ _
let ϕ : { q // q ≠ p } ≃ Σ l : { l : L // p ∈ l }, { q // q ∈ l.1 ∧ q ≠ p } :=
{ toFun := fun q => ⟨⟨mkLine q.2, (mkLine_ax q.2).2⟩, q, (mkLine_ax q.2).1, ... | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | card_points | null |
card_lines [Finite P] [Fintype L] : Fintype.card L = order P L ^ 2 + order P L + 1 :=
(card_points (Dual L) (Dual P)).trans (congr_arg (fun n => n ^ 2 + n + 1) (Dual.order P L)) | theorem | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | card_lines | null |
mem_iff (v w : ℙ K (Fin 3 → K)) : v ∈ w ↔ orthogonal v w :=
Iff.rfl | lemma | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | mem_iff | null |
crossProduct_eq_zero_of_dotProduct_eq_zero {a b c d : Fin 3 → K} (hac : a ⬝ᵥ c = 0)
(hbc : b ⬝ᵥ c = 0) (had : a ⬝ᵥ d = 0) (hbd : b ⬝ᵥ d = 0) :
crossProduct a b = 0 ∨ crossProduct c d = 0 := by
by_contra h
simp_rw [not_or, ← ne_eq, crossProduct_ne_zero_iff_linearIndependent] at h
rw [← Matrix.of_row (![a,b... | lemma | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | crossProduct_eq_zero_of_dotProduct_eq_zero | null |
eq_or_eq_of_orthogonal {a b c d : ℙ K (Fin 3 → K)} (hac : a.orthogonal c)
(hbc : b.orthogonal c) (had : a.orthogonal d) (hbd : b.orthogonal d) :
a = b ∨ c = d := by
induction a with | h a ha =>
induction b with | h b hb =>
induction c with | h c hc =>
induction d with | h d hd =>
rw [mk_eq_mk_iff_cros... | lemma | Combinatorics | [
"Mathlib.Combinatorics.Hall.Basic",
"Mathlib.LinearAlgebra.Matrix.Rank",
"Mathlib.LinearAlgebra.Projectivization.Constructions"
] | Mathlib/Combinatorics/Configuration.lean | eq_or_eq_of_orthogonal | null |
@[ext]
Subspace (η α ι : Type*) where
/-- 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`. -/
idxFun : ι → α ⊕ η
/-- We require combinatorial subspaces to be nontrivial in the sense that `f... | structure | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | Subspace | 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 r... |
@[coe] toFun (l : Subspace η α ι) (x : η → α) (i : ι) : α := (l.idxFun i).elim id x | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | toFun | The combinatorial subspace corresponding to the identity embedding `(ι → α) → (ι → α)`. -/
instance : Inhabited (Subspace ι α ι) := ⟨⟨Sum.inr, fun i ↦ ⟨i, rfl⟩⟩⟩
/-- Consider a subspace `l : Subspace η α ι` as a function `(η → α) → ι → α`. |
instCoeFun : CoeFun (Subspace η α ι) (fun _ ↦ (η → α) → ι → α) := ⟨toFun⟩ | instance | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | instCoeFun | null |
coe_apply (l : Subspace η α ι) (x : η → α) (i : ι) : l x i = (l.idxFun i).elim id x := rfl | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | coe_apply | null |
coe_injective [Nontrivial α] : Injective ((⇑) : Subspace η α ι → (η → α) → ι → α) := by
classical
rintro l m hlm
ext i
simp only [funext_iff] at hlm
cases hl : idxFun l i with
| inl a =>
obtain ⟨b, hba⟩ := exists_ne a
cases hm : idxFun m i <;> simpa [hl, hm, hba.symm, coe_apply] using hlm (const _ b... | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | coe_injective | null |
apply_def (l : Subspace η α ι) (x : η → α) (i : ι) : l x i = (l.idxFun i).elim id x := rfl | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_def | null |
apply_inl (h : l.idxFun i = Sum.inl a) : l x i = a := by simp [apply_def, h] | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_inl | null |
apply_inr (h : l.idxFun i = Sum.inr e) : l x i = x e := by simp [apply_def, h] | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_inr | null |
IsMono (C : (ι → α) → κ) (l : Subspace η α ι) : Prop := ∃ c, ∀ x, C (l x) = c
variable {η' α' ι' : Type*} | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | IsMono | Given a coloring `C` of `ι → α` and a combinatorial subspace `l` of `ι → α`, `l.IsMono C`
means that `l` is monochromatic with regard to `C`. |
reindex (l : Subspace η α ι) (eη : η ≃ η') (eα : α ≃ α') (eι : ι ≃ ι') : Subspace η' α' ι' where
idxFun i := (l.idxFun <| eι.symm i).map eα eη
proper e := (eι.exists_congr fun i ↦ by cases h : idxFun l i <;>
simp [*, Equiv.eq_symm_apply]).1 <| l.proper <| eη.symm e
@[simp] lemma reindex_apply (l : Subspace η α ... | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | reindex | Change the index types of a subspace. |
protected IsMono.reindex {eη : η ≃ η'} {eα : α ≃ α'} {eι : ι ≃ ι'} {C : (ι → α) → κ}
(hl : l.IsMono C) : (l.reindex eη eα eι).IsMono fun x ↦ C <| eα.symm ∘ x ∘ eι := by
simp [reindex_isMono, Function.comp_assoc]; simpa [← Function.comp_assoc] | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | IsMono.reindex | null |
@[ext]
Line (α ι : Type*) where
/-- 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`. -/
idxFun : ι → Option α
/-- We require combinatorial lines to be nontrivial in the sense that `fun x ↦ l x i` is `id` for
at... | structure | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | Line | 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 lea... |
@[coe] toFun (l : Line α ι) (x : α) (i : ι) : α := (l.idxFun i).getD x | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | toFun | Consider a line `l : Line α ι` as a function `α → ι → α`. |
instCoeFun : CoeFun (Line α ι) fun _ => α → ι → α := ⟨toFun⟩
@[simp] lemma coe_apply (l : Line α ι) (x : α) (i : ι) : l x i = (l.idxFun i).getD x := rfl | instance | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | instCoeFun | null |
coe_injective [Nontrivial α] : Injective ((⇑) : Line α ι → α → ι → α) := by
rintro l m hlm
ext i a
obtain ⟨b, hba⟩ := exists_ne a
simp only [funext_iff] at hlm ⊢
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· cases hi : idxFun m i <;> simpa [@eq_comm _ a, hi, h, hba] using hlm b i
· cases hi : idxFun l i <;> simpa [@e... | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | coe_injective | null |
IsMono {α ι κ} (C : (ι → α) → κ) (l : Line α ι) : Prop :=
∃ c, ∀ x, C (l x) = c | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | IsMono | A line is monochromatic if all its points are the same color. |
toSubspaceUnit (l : Line α ι) : Subspace Unit α ι where
idxFun i := (l.idxFun i).elim (.inr ()) .inl
proper _ := l.proper.imp fun i hi ↦ by simp [hi]
@[simp] lemma toSubspaceUnit_apply (l : Line α ι) (a) : ⇑l.toSubspaceUnit a = l (a ()) := by
ext i; cases h : l.idxFun i <;> simp [toSubspaceUnit, h, Subspace.coe_a... | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | toSubspaceUnit | Consider a line as a one-dimensional subspace. |
toSubspace (l : Line (η → α) ι) : Subspace η α (ι × η) where
idxFun ie := (l.idxFun ie.1).elim (.inr ie.2) (fun f ↦ .inl <| f ie.2)
proper e := let ⟨i, hi⟩ := l.proper; ⟨(i, e), by simp [hi]⟩
@[simp] lemma toSubspace_apply (l : Line (η → α) ι) (a ie) :
⇑l.toSubspace a ie = l a ie.1 ie.2 := by
cases h : l.idxF... | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | toSubspace | Consider a line in `ι → η → α` as a `η`-dimensional subspace in `ι × η → α`. |
diagonal (α ι) [Nonempty ι] : Line α ι where
idxFun _ := none
proper := ⟨Classical.arbitrary ι, rfl⟩ | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | diagonal | The diagonal line. It is the identity at every coordinate. |
AlmostMono {α ι κ : Type*} (C : (ι → Option α) → κ) where
/-- 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. -/
line : Line (Option α) ι
/-- The main color of an almost monochroma... | structure | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | AlmostMono | The type of lines that are only one color except possibly at their endpoints. |
ColorFocused {α ι κ : Type*} (C : (ι → Option α) → κ) where
/-- The underlying multiset of almost monochromatic lines of a color-focused collection. -/
lines : Multiset (AlmostMono C)
/-- The common endpoint of the lines in the color-focused collection. -/
focus : ι → Option α
/-- The proposition that all lin... | structure | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | ColorFocused | 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`. |
map {α α' ι} (f : α → α') (l : Line α ι) : Line α' ι where
idxFun i := (l.idxFun i).map f
proper := ⟨l.proper.choose, by simp only [l.proper.choose_spec, Option.map_none]⟩ | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | map | 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`. |
vertical {α ι ι'} (v : ι → α) (l : Line α ι') : Line α (ι ⊕ ι') where
idxFun := Sum.elim (some ∘ v) l.idxFun
proper := ⟨Sum.inr l.proper.choose, l.proper.choose_spec⟩ | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | vertical | A point in `ι → α` and a line in `ι' → α` determine a line in `ι ⊕ ι' → α`. |
horizontal {α ι ι'} (l : Line α ι) (v : ι' → α) : Line α (ι ⊕ ι') where
idxFun := Sum.elim l.idxFun (some ∘ v)
proper := ⟨Sum.inl l.proper.choose, l.proper.choose_spec⟩ | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | horizontal | A line in `ι → α` and a point in `ι' → α` determine a line in `ι ⊕ ι' → α`. |
prod {α ι ι'} (l : Line α ι) (l' : Line α ι') : Line α (ι ⊕ ι') where
idxFun := Sum.elim l.idxFun l'.idxFun
proper := ⟨Sum.inl l.proper.choose, l.proper.choose_spec⟩ | def | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | prod | One line in `ι → α` and one in `ι' → α` together determine a line in `ι ⊕ ι' → α`. |
apply_def (l : Line α ι) (x : α) : l x = fun i => (l.idxFun i).getD x := rfl | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_def | null |
apply_none {α ι} (l : Line α ι) (x : α) (i : ι) (h : l.idxFun i = none) : l x i = x := by
simp only [Option.getD_none, h, l.apply_def] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_none | null |
apply_some (h : l.idxFun i = some a) : l x i = a := by simp [h]
@[simp] | lemma | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | apply_some | null |
map_apply {α α' ι} (f : α → α') (l : Line α ι) (x : α) : l.map f (f x) = f ∘ l x := by
simp only [Line.apply_def, Line.map, Option.getD_map, comp_def]
@[simp] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | map_apply | null |
vertical_apply {α ι ι'} (v : ι → α) (l : Line α ι') (x : α) :
l.vertical v x = Sum.elim v (l x) := by
funext i
cases i <;> rfl
@[simp] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | vertical_apply | null |
horizontal_apply {α ι ι'} (l : Line α ι) (v : ι' → α) (x : α) :
l.horizontal v x = Sum.elim (l x) v := by
funext i
cases i <;> rfl
@[simp] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | horizontal_apply | null |
prod_apply {α ι ι'} (l : Line α ι) (l' : Line α ι') (x : α) :
l.prod l' x = Sum.elim (l x) (l' x) := by
funext i
cases i <;> rfl
@[simp] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | prod_apply | null |
diagonal_apply {α ι} [Nonempty ι] (x : α) : diagonal α ι x = fun _ => x := by
ext; simp [diagonal] | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | diagonal_apply | null |
private exists_mono_in_high_dimension' :
∀ (α : Type u) [Finite α] (κ : Type max v u) [Finite κ],
∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Line α ι, l.IsMono C :=
Finite.induction_empty_option
(-- We have to show that the theorem is invariant under `α ≃ α'` for the induction to work.
fun {... | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | exists_mono_in_high_dimension' | The **Hales-Jewett theorem**. This version has a restriction on universe levels which is
necessary for the proof. See `exists_mono_in_high_dimension` for a fully universe-polymorphic
version. |
exists_mono_in_high_dimension (α : Type u) [Finite α] (κ : Type v) [Finite κ] :
∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Line α ι, l.IsMono C :=
let ⟨ι, ιfin, hι⟩ := exists_mono_in_high_dimension'.{u,v} α (ULift.{u,v} κ)
⟨ι, ιfin, fun C =>
let ⟨l, c, hc⟩ := hι (ULift.up ∘ C)
⟨l, c.down, fu... | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | exists_mono_in_high_dimension | 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. |
exists_mono_homothetic_copy {M κ : Type*} [AddCommMonoid M] (S : Finset M) [Finite κ]
(C : M → κ) : ∃ a > 0, ∃ (b : M) (c : κ), ∀ s ∈ S, C (a • s + b) = c := by
classical
obtain ⟨ι, _inst, hι⟩ := Line.exists_mono_in_high_dimension S κ
specialize hι fun v => C <| ∑ i, v i
obtain ⟨l, c, hl⟩ := hι
set s : Fi... | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | exists_mono_homothetic_copy | 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`. |
exists_mono_in_high_dimension (α κ η) [Finite α] [Finite κ] [Finite η] :
∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Subspace η α ι, l.IsMono C := by
cases nonempty_fintype η
obtain ⟨ι, _, hι⟩ := Line.exists_mono_in_high_dimension (Shrink.{0} η → α) κ
refine ⟨ι × Shrink η, inferInstance, fun C ↦ ?_... | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | exists_mono_in_high_dimension | 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 `η`. |
exists_mono_in_high_dimension_fin (α κ η) [Finite α] [Finite κ] [Finite η] :
∃ n, ∀ C : (Fin n → α) → κ, ∃ l : Subspace η α (Fin n), l.IsMono C := by
obtain ⟨ι, ιfin, hι⟩ := exists_mono_in_high_dimension α κ η
refine ⟨Fintype.card ι, fun C ↦ ?_⟩
obtain ⟨l, c, cl⟩ := hι fun v ↦ C (v ∘ (Fintype.equivFin _).symm... | theorem | Combinatorics | [
"Mathlib.Data.Fintype.Option",
"Mathlib.Data.Fintype.Shrink",
"Mathlib.Data.Fintype.Sum",
"Mathlib.Data.Finite.Prod",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/HalesJewett.lean | exists_mono_in_high_dimension_fin | 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. |
asserts that whenever the positive integers are finitely colored, there exists a sequence
`a₀, a₁, a₂, …` such that `FS(a₀, …)` is monochromatic. There is also a stronger version, saying
that whenever a set of the form `FS(a₀, …)` is finitely colored, there exists a sequence
`b₀, b₁, b₂, …` such that `FS(b₀, …)` is mon... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | asserts | null |
@[to_additive
/-- Addition of ultrafilters given by `∀ᶠ m in U+V, p m ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m+m')`. -/]
Ultrafilter.mul {M} [Mul M] : Mul (Ultrafilter M) where mul U V := (· * ·) <$> U <*> V
attribute [local instance] Ultrafilter.mul Ultrafilter.add
/- We could have taken this as the definition of `U * V`, but th... | def | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | Ultrafilter.mul | Multiplication of ultrafilters given by `∀ᶠ m in U*V, p m ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m*m')`. |
Ultrafilter.eventually_mul {M} [Mul M] (U V : Ultrafilter M) (p : M → Prop) :
(∀ᶠ m in ↑(U * V), p m) ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m * m') :=
Iff.rfl | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | Ultrafilter.eventually_mul | null |
@[to_additive /-- Additive semigroup structure on `Ultrafilter M` induced by an additive semigroup
structure on `M`. -/]
Ultrafilter.semigroup {M} [Semigroup M] : Semigroup (Ultrafilter M) :=
{ Ultrafilter.mul with
mul_assoc := fun U V W =>
Ultrafilter.coe_inj.mp <|
Filter.ext' fun p => by simp [Ult... | def | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | Ultrafilter.semigroup | Semigroup structure on `Ultrafilter M` induced by a semigroup structure on `M`. |
Ultrafilter.continuous_mul_left {M} [Mul M] (V : Ultrafilter M) :
Continuous (· * V) :=
ultrafilterBasis_is_basis.continuous_iff.2 <| Set.forall_mem_range.mpr fun s ↦
ultrafilter_isOpen_basic { m : M | ∀ᶠ m' in V, m * m' ∈ s } | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | Ultrafilter.continuous_mul_left | null |
FS {M} [AddSemigroup M] : Stream' M → Set M
| head' (a : Stream' M) : FS a a.head
| tail' (a : Stream' M) (m : M) (h : FS a.tail m) : FS a m
| cons' (a : Stream' M) (m : M) (h : FS a.tail m) : FS a (a.head + m) | inductive | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FS | `FS a` is the set of finite sums in `a`, i.e. `m ∈ FS a` if `m` is the sum of a nonempty
subsequence of `a`. We give a direct inductive definition instead of talking about subsequences. |
@[to_additive FS]
FP {M} [Semigroup M] : Stream' M → Set M
| head' (a : Stream' M) : FP a a.head
| tail' (a : Stream' M) (m : M) (h : FP a.tail m) : FP a m
| cons' (a : Stream' M) (m : M) (h : FP a.tail m) : FP a (a.head * m) | inductive | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP | `FP a` is the set of finite products in `a`, i.e. `m ∈ FP a` if `m` is the product of a nonempty
subsequence of `a`. We give a direct inductive definition instead of talking about subsequences. |
@[to_additive (attr := match_pattern, nolint defLemma)
/-- Constructor for `FS`. This is the preferred spelling over `FS.head'`. -/]
FP.head : a.head ∈ FP a := FP.head' a | abbrev | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.head | Constructor for `FP`. This is the preferred spelling over `FP.head'`. |
@[to_additive (attr := match_pattern, nolint defLemma)
/-- Constructor for `FS`. This is the preferred spelling over `FS.tail'`. -/]
FP.tail : m ∈ FP a := FP.tail' a m h | abbrev | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.tail | Constructor for `FP`. This is the preferred spelling over `FP.tail'`. |
@[to_additive (attr := match_pattern, nolint defLemma)
/-- Constructor for `FS`. This is the preferred spelling over `FS.cons'`. -/]
FP.cons : a.head * m ∈ FP a := FP.cons' a m h | abbrev | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.cons | Constructor for `FP`. This is the preferred spelling over `FP.cons'`. |
@[to_additive /-- If `m` and `m'` are finite sums in `M`, then so is `m + m'`, provided that `m'`
is obtained from a subsequence of `M` starting sufficiently late. -/]
FP.mul {M} [Semigroup M] {a : Stream' M} {m : M} (hm : m ∈ FP a) :
∃ n, ∀ m' ∈ FP (a.drop n), m * m' ∈ FP a := by
induction hm with
| head' a =>... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.mul | If `m` and `m'` are finite products in `M`, then so is `m * m'`, provided that `m'` is obtained
from a subsequence of `M` starting sufficiently late. |
exists_idempotent_ultrafilter_le_FP {M} [Semigroup M] (a : Stream' M) :
∃ U : Ultrafilter M, U * U = U ∧ ∀ᶠ m in U, m ∈ FP a := by
let S : Set (Ultrafilter M) := ⋂ n, { U | ∀ᶠ m in U, m ∈ FP (a.drop n) }
have h := exists_idempotent_in_compact_subsemigroup ?_ S ?_ ?_ ?_
· rcases h with ⟨U, hU, U_idem⟩
refi... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | exists_idempotent_ultrafilter_le_FP | null |
exists_FP_of_large {M} [Semigroup M] (U : Ultrafilter M) (U_idem : U * U = U) (s₀ : Set M)
(sU : s₀ ∈ U) : ∃ a, FP a ⊆ s₀ := by
/- Informally: given a `U`-large set `s₀`, the set `s₀ ∩ { m | ∀ᶠ m' in U, m * m' ∈ s₀ }` is also
`U`-large (since `U` is idempotent). Thus in particular there is an `a₀` in this inter... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | exists_FP_of_large | null |
@[to_additive FS_partition_regular /-- The strong form of **Hindman's theorem**: in any finite
cover of an FS-set, one the parts contains an FS-set. -/]
FP_partition_regular {M} [Semigroup M] (a : Stream' M) (s : Set (Set M)) (sfin : s.Finite)
(scov : FP a ⊆ ⋃₀ s) : ∃ c ∈ s, ∃ b : Stream' M, FP b ⊆ c :=
let ⟨U, i... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP_partition_regular | The strong form of **Hindman's theorem**: in any finite cover of an FP-set, one the parts
contains an FP-set. |
@[to_additive exists_FS_of_finite_cover /-- The weak form of **Hindman's theorem**: in any finite
cover of a nonempty additive semigroup, one of the parts contains an FS-set. -/]
exists_FP_of_finite_cover {M} [Semigroup M] [Nonempty M] (s : Set (Set M)) (sfin : s.Finite)
(scov : ⊤ ⊆ ⋃₀ s) : ∃ c ∈ s, ∃ a : Stream' M... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | exists_FP_of_finite_cover | The weak form of **Hindman's theorem**: in any finite cover of a nonempty semigroup, one of the
parts contains an FP-set. |
FP_drop_subset_FP {M} [Semigroup M] (a : Stream' M) (n : ℕ) : FP (a.drop n) ⊆ FP a := by
induction n with
| zero => rfl
| succ n ih =>
rw [← Stream'.drop_drop]
exact _root_.trans (FP.tail _) ih
@[to_additive] | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP_drop_subset_FP | null |
FP.singleton {M} [Semigroup M] (a : Stream' M) (i : ℕ) : a.get i ∈ FP a := by
induction i generalizing a with
| zero => exact FP.head _
| succ i ih => exact FP.tail _ _ (ih _)
@[to_additive] | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.singleton | null |
FP.mul_two {M} [Semigroup M] (a : Stream' M) (i j : ℕ) (ij : i < j) :
a.get i * a.get j ∈ FP a := by
refine FP_drop_subset_FP _ i ?_
rw [← Stream'.head_drop]
apply FP.cons
rcases Nat.exists_eq_add_of_le (Nat.succ_le_of_lt ij) with ⟨d, hd⟩
have := FP.singleton (a.drop i).tail d
rw [Stream'.tail_eq_drop, ... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.mul_two | null |
FP.finset_prod {M} [CommMonoid M] (a : Stream' M) (s : Finset ℕ) (hs : s.Nonempty) :
(s.prod fun i => a.get i) ∈ FP a := by
refine FP_drop_subset_FP _ (s.min' hs) ?_
induction s using Finset.eraseInduction with | H s ih => _
rw [← Finset.mul_prod_erase _ _ (s.min'_mem hs), ← Stream'.head_drop]
rcases (s.era... | theorem | Combinatorics | [
"Mathlib.Data.Stream.Init",
"Mathlib.Topology.Algebra.Semigroup",
"Mathlib.Topology.Compactification.StoneCech",
"Mathlib.Algebra.BigOperators.Group.Finset.Basic"
] | Mathlib/Combinatorics/Hindman.lean | FP.finset_prod | null |
eq_zero_of_eval_zero_at_prod_finset {σ : Type*} [Finite σ] [IsDomain R]
(P : MvPolynomial σ R) (S : σ → Finset R)
(Hdeg : ∀ i, P.degreeOf i < #(S i))
(Heval : ∀ (x : σ → R), (∀ i, x i ∈ S i) → eval x P = 0) :
P = 0 := by
induction σ using Finite.induction_empty_option with
| @of_equiv σ τ e h =>
... | theorem | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | eq_zero_of_eval_zero_at_prod_finset | A multivariate polynomial that vanishes on a large product finset is the zero polynomial. |
private noncomputable Alon.P (S : Finset R) (i : σ) : MvPolynomial σ R :=
∏ r ∈ S, (X i - C r) | def | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | Alon.P | The polynomial in `X i` that vanishes at all elements of `S`. |
private Alon.degree_P [Nontrivial R] (m : MonomialOrder σ) (S : Finset R) (i : σ) :
m.degree (Alon.P S i) = single i #S := by
simp only [P]
rw [degree_prod_of_regular]
· simp [Finset.sum_congr rfl (fun r _ ↦ m.degree_X_sub_C i r)]
· intro r _
rw [m.monic_X_sub_C]
exact isRegular_one | theorem | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | Alon.degree_P | The degree of `Alon.P S i` with respect to `X i` is the cardinality of `S`,
and `0` otherwise. |
private Alon.monic_P [Nontrivial R] (m : MonomialOrder σ) (S : Finset R) (i : σ) :
m.Monic (P S i) :=
Monic.prod (fun r _ ↦ m.monic_X_sub_C i r) | theorem | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | Alon.monic_P | The leading coefficient of `Alon.P S i` is `1`. |
private Alon.of_mem_P_support {ι : Type*} (i : ι) (S : Finset R) (m : ι →₀ ℕ)
(hm : m ∈ (Alon.P S i).support) :
∃ e ≤ S.card, m = single i e := by
classical
have hP : Alon.P S i = .rename (fun _ ↦ i) (Alon.P S ()) := by simp [Alon.P, map_prod]
rw [hP, support_rename_of_injective (Function.injective_of_sub... | lemma | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | Alon.of_mem_P_support | The support of `Alon.P S i` is the set of exponents of the form `single i e`,
for `e ≤ S.card`. |
combinatorial_nullstellensatz_exists_linearCombination
[IsDomain R] (S : σ → Finset R) (Sne : ∀ i, (S i).Nonempty)
(f : MvPolynomial σ R) (Heval : ∀ (x : σ → R), (∀ i, x i ∈ S i) → eval x f = 0) :
∃ (h : σ →₀ MvPolynomial σ R),
(∀ i, ((∏ s ∈ S i, (X i - C s)) * h i).totalDegree ≤ f.totalDegree) ∧
... | theorem | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | combinatorial_nullstellensatz_exists_linearCombination | The **Combinatorial Nullstellensatz**.
If `f` vanishes at every point `x : σ → R` such that `x s ∈ S s` for all `s`,
then it can be written as a linear combination
`f = linearCombination (MvPolynomial σ R) (fun i ↦ (∏ r ∈ S i, (X i - C r))) h`,
for some `h : σ →₀ MvPolynomial σ R` such that
`((∏ r ∈ S s, (X i - C r)) ... |
combinatorial_nullstellensatz_exists_eval_nonzero [IsDomain R]
(f : MvPolynomial σ R)
(t : σ →₀ ℕ) (ht : f.coeff t ≠ 0) (ht' : f.totalDegree = t.degree)
(S : σ → Finset R) (htS : ∀ i, t i < #(S i)) :
∃ s : σ → R, (∀ i, s i ∈ S i) ∧ eval s f ≠ 0 := by
let _ : LinearOrder σ := WellOrderingRel.isWellOrde... | theorem | Combinatorics | [
"Mathlib.Algebra.MvPolynomial.Equiv",
"Mathlib.Algebra.Polynomial.Degree.Definitions",
"Mathlib.Data.Finsupp.MonomialOrder.DegLex",
"Mathlib.RingTheory.Ideal.Maps",
"Mathlib.RingTheory.MvPolynomial.Groebner",
"Mathlib.RingTheory.MvPolynomial.Homogeneous",
"Mathlib.RingTheory.MvPolynomial.MonomialOrder.D... | Mathlib/Combinatorics/Nullstellensatz.lean | combinatorial_nullstellensatz_exists_eval_nonzero | The **Combinatorial Nullstellensatz**.
Given a multi-index `t : σ →₀ ℕ` such that `t s < (S s).card` for all `s`,
`f.totalDegree = t.degree` and `f.coeff t ≠ 0`,
there exists a point `x : σ → R` such that `x s ∈ S s` for all `s` and `f.eval s ≠ 0`.
[Alon_1999], theorem 2 |
exists_lt_sum_fiber_of_maps_to_of_nsmul_lt_sum (hf : ∀ a ∈ s, f a ∈ t)
(hb : #t • b < ∑ x ∈ s, w x) : ∃ y ∈ t, b < ∑ x ∈ s with f x = y, w x :=
exists_lt_of_sum_lt <| by simpa only [sum_fiberwise_of_maps_to hf, sum_const] | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_sum_fiber_of_maps_to_of_nsmul_lt_sum | The pigeonhole principle for finitely many pigeons counted by weight, strict inequality version:
if the total weight of a finite set of pigeons is greater than `n • b`, and they are sorted into
`n` pigeonholes, then for some pigeonhole, the total weight of the pigeons in this pigeonhole is
greater than `b`. |
exists_sum_fiber_lt_of_maps_to_of_sum_lt_nsmul (hf : ∀ a ∈ s, f a ∈ t)
(hb : ∑ x ∈ s, w x < #t • b) : ∃ y ∈ t, ∑ x ∈ s with f x = y, w x < b :=
exists_lt_sum_fiber_of_maps_to_of_nsmul_lt_sum (M := Mᵒᵈ) hf hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_lt_of_maps_to_of_sum_lt_nsmul | The pigeonhole principle for finitely many pigeons counted by weight, strict inequality version:
if the total weight of a finite set of pigeons is less than `n • b`, and they are sorted into `n`
pigeonholes, then for some pigeonhole, the total weight of the pigeons in this pigeonhole is less
than `b`. |
exists_lt_sum_fiber_of_sum_fiber_nonpos_of_nsmul_lt_sum
(ht : ∀ y ∉ t, ∑ x ∈ s with f x = y, w x ≤ 0)
(hb : #t • b < ∑ x ∈ s, w x) : ∃ y ∈ t, b < ∑ x ∈ s with f x = y, w x :=
exists_lt_of_sum_lt <|
calc
∑ _y ∈ t, b < ∑ x ∈ s, w x := by simpa
_ ≤ ∑ y ∈ t, ∑ x ∈ s with f x = y, w x := sum_le_sum... | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_sum_fiber_of_sum_fiber_nonpos_of_nsmul_lt_sum | The pigeonhole principle for finitely many pigeons counted by weight, strict inequality version:
if the total weight of a finite set of pigeons is greater than `n • b`, they are sorted into some
pigeonholes, and for all but `n` pigeonholes the total weight of the pigeons there is nonpositive,
then for at least one of t... |
exists_sum_fiber_lt_of_sum_fiber_nonneg_of_sum_lt_nsmul
(ht : ∀ y ∉ t, (0 : M) ≤ ∑ x ∈ s with f x = y, w x) (hb : ∑ x ∈ s, w x < #t • b) :
∃ y ∈ t, ∑ x ∈ s with f x = y, w x < b :=
exists_lt_sum_fiber_of_sum_fiber_nonpos_of_nsmul_lt_sum (M := Mᵒᵈ) ht hb
/-! | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_lt_of_sum_fiber_nonneg_of_sum_lt_nsmul | The pigeonhole principle for finitely many pigeons counted by weight, strict inequality version:
if the total weight of a finite set of pigeons is less than `n • b`, they are sorted into some
pigeonholes, and for all but `n` pigeonholes the total weight of the pigeons there is nonnegative,
then for at least one of thes... |
exists_le_sum_fiber_of_maps_to_of_nsmul_le_sum (hf : ∀ a ∈ s, f a ∈ t) (ht : t.Nonempty)
(hb : #t • b ≤ ∑ x ∈ s, w x) : ∃ y ∈ t, b ≤ ∑ x ∈ s with f x = y, w x :=
exists_le_of_sum_le ht <| by simpa only [sum_fiberwise_of_maps_to hf, sum_const] | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_le_sum_fiber_of_maps_to_of_nsmul_le_sum | The pigeonhole principle for finitely many pigeons counted by weight, non-strict inequality
version: if the total weight of a finite set of pigeons is greater than or equal to `n • b`, and
they are sorted into `n > 0` pigeonholes, then for some pigeonhole, the total weight of the pigeons
in this pigeonhole is greater t... |
exists_sum_fiber_le_of_maps_to_of_sum_le_nsmul (hf : ∀ a ∈ s, f a ∈ t) (ht : t.Nonempty)
(hb : ∑ x ∈ s, w x ≤ #t • b) : ∃ y ∈ t, ∑ x ∈ s with f x = y, w x ≤ b :=
exists_le_sum_fiber_of_maps_to_of_nsmul_le_sum (M := Mᵒᵈ) hf ht hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_le_of_maps_to_of_sum_le_nsmul | The pigeonhole principle for finitely many pigeons counted by weight, non-strict inequality
version: if the total weight of a finite set of pigeons is less than or equal to `n • b`, and they
are sorted into `n > 0` pigeonholes, then for some pigeonhole, the total weight of the pigeons in
this pigeonhole is less than or... |
exists_le_sum_fiber_of_sum_fiber_nonpos_of_nsmul_le_sum
(hf : ∀ y ∉ t, ∑ x ∈ s with f x = y, w x ≤ 0) (ht : t.Nonempty)
(hb : #t • b ≤ ∑ x ∈ s, w x) : ∃ y ∈ t, b ≤ ∑ x ∈ s with f x = y, w x :=
exists_le_of_sum_le ht <|
calc
∑ _y ∈ t, b ≤ ∑ x ∈ s, w x := by simpa
_ ≤ ∑ y ∈ t, ∑ x ∈ s with f x =... | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_le_sum_fiber_of_sum_fiber_nonpos_of_nsmul_le_sum | The pigeonhole principle for finitely many pigeons counted by weight, non-strict inequality
version: if the total weight of a finite set of pigeons is greater than or equal to `n • b`, they
are sorted into some pigeonholes, and for all but `n > 0` pigeonholes the total weight of the
pigeons there is nonpositive, then f... |
exists_sum_fiber_le_of_sum_fiber_nonneg_of_sum_le_nsmul
(hf : ∀ y ∉ t, (0 : M) ≤ ∑ x ∈ s with f x = y, w x) (ht : t.Nonempty)
(hb : ∑ x ∈ s, w x ≤ #t • b) : ∃ y ∈ t, ∑ x ∈ s with f x = y, w x ≤ b :=
exists_le_sum_fiber_of_sum_fiber_nonpos_of_nsmul_le_sum (M := Mᵒᵈ) hf ht hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_le_of_sum_fiber_nonneg_of_sum_le_nsmul | The pigeonhole principle for finitely many pigeons counted by weight, non-strict inequality
version: if the total weight of a finite set of pigeons is less than or equal to `n • b`, they are
sorted into some pigeonholes, and for all but `n > 0` pigeonholes the total weight of the pigeons
there is nonnegative, then for ... |
exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t)
(ht : #t • b < #s) : ∃ y ∈ t, b < #{x ∈ s | f x = y} := by
simp_rw [cast_card] at ht ⊢
exact exists_lt_sum_fiber_of_maps_to_of_nsmul_lt_sum hf ht | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to | The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at least as many pigeons as the ceiling of the average number of pigeons across all pigeonholes. |
exists_lt_card_fiber_of_mul_lt_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t)
(hn : #t * n < #s) : ∃ y ∈ t, n < #{x ∈ s | f x = y} :=
exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to hf hn | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_card_fiber_of_mul_lt_card_of_maps_to | The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at least as many pigeons as the ceiling of the average number of pigeons across all pigeonholes.
("The maximum is at least the mean" specialized to integers.)
More formally, given a function between finite sets `s` and `t` ... |
exists_card_fiber_lt_of_card_lt_nsmul (ht : #s < #t • b) :
∃ y ∈ t, #{x ∈ s | f x = y} < b := by
simp_rw [cast_card] at ht ⊢
exact
exists_sum_fiber_lt_of_sum_fiber_nonneg_of_sum_lt_nsmul
(fun _ _ => sum_nonneg fun _ _ => zero_le_one) ht | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_card_fiber_lt_of_card_lt_nsmul | The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at most as many pigeons as the floor of the average number of pigeons across all pigeonholes. |
exists_card_fiber_lt_of_card_lt_mul (hn : #s < #t * n) : ∃ y ∈ t, #{x ∈ s | f x = y} < n :=
exists_card_fiber_lt_of_card_lt_nsmul hn | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_card_fiber_lt_of_card_lt_mul | The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at most as many pigeons as the floor of the average number of pigeons across all pigeonholes. ("The
minimum is at most the mean" specialized to integers.)
More formally, given a function `f`, a finite sets `s` in its domai... |
exists_le_card_fiber_of_nsmul_le_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t) (ht : t.Nonempty)
(hb : #t • b ≤ #s) : ∃ y ∈ t, b ≤ #{x ∈ s | f x = y} := by
simp_rw [cast_card] at hb ⊢
exact exists_le_sum_fiber_of_maps_to_of_nsmul_le_sum hf ht hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_le_card_fiber_of_nsmul_le_card_of_maps_to | The pigeonhole principle for finitely many pigeons counted by heads: given a function between
finite sets `s` and `t` and a number `b` such that `#t • b ≤ #s`, there exists `y ∈ t` such
that its preimage in `s` has at least `b` elements.
See also `Finset.exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to` for a stronger ... |
exists_le_card_fiber_of_mul_le_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t) (ht : t.Nonempty)
(hn : #t * n ≤ #s) : ∃ y ∈ t, n ≤ #{x ∈ s | f x = y} :=
exists_le_card_fiber_of_nsmul_le_card_of_maps_to hf ht hn | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_le_card_fiber_of_mul_le_card_of_maps_to | The pigeonhole principle for finitely many pigeons counted by heads: given a function between
finite sets `s` and `t` and a natural number `b` such that `#t * n ≤ #s`, there exists
`y ∈ t` such that its preimage in `s` has at least `n` elements. See also
`Finset.exists_lt_card_fiber_of_mul_lt_card_of_maps_to` for a str... |
exists_card_fiber_le_of_card_le_nsmul (ht : t.Nonempty) (hb : #s ≤ #t • b) :
∃ y ∈ t, #{x ∈ s | f x = y} ≤ b := by
simp_rw [cast_card] at hb ⊢
refine
exists_sum_fiber_le_of_sum_fiber_nonneg_of_sum_le_nsmul
(fun _ _ => sum_nonneg fun _ _ => zero_le_one) ht hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_card_fiber_le_of_card_le_nsmul | The pigeonhole principle for finitely many pigeons counted by heads: given a function `f`, a
finite sets `s` and `t`, and a number `b` such that `#s ≤ #t • b`, there exists `y ∈ t` such
that its preimage in `s` has no more than `b` elements.
See also `Finset.exists_card_fiber_lt_of_card_lt_nsmul` for a stronger stateme... |
exists_card_fiber_le_of_card_le_mul (ht : t.Nonempty) (hn : #s ≤ #t * n) :
∃ y ∈ t, #{x ∈ s | f x = y} ≤ n :=
exists_card_fiber_le_of_card_le_nsmul ht hn | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_card_fiber_le_of_card_le_mul | The pigeonhole principle for finitely many pigeons counted by heads: given a function `f`, a
finite sets `s` in its domain, a finite set `t` in its codomain, and a natural number `n` such that
`#s ≤ #t * n`, there exists `y ∈ t` such that its preimage in `s` has no more than `n`
elements. See also `Finset.exists_card_f... |
exists_lt_sum_fiber_of_nsmul_lt_sum (hb : card β • b < ∑ x, w x) :
∃ y, b < ∑ x with f x = y, w x :=
let ⟨y, _, hy⟩ := exists_lt_sum_fiber_of_maps_to_of_nsmul_lt_sum (fun _ _ => mem_univ _) hb
⟨y, hy⟩ | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_sum_fiber_of_nsmul_lt_sum | The pigeonhole principle for finitely many pigeons of different weights, strict inequality
version: there is a pigeonhole with the total weight of pigeons in it greater than `b` provided that
the total number of pigeonholes times `b` is less than the total weight of all pigeons. |
exists_le_sum_fiber_of_nsmul_le_sum [Nonempty β] (hb : card β • b ≤ ∑ x, w x) :
∃ y, b ≤ ∑ x with f x = y, w x :=
let ⟨y, _, hy⟩ :=
exists_le_sum_fiber_of_maps_to_of_nsmul_le_sum (fun _ _ => mem_univ _) univ_nonempty hb
⟨y, hy⟩ | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_le_sum_fiber_of_nsmul_le_sum | The pigeonhole principle for finitely many pigeons of different weights, non-strict inequality
version: there is a pigeonhole with the total weight of pigeons in it greater than or equal to `b`
provided that the total number of pigeonholes times `b` is less than or equal to the total weight of
all pigeons. |
exists_sum_fiber_lt_of_sum_lt_nsmul (hb : ∑ x, w x < card β • b) :
∃ y, ∑ x with f x = y, w x < b :=
exists_lt_sum_fiber_of_nsmul_lt_sum (M := Mᵒᵈ) _ hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_lt_of_sum_lt_nsmul | The pigeonhole principle for finitely many pigeons of different weights, strict inequality
version: there is a pigeonhole with the total weight of pigeons in it less than `b` provided that
the total number of pigeonholes times `b` is greater than the total weight of all pigeons. |
exists_sum_fiber_le_of_sum_le_nsmul [Nonempty β] (hb : ∑ x, w x ≤ card β • b) :
∃ y, ∑ x with f x = y, w x ≤ b :=
exists_le_sum_fiber_of_nsmul_le_sum (M := Mᵒᵈ) _ hb | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_sum_fiber_le_of_sum_le_nsmul | The pigeonhole principle for finitely many pigeons of different weights, non-strict inequality
version: there is a pigeonhole with the total weight of pigeons in it less than or equal to `b`
provided that the total number of pigeonholes times `b` is greater than or equal to the total weight
of all pigeons. |
exists_lt_card_fiber_of_nsmul_lt_card (hb : card β • b < card α) :
∃ y : β, b < #{x | f x = y} :=
let ⟨y, _, h⟩ := exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to (fun _ _ => mem_univ _) hb
⟨y, h⟩ | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_card_fiber_of_nsmul_lt_card | The strong pigeonhole principle for finitely many pigeons and pigeonholes. There is a pigeonhole
with at least as many pigeons as the ceiling of the average number of pigeons across all
pigeonholes. |
exists_lt_card_fiber_of_mul_lt_card (hn : card β * n < card α) :
∃ y : β, n < #{x | f x = y} :=
exists_lt_card_fiber_of_nsmul_lt_card _ hn | theorem | Combinatorics | [
"Mathlib.Algebra.Module.BigOperators",
"Mathlib.Algebra.Order.Ring.Nat",
"Mathlib.Data.Nat.ModEq",
"Mathlib.Order.Preorder.Finite"
] | Mathlib/Combinatorics/Pigeonhole.lean | exists_lt_card_fiber_of_mul_lt_card | The strong pigeonhole principle for finitely many pigeons and pigeonholes.
There is a pigeonhole with at least as many pigeons as
the ceiling of the average number of pigeons across all pigeonholes.
("The maximum is at least the mean" specialized to integers.)
More formally, given a function `f` between finite types `... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.