FormalConjecturesForMathlib/Combinatorics/Ramsey/Diagonal.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: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
12 declarations, 0 contain sorry, 0 declared as axioms
Erdős–Szekeres 1935 upper bound for the diagonal Ramsey number
Statement (Erdős–Szekeres 1935): For every k : ℕ, the diagonal Ramsey number satisfies
Combinatorics.hypergraphRamsey 2 k ≤ 4 ^ k.
Proof sketch. Use the symmetric recursion R(s, t) ≤ R(s-1, t) + R(s, t-1) with base
cases R(0, t) = R(s, 0) = 1. Induction on s + t then gives R(s, t) ≤ C(s+t, s); for
s = t = k this is R(k, k) ≤ C(2k, k) ≤ 4 ^ k (the Catalan-like central binomial
coefficient bound).
The whole argument is phrased directly on the Mathlib-style coloring data
c : Finset (Fin m) → Bool of 2-element subsets — no auxiliary "edge colouring" structure
is introduced.
Reference: [ES35] Erdős, P. and Szekeres, G. (1935). "A combinatorial problem in geometry." Compositio Math. 2, pp. 463–470.
Imported by 1 file
- def
Combinatorics.Diagonal.HasRamseyPropertyDocumented declaration: HasRamseyProperty line 61 sourceSource documentation
HasRamseyProperty N s tasserts: for everym, every coloringc : Finset (Fin m) → Bool, and everyV : Finset (Fin m)withV.card ≥ N, the subsetVcontains either a subset of sizeswhose 2-element subsets are allfalse-coloured, or a subset of sizetwhose 2-element subsets are alltrue-coloured.This is the "off-diagonal Ramsey number does not exceed
N" form of the classical Erdős–Szekeres Ramsey recurrence, packaged in the same shape used byCombinatorics.hypergraphRamsey.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Finset,Fin,Bool,LE.le,Finset.card,Or,Exists,And,Eq,OfNat.ofNat,Bool.false,Bool.true5 instances, coercions and auxiliary constants left out.
def HasRamseyProperty (N s t : ℕ) : Prop := …
- lemma
Combinatorics.Diagonal.HasRamseyProperty.monoMonotonicity line 67 sourceSource documentation
Monotonicity. If
N ≤ N'thenHasRamseyProperty N s t → HasRamseyProperty N' s t.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le, Combinatorics.Diagonal.HasRamseyPropertyProof uses:
Finset,Fin,Bool,Finset.card,LE.le.trans3 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma HasRamseyProperty.mono {N N' s t : ℕ} (hNN' : N ≤ N') (h : HasRamseyProperty N s t) : HasRamseyProperty N' s t := by …Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.hasRamseyProperty_zero_leftBase cases = 0line 73 sourceSource documentation
Base case
s = 0. AnyVcontains an emptyfalse-monochromatic set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,OfNat.ofNatProof uses:
Finset,Fin,Bool,LE.le,Finset.card,Or.inl,Exists,And,Eq,Bool.false,Bool.true,Exists.intro,EmptyCollection.emptyCollection,And.intro,Finset.empty_subset,of_eq_true,eq_self,Iff.mp,Finset.subset_empty,False.elimand 5 more12 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma hasRamseyProperty_zero_left (N t : ℕ) : HasRamseyProperty N 0 t := by …
Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.hasRamseyProperty_zero_rightBase caset = 0line 82 sourceSource documentation
Base case
t = 0. AnyVcontains an emptytrue-monochromatic set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,OfNat.ofNatProof uses:
Finset,Fin,Bool,LE.le,Finset.card,Or.inr,Exists,And,Eq,Bool.false,Bool.true,Exists.intro,EmptyCollection.emptyCollection,And.intro,Finset.empty_subset,of_eq_true,eq_self,Iff.mp,Finset.subset_empty,False.elimand 5 more12 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma hasRamseyProperty_zero_right (N s : ℕ) : HasRamseyProperty N s 0 := by …
Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.forall_two_subset_singletonA singleton has no 2-element subsets, hence is monochromatic of any colour line 90 sourceSource documentation
A singleton has no 2-element subsets, hence is monochromatic of any colour.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Bool,Finset,LE.le,Singleton.singleton,Eq,Finset.card,OfNat.ofNatProof uses:
Finset.card_le_card,Eq.mpr,id,Eq.mp,congrArg,Finset.card_singleton,Decidable.byContradiction,Not14 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma forall_two_subset_singleton {m : ℕ} (v : Fin m) (b : Bool) (c : Finset (Fin m) → Bool) : ∀ e ⊆ ({v} : Finset (Fin m)), e.card = 2 → c e = b := by …Mentions: c
- lemma
Combinatorics.Diagonal.hasRamseyProperty_one_leftBase cases = 1line 101 sourceSource documentation
Base case
s = 1. Any nonemptyVcontains a singletonfalse-monochromatic set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,OfNat.ofNatProof uses:
Finset,Fin,Bool,LE.le,Finset.card,Membership.mem,Finset.Nonempty,Or,Exists,And,Eq,Bool.false,Bool.true,Iff.mp,LT.lt,Finset.card_pos,Decidable.byContradiction,Not,Or.inl,Exists.introand 12 more14 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma hasRamseyProperty_one_left (t : ℕ) : HasRamseyProperty 1 1 t := by …
Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.hasRamseyProperty_one_rightBase caset = 1line 108 sourceSource documentation
Base case
t = 1. Any nonemptyVcontains a singletontrue-monochromatic set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,OfNat.ofNatProof uses:
Finset,Fin,Bool,LE.le,Finset.card,Membership.mem,Finset.Nonempty,Or,Exists,And,Eq,Bool.false,Bool.true,Iff.mp,LT.lt,Finset.card_pos,Decidable.byContradiction,Not,Or.inr,Exists.introand 12 more14 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma hasRamseyProperty_one_right (s : ℕ) : HasRamseyProperty 1 s 1 := by …
Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.card_false_true_splitPigeonhole step: splittingV \ {v}by colour line 117 sourceSource documentation
Pigeonhole step: splitting
V \ {v}by colour. For any vertexv ∈ V, the setV.erase vpartitions intofalse-neighbours ofvandtrue-neighbours ofv, and the cardinalities sum toV.card - 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Fin,Bool,Membership.mem,Eq,HAdd.hAdd,Finset.card,Finset.filter,Insert.insert,Singleton.singleton,Bool.false,Finset.erase,Bool.true,HSub.hSub,OfNat.ofNatProof uses:
Not,Finset.card_filter_add_card_filter_not,Iff,of_eq_true,Eq.trans,False,True,congr,congrArg,eq_self,not_true_eq_false,Bool.false_eq_true,iff_self,Eq.symm,Bool.true_eq_false,not_false_eq_true,Eq.refl,Eq.rec,Finset.ext,Eq.mprand 4 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
lemma card_false_true_split {m : ℕ} (c : Finset (Fin m) → Bool) (V : Finset (Fin m)) {v : Fin m} (hv : v ∈ V) : ((V.erase v).filter (fun u => c {v, u} = false)).card + ((V.erase v).filter (fun u => c {v, u} = true)).card = V.card - 1 := by …Mentions: c
- lemma
Combinatorics.Diagonal.mono_insertExtending ab-monochromatic cliqueSby a vertexvthat isb-adjacent to every element ofSline 142 sourceSource documentation
Extending a
b-monochromatic cliqueSby a vertexvthat isb-adjacent to every element ofS. Parameterised over the colourb : Bool, this covers both thefalseandtrueextension steps used inHasRamseyProperty.step.private lemma mono_insert {m : ℕ} {c : Finset (Fin m) → Bool} {b : Bool} {S : Finset (Fin m)} (hSmono : ∀ e ⊆ S, e.card = 2 → c e = b) {v : Fin m} (hvAdj : ∀ u ∈ S, c {v, u} = b) : ∀ e ⊆ insert v S, e.card = 2 → c e = b := by …Mentions: c
- lemma
Combinatorics.Diagonal.HasRamseyProperty.stepRecurrence line 180 sourceSource documentation
Recurrence. If
HasRamseyProperty Ns s (t+1)andHasRamseyProperty Nt (s+1) thold, thenHasRamseyProperty (Ns + Nt) (s+1) (t+1)holds.This is the core Erdős–Szekeres 1935 pigeonhole step: pick any vertex
v ∈ V, splitV.erase vintofalse-neighboursR_vandtrue-neighboursB_v; by pigeonhole|R_v| ≥ Nsor|B_v| ≥ Nt. In the first case, invokeHasRamseyProperty Ns s (t+1)onR_v: either we get afalse-monoK_sonR_v(extend byvto afalse-monoK_{s+1}onV), or atrue-monoK_{t+1}onR_v ⊆ V(done). The second case is symmetric.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,HAdd.hAdd,OfNat.ofNat,LE.leProof uses:
Finset,Fin,Bool,Finset.card,LT.lt,Nat.le_trans,Nat.le_add_right,Membership.mem,Finset.Nonempty,Or,Exists,And,Eq,Bool.false,Bool.true,Iff.mp,Finset.card_pos,Finset.filter,Insert.insert,Singleton.singletonand 23 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 57 steps
Open to load the checked before-and-after goal states.
lemma HasRamseyProperty.step {Ns Nt s t : ℕ} (hs : HasRamseyProperty Ns s (t + 1)) (ht : HasRamseyProperty Nt (s + 1) t) (hNs : 1 ≤ Ns) : HasRamseyProperty (Ns + Nt) (s + 1) (t + 1) := by …Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics.Diagonal.hasRamseyProperty_chooseBinomial bound via Erdős–Szekeres induction line 237 sourceSource documentation
Binomial bound via Erdős–Szekeres induction.
HasRamseyProperty (Nat.choose (s + t) s) s tfor alls, t.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, Combinatorics.Diagonal.HasRamseyProperty,Nat.choose,HAdd.hAddProof uses:
Eq,Nat.strong_induction_on,LT.lt,OfNat.ofNat,id,Eq.mpr,congrArg,Nat.choose_zero_right, Combinatorics.Diagonal.HasRamseyProperty.mono,Nat.zero_le, Combinatorics.Diagonal.hasRamseyProperty_zero_left, Combinatorics.Diagonal.hasRamseyProperty_zero_right,HSub.hSub,Decidable.byContradiction,Not,LE.le,Nat.choose_pos, Combinatorics.Diagonal.HasRamseyProperty.step,Eq.rec,Eq.refland 5 more18 instances, coercions and auxiliary constants left out.
Tactic trace: 33 steps
Open to load the checked before-and-after goal states.
lemma hasRamseyProperty_choose : ∀ (s t : ℕ), HasRamseyProperty (Nat.choose (s + t) s) s t := by …Mentions: Combinatorics.Diagonal.HasRamseyProperty
- lemma
Combinatorics._root_.Combinatorics.hypergraphRamsey_two_le_four_powErdős–Szekeres 1935 inhypergraphRamseyform:Combinatorics.hypergraphRamsey 2 k ≤ 4 ^ kfor allkline 290 sourceSource documentation
Erdős–Szekeres 1935 in
hypergraphRamseyform:Combinatorics.hypergraphRamsey 2 k ≤ 4 ^ kfor allk.Proof.
Diagonal.hasRamseyProperty_chooseapplied ats = t = kand the full vertex setV = Finset.univofFin (C(2k, k))shows thatC(2k, k)is a member of the defining set ofhypergraphRamsey 2 k, hence byNat.sInf_lewe gethypergraphRamsey 2 k ≤ C(2k, k); the central binomial boundC(2k, k) ≤ 4 ^ kcloses the result.lemma _root_.Combinatorics.hypergraphRamsey_two_le_four_pow (k : ℕ) : Combinatorics.hypergraphRamsey 2 k ≤ 4 ^ k := by …Mentions: Combinatorics.hypergraphRamsey