APNOutputs/ErdosProblems/erdos_138.variants.difference.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: Google DeepMind published the AlphaProof Nexus proof artifacts. The pinned repository identifies the mathematical sources and collaborators, including OEIS, Erdős Problems, Gergely Bérczi, and Mario Krenn; those source records remain the authority for individual credit.
Project sources: Pinned AlphaProof Nexus results documentation, AlphaProof Nexus paper, Pinned human-written natural-language proof companions
29 declarations, 0 contain sorry, 0 declared as axioms
Imports (1)
FormalConjectures.Util.ProblemImports
- def
Erdos138.monoAP_guarantee_setInterval lengths that force a monochromatic arithmetic progression line 51 sourceSource documentation
The set of natural numbers that guarantee a monochromatic arithmetic progression.
A number
Nbelongs to this set if, for a given number of colorsrand an arithmetic progression lengthk, anyr-coloring of the integers{1, ..., N}must contain a monochromatic arithmetic progression of lengthk.L4DEL explanation
contains a monochromatic l-term arithmetic progression.
monoAP_guarantee_set r kcontains exactly those natural numbersNfor which everyr-colouring of{1,...,N}contains a monochromatic arithmetic progression of lengthk.- Membership is the forcing property itself; it does not yet choose the least such interval length.
- The colouring is represented as a function from
Finset.Icc 1 NtoFin r, so the domain and the number of colours are encoded in its type.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 162
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,SetProof uses:
setOf,Subtype,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,Fin,ContainsMonoAPofLength8 instances, coercions and auxiliary constants left out.
def monoAP_guarantee_set (r k : ℕ) : Set ℕ := …
- def
Erdos138.monoAPNumberThe least interval length that forces a monochromatic progression line 59 sourceSource documentation
The van der Waerden number, is the smallest integer
Nsuch that anyr-coloring of{1, ..., N}is guaranteed to contain a monochromatic arithmetic progression of lengthk. It is defined as the infimum of the (non-empty) set of all such numbersN.L4DEL explanation
The smallest N guaranteed by the theorem is often denoted by W(l, k) and called a van der Waerden number.
monoAPNumber r kis the infimum of the forcing set, hence the formal van der Waerden number forrcolours and progression lengthkonce that set is known to be nonempty.- The definition is noncomputable: it specifies the least forcing length mathematically rather than giving an algorithm for calculating it.
- Nonemptiness is not hidden in this definition;
W_is_nonemptyproves it later from van der Waerden's theorem through an ultrafilter compactness argument.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
InfSet.sInf, Erdos138.monoAP_guarantee_set1 instances, coercions and auxiliary constants left out.
noncomputable def monoAPNumber (r k : ℕ) : ℕ := sInf (monoAP_guarantee_set r k)
Mentions: Erdos138.monoAP_guarantee_set
- abbrev
Erdos138.WThe two-colour van der Waerden numberW(k)line 66 sourceSource documentation
An abbreviation for the van der Waerden number for 2 colors, commonly written as
W(k). This represents the smallest integerNsuch that any 2-coloring of{1, ..., N}must contain a monochromatic arithmetic progression of lengthk.L4DEL explanation
WabbreviatesmonoAPNumber 2, soW kis the least interval length that forces a monochromatick-term arithmetic progression under every red-blue colouring.- This is an abbreviation, not a new theorem: Lean unfolds it to the two-colour specialization of
monoAPNumberwhenever needed.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses: Erdos138.monoAPNumber,
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
noncomputable abbrev W : ℕ → ℕ := monoAPNumber 2 …
Mentions: Erdos138.monoAPNumber
- This is an abbreviation, not a new theorem: Lean unfolds it to the two-colour specialization of
- def
Erdos138.HasMonoAPAn explicit monochromatic arithmetic progression inside[1,N]line 103 sourceL4DEL explanation
An l-term arithmetic progression is a set of the form {a, a + d,..., a + (l − 1)d}.
HasMonoAP c N ksupplies a first termaand positive stepdsuch that allktermsa+m*dhave colourc a, start at or above 1, and end at or beforeN.- The endpoint bound is written
a+(k-1)*d≤N; the colour condition quantifies over every indexm<k. - This whole-number formulation is convenient for extending a colouring one integer at a time; two later bridge lemmas connect it to Mathlib's set-valued
ContainsMonoAPofLengthpredicate.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
no axioms what this means
Statement uses:
Nat,Fin,OfNat.ofNatProof uses:
Exists,And,GT.gt,GE.ge,LE.le,HAdd.hAdd,HMul.hMul,HSub.hSub,LT.lt,Eq10 instances, coercions and auxiliary constants left out.
def HasMonoAP (c : ℕ → Fin 2) (N k : ℕ) : Prop := …
- The endpoint bound is written
- lemma
Erdos138.ap_must_endAny newly created(k+1)-progression must end at the new point line 111 sourceL4DEL explanation
the (k + 1)-th element for both progressions lands exactly on M + 1
If the old colouring has no
(k+1)-term progression throughN+i, but assigning a colour atN+i+1creates one, that progression must useN+i+1as its last term.- If its endpoint were at most
N+i, every one of its terms would retain the old colour, contradicting the hypothesis that the old interval had no such progression. - Removing the final term leaves
kold points of the newly assigned colour, a structure used to compare the two blocked colour choices.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,Not, Erdos138.HasMonoAP,HAdd.hAdd,ite,Eq,Exists,And,GT.gt,GE.ge,HMul.hMul,LT.ltProof uses:
LE.le,HSub.hSub,Decidable.byContradiction,Eq.mp,congrArg,Exists.intro,Eq.mpr,id,Ne,Nat.mul_le_mul_right,Nat.le_add_right,if_neg,And.intro,Nat.mul_lt_mul_of_pos_right,Nat.mul_pos,if_pos,Eq.refl32 instances, coercions and auxiliary constants left out.
Tactic trace: 50 steps
Open to load the checked before-and-after goal states.
lemma ap_must_end (k i N : ℕ) (c : ℕ → Fin 2) (color : Fin 2) (h_no_ap_k1 : ¬ HasMonoAP c (N + i) (k + 1)) (h_has : HasMonoAP (fun x => if x = N + i + 1 then color else c x) (N + i + 1) (k + 1)) : ∃ a d, d > 0 ∧ a ≥ 1 ∧ a + k * d = N + i + 1 ∧ (∀ m < k, c (a + m * d) = color) := by …Mentions: Erdos138.HasMonoAP
- If its endpoint were at most
- lemma
Erdos138.extend_one_stepAt least one colour safely extends the progression-free interval line 161 sourceL4DEL explanation
both calculations land exactly on the positive integer M + 1 − dR dB
The only way this algorithm could result in an invalid coloring is if both choices are blocked
any two arithmetic progressions of length k and step size <k with the same start/end point must have at least one other point in common
While fewer than
knew points have been appended, a two-colouring with no oldk-progression and no current(k+1)-progression can always colour the next point without creating a(k+1)-progression.- If both colours were blocked,
ap_must_endwould produce a red and a bluek-term prefix ending at the same new point. - Each step size is at most
i; a larger step would put the entirek-term prefix inside the original interval and contradict the absence of an oldk-progression. - Stepping back
d₁places along the colour-0 progression andd₀places along the colour-1 progression reaches the same integerN+i+1-d₀d₁, forcing it to have both colours.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138, George Tsoukalas et al., AlphaProof Nexus paper, Erdős 138 appendix, Erdős Problems 138 discussion (Adam Zsolt Wagner and Thomas Bloom)
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,GT.gt,LT.lt,Not, Erdos138.HasMonoAP,HAdd.hAdd,Exists,ite,EqProof uses:
Decidable.byContradiction,Eq.mp,Eq.trans,binderNameHint,forall_congr,And,GE.ge,HMul.hMul, Erdos138.ap_must_end,False,LE.le,HSub.hSub,Nat.sub_mul,Nat.one_mul,congrArg,Eq.mpr,id,Nat.mul_le_mul_right,Exists.intro,Eq.refland 6 more46 instances, coercions and auxiliary constants left out.
Tactic trace: 94 steps
Open to load the checked before-and-after goal states.
lemma extend_one_step (k i N : ℕ) (c : ℕ → Fin 2) (hk : k > 0) (hi : i < k) (h_no_ap_k : ¬ HasMonoAP c N k) (h_no_ap_k1 : ¬ HasMonoAP c (N + i) (k + 1)) : ∃ color : Fin 2, ¬ HasMonoAP (fun x => if x = N + i + 1 then color else c x) (N + i + 1) (k + 1) := by …
Mentions: Erdos138.HasMonoAP
- If both colours were blocked,
- lemma
Erdos138.has_mono_ap_extThe progression predicate depends only on colours inside[1,N]line 258 sourceL4DEL explanation
a k-colouring of a set A is any function c : A → B
If two total colourings agree at every positive integer at most
N, then either both contain a monochromatick-term progression inside that interval or neither does.- The endpoint inequality places the first term and every indexed term within the agreement range, so the same witnesses
a,dtransfer in both directions.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 162
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,LE.le,GE.ge,Eq,Iff, Erdos138.HasMonoAPProof uses:
Iff.intro,Exists,And,GT.gt,HAdd.hAdd,HMul.hMul,HSub.hSub,LT.lt,Exists.intro,And.intro,Decidable.byContradiction,Not,Nat.mul_le_mul_right,Eq.mpr,id,congrArg,Eq.symm18 instances, coercions and auxiliary constants left out.
Tactic trace: 33 steps
Open to load the checked before-and-after goal states.
lemma has_mono_ap_ext (c1 c2 : ℕ → Fin 2) (N k : ℕ) (h_eq : ∀ x ≤ N, x ≥ 1 → c1 x = c2 x) : HasMonoAP c1 N k ↔ HasMonoAP c2 N k := by …
Mentions: Erdos138.HasMonoAP
- The endpoint inequality places the first term and every indexed term within the agreement range, so the same witnesses
- lemma
Erdos138.extend_j_stepsIterating the safe extension for up toknew points line 287 sourceL4DEL explanation
we can extend it by k further elements without creating a monochromatic (k + 1)-AP
From a colouring of
[1,N]with no monochromatick-term progression, the lemma constructs a colouring throughN+j, for everyj≤k, with no monochromatic(k+1)-term progression and with all original colours preserved.- At
j=0, any(k+1)-progression would already contain a forbiddenk-term prefix. - The successor case first transfers the old
k-progression-free property to the current extension, then invokesextend_one_stepand proves the new assignment does not alter positions at mostN.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,GT.gt,LE.le,Not, Erdos138.HasMonoAP,Exists,And,Eq,HAdd.hAddProof uses:
Nat.recAux,Exists.intro,And.intro,rfl,id,GE.ge,HMul.hMul,HSub.hSub,LT.lt,False,Decidable.byContradiction,Nat.mul_le_mul_right,Eq.mp,congrArg,Eq.mpr,Eq.symm,propext, Erdos138.has_mono_ap_ext,ite, Erdos138.extend_one_step and 2 more28 instances, coercions and auxiliary constants left out.
Tactic trace: 50 steps
Open to load the checked before-and-after goal states.
lemma extend_j_steps (k N j : ℕ) (c : ℕ → Fin 2) (hk : k > 0) (hj : j ≤ k) (h_no_ap_k : ¬ HasMonoAP c N k) : ∃ c' : ℕ → Fin 2, (∀ x ≤ N, c' x = c x) ∧ ¬ HasMonoAP c' (N + j) (k + 1) := by …
Mentions: Erdos138.HasMonoAP
- At
- def
Erdos138.extend_coloringExtend a finite interval colouring to every natural number line 335 sourceL4DEL explanation
extend_coloring N cagrees with the subtype-valued colouringcon{1,...,N}and assigns colour0everywhere outside that interval.- The arbitrary outside value is bookkeeping only: every later use proves that the progression under discussion lies in the original interval.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 162
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Subtype,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,FinProof uses:
dite,Subtype.mk,Not15 instances, coercions and auxiliary constants left out.
def extend_coloring (N : ℕ) (c : Finset.Icc 1 N → Fin 2) : ℕ → Fin 2 := …
- def
Erdos138.ap_equivIndexing a positive-step arithmetic progression byFin kline 338 sourceL4DEL explanation
For
d>0, the mapm ↦ a+m*dis an equivalence from thekindices to the set of the firstkterms of the arithmetic progression.- The inverse recovers the index as
(x-a)/d; positivity ofdmakes multiplication injective and validates the division identities.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Equiv,Fin,setOf,Exists,And,LT.lt,Eq,HAdd.hAdd,HMul.hMulProof uses:
Equiv.mk,Subtype.mk,Membership.mem,Set,Fin.mk,HDiv.hDiv,HSub.hSub25 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
def ap_equiv (a d k : ℕ) (hd : d > 0) : Fin k ≃ { x : ℕ | ∃ m < k, x = a + m * d } where … - The inverse recovers the index as
- lemma
Erdos138.card_ap_eq_kA positive-stepk-term progression has exactlykelements line 365 sourceL4DEL explanation
The underlying set
{a+m*d | m<k}has extended-natural cardinalitykwheneverd>0andk>0.- The proof transports the known cardinality of
Fin kacrossap_equiv; no separate counting or no-duplication argument is needed.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Eq,ENat,ENat.card,setOf,Exists,And,LT.lt,HAdd.hAdd,HMul.hMulProof uses:
Equiv,Fin, Erdos138.ap_equiv,Eq.mpr,id,congrArg,Eq.symm,ENat.card_congr,Eq.trans,Fintype.card,ENat.card_eq_coe_fintype_card,of_eq_true,True,Fintype.card_fin,eq_self19 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma card_ap_eq_k (a d k : ℕ) (hd : d > 0) (hk : k > 0) : ENat.card ↑{ x : ℕ | ∃ m < k, x = a + m * d } = k := by … - The proof transports the known cardinality of
- lemma
Erdos138.card_ap_pos_dMore than one progression term forces a positive step line 371 sourceL4DEL explanation
If
k>1and the set{a+m*d | m<k}really has cardinalityk, thendcannot be zero.- With
d=0every indexed term collapses toa, making the set a singleton and contradictingk>1.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Eq,ENat,ENat.card,setOf,Exists,And,LT.lt,HAdd.hAdd,HMul.hMulProof uses:
Decidable.byContradiction,Not,Set,Singleton.singleton,Set.ext,Eq.mpr,Iff,Membership.mem,id,congrArg,Iff.intro,Eq.symm,Exists.intro,And.intro,Set.encard_singleton,Eq.refl,Iff.mp,WithTop,WithTop.coe_inj39 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
lemma card_ap_pos_d (a d k : ℕ) (hk : k > 1) (h_card : ENat.card ↑{ x : ℕ | ∃ m < k, x = a + m * d } = k) : d > 0 := by … - With
- lemma
Erdos138.contains_mono_ap_impConvert Mathlib's set-valued progression witness toHasMonoAPline 395 sourceL4DEL explanation
A monochromatic arithmetic-progression subset of
Finset.Icc 1 Nyields explicit natural-number witnessesa,dsatisfyingHasMonoAPfor the extended colouring.- The proof identifies the coerced subtype set with
{a+m*d | m<k}and transports its cardinality. - For
k=1it may choose step1; fork>1,card_ap_pos_drecovers the strictly positive step required byHasMonoAP.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Subtype,Membership.mem,Finset,Finset.Icc,Fin,ContainsMonoAPofLength, Erdos138.HasMonoAP, Erdos138.extend_coloringProof uses:
Exists,Set,And,Set.IsAPOfLength,Set.image,ENat,Eq,Set.IsAPOfLengthWith,ENat.card,setOf,LT.lt,HAdd.hAdd,HSMul.hSMul,HMul.hMul,rfl,Eq.mpr,id,congrArg,Set.ext,Iffand 25 more88 instances, coercions and auxiliary constants left out.
Tactic trace: 124 steps
Open to load the checked before-and-after goal states.
lemma contains_mono_ap_imp (N k : ℕ) (hk : k > 0) (c : Finset.Icc 1 N → Fin 2) (h : ContainsMonoAPofLength c k) : HasMonoAP (extend_coloring N c) N k := by …
Mentions: Erdos138.HasMonoAP, Erdos138.extend_coloring
- The proof identifies the coerced subtype set with
- lemma
Erdos138.imp_contains_mono_apConvertHasMonoAPback to Mathlib's interval predicate line 507 sourceL4DEL explanation
Explicit witnesses
a,dfor a monochromatic progression inside[1,N]define the required progression subset of the interval subtype.- The endpoint bound proves every term lies in
Finset.Icc 1 N;card_ap_eq_ksupplies the exact size, and the original colour equation supplies monochromaticity.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Fin, Erdos138.HasMonoAP,ContainsMonoAPofLength,Finset,Finset.Icc,Subtype,Membership.memProof uses:
Exists,And,GE.ge,LE.le,HAdd.hAdd,HMul.hMul,HSub.hSub,LT.lt,Eq,id,Exists.intro,Set,Set.IsAPOfLength,Set.image,ENat,setOf,HasSubset.Subset,Eq.mpr,congrArg,propextand 28 more70 instances, coercions and auxiliary constants left out.
Tactic trace: 68 steps
Open to load the checked before-and-after goal states.
lemma imp_contains_mono_ap (N k : ℕ) (hk : k > 0) (c : ℕ → Fin 2) (h : HasMonoAP c N k) : ContainsMonoAPofLength (fun (x : Finset.Icc 1 N) => c x.1) k := by …
Mentions: Erdos138.HasMonoAP
- The endpoint bound proves every term lies in
- lemma
Erdos138.not_guarantee_extendA countercolouring forkextends to one fork+1line 566 sourceL4DEL explanation
Given a 2-coloring of the first W(k) − 1 integers without a monochromatic k-AP
If some two-colouring of
{1,...,N}avoids everyk-term progression, then some two-colouring of{1,...,N+k}avoids every(k+1)-term progression.- Extend the finite colouring to all naturals, apply
extend_j_stepswithj=k, and translate the resulting explicit predicate back toContainsMonoAPofLengthonly to contradict it.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Not,Membership.mem,Set, Erdos138.monoAP_guarantee_set,HAdd.hAddProof uses:
Subtype,Finset,Finset.Icc,Fin,ContainsMonoAPofLength,Exists,Eq.mp,setOf, Erdos138.HasMonoAP, Erdos138.extend_coloring, Erdos138.imp_contains_mono_ap,Eq,funext,Fin.ext,id,Subtype.property,Eq.mpr,dite,Subtype.mk,congrArgand 14 more35 instances, coercions and auxiliary constants left out.
Tactic trace: 34 steps
Open to load the checked before-and-after goal states.
lemma not_guarantee_extend (k N : ℕ) (hk : k > 0) : N ∉ monoAP_guarantee_set 2 k → (N + k) ∉ monoAP_guarantee_set 2 (k + 1) := by …Mentions: Erdos138.monoAP_guarantee_set
- Extend the finite colouring to all naturals, apply
- lemma
Erdos138.not_in_set_of_lt_sInfNothing below a natural-number infimum belongs to the set line 601 sourceL4DEL explanation
For any set of naturals
s, ifn<sInf s, thenn∉s.- Membership would imply
sInf s≤nby the defining lower-bound property of the infimum, contradicting the strict inequality.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Set,Nat,LT.lt,InfSet.sInf,Not,Membership.memProof uses:
LE.le,csInf_le,OrderBot.bddBelow13 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma not_in_set_of_lt_sInf {s : Set ℕ} {n : ℕ} (h : n < sInf s) : n ∉ s := by … - Membership would imply
- def
Erdos138.U_limit_colorThe ultrafilter-limit colour at one integer line 607 sourceL4DEL explanation
Given a sequence of two-colourings
C n,U_limit_color C U xchooses colour0when the indices assigning0toxare large inU, and otherwise chooses colour1.- This is a proof-oriented compactness construction in the Lean file, not a step stated in the one-page human-written companion.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,UltrafilterProof uses:
ite,Membership.mem,Set,setOf,Eq6 instances, coercions and auxiliary constants left out.
noncomputable def U_limit_color (C : ℕ → ℕ → Fin 2) (U : Ultrafilter ℕ) (x : ℕ) : Fin 2 := …
- lemma
Erdos138.U_limit_color_memThe chosen limit colour occurs on aU-large set of indices line 610 sourceL4DEL explanation
For each position
x, the indicesnsatisfyingC n x = U_limit_color C U xbelong to the ultrafilter.- If the colour-0 fibre is not in
U, ultrafilter maximality puts its complement inU; becauseFin 2has only two values, that complement is exactly the colour-1 fibre.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,Ultrafilter,Membership.mem,Set,setOf,Eq, Erdos138.U_limit_colorProof uses:
id,dite,ite,Eq.mpr,congrArg,if_pos,Not,if_neg,Compl.compl,Union.union,Set.univ,Set.union_compl_self,Filter.univ_mem,Or,Iff.mp,Ultrafilter.union_mem_iff,Eq.mp,Eq.symm,Or.inl,False.elimand 14 more22 instances, coercions and auxiliary constants left out.
Tactic trace: 45 steps
Open to load the checked before-and-after goal states.
lemma U_limit_color_mem (C : ℕ → ℕ → Fin 2) (U : Ultrafilter ℕ) (x : ℕ) : {n | C n x = U_limit_color C U x} ∈ U := by …Mentions: Erdos138.U_limit_color
- If the colour-0 fibre is not in
- lemma
Erdos138.U_inter_memFinitely many progression positions agree with the limit colouring together line 645 sourceL4DEL explanation
For fixed
a,b,k, the indices whose colourings agree with the ultrafilter-limit colouring at every pointa*s+bfors<kform a set inU.- Induction on
kreduces the claim to closure of a filter under finite intersections.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,OfNat.ofNat,Ultrafilter,Membership.mem,Set,setOf,LT.lt,Eq,HAdd.hAdd,HMul.hMul, Erdos138.U_limit_colorProof uses:
Nat.recAux,Set.univ,Set.ext,Eq.mpr,Iff,id,Eq.trans,True,congrArg,iff_true,Decidable.byContradiction,Not,Filter.univ_mem, Erdos138.U_limit_color_mem,Filter,Inter.inter,Filter.inter_mem,And,Iff.intro,Orand 2 more31 instances, coercions and auxiliary constants left out.
Tactic trace: 35 steps
Open to load the checked before-and-after goal states.
lemma U_inter_mem (C : ℕ → ℕ → Fin 2) (U : Ultrafilter ℕ) (a b k : ℕ) : {n | ∀ s < k, C n (a * s + b) = U_limit_color C U (a * s + b)} ∈ U := by …Mentions: Erdos138.U_limit_color
- Induction on
- lemma
Erdos138.U_atTop_mem_largeAU-large set contains arbitrarily large indices line 676 sourceL4DEL explanation
When the ultrafilter lies above
atTop, every set in it meets every tail{n | n≥M}.- Intersect the given set with the tail inside
U; a member of an ultrafilter is nonempty, so the intersection supplies an index at leastM.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Ultrafilter,Nat,LE.le,Filter,Filter.atTop,Set,Membership.mem,Exists,And,GE.geProof uses:
setOf,Iff.mpr,Filter.mem_atTop_sets,Exists.intro,Inter.inter,Filter.inter_mem,Set.Nonempty,Ultrafilter.nonempty_of_mem,And.intro,And.left,And.right29 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma U_atTop_mem_large (U : Ultrafilter ℕ) (h_le : ↑U ≤ (Filter.atTop : Filter ℕ)) (s : Set ℕ) (hs : s ∈ U) (M : ℕ) : ∃ n ∈ s, n ≥ M := by …
- Intersect the given set with the tail inside
- lemma
Erdos138.W_is_nonemptyVan der Waerden forcing lengths exist for every progression length line 685 sourceL4DEL explanation
follows van der Waerden’s original idea to establish the existence of W(l, k) by using double induction.
proved that there is a smallest integer f (n)
For every
k, some finiteNforces a monochromatick-term progression under every two-colouring, so the set whose infimum definesW kis nonempty.- For
k=0the empty progression is immediate. Otherwise, assume countercolourings exist for every finiteN, extend them to all naturals, and take an ultrafilter-limit colouring. - Mathlib's infinite van der Waerden theorem gives a monochromatic homothetic copy in the limit colouring. Finite intersection and an arbitrarily large matching index transfer that progression back to one of the alleged countercolourings.
- Blondal and Jungić describe van der Waerden's original double-induction proof of existence; the Lean declaration instead uses this ultrafilter compactness route. The sources support the theorem, not an identity of proofs.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163, Paul Erdős, On the combinatorial problems which I would most like to see solved (1981), p. 5
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Set.Nonempty, Erdos138.monoAP_guarantee_set,OfNat.ofNatProof uses:
dite,Eq,Exists.intro,Membership.mem,Set,Subtype,Finset,Finset.Icc,Fin,id,ContainsMonoAPofLength,Exists,And,Set.IsAPOfLength,Set.image,ENat,Set.IsAPOfLengthWith,ENat.card,setOf,LT.ltand 66 more105 instances, coercions and auxiliary constants left out.
Tactic trace: 102 steps
Open to load the checked before-and-after goal states.
lemma W_is_nonempty (k : ℕ) : (monoAP_guarantee_set 2 k).Nonempty := by …
Mentions: Erdos138.monoAP_guarantee_set
- For
- lemma
Erdos138.Icc_subset_succThe interval[1,N]sits inside[1,N+1]line 787 sourceL4DEL explanation
Any natural number between
1andNis also between1andN+1.- This small coercion lemma lets the proof restrict a colouring of the larger interval to the smaller subtype without changing its values.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,HAdd.hAddProof uses:
Eq.mpr,And,LE.le,id,Eq,congrArg,propext,Finset.mem_Icc,Decidable.byContradiction,Not,Eq.mp16 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma Icc_subset_succ (N x : ℕ) (hx : x ∈ Finset.Icc 1 N) : x ∈ Finset.Icc 1 (N + 1) := by …
- lemma
Erdos138.guarantee_upward_closedOnce an interval length guarantees a progression, every larger one does line 791 sourceL4DEL explanation
If every
r-colouring of{1,...,N}contains a monochromatick-term progression, then the same is true for{1,...,N+1}.- Restrict an arbitrary colouring of the larger interval to the first
Npoints, obtain the progression there, and lift its subtype-valued set back into the larger interval.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Set, Erdos138.monoAP_guarantee_set,HAdd.hAdd,OfNat.ofNatProof uses:
Subtype,Finset,Finset.Icc,Fin,Subtype.mk, Erdos138.Icc_subset_succ,Subtype.property,ContainsMonoAPofLength,id,Exists,And,Set.IsAPOfLength,Set.image,ENat,Eq,setOf,Exists.intro,And.intro,Set.IsAPOfLengthWith,ENat.cardand 11 more40 instances, coercions and auxiliary constants left out.
Tactic trace: 55 steps
Open to load the checked before-and-after goal states.
lemma guarantee_upward_closed (k r N : ℕ) : N ∈ monoAP_guarantee_set r k → (N + 1) ∈ monoAP_guarantee_set r k := by …Mentions: Erdos138.monoAP_guarantee_set
- Restrict an arbitrary colouring of the larger interval to the first
- lemma
Erdos138.not_in_guarantee_lt_sInfA non-guaranteeing length lies below the van der Waerden number line 841 sourceL4DEL explanation
If
Ndoes not force a two-colourk-term progression, thenN<W k.W_is_nonemptymakes the infimum a genuine minimum, whileguarantee_upward_closedshows every number at or above that minimum belongs to the forcing set.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Blondal and Jungić, Proof of van der Waerden's Theorem in Nine Figures (2018), p. 163
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Membership.mem,Set, Erdos138.monoAP_guarantee_set,OfNat.ofNat,LT.lt, Erdos138.WProof uses:
Set.Nonempty, Erdos138.W_is_nonempty,Nat.sInf_mem,Decidable.byContradiction,Exists,Eq,HAdd.hAdd,Exists.intro,HSub.hSub,Eq.symm,Nat.add_sub_of_le,Eq.mp,LE.le,False,Nat.recAux,Nat.succ,Eq.mpr,id,congrArg, Erdos138.guarantee_upward_closed20 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
lemma not_in_guarantee_lt_sInf (k N : ℕ) (hN : N ∉ monoAP_guarantee_set 2 k) : N < W k := by …Mentions: Erdos138.monoAP_guarantee_set, Erdos138.W
- lemma
Erdos138.W_not_guaranteeOne less than a positive van der Waerden number is a counterexample length line 859 sourceL4DEL explanation
When
W k≠0, minimality givesW k-1∉monoAP_guarantee_set 2 k.- Natural-number arithmetic gives
W k-1<W k;not_in_set_of_lt_sInfthen excludes membership in the forcing set.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne, Erdos138.W,OfNat.ofNat,Not,Membership.mem,Set, Erdos138.monoAP_guarantee_set,HSub.hSubProof uses: Erdos138.not_in_set_of_lt_sInf,
id,LT.lt,InfSet.sInf,Decidable.byContradiction11 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma W_not_guarantee (k : ℕ) (hW : W k ≠ 0) : W k - 1 ∉ monoAP_guarantee_set 2 k := by …
Mentions: Erdos138.W, Erdos138.monoAP_guarantee_set
- Natural-number arithmetic gives
- lemma
Erdos138.W_diff_bound_gt0The quantitative gap bound whenW(k)is positive line 864 sourceL4DEL explanation
We will show that W(k + 1) ≥ W(k) + k
For
k>0andW k≠0, the proof establishesW(k+1)-W(k)≥k.- Minimality supplies a
k-progression-free colouring throughW k-1;not_guarantee_extendextends it through(W k-1)+kwithout a(k+1)-progression. - That extended counterexample lies strictly below
W(k+1), and natural-number arithmetic rearranges the inequality into the desired difference bound.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GT.gt,OfNat.ofNat,Ne, Erdos138.W,GE.ge,HSub.hSub,HAdd.hAddProof uses:
Not,Membership.mem,Set, Erdos138.monoAP_guarantee_set, Erdos138.W_not_guarantee, Erdos138.not_guarantee_extend,LT.lt, Erdos138.not_in_guarantee_lt_sInf,Decidable.byContradiction17 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma W_diff_bound_gt0 (k : ℕ) (hk : k > 0) (hW : W k ≠ 0) : W (k + 1) - W k ≥ k := by …
Mentions: Erdos138.W
- Minimality supplies a
- lemma
Erdos138.W_diff_ge_kThe gap bound for every naturalkline 870 sourceL4DEL explanation
For all natural numbers
k,W(k+1)-W(k)≥k, including the edge cases introduced by the natural-number encoding.- The case
k=0is immediate. Ifk>0butW k=0, the proof first shows that the empty interval cannot force a positive-length progression and extends that counterexample. - When
W k≠0, the result is exactlyW_diff_bound_gt0.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, Human-written proof companion for Erdős 138
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GE.ge,HSub.hSub, Erdos138.W,HAdd.hAdd,OfNat.ofNatProof uses:
dite,Eq,Decidable.byContradiction,Not,Eq.symm,Membership.mem,Set, Erdos138.monoAP_guarantee_set,Subtype,Finset,Finset.Icc,Fin,ContainsMonoAPofLength,Exists,And,Set.IsAPOfLength,Set.image,ENat,False,Set.IsAPOfLengthWithand 19 more58 instances, coercions and auxiliary constants left out.
Tactic trace: 32 steps
Open to load the checked before-and-after goal states.
lemma W_diff_ge_k (k : ℕ) : W (k + 1) - W k ≥ k := by …
Mentions: Erdos138.W
- The case
- lemma
Erdos138.W_diff_ge_k_allThe pointwise lower bound used to prove divergence line 898 sourceL4DEL explanation
the obvious generalization of this argument gives W(k + 1, l + 1) ≥ W(k, l) + min(k, l)
This wrapper presents the uniform inequality
k≤W(k+1)-W(k)in the orientation expected byFilter.tendsto_atTop_mono.- At zero the bound is trivial; at a successor it invokes
W_diff_ge_kwith the positive index. - The AlphaProof Nexus paper also records Thomas Bloom's off-diagonal generalization; that is linked as context, not claimed by this Lean declaration.
Sources and attribution: Pinned Lean source (0647711a7118), Pinned AlphaProof Nexus Lean proof for Erdős 138, George Tsoukalas et al., AlphaProof Nexus paper, Erdős 138 appendix
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,GE.ge,HSub.hSub, Erdos138.W,HAdd.hAdd,OfNat.ofNatProof uses:
Nat.casesAuxOn,Eq,Nat.zero_le,Eq.symm, Erdos138.W_diff_ge_k,Eq.refl13 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma W_diff_ge_k_all (k : ℕ) : W (k + 1) - W k ≥ k := by …
Mentions: Erdos138.W
- At zero the bound is trivial; at a successor it invokes
- theorem
Erdos138.target_theorem_0Erdős problem 138: consecutive van der Waerden numbers separate without bound line 906 sourceL4DEL explanation
We will show that W(k + 1) ≥ W(k) + k
We will show that W(k + 1) ≥ W(k) + k
Can one at least prove that f(n + 1) − f(n) → ∞?
Whatever one makes explicit and draws is much easier to remember and to reproduce than mere thoughts
The argument is rather simple, once one knows what the right thing to prove is.
For the two-colour van der Waerden number
W(k), the differenceW(k+1)-W(k)tends to infinity. The proof establishes the explicit lower boundW(k+1) ≥ W(k)+k, which immediately forces the differences upward.- Begin with a two-colouring of
[1,W(k)-1]containing no monochromatick-term arithmetic progression. - Greedily colour
kmore integers; if both colours were blocked at one step, two terminal progressions would force one earlier point to have both colours. - Hence a colouring without a monochromatic
(k+1)-term progression exists throughW(k)+k-1, proving the bound. - The Lean file separately proves that every
W(k)exists, using an ultrafilter limit and Mathlib's infinite van der Waerden theorem; the one-page companion states the greedy difference argument rather than that compactness implementation. - Erdős's 1981 source asks both a quotient question and this weaker difference question. This theorem resolves only the difference variant; it does not claim that
W(k+1)/W(k)→∞or settle the stronger growth problem. - Formally the statement is
answer(True) ↔ Tendsto ...; the reverse implication is trivial because the recorded answer is alreadyTrue, while the forward implication uses the quantitative bound.
Sources and attribution: Pinned Lean source (0647711a7118), Human-written proof companion for Erdős 138, Erdős Problems 138 source record, George Tsoukalas et al., AlphaProof Nexus paper, Erdős 138 appendix, Paul Erdős, On the combinatorial problems which I would most like to see solved (1981), p. 6, Bartel van der Waerden's 1971 recollection, reproduced by Blondal and Jungić (2018), p. 162, Erdős Problems 138 discussion (Adam Zsolt Wagner and Thomas Bloom)
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Iff,True,Filter.Tendsto,Nat,HSub.hSub, Erdos138.W,HAdd.hAdd,OfNat.ofNat,Filter.atTopProof uses:
Iff.intro,Filter.tendsto_atTop_mono, Erdos138.W_diff_ge_k_all,Filter.tendsto_id,True.intro12 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
theorem target_theorem_0 : answer( -- EVOLVE-VALUE-START True -- EVOLVE-VALUE-END ) ↔ atTop.Tendsto (fun k => (W (k + 1) - W k)) atTop := by …
Mentions: Erdos138.W
- Begin with a two-colouring of