l3lab/ntp-mathlib huggingface dataset:
theorem isPathConnected_iff_eq : IsPathConnected F ↔ ∃ x ∈ F, pathComponentIn x F = F := by
  constructor <;> rintro ⟨x, x_in, h⟩ <;> use x, x_in
  · ext y
    exact ⟨fun hy => hy.mem.2, h⟩
  · intro y y_in
    

Proof state:
case right
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
x : X
x_in : x ∈ F
h : pathComponentIn x F = F
y : X
y_in : y ∈ F
⊢ JoinedIn F x y

Next tactic:
rwa [← h] at y_in
/-- If `f` is continuous on `F` and `F` is path-connected, so is `f(F)`. -/
theorem IsPathConnected.image' (hF : IsPathConnected F)
    {f : X → Y} (hf : ContinuousOn f F) : IsPathConnected (f '' F) := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
hF : IsPathConnected F
f : X → Y
hf : ContinuousOn f F
⊢ IsPathConnected (f '' F)

Next tactic:
rcases hF with ⟨x, x_in, hx⟩
/-- If `f` is continuous on `F` and `F` is path-connected, so is `f(F)`. -/
theorem IsPathConnected.image' (hF : IsPathConnected F)
    {f : X → Y} (hf : ContinuousOn f F) : IsPathConnected (f '' F) := by
  rcases hF with ⟨x, x_in, hx⟩
  

Proof state:
case intro.intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : ContinuousOn f F
x : X
x_in : x ∈ F
hx : ∀ {y : X}, y ∈ F → JoinedIn F x y
⊢ IsPathConnected (f '' F)

Next tactic:
use f x, mem_image_of_mem f x_in
/-- If `f` is continuous on `F` and `F` is path-connected, so is `f(F)`. -/
theorem IsPathConnected.image' (hF : IsPathConnected F)
    {f : X → Y} (hf : ContinuousOn f F) : IsPathConnected (f '' F) := by
  rcases hF with ⟨x, x_in, hx⟩
  use f x, mem_image_of_mem f x_in
  

Proof state:
case right
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : ContinuousOn f F
x : X
x_in : x ∈ F
hx : ∀ {y : X}, y ∈ F → JoinedIn F x y
⊢ ∀ {y : Y}, y ∈ f '' F → JoinedIn (f '' F) (f x) y

Next tactic:
rintro _ ⟨y, y_in, rfl⟩
/-- If `f` is continuous on `F` and `F` is path-connected, so is `f(F)`. -/
theorem IsPathConnected.image' (hF : IsPathConnected F)
    {f : X → Y} (hf : ContinuousOn f F) : IsPathConnected (f '' F) := by
  rcases hF with ⟨x, x_in, hx⟩
  use f x, mem_image_of_mem f x_in
  rintro _ ⟨y, y_in, rfl⟩
  

Proof state:
case right.intro.intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : ContinuousOn f F
x : X
x_in : x ∈ F
hx : ∀ {y : X}, y ∈ F → JoinedIn F x y
y : X
y_in : y ∈ F
⊢ JoinedIn (f '' F) (f x) (f y)

Next tactic:
refine ⟨(hx y_in).somePath.map' ?_, fun t ↦ ⟨_, (hx y_in).somePath_mem t, rfl⟩⟩
/-- If `f` is continuous on `F` and `F` is path-connected, so is `f(F)`. -/
theorem IsPathConnected.image' (hF : IsPathConnected F)
    {f : X → Y} (hf : ContinuousOn f F) : IsPathConnected (f '' F) := by
  rcases hF with ⟨x, x_in, hx⟩
  use f x, mem_image_of_mem f x_in
  rintro _ ⟨y, y_in, rfl⟩
  refine ⟨(hx y_in).somePath.map' ?_, fun t ↦ ⟨_, (hx y_in).somePath_mem t, rfl⟩⟩
  

Proof state:
case right.intro.intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : ContinuousOn f F
x : X
x_in : x ∈ F
hx : ∀ {y : X}, y ∈ F → JoinedIn F x y
y : X
y_in : y ∈ F
⊢ ContinuousOn f (range ⇑(JoinedIn.somePath (_ : JoinedIn F x y)))

Next tactic:
exact hf.mono (range_subset_iff.2 (hx y_in).somePath_mem)
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
⊢ IsPathConnected F ↔ IsPathConnected (f '' F)

Next tactic:
refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : IsPathConnected (f '' F)
⊢ IsPathConnected F

Next tactic:
simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : IsPathConnected (f '' F)
⊢ IsPathConnected F

Next tactic:
simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
⊢ Set.Nonempty F ∧ ∀ x ∈ F, ∀ y ∈ F, JoinedIn F x y

Next tactic:
refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
⊢ JoinedIn F x y

Next tactic:
rcases hF.2 x hx y hy with ⟨γ, hγ⟩
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
hγ : ∀ (t : ↑I), γ t ∈ f '' F
⊢ JoinedIn F x y

Next tactic:
choose γ' hγ' hγγ' using hγ
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
⊢ JoinedIn F x y

Next tactic:
have key₁ : Inseparable x (γ' 0) := by rw [← hf.inseparable_iff, hγγ' 0, γ.source]
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  have key₁ : Inseparable x (γ' 0) := by 

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
⊢ Inseparable x (γ' 0)

Next tactic:
rw [← hf.inseparable_iff, hγγ' 0, γ.source]
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  have key₁ : Inseparable x (γ' 0) := by rw [← hf.inseparable_iff, hγγ' 0, γ.source]
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
key₁ : Inseparable x (γ' 0)
⊢ JoinedIn F x y

Next tactic:
have key₂ : Inseparable (γ' 1) y := by rw [← hf.inseparable_iff, hγγ' 1, γ.target]
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  have key₁ : Inseparable x (γ' 0) := by rw [← hf.inseparable_iff, hγγ' 0, γ.source]
  have key₂ : Inseparable (γ' 1) y := by 

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
key₁ : Inseparable x (γ' 0)
⊢ Inseparable (γ' 1) y

Next tactic:
rw [← hf.inseparable_iff, hγγ' 1, γ.target]
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  have key₁ : Inseparable x (γ' 0) := by rw [← hf.inseparable_iff, hγγ' 0, γ.source]
  have key₂ : Inseparable (γ' 1) y := by rw [← hf.inseparable_iff, hγγ' 1, γ.target]
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
key₁ : Inseparable x (γ' 0)
key₂ : Inseparable (γ' 1) y
⊢ JoinedIn F x y

Next tactic:
refine key₁.joinedIn hx (hγ' 0) |>.trans ⟨⟨⟨γ', ?_⟩, rfl, rfl⟩, hγ'⟩ |>.trans
    (key₂.joinedIn (hγ' 1) hy)
/-- If `f : X → Y` is a `Inducing`, `f(F)` is path-connected iff `F` is. -/
nonrec theorem Inducing.isPathConnected_iff {f : X → Y} (hf : Inducing f) :
    IsPathConnected F ↔ IsPathConnected (f '' F) := by
  refine ⟨fun hF ↦ hF.image hf.continuous, fun hF ↦ ?_⟩
  simp? [isPathConnected_iff] at hF ⊢ says
    simp only [isPathConnected_iff, nonempty_image_iff, mem_image, forall_exists_index,
      and_imp, forall_apply_eq_imp_iff₂] at hF ⊢
  refine ⟨hF.1, fun x hx y hy ↦ ?_⟩
  rcases hF.2 x hx y hy with ⟨γ, hγ⟩
  choose γ' hγ' hγγ' using hγ
  have key₁ : Inseparable x (γ' 0) := by rw [← hf.inseparable_iff, hγγ' 0, γ.source]
  have key₂ : Inseparable (γ' 1) y := by rw [← hf.inseparable_iff, hγγ' 1, γ.target]
  refine key₁.joinedIn hx (hγ' 0) |>.trans ⟨⟨⟨γ', ?_⟩, rfl, rfl⟩, hγ'⟩ |>.trans
    (key₂.joinedIn (hγ' 1) hy)
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F : Set X
f : X → Y
hf : Inducing f
hF : Set.Nonempty F ∧ ∀ a ∈ F, ∀ a_2 ∈ F, JoinedIn (f '' F) (f a) (f a_2)
x : X
hx : x ∈ F
y : X
hy : y ∈ F
γ : Path (f x) (f y)
γ' : ↑I → X
hγ' : ∀ (t : ↑I), γ' t ∈ F
hγγ' : ∀ (t : ↑I), f (γ' t) = γ t
key₁ : Inseparable x (γ' 0)
key₂ : Inseparable (γ' 1) y
⊢ Continuous γ'

Next tactic:
simpa [hf.continuous_iff] using γ.continuous.congr fun t ↦ (hγγ' t).symm
/-- If `h : X → Y` is a homeomorphism, `h⁻¹(s)` is path-connected iff `s` is. -/
@[simp]
theorem Homeomorph.isPathConnected_preimage {s : Set Y} (h : X ≃ₜ Y) :
    IsPathConnected (h ⁻¹' s) ↔ IsPathConnected s := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
s : Set Y
h : X ≃ₜ Y
⊢ IsPathConnected (⇑h ⁻¹' s) ↔ IsPathConnected s

Next tactic:
rw [← Homeomorph.image_symm]
/-- If `h : X → Y` is a homeomorphism, `h⁻¹(s)` is path-connected iff `s` is. -/
@[simp]
theorem Homeomorph.isPathConnected_preimage {s : Set Y} (h : X ≃ₜ Y) :
    IsPathConnected (h ⁻¹' s) ↔ IsPathConnected s := by
  rw [← Homeomorph.image_symm]; 

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
s : Set Y
h : X ≃ₜ Y
⊢ IsPathConnected (⇑(Homeomorph.symm h) '' s) ↔ IsPathConnected s

Next tactic:
exact h.symm.isPathConnected_image
theorem isPathConnected_singleton (x : X) : IsPathConnected ({x} : Set X) := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
x : X
⊢ IsPathConnected {x}

Next tactic:
refine ⟨x, rfl, ?_⟩
theorem isPathConnected_singleton (x : X) : IsPathConnected ({x} : Set X) := by
  refine ⟨x, rfl, ?_⟩
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F : Set X
x : X
⊢ ∀ {y : X}, y ∈ {x} → JoinedIn {x} x y

Next tactic:
rintro y rfl
theorem isPathConnected_singleton (x : X) : IsPathConnected ({x} : Set X) := by
  refine ⟨x, rfl, ?_⟩
  rintro y rfl
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y✝ z : X
ι : Type u_3
F : Set X
y : X
⊢ JoinedIn {y} y y

Next tactic:
exact JoinedIn.refl rfl
theorem IsPathConnected.union {U V : Set X} (hU : IsPathConnected U) (hV : IsPathConnected V)
    (hUV : (U ∩ V).Nonempty) : IsPathConnected (U ∪ V) := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F U V : Set X
hU : IsPathConnected U
hV : IsPathConnected V
hUV : Set.Nonempty (U ∩ V)
⊢ IsPathConnected (U ∪ V)

Next tactic:
rcases hUV with ⟨x, xU, xV⟩
theorem IsPathConnected.union {U V : Set X} (hU : IsPathConnected U) (hV : IsPathConnected V)
    (hUV : (U ∩ V).Nonempty) : IsPathConnected (U ∪ V) := by
  rcases hUV with ⟨x, xU, xV⟩
  

Proof state:
case intro.intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F U V : Set X
hU : IsPathConnected U
hV : IsPathConnected V
x : X
xU : x ∈ U
xV : x ∈ V
⊢ IsPathConnected (U ∪ V)

Next tactic:
use x, Or.inl xU
theorem IsPathConnected.union {U V : Set X} (hU : IsPathConnected U) (hV : IsPathConnected V)
    (hUV : (U ∩ V).Nonempty) : IsPathConnected (U ∪ V) := by
  rcases hUV with ⟨x, xU, xV⟩
  use x, Or.inl xU
  

Proof state:
case right
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F U V : Set X
hU : IsPathConnected U
hV : IsPathConnected V
x : X
xU : x ∈ U
xV : x ∈ V
⊢ ∀ {y : X}, y ∈ U ∪ V → JoinedIn (U ∪ V) x y

Next tactic:
rintro y (yU | yV)
theorem IsPathConnected.union {U V : Set X} (hU : IsPathConnected U) (hV : IsPathConnected V)
    (hUV : (U ∩ V).Nonempty) : IsPathConnected (U ∪ V) := by
  rcases hUV with ⟨x, xU, xV⟩
  use x, Or.inl xU
  rintro y (yU | yV)
  · 

Proof state:
case right.inl
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F U V : Set X
hU : IsPathConnected U
hV : IsPathConnected V
x : X
xU : x ∈ U
xV : x ∈ V
y : X
yU : y ∈ U
⊢ JoinedIn (U ∪ V) x y

Next tactic:
exact (hU.joinedIn x xU y yU).mono (subset_union_left U V)
theorem IsPathConnected.union {U V : Set X} (hU : IsPathConnected U) (hV : IsPathConnected V)
    (hUV : (U ∩ V).Nonempty) : IsPathConnected (U ∪ V) := by
  rcases hUV with ⟨x, xU, xV⟩
  use x, Or.inl xU
  rintro y (yU | yV)
  · exact (hU.joinedIn x xU y yU).mono (subset_union_left U V)
  · 

Proof state:
case right.inr
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F U V : Set X
hU : IsPathConnected U
hV : IsPathConnected V
x : X
xU : x ∈ U
xV : x ∈ V
y : X
yV : y ∈ V
⊢ JoinedIn (U ∪ V) x y

Next tactic:
exact (hV.joinedIn x xV y yV).mono (subset_union_right U V)
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F U W : Set X
hW : IsPathConnected W
hWU : W ⊆ U
⊢ IsPathConnected (Subtype.val ⁻¹' W)

Next tactic:
rcases hW with ⟨x, x_in, hx⟩
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  rcases hW with ⟨x, x_in, hx⟩
  

Proof state:
case intro.intro
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F U W : Set X
hWU : W ⊆ U
x : X
x_in : x ∈ W
hx : ∀ {y : X}, y ∈ W → JoinedIn W x y
⊢ IsPathConnected (Subtype.val ⁻¹' W)

Next tactic:
use ⟨x, hWU x_in⟩, by simp [x_in]
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  rcases hW with ⟨x, x_in, hx⟩
  use ⟨x, hWU x_in⟩, by 

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F U W : Set X
hWU : W ⊆ U
x : X
x_in : x ∈ W
hx : ∀ {y : X}, y ∈ W → JoinedIn W x y
⊢ { val := x, property := (_ : x ∈ U) } ∈ Subtype.val ⁻¹' W

Next tactic:
simp [x_in]
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  rcases hW with ⟨x, x_in, hx⟩
  use ⟨x, hWU x_in⟩, by simp [x_in]
  

Proof state:
case right
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y z : X
ι : Type u_3
F U W : Set X
hWU : W ⊆ U
x : X
x_in : x ∈ W
hx : ∀ {y : X}, y ∈ W → JoinedIn W x y
⊢ ∀ {y : { x // x ∈ U }}, y ∈ Subtype.val ⁻¹' W → JoinedIn (Subtype.val ⁻¹' W) { val := x, property := (_ : x ∈ U) } y

Next tactic:
rintro ⟨y, hyU⟩ hyW
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  rcases hW with ⟨x, x_in, hx⟩
  use ⟨x, hWU x_in⟩, by simp [x_in]
  rintro ⟨y, hyU⟩ hyW
  

Proof state:
case right.mk
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F U W : Set X
hWU : W ⊆ U
x : X
x_in : x ∈ W
hx : ∀ {y : X}, y ∈ W → JoinedIn W x y
y : X
hyU : y ∈ U
hyW : { val := y, property := hyU } ∈ Subtype.val ⁻¹' W
⊢ JoinedIn (Subtype.val ⁻¹' W) { val := x, property := (_ : x ∈ U) } { val := y, property := hyU }

Next tactic:
exact ⟨(hx hyW).joined_subtype.somePath.map (continuous_inclusion hWU), by simp⟩
/-- If a set `W` is path-connected, then it is also path-connected when seen as a set in a smaller
ambient type `U` (when `U` contains `W`). -/
theorem IsPathConnected.preimage_coe {U W : Set X} (hW : IsPathConnected W) (hWU : W ⊆ U) :
    IsPathConnected (((↑) : U → X) ⁻¹' W) := by
  rcases hW with ⟨x, x_in, hx⟩
  use ⟨x, hWU x_in⟩, by simp [x_in]
  rintro ⟨y, hyU⟩ hyW
  exact ⟨(hx hyW).joined_subtype.somePath.map (continuous_inclusion hWU), by 

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x✝ y✝ z : X
ι : Type u_3
F U W : Set X
hWU : W ⊆ U
x : X
x_in : x ∈ W
hx : ∀ {y : X}, y ∈ W → JoinedIn W x y
y : X
hyU : y ∈ U
hyW : { val := y, property := hyU } ∈ Subtype.val ⁻¹' W
⊢ ∀ (t : ↑I),
    (Path.map
          (Joined.somePath
            (_ :
              Joined { val := x, property := (_ : x ∈ W) }
                { val := ↑{ val := y, property := hyU }, property := (_ : ↑{ val := y, property := hyU } ∈ W) }))
          (_ : Continuous (inclusion hWU)))
        t ∈
      Subtype.val ⁻¹' W

Next tactic:
simp
theorem IsPathConnected.exists_path_through_family {n : ℕ}
    {s : Set X} (h : IsPathConnected s) (p : Fin (n + 1) → X) (hp : ∀ i, p i ∈ s) :
    ∃ γ : Path (p 0) (p n), range γ ⊆ s ∧ ∀ i, p i ∈ range γ := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
x y z : X
ι : Type u_3
F : Set X
n : ℕ
s : Set X
h : IsPathConnected s
p : Fin (n + 1) → X
hp : ∀ (i : Fin (n + 1)), p i ∈ s
⊢ ∃ γ, range ⇑γ ⊆ s ∧ ∀ (i : Fin (n + 1)), p i ∈ range ⇑γ

Next tactic:
let p' : ℕ → X := fun k => if h : k < n + 1 then p ⟨k, h⟩ else p ⟨0, n.zero_lt_succ⟩