l3lab/ntp-mathlib huggingface dataset:
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t✝ u v s : Set α
h : IsPreconnected s
t t' : Set α
ht : IsClosed t
ht' : IsClosed t'
htt' : s ⊆ t ∪ t'
x : α
xs : x ∈ s
xt : x ∈ t
y : α
ys : y ∈ s
yt' : y ∈ t'
h' : s ⊆ tᶜ ∪ t'ᶜ
xt' : x ∉ t'
yt : y ∉ t
this : Set.Nonempty (s ∩ (t ∪ t')ᶜ)
⊢ False

Next tactic:
exact this.ne_empty htt'.disjoint_compl_right.inter_eq
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u v s : Set α
⊢ (∀ (t t' : Set α),
      IsClosed t →
        IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))) →
    IsPreconnected s

Next tactic:
rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
⊢ ¬s ⊆ uᶜ ∪ vᶜ

Next tactic:
intro h'
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
h' : s ⊆ uᶜ ∪ vᶜ
⊢ False

Next tactic:
have xv : x ∉ v := (h' xs).elim (absurd xu) id
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xv : x ∉ v := (h' xs).elim (absurd xu) id
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
h' : s ⊆ uᶜ ∪ vᶜ
xv : x ∉ v
⊢ False

Next tactic:
have yu : y ∉ u := (h' ys).elim id (absurd yv)
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xv : x ∉ v := (h' xs).elim (absurd xu) id
      have yu : y ∉ u := (h' ys).elim id (absurd yv)
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
h' : s ⊆ uᶜ ∪ vᶜ
xv : x ∉ v
yu : y ∉ u
⊢ False

Next tactic:
have := h _ _ hu.isClosed_compl hv.isClosed_compl h' ⟨y, ys, yu⟩ ⟨x, xs, xv⟩
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xv : x ∉ v := (h' xs).elim (absurd xu) id
      have yu : y ∉ u := (h' ys).elim id (absurd yv)
      have := h _ _ hu.isClosed_compl hv.isClosed_compl h' ⟨y, ys, yu⟩ ⟨x, xs, xv⟩
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
h' : s ⊆ uᶜ ∪ vᶜ
xv : x ∉ v
yu : y ∉ u
this : Set.Nonempty (s ∩ (uᶜ ∩ vᶜ))
⊢ False

Next tactic:
rw [← compl_union] at this
theorem isPreconnected_closed_iff {s : Set α} :
    IsPreconnected s ↔ ∀ t t', IsClosed t → IsClosed t' →
      s ⊆ t ∪ t' → (s ∩ t).Nonempty → (s ∩ t').Nonempty → (s ∩ (t ∩ t')).Nonempty :=
  ⟨by
      rintro h t t' ht ht' htt' ⟨x, xs, xt⟩ ⟨y, ys, yt'⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xt' : x ∉ t' := (h' xs).resolve_left (absurd xt)
      have yt : y ∉ t := (h' ys).resolve_right (absurd yt')
      have := h _ _ ht.isOpen_compl ht'.isOpen_compl h' ⟨y, ys, yt⟩ ⟨x, xs, xt'⟩
      rw [← compl_union] at this
      exact this.ne_empty htt'.disjoint_compl_right.inter_eq,
    by
      rintro h u v hu hv huv ⟨x, xs, xu⟩ ⟨y, ys, yv⟩
      rw [← not_disjoint_iff_nonempty_inter, ← subset_compl_iff_disjoint_right, compl_inter]
      intro h'
      have xv : x ∉ v := (h' xs).elim (absurd xu) id
      have yu : y ∉ u := (h' ys).elim id (absurd yv)
      have := h _ _ hu.isClosed_compl hv.isClosed_compl h' ⟨y, ys, yu⟩ ⟨x, xs, xv⟩
      rw [← compl_union] at this
      

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
h :
  ∀ (t t' : Set α),
    IsClosed t → IsClosed t' → s ⊆ t ∪ t' → Set.Nonempty (s ∩ t) → Set.Nonempty (s ∩ t') → Set.Nonempty (s ∩ (t ∩ t'))
u v : Set α
hu : IsOpen u
hv : IsOpen v
huv : s ⊆ u ∪ v
x : α
xs : x ∈ s
xu : x ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
h' : s ⊆ uᶜ ∪ vᶜ
xv : x ∉ v
yu : y ∉ u
this : Set.Nonempty (s ∩ (u ∪ v)ᶜ)
⊢ False

Next tactic:
exact this.ne_empty huv.disjoint_compl_right.inter_eq
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
⊢ IsPreconnected (f '' s) ↔ IsPreconnected s

Next tactic:
refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
⊢ IsPreconnected s

Next tactic:
rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
u v : Set α
hu' : IsOpen u
hv' : IsOpen v
huv : s ⊆ u ∪ v
x : α
hxs : x ∈ s
hxu : x ∈ u
y : α
hys : y ∈ s
hyv : y ∈ v
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
v : Set α
hv' : IsOpen v
x : α
hxs : x ∈ s
y : α
hys : y ∈ s
hyv : y ∈ v
u : Set β
hu : IsOpen u
hu' : IsOpen (f ⁻¹' u)
huv : s ⊆ f ⁻¹' u ∪ v
hxu : x ∈ f ⁻¹' u
⊢ Set.Nonempty (s ∩ (f ⁻¹' u ∩ v))

Next tactic:
rcases hf.isOpen_iff.1 hv' with ⟨v, hv, rfl⟩
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
  rcases hf.isOpen_iff.1 hv' with ⟨v, hv, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
x : α
hxs : x ∈ s
y : α
hys : y ∈ s
u : Set β
hu : IsOpen u
hu' : IsOpen (f ⁻¹' u)
hxu : x ∈ f ⁻¹' u
v : Set β
hv : IsOpen v
hv' : IsOpen (f ⁻¹' v)
hyv : y ∈ f ⁻¹' v
huv : s ⊆ f ⁻¹' u ∪ f ⁻¹' v
⊢ Set.Nonempty (s ∩ (f ⁻¹' u ∩ f ⁻¹' v))

Next tactic:
replace huv : f '' s ⊆ u ∪ v
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
  rcases hf.isOpen_iff.1 hv' with ⟨v, hv, rfl⟩
  replace huv : f '' s ⊆ u ∪ v; · 

Proof state:
case huv
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
x : α
hxs : x ∈ s
y : α
hys : y ∈ s
u : Set β
hu : IsOpen u
hu' : IsOpen (f ⁻¹' u)
hxu : x ∈ f ⁻¹' u
v : Set β
hv : IsOpen v
hv' : IsOpen (f ⁻¹' v)
hyv : y ∈ f ⁻¹' v
huv : s ⊆ f ⁻¹' u ∪ f ⁻¹' v
⊢ f '' s ⊆ u ∪ v

Next tactic:
rwa [image_subset_iff]
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
  rcases hf.isOpen_iff.1 hv' with ⟨v, hv, rfl⟩
  replace huv : f '' s ⊆ u ∪ v; · rwa [image_subset_iff]
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
x : α
hxs : x ∈ s
y : α
hys : y ∈ s
u : Set β
hu : IsOpen u
hu' : IsOpen (f ⁻¹' u)
hxu : x ∈ f ⁻¹' u
v : Set β
hv : IsOpen v
hv' : IsOpen (f ⁻¹' v)
hyv : y ∈ f ⁻¹' v
huv : f '' s ⊆ u ∪ v
⊢ Set.Nonempty (s ∩ (f ⁻¹' u ∩ f ⁻¹' v))

Next tactic:
rcases h u v hu hv huv ⟨f x, mem_image_of_mem _ hxs, hxu⟩ ⟨f y, mem_image_of_mem _ hys, hyv⟩ with
    ⟨_, ⟨z, hzs, rfl⟩, hzuv⟩
theorem Inducing.isPreconnected_image [TopologicalSpace β] {s : Set α} {f : α → β}
    (hf : Inducing f) : IsPreconnected (f '' s) ↔ IsPreconnected s := by
  refine' ⟨fun h => _, fun h => h.image _ hf.continuous.continuousOn⟩
  rintro u v hu' hv' huv ⟨x, hxs, hxu⟩ ⟨y, hys, hyv⟩
  rcases hf.isOpen_iff.1 hu' with ⟨u, hu, rfl⟩
  rcases hf.isOpen_iff.1 hv' with ⟨v, hv, rfl⟩
  replace huv : f '' s ⊆ u ∪ v; · rwa [image_subset_iff]
  rcases h u v hu hv huv ⟨f x, mem_image_of_mem _ hxs, hxu⟩ ⟨f y, mem_image_of_mem _ hys, hyv⟩ with
    ⟨_, ⟨z, hzs, rfl⟩, hzuv⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
s : Set α
f : α → β
hf : Inducing f
h : IsPreconnected (f '' s)
x : α
hxs : x ∈ s
y : α
hys : y ∈ s
u : Set β
hu : IsOpen u
hu' : IsOpen (f ⁻¹' u)
hxu : x ∈ f ⁻¹' u
v : Set β
hv : IsOpen v
hv' : IsOpen (f ⁻¹' v)
hyv : y ∈ f ⁻¹' v
huv : f '' s ⊆ u ∪ v
z : α
hzs : z ∈ s
hzuv : f z ∈ u ∩ v
⊢ Set.Nonempty (s ∩ (f ⁻¹' u ∩ f ⁻¹' v))

Next tactic:
exact ⟨z, hzs, hzuv⟩
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
hsf : s ⊆ range f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
⊢ Set.Nonempty (f ⁻¹' s ∩ (u ∩ v))

Next tactic:
replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
hsf : f '' (f ⁻¹' s) = s
⊢ Set.Nonempty (f ⁻¹' s ∩ (u ∩ v))

Next tactic:
obtain ⟨_, has, ⟨a, hau, rfl⟩, hav⟩ : (s ∩ (f '' u ∩ f '' v)).Nonempty
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
  obtain ⟨_, has, ⟨a, hau, rfl⟩, hav⟩ : (s ∩ (f '' u ∩ f '' v)).Nonempty
  · 

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
hsf : f '' (f ⁻¹' s) = s
⊢ Set.Nonempty (s ∩ (f '' u ∩ f '' v))

Next tactic:
refine hs (f '' u) (f '' v) (hf u hu) (hf v hv) ?_ ?_ ?_
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
  obtain ⟨_, has, ⟨a, hau, rfl⟩, hav⟩ : (s ∩ (f '' u ∩ f '' v)).Nonempty
  · refine hs (f '' u) (f '' v) (hf u hu) (hf v hv) ?_ ?_ ?_
    · 

Proof state:
case refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
hsf : f '' (f ⁻¹' s) = s
⊢ s ⊆ f '' u ∪ f '' v

Next tactic:
simpa only [hsf, image_union] using image_subset f hsuv
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
  obtain ⟨_, has, ⟨a, hau, rfl⟩, hav⟩ : (s ∩ (f '' u ∩ f '' v)).Nonempty
  · refine hs (f '' u) (f '' v) (hf u hu) (hf v hv) ?_ ?_ ?_
    · simpa only [hsf, image_union] using image_subset f hsuv
    · 

Proof state:
case refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
hsf : f '' (f ⁻¹' s) = s
⊢ Set.Nonempty (s ∩ f '' u)

Next tactic:
simpa only [image_preimage_inter] using hsu.image f
theorem IsPreconnected.preimage_of_isOpenMap [TopologicalSpace β] {f : α → β} {s : Set β}
    (hs : IsPreconnected s) (hinj : Function.Injective f) (hf : IsOpenMap f) (hsf : s ⊆ range f) :
    IsPreconnected (f ⁻¹' s) := fun u v hu hv hsuv hsu hsv => by
  replace hsf : f '' (f ⁻¹' s) = s := image_preimage_eq_of_subset hsf
  obtain ⟨_, has, ⟨a, hau, rfl⟩, hav⟩ : (s ∩ (f '' u ∩ f '' v)).Nonempty
  · refine hs (f '' u) (f '' v) (hf u hu) (hf v hv) ?_ ?_ ?_
    · simpa only [hsf, image_union] using image_subset f hsuv
    · simpa only [image_preimage_inter] using hsu.image f
    · 

Proof state:
case refine_3
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s✝ t u✝ v✝ : Set α
inst✝ : TopologicalSpace β
f : α → β
s : Set β
hs : IsPreconnected s
hinj : Injective f
hf : IsOpenMap f
u v : Set α
hu : IsOpen u
hv : IsOpen v
hsuv : f ⁻¹' s ⊆ u ∪ v
hsu : Set.Nonempty (f ⁻¹' s ∩ u)
hsv : Set.Nonempty (f ⁻¹' s ∩ v)
hsf : f '' (f ⁻¹' s) = s
⊢ Set.Nonempty (s ∩ f '' v)

Next tactic:
simpa only [image_preimage_inter] using hsv.image f