Lean library · module TopologyByExample.Theorems.ConnectedPolygonRefinement
Refining connected polygonal paths
This file was written by Codex (OpenAI's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.
variable {X : Type*} [MetricSpace X] [LocallyConnectedSpace X]
theorem smallLinkWithin_self
TopologyByExample.LocallyConnectedPaths.smallLinkWithin_self
A point has a small connected open neighbourhood inside any given open set.
theorem smallLinkWithin_self {U : Set X} (hU : IsOpen U) {x : X} (hx : x ∈ U)
{ε : ℝ} (hε : 0 < ε) : SmallLinkWithin ε U x x
Proof
:= by
obtain ⟨V, ⟨hVo, hxV, hVc⟩, hV⟩ :=
(LocallyConnectedSpace.open_connected_basis x).mem_iff.mp
(Filter.inter_mem (hU.mem_nhds hx) (ball_mem_nhds x (half_pos hε)))
refine ⟨V, fun z hz ↦ (hV hz).1, hVo, hVc, hxV, hxV, fun a ha b hb ↦ ?_⟩
have ha' : dist a x < ε / 2 := (hV ha).2
have hb' : dist b x < ε / 2 := (hV hb).2
calc
dist a b ≤ dist a x + dist x b := dist_triangle _ _ _
_ < ε := by rw [dist_comm x b]; linarith
omit [LocallyConnectedSpace X] in
theorem exists_polygon_of_chain
TopologyByExample.LocallyConnectedPaths.exists_polygon_of_chain
A finite small-link chain gives a polygon with equally small labelled sets.
theorem exists_polygon_of_chain {ε : ℝ} {U : Set X} {x y : X}
(hself : SmallLinkWithin ε U x x)
(h : Relation.ReflTransGen (SmallLinkWithin ε U) x y) :
∃ p : Polygon X x y, p.Small dist ε ∧ p.Within U
Proof
:= by
induction h with
| refl =>
obtain ⟨V, hVU, hVo, hVc, hx, _, hV⟩ := hself
exact ⟨.segment V hVo hVc hx hx, fun a ha b hb ↦ (hV a ha b hb).le, hVU⟩
| @tail b c hab hbc ih =>
obtain ⟨p, hp, hpin⟩ := ih
obtain ⟨V, hVU, hVo, hVc, hb, hc, hV⟩ := hbc
exact ⟨.join p (.segment V hVo hVc hb hc),
⟨hp, fun a ha b hb ↦ (hV a ha b hb).le⟩, hpin, hVU⟩
theorem exists_small_polygon
TopologyByExample.LocallyConnectedPaths.exists_small_polygon
Any two points in a connected open set admit arbitrarily small polygonal refinements.
theorem exists_small_polygon {U : Set X} (hU : IsOpen U) (hUc : IsPreconnected U)
{ε : ℝ} (hε : 0 < ε) {x y : X} (hx : x ∈ U) (hy : y ∈ U) :
∃ p : Polygon X x y, p.Small dist ε ∧ p.Within U
Proof
:=
exists_polygon_of_chain (smallLinkWithin_self hU hx hε)
(smallLink_chain_within hU hUc hε hx hy)
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
omit [LocallyConnectedSpace X] in
theorem polygon_near_vertex
TopologyByExample.LocallyConnectedPaths.polygon_near_vertex
Every point on a small polygon is close to a vertex in the original metric space.
theorem polygon_near_vertex {e : X → E} (he : Isometry e) {δ : ℝ}
{x y : X} (p : Polygon X x y) (hp : p.Small dist δ)
{S : Set X} (hS : p.Within S) (t : unitInterval) :
∃ z ∈ S, dist (Polygon.path e p t) (e z) ≤ δ
Proof
:= by
induction p generalizing t with
| @segment x y U ho hc hx hy =>
refine ⟨x, hS hx, ?_⟩
have hball (z : X) (hz : z ∈ U) : e z ∈ closedBall (e x) δ := by
change dist (e z) (e x) ≤ δ
rw [he.dist_eq]
exact hp z hz x hx
exact Polygon.path_mem (convex_closedBall (e x) δ) hball
(.segment U ho hc hx hy) (Subset.refl U) t
| join p q ihp ihq =>
change ∃ z ∈ S, dist (((Polygon.path e p).trans (Polygon.path e q)) t) (e z) ≤ δ
rw [Path.trans_apply]
split_ifs
· exact ihp hp.1 hS.1 _
· exact ihq hp.2 hS.2 _
theorem exists_polygon_refinement
TopologyByExample.LocallyConnectedPaths.exists_polygon_refinement
Refining each leaf preserves its ambient set and changes the path by a controlled amount.
theorem exists_polygon_refinement {e : X → E} (he : Isometry e)
{ε δ : ℝ} (hε : 0 < ε) {x y : X} (p : Polygon X x y) (hp : p.Small dist δ) :
∃ q : Polygon X x y, q.Small dist ε ∧
(∀ S, p.Within S → q.Within S) ∧
∀ t, dist (Polygon.path e q t) (Polygon.path e p t) ≤ 2 * δ
Proof
:= by
induction p with
| @segment x y U ho hc hx hy =>
obtain ⟨q, hq, hqin⟩ := exists_small_polygon ho hc.isPreconnected hε hx hy
have hball (z : X) (hz : z ∈ U) : e z ∈ closedBall (e x) δ := by
change dist (e z) (e x) ≤ δ
rw [he.dist_eq]
exact hp z hz x hx
refine ⟨q, hq, fun S hS ↦ hqin.mono hS, fun t ↦ ?_⟩
have hnew := Polygon.path_mem (convex_closedBall (e x) δ) hball q hqin t
have hold := Polygon.path_mem (convex_closedBall (e x) δ) hball
(.segment U ho hc hx hy) (Subset.refl U) t
have htri := dist_triangle (Polygon.path e q t) (e x)
(Polygon.path e (.segment U ho hc hx hy) t)
rw [dist_comm (e x)] at htri
change dist _ _ ≤ δ at hnew hold
linarith
| join p q ihp ihq =>
obtain ⟨p', hp', hpin, hpd⟩ := ihp hp.1
obtain ⟨q', hq', hqin, hqd⟩ := ihq hp.2
refine ⟨.join p' q', ⟨hp', hq'⟩, fun S hS ↦ ⟨hpin S hS.1, hqin S hS.2⟩, ?_⟩
exact Polygon.dist_trans_le _ _ _ _ hpd hqd