l3lab/ntp-mathlib huggingface dataset:
theorem embedding_prod_map {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : Embedding f)
    (hg : Embedding g) : Embedding (Limits.prod.map f g) :=
  ⟨inducing_prod_map hf.toInducing hg.toInducing, by
    

Proof state:
J : Type v
inst✝ : SmallCategory J
W X Y Z : TopCat
f : W ⟶ X
g : Y ⟶ Z
hf : Embedding ⇑f
hg : Embedding ⇑g
⊢ Function.Injective ⇑(prod.map f g)

Next tactic:
haveI := (TopCat.mono_iff_injective _).mpr hf.inj
theorem embedding_prod_map {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : Embedding f)
    (hg : Embedding g) : Embedding (Limits.prod.map f g) :=
  ⟨inducing_prod_map hf.toInducing hg.toInducing, by
    haveI := (TopCat.mono_iff_injective _).mpr hf.inj
    

Proof state:
J : Type v
inst✝ : SmallCategory J
W X Y Z : TopCat
f : W ⟶ X
g : Y ⟶ Z
hf : Embedding ⇑f
hg : Embedding ⇑g
this : Mono f
⊢ Function.Injective ⇑(prod.map f g)

Next tactic:
haveI := (TopCat.mono_iff_injective _).mpr hg.inj
theorem embedding_prod_map {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : Embedding f)
    (hg : Embedding g) : Embedding (Limits.prod.map f g) :=
  ⟨inducing_prod_map hf.toInducing hg.toInducing, by
    haveI := (TopCat.mono_iff_injective _).mpr hf.inj
    haveI := (TopCat.mono_iff_injective _).mpr hg.inj
    

Proof state:
J : Type v
inst✝ : SmallCategory J
W X Y Z : TopCat
f : W ⟶ X
g : Y ⟶ Z
hf : Embedding ⇑f
hg : Embedding ⇑g
this✝ : Mono f
this : Mono g
⊢ Function.Injective ⇑(prod.map f g)

Next tactic:
exact (TopCat.mono_iff_injective _).mp inferInstance
/-- The binary coproduct cofan in `TopCat`. -/
protected def binaryCofan (X Y : TopCat.{u}) : BinaryCofan X Y :=
  BinaryCofan.mk (⟨Sum.inl, by 

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ Continuous Sum.inl

Next tactic:
continuity
/-- The binary coproduct cofan in `TopCat`. -/
protected def binaryCofan (X Y : TopCat.{u}) : BinaryCofan X Y :=
  BinaryCofan.mk (⟨Sum.inl, by continuity⟩ : X ⟶ TopCat.of (Sum X Y)) ⟨Sum.inr, by 

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ Continuous Sum.inr

Next tactic:
continuity
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ IsColimit (TopCat.binaryCofan X Y)

Next tactic:
refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · 

Proof state:
case refine'_1
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
⊢ Continuous (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))

Next tactic:
apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · 

Proof state:
case refine'_2
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ ∀ (s : BinaryCofan X Y),
    ContinuousMap.mk Sum.inl ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s =
      BinaryCofan.inl s

Next tactic:
intro s
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    

Proof state:
case refine'_2
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
⊢ ContinuousMap.mk Sum.inl ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s =
    BinaryCofan.inl s

Next tactic:
ext
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    

Proof state:
case refine'_2.w
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
x✝ : (forget TopCat).obj X
⊢ (ContinuousMap.mk Sum.inl ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s) x✝ =
    (BinaryCofan.inl s) x✝

Next tactic:
rfl
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · 

Proof state:
case refine'_3
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ ∀ (s : BinaryCofan X Y),
    ContinuousMap.mk Sum.inr ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s =
      BinaryCofan.inr s

Next tactic:
intro s
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · intro s
    

Proof state:
case refine'_3
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
⊢ ContinuousMap.mk Sum.inr ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s =
    BinaryCofan.inr s

Next tactic:
ext
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · intro s
    ext
    

Proof state:
case refine'_3.w
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
x✝ : (forget TopCat).obj Y
⊢ (ContinuousMap.mk Sum.inr ≫ (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s) x✝ =
    (BinaryCofan.inr s) x✝

Next tactic:
rfl
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · intro s
    ext
    rfl
  · 

Proof state:
case refine'_4
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
⊢ ∀ (s : BinaryCofan X Y) (m : of (↑X ⊕ ↑Y) ⟶ s.pt),
    ContinuousMap.mk Sum.inl ≫ m = BinaryCofan.inl s →
      ContinuousMap.mk Sum.inr ≫ m = BinaryCofan.inr s →
        m = (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s

Next tactic:
intro s m h₁ h₂
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · intro s
    ext
    rfl
  · intro s m h₁ h₂
    

Proof state:
case refine'_4
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
m : of (↑X ⊕ ↑Y) ⟶ s.pt
h₁ : ContinuousMap.mk Sum.inl ≫ m = BinaryCofan.inl s
h₂ : ContinuousMap.mk Sum.inr ≫ m = BinaryCofan.inr s
⊢ m = (fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s

Next tactic:
ext (x | x)
/-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/
def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by
  refine' Limits.BinaryCofan.isColimitMk (fun s =>
    {toFun := Sum.elim s.inl s.inr, continuous_toFun := _ }) _ _ _
  · apply
      Continuous.sum_elim (BinaryCofan.inl s).continuous_toFun (BinaryCofan.inr s).continuous_toFun
  · intro s
    ext
    rfl
  · intro s
    ext
    rfl
  · intro s m h₁ h₂
    ext (x | x)
    

Proof state:
case refine'_4.w.inl
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
m : of (↑X ⊕ ↑Y) ⟶ s.pt
h₁ : ContinuousMap.mk Sum.inl ≫ m = BinaryCofan.inl s
h₂ : ContinuousMap.mk Sum.inr ≫ m = BinaryCofan.inr s
x : ↑X
⊢ m (Sum.inl x) = ((fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s) (Sum.inl x)
case refine'_4.w.inr
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
s : BinaryCofan X Y
m : of (↑X ⊕ ↑Y) ⟶ s.pt
h₁ : ContinuousMap.mk Sum.inl ≫ m = BinaryCofan.inl s
h₂ : ContinuousMap.mk Sum.inr ≫ m = BinaryCofan.inr s
x : ↑Y
⊢ m (Sum.inr x) = ((fun s => ContinuousMap.mk (Sum.elim ⇑(BinaryCofan.inl s) ⇑(BinaryCofan.inr s))) s) (Sum.inr x)

Next tactic:
exacts [(ConcreteCategory.congr_hom h₁ x : _), (ConcreteCategory.congr_hom h₂ x : _)]
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
⊢ Nonempty (IsColimit c) ↔
    OpenEmbedding ⇑(BinaryCofan.inl c) ∧
      OpenEmbedding ⇑(BinaryCofan.inr c) ∧ IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))

Next tactic:
constructor
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · 

Proof state:
case mp
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
⊢ Nonempty (IsColimit c) →
    OpenEmbedding ⇑(BinaryCofan.inl c) ∧
      OpenEmbedding ⇑(BinaryCofan.inr c) ∧ IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))

Next tactic:
rintro ⟨h⟩
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      

Proof state:
case mp.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h : IsColimit c
⊢ OpenEmbedding ⇑(BinaryCofan.inl c) ∧
    OpenEmbedding ⇑(BinaryCofan.inr c) ∧ IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))

Next tactic:
rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      

Proof state:
case mp.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h : IsColimit c
⊢ OpenEmbedding
      ⇑((TopCat.binaryCofan X Y).ι.app { as := WalkingPair.left } ≫
          (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv) ∧
    OpenEmbedding
        ⇑((TopCat.binaryCofan X Y).ι.app { as := WalkingPair.right } ≫
            (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv) ∧
      IsCompl
        (Set.range
          ⇑((TopCat.binaryCofan X Y).ι.app { as := WalkingPair.left } ≫
              (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))
        (Set.range
          ⇑((TopCat.binaryCofan X Y).ι.app { as := WalkingPair.right } ≫
              (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))

Next tactic:
dsimp
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      

Proof state:
case mp.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h : IsColimit c
⊢ OpenEmbedding
      ⇑(BinaryCofan.inl (TopCat.binaryCofan X Y) ≫
          (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv) ∧
    OpenEmbedding
        ⇑(BinaryCofan.inr (TopCat.binaryCofan X Y) ≫
            (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv) ∧
      IsCompl
        (Set.range
          ⇑(BinaryCofan.inl (TopCat.binaryCofan X Y) ≫
              (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))
        (Set.range
          ⇑(BinaryCofan.inr (TopCat.binaryCofan X Y) ≫
              (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))

Next tactic:
refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      

Proof state:
case mp.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h : IsColimit c
⊢ IsCompl
    (Set.range
      ⇑(BinaryCofan.inl (TopCat.binaryCofan X Y) ≫
          (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))
    (Set.range
      ⇑(BinaryCofan.inr (TopCat.binaryCofan X Y) ≫
          (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv))

Next tactic:
erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
      

Proof state:
case mp.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h : IsColimit c
⊢ ⇑(IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)).inv ''
      (⇑(BinaryCofan.inl (TopCat.binaryCofan X Y)) '' Set.range fun x => x) =
    ⇑(Homeomorph.symm (homeoOfIso (IsColimit.coconePointUniqueUpToIso h (binaryCofanIsColimit X Y)))) ''
      Set.range Sum.inl

Next tactic:
aesop
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
      aesop
    · 

Proof state:
case mpr
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
⊢ OpenEmbedding ⇑(BinaryCofan.inl c) ∧
      OpenEmbedding ⇑(BinaryCofan.inr c) ∧ IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c)) →
    Nonempty (IsColimit c)

Next tactic:
rintro ⟨h₁, h₂, h₃⟩
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
      aesop
    · rintro ⟨h₁, h₂, h₃⟩
      

Proof state:
case mpr.intro.intro
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h₁ : OpenEmbedding ⇑(BinaryCofan.inl c)
h₂ : OpenEmbedding ⇑(BinaryCofan.inr c)
h₃ : IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))
⊢ Nonempty (IsColimit c)

Next tactic:
have : ∀ x, x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr := by
        rw [eq_compl_iff_isCompl.mpr h₃.symm]
        exact fun _ => or_not
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
      aesop
    · rintro ⟨h₁, h₂, h₃⟩
      have : ∀ x, x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr := by
        

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h₁ : OpenEmbedding ⇑(BinaryCofan.inl c)
h₂ : OpenEmbedding ⇑(BinaryCofan.inr c)
h₃ : IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))
⊢ ∀ (x : (forget TopCat).obj (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := WalkingPair.left })),
    x ∈ Set.range ⇑(BinaryCofan.inl c) ∨ x ∈ Set.range ⇑(BinaryCofan.inr c)

Next tactic:
rw [eq_compl_iff_isCompl.mpr h₃.symm]
theorem binaryCofan_isColimit_iff {X Y : TopCat} (c : BinaryCofan X Y) :
    Nonempty (IsColimit c) ↔
      OpenEmbedding c.inl ∧ OpenEmbedding c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) := by
  classical
    constructor
    · rintro ⟨h⟩
      rw [← show _ = c.inl from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.left⟩,
        ← show _ = c.inr from
          h.comp_coconePointUniqueUpToIso_inv (binaryCofanIsColimit X Y) ⟨WalkingPair.right⟩]
      dsimp
      refine' ⟨(homeoOfIso <| h.coconePointUniqueUpToIso
        (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inl,
          (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.openEmbedding.comp openEmbedding_inr, _⟩
      erw [Set.range_comp, ← eq_compl_iff_isCompl, coe_comp, coe_comp, Set.range_comp _ Sum.inr,
        ← Set.image_compl_eq (homeoOfIso <| h.coconePointUniqueUpToIso
            (binaryCofanIsColimit X Y)).symm.bijective, Set.compl_range_inr, Set.image_comp]
      aesop
    · rintro ⟨h₁, h₂, h₃⟩
      have : ∀ x, x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr := by
        rw [eq_compl_iff_isCompl.mpr h₃.symm]
        

Proof state:
J : Type v
inst✝ : SmallCategory J
X Y : TopCat
c : BinaryCofan X Y
h₁ : OpenEmbedding ⇑(BinaryCofan.inl c)
h₂ : OpenEmbedding ⇑(BinaryCofan.inr c)
h₃ : IsCompl (Set.range ⇑(BinaryCofan.inl c)) (Set.range ⇑(BinaryCofan.inr c))
⊢ ∀ (x : (forget TopCat).obj (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := WalkingPair.left })),
    x ∈ Set.range ⇑(BinaryCofan.inl c) ∨ x ∈ (Set.range ⇑(BinaryCofan.inl c))ᶜ

Next tactic:
exact fun _ => or_not