Lean / Reader
Lean readerCarpetGridStatement.lean
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.
import CarpetGridimport CarpetStatementnamespace Carpet/-- Domination written directly on integer grid cells of the level-n carpet. -/def gridDominates (n : ℕ) (P : Finset Block) : Prop :=P ⊆ blocks n ∧ ∀ p ∈ blocks n, ∃ q ∈ P, gridClosed p qprivate theorem dominates_image {k : ℕ} {D : Finset Vertex}(h : Dominates (blocks k) D) : gridDominates (k+1) (D.image cell) := byconstructor· intro p hpobtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hprw [← cells_eq_blocks]exact Finset.mem_image.mpr ⟨v, Finset.mem_product.mpr ⟨h.1 v hv, Finset.mem_univ _⟩, rfl⟩· intro p hprw [← cells_eq_blocks] at hpobtain ⟨⟨b,l⟩,hv,rfl⟩ := Finset.mem_image.mp hpobtain ⟨w,hw⟩ := h.2 b (Finset.mem_product.mp hv).1 lobtain ⟨hc,hd⟩ := Finset.mem_inter.mp hwexact ⟨cell w,Finset.mem_image_of_mem _ hd,(mem_closed_iff_grid _ _).mp hc⟩private theorem dominates_lift {k : ℕ} {P : Finset Block} (h : gridDominates (k+1) P) :∃ D : Finset Vertex, Dominates (blocks k) D ∧ D.card=P.card := bylet D := (blocks k ×ˢ (Finset.univ : Finset Loc)).filter fun v => cell v ∈ Phave himg : D.image cell = P := byext pconstructor· intro hpobtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hpexact (Finset.mem_filter.mp hv).2· intro hphave hp' := h.1 hprw [← cells_eq_blocks] at hp'obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hp'exact Finset.mem_image.mpr ⟨v,Finset.mem_filter.mpr ⟨hv,hp⟩,rfl⟩refine ⟨D, ⟨fun v hv => (Finset.mem_product.mp (Finset.mem_filter.mp hv).1).1, ?_⟩,?_⟩· intro b hb lhave hp : cell (b,l) ∈ blocks (k+1) := byrw [← cells_eq_blocks]exact Finset.mem_image.mpr ⟨(b,l),Finset.mem_product.mpr ⟨hb,Finset.mem_univ _⟩,rfl⟩obtain ⟨q,hq,hc⟩ := h.2 _ hprw [← himg] at hqobtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp hqexact ⟨w,Finset.mem_inter.mpr ⟨(mem_closed_iff_grid _ _).mpr hc,hw⟩⟩· rw [← himg,Finset.card_image_of_injective _ cell_injective]/-- Bickle's conjecture for the ordinary grid graph on recursively retained cells. -/theorem grid_domination_number (n : ℕ) (hn : 2≤n) :IsLeast {m : ℕ | ∃ P : Finset Block, gridDominates n P ∧ P.card=m} (2^(3*n-2)+2) := byobtain ⟨k,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (show n≠0 by omega)have h := sierpinski_carpet_domination (k+1) hnsimp only [Nat.add_sub_cancel] at hconstructor· obtain ⟨D,hd,hc⟩ := h.1exact ⟨D.image cell,dominates_image hd,(Finset.card_image_of_injective _ cell_injective).trans hc⟩· rintro m ⟨P,hP,rfl⟩obtain ⟨D,hD,hcard⟩ := dominates_lift hPexact h.2 ⟨D,hD,hcard⟩#print axioms grid_domination_numberend Carpet