Lean / Reader
Lean readerDecayTransfer.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports DecayPalettes, DecayIntegral, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import DecayPalettesimport DecayIntegralnamespace DecayClassificationtheorem geometric_tail (b : ℕ → ℝ) (half : ∀ j, 2*b (j+1) ≤ b j) :∀ J j, j ≤ J → (∑ i ∈ Finset.Ioc j J, b i) + b J ≤ b j := byintro Jinduction J with| zero =>intro j hjhave := Nat.eq_zero_of_le_zero hjsubst j; simp| succ J ih =>intro j hjby_cases eq : j = J+1· subst j; simp· have le : j ≤ J := by omegahave split : Finset.Ioc j (J+1) = insert (J+1) (Finset.Ioc j J) := byext isimp only [Finset.mem_insert, Finset.mem_Ioc]omegarw [split,Finset.sum_insert (by simp)]linarith [ih j le, half J]theorem mono_of_refines {n k : ℕ} {c c' : Fin n × Fin n → ℕ}(refines : ∀ x ∈ edges n, ∀ y ∈ edges n, c' x = c' y → c x = c y) :MonoClique k c' → MonoClique k c := byrintro ⟨s,hk,col,mono⟩by_cases has : ∃ u ∈ s, ∃ v ∈ s, u < v· obtain ⟨u,hu,v,hv,huv⟩ := hasrefine ⟨s,hk,c (u,v),?_⟩intro x hx y hy hxyexact refines (x,y) (by simpa [edges] using hxy)(u,v) (by simpa [edges] using huv) ((mono _ hx _ hy hxy).trans (mono _ hu _ hv huv).symm)· exact ⟨s,hk,0,fun x hx y hy hxy => (has ⟨x,hx,y,hy,hxy⟩).elim⟩/-- At unbounded common cutoffs, every provisional graph with enough edges andthe indicated density control admits an actual bounded refinement, simultaneouslypreserving the absence of every monochromatic clique. -/theorem integral_transfer (a b : ℕ → ℝ) (ha : Antitone a) (ha0 : ∀ i, 0 ≤ a i)(hb : ∀ j, 0 < b j) (half : ∀ j, 2*b (j+1) ≤ b j)(supply : ∀ j, ∃ l ≥ j, 40*b j < ∑ i ∈ Finset.Icc j l, a (2*i+1)) :∀ N, ∃ J ≥ N, ∀ n (c : Fin n × Fin n → ℕ),(∀ e ∈ edges n, c e ≤ J) → Bounded b c →1 ≤ 2*b J*(edges n).card →∃ c' : Fin n × Fin n → ℕ, Bounded a c' ∧ ∀ k, MonoClique k c' → MonoClique k c := byintro Nhave excess : ∀ s, ∃ l ≥ s, ∑ i ∈ Finset.Icc s l, a (2*i+1) >∑ i ∈ Finset.Icc s l, 20*b i := byintro sobtain ⟨l,hl,hs⟩ := supply shave heq : Finset.Icc s l = insert s (Finset.Ioc s l) := byext isimp only [Finset.mem_insert,Finset.mem_Icc,Finset.mem_Ioc]omegarefine ⟨l,hl,?_⟩rw [← Finset.mul_sum,heq]simp only [Finset.sum_insert (by simp : s ∉ Finset.Ioc s l)]rw [heq,Finset.sum_insert (by simp)] at hslinarith [geometric_tail b half l s hl,hb l]obtain ⟨J,hJN,hbig,hblocks⟩ := good_blocks (fun i => a (2*i+1)) b(fun _ _ hij => ha (by omega)) (fun _ => ha0 _) hb excess Nobtain ⟨A,dis,limited,mass⟩ := palettes a b ha ha0 (fun i => (hb i).le) J(fun j hj => by linarith [geometric_tail b half J j hj,hb J]) hblocksrefine ⟨J,hJN,?_⟩intro n c active budget hsizehave roundable : 2 ≤ a (2*J+1)*(edges n).card := byhave hh := mul_le_mul_of_nonneg_right hbig (show (0:ℝ) ≤ (edges n).card by positivity)linarithobtain ⟨c',hbounded,parent⟩ := integer_refinement (edges n) c a b ha ha0 J active(fun j _ => budget j) roundable A dis limited massexact ⟨c',hbounded,fun _ => mono_of_refines parent⟩/-- A family of regular provisional colorings at all sufficiently large palettecutoffs transfers to counterexamples of unbounded order for the irregular cap. -/theorem nonforcing_of_models (a b : ℕ → ℝ) (ha : Antitone a) (ha0 : ∀ i, 0 ≤ a i)(hb : ∀ j, 0 < b j) (half : ∀ j, 2*b (j+1) ≤ b j)(supply : ∀ j, ∃ l ≥ j, 40*b j < ∑ i ∈ Finset.Icc j l, a (2*i+1))(k : ℕ) (hk : 2 ≤ k)(models : ∀ L, ∃ N, ∀ J ≥ N, ∃ n ≥ L, ∃ c : Fin n × Fin n → ℕ,(∀ e ∈ edges n, c e ≤ J) ∧ Bounded b c ∧ 1 ≤ 2*b J*(edges n).card ∧ ¬MonoClique k c) :¬DecayRamsey a := byintro ramseyobtain ⟨L,forced⟩ := ramsey k hkobtain ⟨N,hmodel⟩ := models Lobtain ⟨J,hJ,htransfer⟩ := integral_transfer a b ha ha0 hb half supply Nobtain ⟨n,hn,c,hactive,hbounded,hsize,hfree⟩ := hmodel J hJobtain ⟨c',hc',href⟩ := htransfer n c hactive hbounded hsizeexact hfree (href k (forced n hn c' hc'))end DecayClassification