Lean library · module TopologyByExample.Theorems.ConnectedPolygon
Polygonal paths labelled by connected neighbourhoods
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.
Imports
inductive type Polygon
TopologyByExample.LocallyConnectedPaths.Polygon
A finite concatenation tree, with an open connected set attached to every segment.
inductive Polygon (X : Type*) [TopologicalSpace X] : X → X → Type _
/-- One segment whose endpoints belong to the specified connected open set. -/
| segment {x y : X} (U : Set X) (ho : IsOpen U) (hc : IsConnected U)
(hx : x ∈ U) (hy : y ∈ U) : Polygon X x y
/-- Concatenate two trees at their common endpoint. -/
| join {x y z : X} (left : Polygon X x y) (right : Polygon X y z) : Polygon X x z
variable {X : Type*} [TopologicalSpace X]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
definition path
TopologyByExample.LocallyConnectedPaths.Polygon.path
Realize the tree as a polygonal path in a real normed space.
def path (e : X → E) {x y : X} : Polygon X x y → Path (e x) (e y)
| .segment _ _ _ _ _ => Path.segment _ _
| .join p q => (path e p).trans (path e q)
definition Within
TopologyByExample.LocallyConnectedPaths.Polygon.Within
Every labelled neighbourhood lies inside the specified set.
def Within (S : Set X) {x y : X} : Polygon X x y → Prop
| .segment U _ _ _ _ => U ⊆ S
| .join p q => Within S p ∧ Within S q
definition Small
TopologyByExample.LocallyConnectedPaths.Polygon.Small
Every labelled neighbourhood has its pairwise distances bounded by the given number.
def Small (d : X → X → ℝ) (δ : ℝ) {x y : X} : Polygon X x y → Prop
| .segment U _ _ _ _ => ∀ a ∈ U, ∀ b ∈ U, d a b ≤ δ
| .join p q => Small d δ p ∧ Small d δ q
theorem mono
TopologyByExample.LocallyConnectedPaths.Polygon.Within.mono
Containment of all labelled sets is monotone in the ambient set.
theorem Within.mono {S T : Set X} (hST : S ⊆ T) {x y : X} {p : Polygon X x y}
(hp : Within S p) : Within T p
Proof
:= by
induction p with
| segment U ho hc hx hy => exact hp.trans hST
| join p q ihp ihq => exact ⟨ihp hp.1, ihq hp.2⟩
theorem path_mem
TopologyByExample.LocallyConnectedPaths.Polygon.path_mem
Convex sets containing the labelled neighbourhoods contain the whole path.
theorem path_mem {S : Set X} {T : Set E} (hT : Convex ℝ T) {e : X → E}
(he : ∀ x ∈ S, e x ∈ T) {x y : X} (p : Polygon X x y) (hp : Within S p)
(t : unitInterval) : path e p t ∈ T
Proof
:= by
induction p generalizing t with
| segment U ho hc hx hy =>
have hseg := hT.segment_subset (he _ (hp hx)) (he _ (hp hy))
apply hseg
exact (Path.range_segment _ _).le ⟨t, rfl⟩
| join p q ihp ihq =>
change ((path e p).trans (path e q)) t ∈ T
rw [Path.trans_apply]
split_ifs
· exact ihp hp.1 _
· exact ihq hp.2 _
omit [NormedSpace ℝ E] in
theorem dist_trans_le
TopologyByExample.LocallyConnectedPaths.Polygon.dist_trans_le
Concatenating uniformly close pairs of paths preserves the same pointwise bound.
theorem dist_trans_le {x y z : E} (p p' : Path x y) (q q' : Path y z) {δ : ℝ}
(hp : ∀ t, dist (p t) (p' t) ≤ δ) (hq : ∀ t, dist (q t) (q' t) ≤ δ)
(t : unitInterval) : dist ((p.trans q) t) ((p'.trans q') t) ≤ δ
Proof
:= by
simp only [Path.trans_apply]
split_ifs
· exact hp _
· exact hq _