roseking's picture
Add lean source and binary files (part 94)
7f37411 verified
Raw History Blame Contribute Delete
1.74 kB
15
noncomputable def treeCenter (p : CellPath d) : EuclideanSpace ℝ (Fin d) :=
body · 1 line
  ambientGridCenter p.length (fun i => (pathIndex p i : ℤ))
18
lemma treeCenter_mem (p : CellPath d) : treeCenter p ∈ treeCell p :=
proof · 1 line
  ambientGridCenter_mem _ _
21
noncomputable def occupiedCenterCells (ν : Measure (EuclideanSpace ℝ (Fin d)))
    (p : ℕ) (x : EuclideanSpace ℝ (Fin d)) (r : ℝ) : Finset (CellPath d) := by
body · 2 lines
  classical
  exact (dyadicPaths p).filter fun q => 0 < ν (treeCell q) ∧ treeCenter q ∈ ball x r
26
lemma treeCenter_ball_card {g : ℕ} (T : Finset (CellPath d)) (hT : T ⊆ dyadicPaths g)
    (x : EuclideanSpace ℝ (Fin d)) {r : ℝ} (hr : 0 ≤ r)
    (hdist : ∀ p ∈ T, dist (treeCenter p) x ≤ r) :
    (T.card : ℝ) ≤ (2*(2:ℝ)^g*r+5)^d := by
proof · 14 lines
  classical
  let f : CellPath d → (Fin d → ℤ) := fun p i => pathIndex p i
  have hf : Set.InjOn f T := by
    intro p hp q hq he
    apply pathIndex_injective (((mem_dyadicPaths _ _).mp (hT hp)).trans
      ((mem_dyadicPaths _ _).mp (hT hq)).symm)
    funext i
    have hei : (pathIndex p i : ℤ) = pathIndex q i := congrFun he i
    exact_mod_cast hei
  have hh := ambientGridCenter_ball_card g (T.image f) x hr (fun a ha => by
    obtain ⟨p,hp,rfl⟩ := Finset.mem_image.mp ha
    have he : p.length = g := (mem_dyadicPaths _ _).mp (hT hp)
    simpa only [treeCenter,he] using hdist p hp)
  rwa [Finset.card_image_of_injOn hf] at hh