openAI-math-dataset / lean /OAI /Geometry /Cannon /Energy /OpenPreconnectedRemovePoint.lean
roseking's picture
Add lean source and binary files (part 66)
8e4d533 verified
Raw History Blame Contribute Delete
3.28 kB
55
theorem open_preconnected_remove_point {U : Set ℂ} (hU : IsOpen U)
    (hc : IsPreconnected U) (x : ℂ) : IsPreconnected (U\{x}) := by
proof · 30 lines
  by_cases hx : x∈U
  swap
  · have he : U\{x}=U := by ext z; simp only [mem_sdiff,mem_singleton_iff]; constructor; exact And.left; intro hz; exact ⟨hz,fun h => hx (h ▸ hz)⟩
    rwa [he]
  have hV : IsOpen (U\{x}) := hU.sdiff isClosed_singleton
  let _ : LocallyConnectedSpace (U\{x} : Set ℂ) := hV.locallyConnectedSpace
  let _ : DiscreteTopology (ConnectedComponents (U\{x} : Set ℂ)) := inferInstance
  obtain ⟨r,hr,hrU⟩ := Metric.isOpen_iff.mp hU x hx
  have hsub : ball x r\{x}⊆U\{x} := sdiff_subset_sdiff_left hrU
  obtain ⟨d,hd⟩ := label_on_connected ConnectedComponents.continuous_coe
    (punctured_ball_connected x hr) hsub
  have hi : incident (U\{x}) ConnectedComponents.mk x⊆{d} := by
    apply incident_subset_of_patch isOpen_ball _ (mem_ball_self hr)
    intro y hy
    exact hd ⟨hy.1,hy.2.2⟩
  have hconstant (e : ConnectedComponents (U\{x} : Set ℂ)) : e=d := by
    obtain ⟨z,rfl⟩ := ConnectedComponents.surjective_coe e
    obtain ⟨y,⟨hyU,hyV⟩,hy⟩ := region_boundary_hits_in_open hU hV sdiff_subset hc
      ⟨x,hx,fun h => h.2 (mem_singleton x)⟩ ConnectedComponents.continuous_coe
      (ConnectedComponents.mk z) ⟨z,z.property,rfl⟩
    have hyx : y=x := by by_contra hn; exact hyV ⟨hyU,hn⟩
    subst y
    exact hi hy
  have : PreconnectedSpace (U\{x} : Set ℂ) := by
    rw [preconnectedSpace_iff_connectedComponent]
    intro a
    apply eq_univ_of_forall
    intro b
    exact ConnectedComponents.coe_eq_coe'.mp ((hconstant _).trans (hconstant _).symm)
  exact isPreconnected_iff_preconnectedSpace.mpr inferInstance
88
theorem open_preconnected_remove_finite {U : Set ℂ} (hU : IsOpen U)
    (hc : IsPreconnected U) (T : Finset ℂ) : IsPreconnected (U\(T:Set ℂ)) := by
proof · 7 lines
  classical
  induction T using Finset.induction_on with
  | empty => simpa using hc
  | @insert x T hx ih =>
    have he : U\(↑(insert x T):Set ℂ)=(U\(T:Set ℂ))\{x} := by ext z; simp; tauto
    rw [he]
    exact open_preconnected_remove_point (hU.sdiff T.finite_toSet.isClosed) ih x