-- Mathlib/Topology/Connected/Clopen.lean
theorem preimage_connectedComponent_connected
    (connected_fibers : ∀ t : β, IsConnected (f ⁻¹' {t}))
    (hcl : ∀ T : Set β, IsClosed T ↔ IsClosed (f ⁻¹' T)) (t : β) :
    IsConnected (f ⁻¹' connectedComponent t)

Proof state:
case inr.h
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
T₁_u : f ⁻¹' T₁ = f ⁻¹' connectedComponent t ∩ u
T₂_v : f ⁻¹' T₂ = f ⁻¹' connectedComponent t ∩ v
hT₁ : IsClosed T₁
hT₂ : IsClosed T₂
t' : β
ht' : t' ∈ connectedComponent t
htv : f ⁻¹' {t'} ⊆ v
⊢ t' ∈ T₂

Tactic:
exact ⟨ht', htv⟩

Result:
no goals

Proof state:
case a.intro.right
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
a : α
hat : a ∈ f ⁻¹' connectedComponent t
hau : a ∈ u
⊢ f ⁻¹' {f a} ⊆ u

Tactic:
refine (fiber_decomp (f a) (mem_preimage.1 hat)).resolve_right fun h => ?_

Result:
case a.intro.right
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
a : α
hat : a ∈ f ⁻¹' connectedComponent t
hau : a ∈ u
h : f ⁻¹' {f a} ⊆ v
⊢ False

Proof state:
case inr
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
T₁_u : f ⁻¹' T₁ = f ⁻¹' connectedComponent t ∩ u
T₂_v : f ⁻¹' T₂ = f ⁻¹' connectedComponent t ∩ v
hT₁ : IsClosed T₁
hT₂ : IsClosed T₂
T_decomp : connectedComponent t ⊆ T₁ ∪ T₂
T_disjoint : Disjoint T₁ T₂
h : connectedComponent t ⊆ T₂
⊢ f ⁻¹' connectedComponent t ⊆ u ∨ f ⁻¹' connectedComponent t ⊆ v

Tactic:
right

Result:
case inr.h
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
T₁_u : f ⁻¹' T₁ = f ⁻¹' connectedComponent t ∩ u
T₂_v : f ⁻¹' T₂ = f ⁻¹' connectedComponent t ∩ v
hT₁ : IsClosed T₁
hT₂ : IsClosed T₂
T_decomp : connectedComponent t ⊆ T₁ ∪ T₂
T_disjoint : Disjoint T₁ T₂
h : connectedComponent t ⊆ T₂
⊢ f ⁻¹' connectedComponent t ⊆ v

Proof state:
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
T₁_u : f ⁻¹' T₁ = f ⁻¹' connectedComponent t ∩ u
T₂_v : f ⁻¹' T₂ = f ⁻¹' connectedComponent t ∩ v
hT₁ : IsClosed T₁
hT₂ : IsClosed T₂
T_decomp : connectedComponent t ⊆ T₁ ∪ T₂
⊢ f ⁻¹' connectedComponent t ⊆ u ∨ f ⁻¹' connectedComponent t ⊆ v

Tactic:
have T_disjoint : Disjoint T₁ T₂ := by
  refine Disjoint.of_preimage hf ?_
  rw [T₁_u, T₂_v, disjoint_iff_inter_eq_empty, ← inter_inter_distrib_left, uv_disj.inter_eq,
    inter_empty]

Result:
α : Type u
β : Type v
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : α → β
connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t})
hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T)
t : β
hf : Surjective f
hT : IsClosed (f ⁻¹' connectedComponent t)
u v : Set α
hu : IsClosed u
hv : IsClosed v
huv : f ⁻¹' connectedComponent t ⊆ u ∪ v
uv_disj : Disjoint u v
T₁ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ u}
T₂ : Set β := {t' | t' ∈ connectedComponent t ∧ f ⁻¹' {t'} ⊆ v}
fiber_decomp : ∀ t' ∈ connectedComponent t, f ⁻¹' {t'} ⊆ u ∨ f ⁻¹' {t'} ⊆ v
T₁_u : f ⁻¹' T₁ = f ⁻¹' connectedComponent t ∩ u
T₂_v : f ⁻¹' T₂ = f ⁻¹' connectedComponent t ∩ v
hT₁ : IsClosed T₁
hT₂ : IsClosed T₂
T_decomp : connectedComponent t ⊆ T₁ ∪ T₂
T_disjoint : Disjoint T₁ T₂
⊢ f ⁻¹' connectedComponent t ⊆ u ∨ f ⁻¹' connectedComponent t ⊆ v