import Mathlib import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FinePatchAtlas namespace OAI section section open scoped symmDiff namespace SimpleAmenable open scoped commutatorElement open scoped commutatorElement section FarClippingGeometry theorem windowRectangle_clipping_chart_at_lift {a : ℕ} (r : CutRing) (n : ℕ) (hn : 201≤n) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) (hb : ∀ d, q d≤endpointLabel (-r) ∧ endpointLabel (-r) linarith [(hk d),(hclip d).1,(hclip d).2]) simpa only [map_neg] using h · apply Prod.ext · change (windowPlanarLift q p).1+(k 0:ℝ)=z.1 have h := hk 0 change z.1-(windowPlanarLift q p).1=(k 0:ℝ) at h linarith · change (windowPlanarLift q p).2+(k 1:ℝ)=z.2 have h := hk 1 change z.2-(windowPlanarLift q p).2=(k 1:ℝ) at h linarith theorem far_cut_neighborhood (a : ℕ) (j : Fin 4) (z : ℝ × ℝ) (c R E : ℝ) (hR : 0 -r) (fun _ => r) := by intro p hp have hb (d : Fin 2) : p ∈ coordinateBetween a d (-r) r := by apply (mem_coordinateBetween_iff d (-r) r (by rw [map_neg]; linarith [hr.1]) (by rw [map_neg]; linarith [hr.2]) p).mpr refine ⟨k d-⌊coordinate d p-ordinary ((q d:CutRing)*cutTau)⌋,?_⟩ have hh := (windowRectangle_mem n hn q cell p).mp hp d simp only [windowPlanarLift_coordinate,liftedCoordinate] at hh simp only [map_neg,Int.cast_sub] constructor <;> linarith [(hk d).1,(hk d).2,hh.1,hh.2] exact ⟨hb 0,hb 1⟩ theorem windowRectangle_clipping_dichotomy {a : ℕ} (r : CutRing) (hr : 0 -r) (fun _ => r)) ∨ windowRectangle a n q cell ≤ coordinateRectangle a (fun _ => -r) (fun _ => r) := by classical by_cases h : ∃ p : GenericSquare a, p ∈ (windowRectangle a n q cell).val ∧ p ∈ (coordinateRectangle a (fun _ => -r) (fun _ => r)).val · obtain ⟨p,hp,hbox⟩ := h obtain ⟨k,hk⟩ := windowRectangle_clipping_chart r hr n hn q cell hb he p hp hbox exact Or.inr (windowRectangle_le_clipping_box r hr n hn q cell k hk) · left rw [disjoint_iff_inf_le] exact fun p hp => h ⟨p,hp.1,hp.2⟩ theorem windowRectangle_exterior_of_point {a : ℕ} (r : CutRing) (hr : 0 -r) (fun _ => r)).val) : Disjoint (windowRectangle a n q cell) (coordinateRectangle a (fun _ => -r) (fun _ => r)) := by rcases windowRectangle_clipping_dichotomy r hr n hn q cell hb he with h | h · exact h · exact False.elim (hout (h hp)) end WindowBoxDichotomy end SimpleAmenable end end end OAI