Lean / Reader
Lean reader

CarpetGridStatement.lean

64 lines4 declarationsno sorryimports CarpetGrid CarpetStatement

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

  1. import CarpetGrid
  2. import CarpetStatement
  3. namespace Carpet
  4. /-- Domination written directly on integer grid cells of the level-n carpet. -/
  5. def gridDominates (n : ℕ) (P : Finset Block) : Prop :=
  6. P ⊆ blocks n ∧ ∀ p ∈ blocks n, ∃ q ∈ P, gridClosed p q
  7. private theorem dominates_image {k : ℕ} {D : Finset Vertex}
  8. (h : Dominates (blocks k) D) : gridDominates (k+1) (D.image cell) := by
  9. constructor
  10. · intro p hp
  11. obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hp
  12. rw [← cells_eq_blocks]
  13. exact Finset.mem_image.mpr ⟨v, Finset.mem_product.mpr ⟨h.1 v hv, Finset.mem_univ _⟩, rfl⟩
  14. · intro p hp
  15. rw [← cells_eq_blocks] at hp
  16. obtain ⟨⟨b,l⟩,hv,rfl⟩ := Finset.mem_image.mp hp
  17. obtain ⟨w,hw⟩ := h.2 b (Finset.mem_product.mp hv).1 l
  18. obtain ⟨hc,hd⟩ := Finset.mem_inter.mp hw
  19. exact ⟨cell w,Finset.mem_image_of_mem _ hd,(mem_closed_iff_grid _ _).mp hc⟩
  20. private theorem dominates_lift {k : ℕ} {P : Finset Block} (h : gridDominates (k+1) P) :
  21. ∃ D : Finset Vertex, Dominates (blocks k) D ∧ D.card=P.card := by
  22. let D := (blocks k ×ˢ (Finset.univ : Finset Loc)).filter fun v => cell v ∈ P
  23. have himg : D.image cell = P := by
  24. ext p
  25. constructor
  26. · intro hp
  27. obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hp
  28. exact (Finset.mem_filter.mp hv).2
  29. · intro hp
  30. have hp' := h.1 hp
  31. rw [← cells_eq_blocks] at hp'
  32. obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hp'
  33. exact Finset.mem_image.mpr ⟨v,Finset.mem_filter.mpr ⟨hv,hp⟩,rfl⟩
  34. refine ⟨D, ⟨fun v hv => (Finset.mem_product.mp (Finset.mem_filter.mp hv).1).1, ?_⟩,?_⟩
  35. · intro b hb l
  36. have hp : cell (b,l) ∈ blocks (k+1) := by
  37. rw [← cells_eq_blocks]
  38. exact Finset.mem_image.mpr ⟨(b,l),Finset.mem_product.mpr ⟨hb,Finset.mem_univ _⟩,rfl⟩
  39. obtain ⟨q,hq,hc⟩ := h.2 _ hp
  40. rw [← himg] at hq
  41. obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp hq
  42. exact ⟨w,Finset.mem_inter.mpr ⟨(mem_closed_iff_grid _ _).mpr hc,hw⟩⟩
  43. · rw [← himg,Finset.card_image_of_injective _ cell_injective]
  44. /-- Bickle's conjecture for the ordinary grid graph on recursively retained cells. -/
  45. theorem grid_domination_number (n : ℕ) (hn : 2≤n) :
  46. IsLeast {m : ℕ | ∃ P : Finset Block, gridDominates n P ∧ P.card=m} (2^(3*n-2)+2) := by
  47. obtain ⟨k,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (show n≠0 by omega)
  48. have h := sierpinski_carpet_domination (k+1) hn
  49. simp only [Nat.add_sub_cancel] at h
  50. constructor
  51. · obtain ⟨D,hd,hc⟩ := h.1
  52. exact ⟨D.image cell,dominates_image hd,(Finset.card_image_of_injective _ cell_injective).trans hc⟩
  53. · rintro m ⟨P,hP,rfl⟩
  54. obtain ⟨D,hD,hcard⟩ := dominates_lift hP
  55. exact h.2 ⟨D,hD,hcard⟩
  56. #print axioms grid_domination_number
  57. end Carpet