Lean / ericlisg/erdos550-lean / Main.lean
Lean readerRequestProject/Main.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports RequestProject.Basic, RequestProject.FinalReduction, RequestProject.Reservoirs, RequestProject.BlockerInequalities and more, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import RequestProject.Basicimport RequestProject.FinalReductionimport RequestProject.Reservoirsimport RequestProject.BlockerInequalitiesimport RequestProject.Compactnessimport RequestProject.CompactnessGraphimport RequestProject.EFRSimport RequestProject.ProfileForestimport RequestProject.MainProof/-!# Erdős Problem 550 — main theorem (statement)For fixed `k ≥ 2` and `1 ≤ m₁ ≤ ⋯ ≤ m_k`, for every sufficiently large `n` andevery `n`-vertex tree `T`,$$ R(T, K_{m_1,\ldots,m_k}) \le (k-1)\bigl(R(T,K_{m_1,m_2})-1\bigr) + m_1. $$Here the two smallest classes `m₁, m₂` are `m 0, m 1` (using monotonicity), and`K_{m_1,m_2}` is modelled as a two-part complete multipartite graph`Kmult 2 (m ∘ Fin.castLE …)`.The `k = 2` case is elementary (the right-hand side is `R(T,H) - 1 + m₁ ≥ R(T,H)`and `K_{m_1,m_2} = K_{m_1,…,m_k}`). The substantial content is the case`k ≥ 3`, isolated as `erdos_550_large`, whose proof follows the paper's chain.The off--Turán step follows from exact Szemerédi regularity, the redmultipartite blow-up lemma, a maximal reduced matching, whole-edge allocation,and the stateful Hladký--Piguet parity embedding.-/open SimpleGraphnamespace Erdos550/-- The substantial case `k ≥ 3` (equivalently `q = k-1 ≥ 2`) of Erdős 550. -/theorem erdos_550_large (k : ℕ) (hk : 3 ≤ k) (m : Fin k → ℕ)(hmono : Monotone m) (hpos : 1 ≤ m ⟨0, by omega⟩) :∃ n0 : ℕ, ∀ n, n0 ≤ n → ∀ {V : Type} [Fintype V] (T : SimpleGraph V),T.IsTree → Fintype.card V = n →ramsey T (Kmult k m) ≤(k - 1) * (ramsey T (Kmult 2 (fun j => m (Fin.castLE (by omega) j))) - 1)+ m ⟨0, by omega⟩ := byset q := k - 1 with hqdefhave hqk : q + 1 = k := by omegahave hq : 2 ≤ q := by omegaset m' : Fin (q + 1) → ℕ := fun j => m (Fin.cast hqk j) with hm'have hmono' : Monotone m' := fun i j hij => hmono hijhave ec0 : Fin.cast hqk (0 : Fin (q+1)) = (⟨0, by omega⟩ : Fin k) := by ext; simp; try omegahave ec1 : Fin.cast hqk (1 : Fin (q+1)) = (⟨1, by omega⟩ : Fin k) := by ext; simp; try omegahave el0 : Fin.castLE (by omega : 2 ≤ k) (0 : Fin 2) = (⟨0, by omega⟩ : Fin k) := by ext; simp; try omegahave el1 : Fin.castLE (by omega : 2 ≤ k) (1 : Fin 2) = (⟨1, by omega⟩ : Fin k) := by ext; simp; try omegahave hm'0 : m' 0 = m ⟨0, by omega⟩ := by simp only [hm']; rw [ec0]have hm'1 : m' 1 = m ⟨1, by omega⟩ := by simp only [hm']; rw [ec1]have hpos' : 1 ≤ m' 0 := by rw [hm'0]; exact hposobtain ⟨n0, H⟩ := erdos_550_large_core q hq m' hmono' hpos'refine ⟨n0, fun n hn V _ T hT hcard => ?_⟩have hreidx : ramsey T (Kmult k m) = ramsey T (Kmult (q+1) m') :=ramsey_Kmult_reindex T (finCongr hqk.symm) m m' (fun i => by simp only [hm']; congr 1)have hbip : ramsey T (Kmult 2 (fun j => m (Fin.castLE (by omega : 2 ≤ k) j)))= ramsey T (Kbip (m' 0) (m' 1)) := byrw [ramsey_Kmult2_Kbip T (fun j => m (Fin.castLE (by omega : 2 ≤ k) j)), hm'0, hm'1, el0, el1]rw [hreidx, hbip, hm'0]exact H n hn T hT hcard/-- **Erdős Problem 550.** Fix `k ≥ 2` and`1 ≤ m 0 ≤ m 1 ≤ ⋯ ≤ m (k-1)`. There is `n₀` such thatfor every `n ≥ n₀` and every `n`-vertex tree `T`,`R(T, K_{m 0,…,m (k-1)}) ≤ (k-1)(R(T, K_{m 0, m 1}) - 1) + m 0`.Its off--Turán input is the unconditional theorem`off_turan_embedding_direct`. -/theorem erdos_550 (k : ℕ) (hk : 2 ≤ k) (m : Fin k → ℕ)(hmono : Monotone m) (hpos : 1 ≤ m ⟨0, by omega⟩) :∃ n0 : ℕ, ∀ n, n0 ≤ n → ∀ {V : Type} [Fintype V] (T : SimpleGraph V),T.IsTree → Fintype.card V = n →ramsey T (Kmult k m) ≤(k - 1) * (ramsey T (Kmult 2 (fun j => m (Fin.castLE hk j))) - 1)+ m ⟨0, by omega⟩ := byrcases lt_or_ge k 3 with hk2 | hk3· -- `k = 2`: here `K_{m_1,…,m_k} = K_{m_1,m_2}` and the RHS is `R - 1 + m 0 ≥ R`.obtain rfl : k = 2 := by omegarefine ⟨0, fun n _ V _ T _ _ => ?_⟩-- the two graphs coincide and `m 0 ≥ 1`have hcast : (fun j => m (Fin.castLE hk j)) = m := byfunext j; simprw [ramsey_Kmult_congr T hcast]have h0 : 1 ≤ m ⟨0, by omega⟩ := hposomega· -- `k ≥ 3`: the substantial case.exact erdos_550_large k hk3 m hmono hposend Erdos550