Lean / Reader
Lean reader

AllRealCube.lean

132 lines7 declarationsno sorryimports RealCubeSixteen RealCubeDominant

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

  1. import RealCubeSixteen
  2. import RealCubeDominant
  3. namespace RealCube
  4. noncomputable section
  5. open scoped Classical
  6. private theorem anchor_mem (d : ℕ) (h : ℝ) (a : Point d) : a ∈ vertices d h a := by
  7. induction d with
  8. | zero => simp [vertices]
  9. | succ d ih => exact Finset.mem_product.mpr ⟨by simp,ih _⟩
  10. /-- A nonintegral side forces sixteen distinct residue classes, which are
  11. paid for in addition to the fixed-scale cost minus one. -/
  12. theorem nonintegral_budget {S A : Host} {h k : ℝ} (hh : 0<h) (hk : 0<k)
  13. (step : ¬integralStep h k) (a : Point 4) (cov : expansion 4 h A ⊆ S)
  14. (other : vertices 4 k a ⊆ S) (many : 0<A.card) (few : A.card≤16) :
  15. 15 + price 4 A.card ≤ S.card := by
  16. let Z := S.image (residue 4 h)
  17. let n (z : Fin 4 → ℝ) := (cell A h z).card
  18. have self : integralStep h h := ⟨1,by simp [div_self hh.ne']⟩
  19. have anchors : A ⊆ S := fun x hx => cov (Finset.mem_biUnion.mpr ⟨x,hx,anchor_mem 4 h x⟩)
  20. have sumN : ∑ z∈Z,n z = A.card :=
  21. (Finset.card_eq_sum_card_fiberwise (f:=residue 4 h)
  22. (fun x hx => Finset.mem_image_of_mem _ (anchors hx))).symm
  23. have sumS : ∑ z∈Z,(cell S h z).card = S.card :=
  24. (Finset.card_eq_sum_card_fiberwise (f:=residue 4 h)
  25. (fun x hx => Finset.mem_image_of_mem _ hx)).symm
  26. have count : 16 ≤ Z.card := by
  27. have sub := Finset.card_le_card (Finset.image_subset_image (f:=residue 4 h) other)
  28. rwa [residue_vertex_count 4 hk step a] at sub
  29. have localBound (z) (hz : z∈Z) : 1 + fee 2 (n z) ≤ (cell S h z).card := by
  30. have live : 0 < (cell S h z).card := by
  31. obtain ⟨x,hx,eq⟩ := Finset.mem_image.mp hz
  32. exact Finset.card_pos.mpr ⟨x,Finset.mem_filter.mpr ⟨hx,eq⟩⟩
  33. by_cases empty : n z=0
  34. · simpa only [empty,fee,if_pos rfl,Nat.add_zero] using live
  35. have sub : expansion 4 h (cell A h z) ⊆ cell S h z := by
  36. intro x hx
  37. obtain ⟨b,hb,v⟩ := Finset.mem_biUnion.mp hx
  38. obtain ⟨mem,eq⟩ := Finset.mem_filter.mp hb
  39. exact Finset.mem_filter.mpr ⟨cov (Finset.mem_biUnion.mpr ⟨b,mem,v⟩),
  40. (residue_constant 4 self v).trans eq⟩
  41. have bound := (fixed_scale_bound 4 (by decide) hh (cell A h z)
  42. ((Finset.card_le_card (Finset.filter_subset _ _)).trans (by omega : A.card≤18))).trans
  43. (Finset.card_le_card sub)
  44. change price 4 (n z) ≤ _ at bound
  45. simp only [fee,if_neg empty]; omega
  46. have tot := Finset.sum_le_sum localBound
  47. simp only [Finset.sum_add_distrib,Finset.sum_const,nsmul_eq_mul,Nat.mul_one,sumS] at tot
  48. change Z.card + (∑ z∈Z,fee 2 (n z)) ≤ S.card at tot
  49. have merged := sum_fee Z n (by decide : 2≤8) (sumN.trans_le few)
  50. rw [sumN,fee,if_neg (Nat.ne_of_gt many)] at merged
  51. omega
  52. private theorem price_rich : ∀ r : Fin 17, 11≤(r:ℕ) → 70 ≤ price 4 r := by decide +kernel
  53. private theorem beta_rich : ∀ r : Fin 17, 11≤(r:ℕ) → 7 ≤ beta r := by decide +kernel
  54. /-- Eleven cubes of side h force every cube on the host to have side h or 2h. -/
  55. theorem two_scales_of_eleven {S : Host} {C : Finset Cube} (sup : supported S C)
  56. (hs : S.card≤81) {h : ℝ} (hh : 0<h) (many : 11 ≤ (sideGroup C h).card)
  57. {c : Cube} (hc : c∈C) : c.2=h ∨ c.2=2*h := by
  58. let A := bases C h
  59. have ha : A.card = (sideGroup C h).card := bases_card _ _
  60. have lo : 11 ≤ A.card := by omega
  61. have hi : A.card ≤ 16 := ha.trans_le (at_most_sixteen_same_side sup hs hh)
  62. have price70 := price_rich ⟨A.card,by omega⟩ lo
  63. change 70≤price 4 A.card at price70
  64. have cov := anchor_expansion_inside sup h
  65. have pos := (sup c hc).1
  66. have incl := (sup c hc).2
  67. by_cases step : integralStep h c.2
  68. · obtain ⟨n,hn⟩ := step
  69. rw [div_eq_iff hh.ne'] at hn
  70. have hnpos : 0<n := by
  71. have : 0<(n:ℝ) := (mul_pos_iff_of_pos_right hh).mp (hn ▸ pos)
  72. exact_mod_cast this
  73. have ub : c.2≤2*h := by
  74. by_contra! gt
  75. have ub := (large_cube_restriction hh gt A S c.1 cov incl hs).1
  76. have lb := fixed_scale_bound 4 (by decide) hh A (by omega)
  77. omega
  78. have hnle : n≤2 := by
  79. have : (n:ℝ)≤2 := (mul_le_mul_iff_left₀ hh).mp (hn ▸ ub)
  80. exact_mod_cast this
  81. rcases (show n=1 ∨ n=2 by omega) with e|e <;> subst n <;> simp_all
  82. · have cost := nonintegral_budget hh pos step c.1 cov incl (by change 0<A.card;omega) hi
  83. change 15 + price 4 A.card ≤ S.card at cost
  84. omega
  85. /-- No side occurs more than ten times in a hypothetical eighteen-cube family. -/
  86. theorem counterexample_side_cap {S : Host} {C : Finset Cube} (sup : supported S C)
  87. (hs : S.card≤81) (hc : C.card=18) {h : ℝ} (hh : 0<h) : (sideGroup C h).card≤10 := by
  88. by_contra! mid
  89. have hi := at_most_sixteen_same_side sup hs hh
  90. have sub : C ⊆ sideGroup C h ∪ sideGroup C (2*h) := by
  91. intro x hx
  92. rcases two_scales_of_eleven sup hs hh mid hx with e|e
  93. · exact Finset.mem_union_left _ (Finset.mem_filter.mpr ⟨hx,e⟩)
  94. · exact Finset.mem_union_right _ (Finset.mem_filter.mpr ⟨hx,e⟩)
  95. have totals := (Finset.card_le_card sub).trans (Finset.card_union_le _ _)
  96. have covSub (B : Host) (bs : B ⊆ bases C (2*h)) : expansion 4 (2*h) B ⊆ S := by
  97. intro p hp
  98. obtain ⟨b,hb,v⟩ := Finset.mem_biUnion.mp hp
  99. exact anchor_expansion_inside sup _ (Finset.mem_biUnion.mpr ⟨b,bs hb,v⟩)
  100. by_cases eq : (sideGroup C h).card=16
  101. · have bh : 2 ≤ (bases C (2*h)).card := by rw [bases_card]; omega
  102. obtain ⟨B,bs,bc⟩ := Finset.exists_subset_card_eq bh
  103. exact sixteen_forbids_two S (bases C h) B hh (anchor_expansion_inside sup h) (covSub B bs)
  104. (by rwa [bases_card]) bc hs
  105. · have bh : 3 ≤ (bases C (2*h)).card := by rw [bases_card]; omega
  106. obtain ⟨B,bs,bc⟩ := Finset.exists_subset_card_eq bh
  107. have cost := parity_budget S (bases C h) B hh (anchor_expansion_inside sup h) (covSub B bs)
  108. (by rw [bases_card];omega) (by rwa [bases_card]) (by omega) (by omega)
  109. rw [bc,bases_card] at cost
  110. have β := beta_rich ⟨(sideGroup C h).card,by omega⟩ mid
  111. change 7≤beta (sideGroup C h).card at β
  112. change 32+1+7*beta (sideGroup C h).card ≤ S.card at cost
  113. omega
  114. /-- Every eighteen-cube counterexample has a group of seven to ten of one side,
  115. and every side occurs at most ten times. -/
  116. theorem counterexample_profile {S : Host} {C : Finset Cube} (sup : supported S C)
  117. (hs : S.card≤81) (hc : C.card=18) :
  118. (∃ h∈C.image Prod.snd, 7≤(sideGroup C h).card) ∧
  119. ∀ h>0,(sideGroup C h).card≤10 :=
  120. ⟨dominant_side sup hc hs,fun _ hh => counterexample_side_cap sup hs hc hh⟩
  121. #print axioms counterexample_profile
  122. end
  123. end RealCube