Lean / Reader
Lean reader

FourCubeTheorem.lean

75 lines9 declarationsno sorryimports RealCubeEndpoint

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

  1. import RealCubeEndpoint
  2. namespace RealCube
  3. noncomputable section
  4. open scoped Classical
  5. def boxGrid (L : Finset ℝ) : (d : ℕ) → Finset (Point d)
  6. | 0 => {()}
  7. | d+1 => L ×ˢ boxGrid L d
  8. theorem boxGrid_card (L : Finset ℝ) (d : ℕ) : (boxGrid L d).card=L.card^d := by
  9. induction d with
  10. | zero => simp [boxGrid]
  11. | succ d ih =>
  12. calc
  13. _ = L.card * (boxGrid L d).card := Finset.card_product L (boxGrid L d)
  14. _ = L.card^(d+1) := by rw [ih,pow_succ,Nat.mul_comm]
  15. theorem cube_in_grid {L M : Finset ℝ} {h : ℝ} (inc : ∀ t∈L,t∈M ∧ t+h∈M)
  16. (d : ℕ) {a : Point d} (ha : a∈boxGrid L d) : vertices d h a ⊆ boxGrid M d := by
  17. induction d with
  18. | zero => simp [vertices,boxGrid]
  19. | succ d ih =>
  20. intro x hx
  21. obtain ⟨hx1,hxt⟩ := Finset.mem_product.mp hx
  22. obtain ⟨ha1,hat⟩ := Finset.mem_product.mp ha
  23. exact Finset.mem_product.mpr ⟨(Finset.mem_insert.mp hx1).elim
  24. (fun e => e ▸ (inc _ ha1).1)
  25. (fun e => (Finset.mem_singleton.mp e) ▸ (inc _ ha1).2),ih hat hxt⟩
  26. def regularHost : Host := boxGrid {0,1,2} 4
  27. def smallGridCubes : Finset Cube := (boxGrid {0,1} 4).image (fun a => (a,1))
  28. def origin4 : Point 4 := (0,0,0,0,())
  29. def regularFamily : Finset Cube := insert (origin4,2) smallGridCubes
  30. theorem regular_lower_bound : regularHost.card=81 ∧ regularFamily.card=17 ∧
  31. supported regularHost regularFamily := by
  32. have m3 : ({0,1,2} : Finset ℝ).card=3 := by norm_num
  33. have m2 : ({0,1} : Finset ℝ).card=2 := by norm_num
  34. have small : smallGridCubes.card=16 := by
  35. unfold smallGridCubes
  36. rw [Finset.card_image_of_injective _ (fun _ _ eq => congrArg Prod.fst eq),boxGrid_card,m2]
  37. decide
  38. have fresh : (origin4,(2:ℝ))∉smallGridCubes := by
  39. intro hm
  40. obtain ⟨a,_,eq⟩ := Finset.mem_image.mp hm
  41. have := congrArg Prod.snd eq
  42. norm_num at this
  43. refine ⟨by rw [regularHost,boxGrid_card,m3]; decide, by rw [regularFamily,Finset.card_insert_of_notMem fresh,small],?_⟩
  44. intro c hc
  45. rcases Finset.mem_insert.mp hc with e|e
  46. · subst c
  47. refine ⟨by norm_num, cube_in_grid (L:={0}) (M:={0,1,2}) (h:=2) ?_ 4 ?_⟩
  48. · intro t ht
  49. have eq := Finset.mem_singleton.mp ht
  50. subst t; norm_num
  51. · simp [boxGrid,origin4]
  52. · obtain ⟨a,ha,he⟩ := Finset.mem_image.mp e
  53. subst c
  54. refine ⟨by norm_num,cube_in_grid (M:={0,1,2}) (h:=1) ?_ 4 ha⟩
  55. intro t ht
  56. simp only [Finset.mem_insert,Finset.mem_singleton] at ht
  57. rcases ht with e|e <;> subst t <;> norm_num
  58. /-- Among all 81-point hosts in real four-space the exact greatest possible
  59. number of positive homothetic copies of the four-cube vertex set is 17. -/
  60. theorem exact_maximum :
  61. (∀ (S : Host) (C : Finset Cube), S.card≤81 → supported S C → C.card≤17) ∧
  62. ∃ (S : Host) (C : Finset Cube), S.card=81 ∧ C.card=17 ∧ supported S C :=
  63. ⟨at_most_seventeen,regularHost,regularFamily,regular_lower_bound⟩
  64. #print axioms exact_maximum
  65. end
  66. end RealCube