Lean / Reader
Lean reader

DecayConverse.lean

80 lines6 declarationsno sorryimports DecayTail DecayTransfer

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports DecayTail, DecayTransfer, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. import DecayTail
  2. import DecayTransfer
  3. namespace DecayClassification
  4. /-- i+1 converts from the formal zero-based index to the source index. -/
  5. noncomputable def regular (A : ℝ) (D j : ℕ) : ℝ := A / ((j+1:ℕ):ℝ)^(D*(j+1))
  6. theorem regular_pos {A : ℝ} (hA : 0 < A) (D j : ℕ) : 0 < regular A D j := by
  7. unfold regular
  8. positivity
  9. theorem regular_half {A : ℝ} (hA : 0 < A) {D : ℕ} (hD : 0 < D) (j : ℕ) :
  10. 2*regular A D (j+1) ≤ regular A D j := by
  11. let x : ℝ := ((j+1:ℕ):ℝ)
  12. let y : ℝ := ((j+1+1:ℕ):ℝ)
  13. have hx : 1 ≤ x := by dsimp [x]; exact_mod_cast (show 1 ≤ j+1 by omega)
  14. have hy : 2 ≤ y := by dsimp [y]; push_cast; linarith [Nat.cast_nonneg (α := ℝ) j]
  15. have xy : x ≤ y := by dsimp [x,y]; push_cast; linarith
  16. have denom : 2*x^(D*(j+1)) ≤ y^(D*(j+1+1)) := by
  17. have hbase := pow_le_pow_left₀ (le_trans zero_le_one hx) xy (D*(j+1))
  18. have hfactor : 2 ≤ y^D := by
  19. have hh := pow_le_pow_right₀ (by linarith : (1:ℝ) ≤ y) (show 1 ≤ D by omega)
  20. exact hy.trans (by simpa using hh)
  21. calc
  22. _ ≤ y^D * y^(D*(j+1)) := mul_le_mul hfactor hbase (by positivity) (by positivity)
  23. _ = y^(D*(j+1+1)) := by rw [← pow_add]; congr 1; ring
  24. have x0 := pow_pos (by linarith : 0 < x) (D*(j+1))
  25. have y0 := pow_pos (by linarith : 0 < y) (D*(j+1+1))
  26. change 2*(A/y^(D*(j+1+1))) ≤ A/x^(D*(j+1))
  27. rw [← mul_div_assoc, div_le_div_iff₀ y0 x0]
  28. nlinarith [mul_le_mul_of_nonneg_left denom hA.le]
  29. theorem regular_tail_comparison (A : ℝ) (hA : 0 ≤ A) (C j : ℕ) (hj : 1 ≤ j) :
  30. regular A (4*C+1) j * ((2*j+2:ℕ):ℝ)^(C*(2*j+2)) ≤ A := by
  31. let x : ℝ := ((j+1:ℕ):ℝ)
  32. have hx : 2 ≤ x := by dsimp [x]; exact_mod_cast (show 2 ≤ j+1 by omega)
  33. have x0 : 0 < x := by linarith
  34. have rcast : ((2*j+2:ℕ):ℝ) = 2*x := by dsimp [x]; push_cast; ring
  35. have denom : (2*x)^(C*(2*j+2)) ≤ x^((4*C+1)*(j+1)) := by
  36. have h1 : 2*x ≤ x^2 := by nlinarith [mul_nonneg (show 0 ≤ x-2 by linarith) x0.le]
  37. calc
  38. _ ≤ (x^2)^(C*(2*j+2)) := pow_le_pow_left₀ (by positivity) h1 _
  39. _ = x^(2*(C*(2*j+2))) := (pow_mul ..).symm
  40. _ ≤ _ := pow_le_pow_right₀ (by linarith) (by nlinarith : 2*(C*(2*j+2)) ≤ (4*C+1)*(j+1))
  41. rw [rcast]
  42. change (A / x^((4*C+1)*(j+1)))*(2*x)^(C*(2*j+2)) ≤ A
  43. rw [div_mul_eq_mul_div, div_le_iff₀ (pow_pos x0 _)]
  44. exact mul_le_mul_of_nonneg_left denom hA
  45. /-- The graph-theoretic input in the converse is independent of the target
  46. profile. It records exactly the provisional graph sizes and regular caps. -/
  47. def RegularModels : Prop :=
  48. ∀ D : ℕ, 0 < D → ∃ A : ℝ, 0 < A ∧ ∃ k : ℕ, 2 ≤ k ∧
  49. ∀ L : ℕ, ∃ N : ℕ, ∀ J ≥ N, ∃ n ≥ L, ∃ c : Fin n × Fin n → ℕ,
  50. (∀ e ∈ edges n, c e ≤ J) ∧ Bounded (regular A D) c ∧
  51. 1 ≤ 2*regular A D J*(edges n).card ∧ ¬MonoClique k c
  52. /-- The complete transfer from a failed tail test for any positive monotone
  53. profile to unbounded finite counterexamples, up to one scale factor. -/
  54. theorem scaled_counterexamples (models : RegularModels) (a : ℕ → ℝ) (ha : Antitone a)
  55. (ha0 : ∀ i, 0 < a i) (bad : ¬TailTest a) :
  56. ∃ γ : ℝ, 1 ≤ γ ∧ ¬DecayRamsey (fun i => γ*a i) := by
  57. obtain ⟨C,_,N,witness⟩ := witnesses_of_failure a bad
  58. let D := 4*C+1
  59. have hD : 0 < D := by dsimp [D]; omega
  60. obtain ⟨A,hA,k,hk,hmodel⟩ := models D hD
  61. obtain ⟨γ,hγ,supply⟩ := scaled_supply a (regular A D) ha ha0 (regular_pos hA D)
  62. C N 1 A hA witness (fun j hj => regular_tail_comparison A hA.le C j hj)
  63. have hγ0 : 0 ≤ γ := by linarith
  64. exact ⟨γ,hγ,nonforcing_of_models _ _ (fun _ _ hij => mul_le_mul_of_nonneg_left (ha hij) hγ0)
  65. (fun i => mul_nonneg hγ0 (ha0 i).le) (regular_pos hA D)
  66. (regular_half hA hD) supply k hk hmodel⟩
  67. #print axioms scaled_counterexamples
  68. #print axioms integral_transfer
  69. #print axioms DecayEdgeRefinement.recolor
  70. end DecayClassification