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

tactic: refine ⟨fun hs => ?_, ?_⟩
state_before: α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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

case refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: obtain ⟨x | x, hx⟩ := hs.nonempty
state_before: case refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1.intro.inl
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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

case refine_1.intro.inr
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: have h : s ⊆ range Sum.inl :=
  hs.isPreconnected.subset_isClopen isClopen_range_inl ⟨.inl x, hx, x, rfl⟩
state_before: case refine_1.intro.inl
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1.intro.inl
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: refine Or.inl ⟨Sum.inl ⁻¹' s, ?_, ?_⟩
state_before: case refine_1.intro.inl
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1.intro.inl.refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)

case refine_1.intro.inl.refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: exact hs.preimage_of_isOpenMap Sum.inl_injective isOpenMap_inl h
state_before: case refine_1.intro.inl.refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)
state_after: no goals

tactic: exact (image_preimage_eq_of_subset h).symm
state_before: case refine_1.intro.inl.refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)
state_after: no goals

tactic: have h : s ⊆ range Sum.inr :=
  hs.isPreconnected.subset_isClopen isClopen_range_inr ⟨.inr x, hx, x, rfl⟩
state_before: case refine_1.intro.inr
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1.intro.inr
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: refine Or.inr ⟨Sum.inr ⁻¹' s, ?_, ?_⟩
state_before: case refine_1.intro.inr
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_1.intro.inr.refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)

case refine_1.intro.inr.refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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: exact hs.preimage_of_isOpenMap Sum.inr_injective isOpenMap_inr h
state_before: case refine_1.intro.inr.refine_1
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)
state_after: no goals

tactic: exact (image_preimage_eq_of_subset h).symm
state_before: case refine_1.intro.inr.refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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)
state_after: no goals

tactic: rintro (⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩)
state_before: case refine_2
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
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
state_after: case refine_2.inl.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set α
ht : IsConnected t
⊢ IsConnected (inl '' t)

case refine_2.inr.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set β
ht : IsConnected t
⊢ IsConnected (inr '' t)

tactic: exact ht.image _ continuous_inl.continuousOn
state_before: case refine_2.inl.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set α
ht : IsConnected t
⊢ IsConnected (inl '' t)
state_after: no goals

tactic: exact ht.image _ continuous_inr.continuousOn
state_before: case refine_2.inr.intro.intro
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝¹ : TopologicalSpace α
s t✝ u v : Set α
inst✝ : TopologicalSpace β
t : Set β
ht : IsConnected t
⊢ IsConnected (inr '' t)
state_after: no goals