Theorem: Sum.isConnected_iff
File: Mathlib/Topology/Connected.lean

tactic: refine' ⟨fun hs => _, _⟩
state_before: α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
⊢ IsConnected s ↔ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: obtain ⟨x | x, hx⟩ := hs.nonempty
state_before: case refine'_1
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
⊢ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: have h : s ⊆ range Sum.inl :=
  hs.isPreconnected.subset_clopen isClopen_range_inl ⟨.inl x, hx, x, rfl⟩
state_before: case refine'_1.intro.inl
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : α
hx : inl x ∈ s
⊢ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: refine' Or.inl ⟨Sum.inl ⁻¹' s, _, _⟩
state_before: case refine'_1.intro.inl
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : α
hx : inl x ∈ s
h : s ⊆ range inl
⊢ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: exact hs.preimage_of_openMap Sum.inl_injective isOpenMap_inl h
state_before: case refine'_1.intro.inl.refine'_1
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : α
hx : inl x ∈ s
h : s ⊆ range inl
⊢ IsConnected (inl ⁻¹' s)

tactic: exact (image_preimage_eq_of_subset h).symm
state_before: case refine'_1.intro.inl.refine'_2
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : α
hx : inl x ∈ s
h : s ⊆ range inl
⊢ s = inl '' (inl ⁻¹' s)

tactic: have h : s ⊆ range Sum.inr :=
  hs.isPreconnected.subset_clopen isClopen_range_inr ⟨.inr x, hx, x, rfl⟩
state_before: case refine'_1.intro.inr
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : β
hx : inr x ∈ s
⊢ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: refine' Or.inr ⟨Sum.inr ⁻¹' s, _, _⟩
state_before: case refine'_1.intro.inr
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : β
hx : inr x ∈ s
h : s ⊆ range inr
⊢ (∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t

tactic: exact hs.preimage_of_openMap Sum.inr_injective isOpenMap_inr h
state_before: case refine'_1.intro.inr.refine'_1
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : β
hx : inr x ∈ s
h : s ⊆ range inr
⊢ IsConnected (inr ⁻¹' s)

tactic: exact (image_preimage_eq_of_subset h).symm
state_before: case refine'_1.intro.inr.refine'_2
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
hs : IsConnected s
x : β
hx : inr x ∈ s
h : s ⊆ range inr
⊢ s = inr '' (inr ⁻¹' s)

tactic: rintro (⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩)
state_before: case refine'_2
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s✝ t u v : Set α
inst✝ : TopologicalSpace β
s : Set (α ⊕ β)
⊢ ((∃ t, IsConnected t ∧ s = inl '' t) ∨ ∃ t, IsConnected t ∧ s = inr '' t) → IsConnected s

tactic: exact ht.image _ continuous_inl.continuousOn
state_before: case refine'_2.inl.intro.intro
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set α
ht : IsConnected t
⊢ IsConnected (inl '' t)

tactic: exact ht.image _ continuous_inr.continuousOn
state_before: case refine'_2.inr.intro.intro
α : Type u
β : Type v
ι : Type ?u.42555
π : ι → Type ?u.42560
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set β
ht : IsConnected t
⊢ IsConnected (inr '' t)