l3lab/ntp-mathlib huggingface dataset:
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    

Proof state:
case refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
⊢ ⊤ ≤ ⨆ i, LowerAdjoint.toFun (Substructure.closure L) (⇑(of L ι G f i) '' Classical.choose (_ : Substructure.CG ⊤))

Next tactic:
simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    

Proof state:
case refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
⊢ ⊤ ≤
    ⨆ i,
      Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤)))

Next tactic:
rw [le_iSup_iff]
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    

Proof state:
case refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
⊢ ∀ (b : Substructure L (DirectLimit G f)),
    (∀ (i : ι),
        Substructure.map (Embedding.toHom (of L ι G f i))
            (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
          b) →
      ⊤ ≤ b

Next tactic:
intro S hS x _
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    intro S hS x _
    

Proof state:
case refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
S : Substructure L (DirectLimit G f)
hS :
  ∀ (i : ι),
    Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
      S
x : DirectLimit G f
a✝ : x ∈ ⊤
⊢ x ∈ S

Next tactic:
let out := Quotient.out (s := DirectLimit.setoid G f)
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    intro S hS x _
    let out := Quotient.out (s := DirectLimit.setoid G f)
    

Proof state:
case refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
S : Substructure L (DirectLimit G f)
hS :
  ∀ (i : ι),
    Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
      S
x : DirectLimit G f
a✝ : x ∈ ⊤
out : Quotient (setoid G f) → Σˣ f := Quotient.out
⊢ x ∈ S

Next tactic:
refine' hS (out x).1 ⟨(out x).2, _, _⟩
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    intro S hS x _
    let out := Quotient.out (s := DirectLimit.setoid G f)
    refine' hS (out x).1 ⟨(out x).2, _, _⟩
    · 

Proof state:
case refine'_2.refine'_1
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
S : Substructure L (DirectLimit G f)
hS :
  ∀ (i : ι),
    Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
      S
x : DirectLimit G f
a✝ : x ∈ ⊤
out : Quotient (setoid G f) → Σˣ f := Quotient.out
⊢ (out x).snd ∈ ↑(LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤)))

Next tactic:
rw [(Classical.choose_spec (h (out x).1).out).2]
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    intro S hS x _
    let out := Quotient.out (s := DirectLimit.setoid G f)
    refine' hS (out x).1 ⟨(out x).2, _, _⟩
    · rw [(Classical.choose_spec (h (out x).1).out).2]
      

Proof state:
case refine'_2.refine'_1
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
S : Substructure L (DirectLimit G f)
hS :
  ∀ (i : ι),
    Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
      S
x : DirectLimit G f
a✝ : x ∈ ⊤
out : Quotient (setoid G f) → Σˣ f := Quotient.out
⊢ (out x).snd ∈ ↑⊤

Next tactic:
trivial
/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Encodable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f) := by
  refine' ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, _, _⟩⟩
  · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _
  · rw [eq_top_iff, Substructure.closure_unionᵢ]
    simp_rw [← Embedding.coe_toHom, Substructure.closure_image]
    rw [le_iSup_iff]
    intro S hS x _
    let out := Quotient.out (s := DirectLimit.setoid G f)
    refine' hS (out x).1 ⟨(out x).2, _, _⟩
    · rw [(Classical.choose_spec (h (out x).1).out).2]
      trivial
    · 

Proof state:
case refine'_2.refine'_2
L : Language
ι✝ : Type v
inst✝¹¹ : Preorder ι✝
G✝ : ι✝ → Type w
inst✝¹⁰ : (i : ι✝) → Structure L (G✝ i)
f✝ : (i j : ι✝) → i ≤ j → G✝ i ↪[L] G✝ j
inst✝⁹ : IsDirected ι✝ fun x x_1 => x ≤ x_1
inst✝⁸ : DirectedSystem G✝ fun i j h => ⇑(f✝ i j h)
inst✝⁷ : Nonempty ι✝
P : Type u₁
inst✝⁶ : Structure L P
g : (i : ι✝) → G✝ i ↪[L] P
Hg : ∀ (i j : ι✝) (hij : i ≤ j) (x : G✝ i), (g j) ((f✝ i j hij) x) = (g i) x
ι : Type u_1
inst✝⁵ : Encodable ι
inst✝⁴ : Preorder ι
inst✝³ : IsDirected ι fun x x_1 => x ≤ x_1
inst✝² : Nonempty ι
G : ι → Type w
inst✝¹ : (i : ι) → Structure L (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
h : ∀ (i : ι), CG L (G i)
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
S : Substructure L (DirectLimit G f)
hS :
  ∀ (i : ι),
    Substructure.map (Embedding.toHom (of L ι G f i))
        (LowerAdjoint.toFun (Substructure.closure L) (Classical.choose (_ : Substructure.CG ⊤))) ≤
      S
x : DirectLimit G f
a✝ : x ∈ ⊤
out : Quotient (setoid G f) → Σˣ f := Quotient.out
⊢ (Embedding.toHom (of L ι G f (out x).fst)) (out x).snd = x

Next tactic:
simp only [Embedding.coe_toHom, DirectLimit.of_apply, Sigma.eta, Quotient.out_eq]
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u v s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
⊢ IsPreconnected s

Next tactic:
rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨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 α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
⊢ x ∈ s

Next tactic:
rcases H y ys with ⟨t, ts, xt, -, -⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    

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 α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
t : Set α
ts : t ⊆ s
xt : x ∈ t
⊢ x ∈ s

Next tactic:
exact ts xt
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  

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 α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
cases hs xs
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  cases hs xs
  

Proof state:
case intro.intro.intro.intro.inl
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
h✝ : x ∈ u
⊢ Set.Nonempty (s ∩ (u ∩ v))
case intro.intro.intro.intro.inr
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
h✝ : x ∈ v
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
case inl xu =>
    rcases H y ys with ⟨t, ts, xt, yt, ht⟩
    have := ht u v hu hv (ts.trans hs) ⟨x, xt, xu⟩ ⟨y, yt, yv⟩
    exact this.imp fun z hz => ⟨ts hz.1, hz.2⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  cases hs xs
  

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
xu : x ∈ u
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
case inl xu =>
    rcases H y ys with ⟨t, ts, xt, yt, ht⟩
    have := ht u v hu hv (ts.trans hs) ⟨x, xt, xu⟩ ⟨y, yt, yv⟩
    exact this.imp fun z hz => ⟨ts hz.1, hz.2⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  cases hs xs
  case inl xu =>
    

Proof state:
α : Type u
β : Type v
ι : Type u_1
π : ι → Type u_2
inst✝ : TopologicalSpace α
s✝ t u✝ v✝ s : Set α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
xu : x ∈ u
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
rcases H y ys with ⟨t, ts, xt, yt, ht⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  cases hs xs
  case inl xu =>
    rcases H y ys with ⟨t, ts, xt, yt, ht⟩
    

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 α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
xu : x ∈ u
t : Set α
ts : t ⊆ s
xt : x ∈ t
yt : y ∈ t
ht : IsPreconnected t
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
have := ht u v hu hv (ts.trans hs) ⟨x, xt, xu⟩ ⟨y, yt, yv⟩
/-- If any point of a set is joined to a fixed point by a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall {s : Set α} (x : α)
    (H : ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) : IsPreconnected s := by
  rintro u v hu hv hs ⟨z, zs, zu⟩ ⟨y, ys, yv⟩
  have xs : x ∈ s := by
    rcases H y ys with ⟨t, ts, xt, -, -⟩
    exact ts xt
  -- porting note: todo: use `wlog xu : x ∈ u := hs xs using u v y z, v u z y`
  cases hs xs
  case inl xu =>
    rcases H y ys with ⟨t, ts, xt, yt, ht⟩
    have := ht u v hu hv (ts.trans hs) ⟨x, xt, xu⟩ ⟨y, yt, 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 α
x : α
H : ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t
u v : Set α
hu : IsOpen u
hv : IsOpen v
hs : s ⊆ u ∪ v
z : α
zs : z ∈ s
zu : z ∈ u
y : α
ys : y ∈ s
yv : y ∈ v
xs : x ∈ s
xu : x ∈ u
t : Set α
ts : t ⊆ s
xt : x ∈ t
yt : y ∈ t
ht : IsPreconnected t
this : Set.Nonempty (t ∩ (u ∩ v))
⊢ Set.Nonempty (s ∩ (u ∩ v))

Next tactic:
exact this.imp fun z hz => ⟨ts hz.1, hz.2⟩