Lean / Reader
Lean reader

KemptonGrowth.lean

107 lines10 declarationsno sorryimports KemptonTrees

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

  1. import KemptonTrees
  2. namespace Kempton
  3. open MeasureTheory Filter
  4. open scoped Topology
  5. def after (j : ℕ) := 2 * block j + 2
  6. def beforeNext (j : ℕ) := 2 * block (j+1) + 1
  7. private def child (j : ℕ) (u : Fin (block j) → Bool) :
  8. Ball bursts zeroSeq (after j) :=
  9. ⟨[code (block j) u], ⟨⟨⟨rfl,j,u,rfl⟩,trivial⟩,by simp [weight,code,after]⟩⟩
  10. private theorem child_injective (j : ℕ) : Function.Injective (child j) := by
  11. intro u v he
  12. have e : code (block j) u = code (block j) v := by
  13. have := congrArg Subtype.val he
  14. simpa [child] using this
  15. funext ⟨i,hi⟩
  16. let k := block j
  17. have h := congrArg (fun w => prepend w zeroSeq (k+1+i)) e
  18. have hk : i < k := hi
  19. simpa [prepend, code, ←show k = block j from rfl, show k+1+i < 2*k+1 by omega,
  20. show ¬k+1+i < k by omega, show k+1+i ≠ k by omega] using h
  21. theorem highCount (j : ℕ) : 2 ^ block j ≤ Nat.card (Ball bursts zeroSeq (after j)) := by
  22. simpa [Nat.card_eq_fintype_card] using Nat.card_le_card_of_injective _ (child_injective j)
  23. theorem lowCount (j : ℕ) :
  24. Nat.card (Ball bursts zeroSeq (beforeNext j)) ≤ 2 ^ (2 * block j + 2) := by
  25. let m := 2 * block j + 1
  26. have hb : ∀ w ∈ bursts zeroSeq, w.1 < beforeNext j → w.1 ≤ m := by
  27. rintro _ ⟨_,i,u,rfl⟩ hw
  28. change 2*block i+1 < 2*block (j+1)+1 at hw
  29. have hi : i ≤ j := by
  30. by_contra! h
  31. have : block (j+1) ≤ block i := block_mono.monotone h
  32. omega
  33. have : block i ≤ block j := block_mono.monotone hi
  34. change 2*block i+1 ≤ 2*block j+1
  35. omega
  36. have h := Nat.card_le_card_of_injective _ (compress_injective hb)
  37. simp only [Nat.card_eq_fintype_card, Fintype.card_option, Fintype.card_fun, Fintype.card_bool,
  38. Fintype.card_fin] at h
  39. apply h.trans
  40. change 2^m + 1 ≤ 2^(m+1)
  41. rw [pow_succ 2 m]
  42. have : 0 < 2^m := by positivity
  43. omega
  44. theorem highGrowth (j : ℕ) : Real.log 2 / 4 ≤ growth bursts zeroSeq (after j) := by
  45. have h : (2:ℝ)^block j ≤ (Nat.card (Ball bursts zeroSeq (after j)) : ℝ) := by
  46. exact_mod_cast highCount j
  47. have hlog := Real.log_le_log (by positivity) h
  48. rw [Real.log_pow] at hlog
  49. have hk : 1 ≤ (block j : ℝ) := by exact_mod_cast block_pos j
  50. have hconst : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num)
  51. unfold growth
  52. apply (le_div_iff₀ (by unfold after; positivity)).mpr
  53. simp only [after, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat] at *
  54. nlinarith [mul_nonneg (sub_nonneg.mpr hk) hconst]
  55. theorem lowGrowth (j : ℕ) : growth bursts zeroSeq (beforeNext j) ≤ Real.log 2 / 8 := by
  56. have h : (Nat.card (Ball bursts zeroSeq (beforeNext j)) : ℝ) ≤ (2:ℝ)^(2*block j+2) := by
  57. exact_mod_cast lowCount j
  58. have hc : 0 < Nat.card (Ball bursts zeroSeq (beforeNext j)) := by
  59. have hn : 0 < beforeNext j := by unfold beforeNext; omega
  60. letI : Nonempty (Ball bursts zeroSeq (beforeNext j)) := ⟨⟨[],trivial,hn⟩⟩
  61. exact Nat.card_pos
  62. have hlog := Real.log_le_log (by exact_mod_cast hc) h
  63. rw [Real.log_pow] at hlog
  64. have hk : 1 ≤ (block j : ℝ) := by exact_mod_cast block_pos j
  65. have hconst : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num)
  66. have hnext : block (j+1) = 16 * block j := by simp [block,pow_succ,Nat.mul_comm]
  67. unfold growth
  68. apply (div_le_iff₀ (by unfold beforeNext; positivity)).mpr
  69. simp only [beforeNext, hnext, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] at *
  70. nlinarith [mul_nonneg (sub_nonneg.mpr hk) hconst]
  71. theorem no_limit : ¬ ∃ L : ℝ, Tendsto (growth bursts zeroSeq) atTop (𝓝 L) := by
  72. rintro ⟨L,hL⟩
  73. have ht₁ : Tendsto after atTop atTop :=
  74. tendsto_atTop_mono (fun j => by
  75. have hj := Nat.lt_pow_self (n := j) (a := 16) (by decide)
  76. change j ≤ 2 * 16^j + 2; omega) tendsto_id
  77. have ht₂ : Tendsto beforeNext atTop atTop :=
  78. tendsto_atTop_mono (fun j => by
  79. have hj := Nat.lt_pow_self (n := j+1) (a := 16) (by decide)
  80. change j ≤ 2 * 16^(j+1) + 1; omega) tendsto_id
  81. have hhi := ge_of_tendsto (hL.comp ht₁) (.of_forall highGrowth)
  82. have hlo := le_of_tendsto (hL.comp ht₂) (.of_forall lowGrowth)
  83. have : 0 < Real.log 2 := Real.log_pos (by norm_num)
  84. linarith
  85. /-- A continuous countable family of mutually disjoint binary cylinders, and a
  86. shift-invariant probability measure under which almost-everywhere convergence fails. -/
  87. theorem counterexample : ∃ (F : Family) (μ : Measure Seq), Admissible F ∧
  88. IsProbabilityMeasure μ ∧ MeasurePreserving shift μ μ ∧
  89. ¬ (∀ᵐ a ∂μ, ∃ L : ℝ, Tendsto (growth F a) atTop (𝓝 L)) := by
  90. refine ⟨bursts,Measure.dirac zeroSeq,admissible,inferInstance,?_,?_⟩
  91. · have hs : Measurable shift := measurable_pi_lambda _ fun i => measurable_pi_apply (i+1)
  92. exact ⟨hs, Measure.map_dirac hs zeroSeq⟩
  93. · simpa [Filter.Eventually, ae_dirac_eq] using no_limit
  94. #print axioms counterexample
  95. end Kempton