l3lab/ntp-mathlib huggingface dataset:
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    

Proof state:
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
⊢ InvImage (Rel D) (⇑(sigmaIsoSigma D.U).hom) ((MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData)) x)
    ((MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) x)

Next tactic:
rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    

Proof state:
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
⊢ InvImage (Rel D) (⇑(sigmaIsoSigma D.U).hom)
    ((MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv
        ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).hom x)))
    ((MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv
        ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).hom x)))

Next tactic:
generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    

Proof state:
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
x' : (forget TopCat).obj (of ((i : D.J × D.J) × ↑(GlueData.V D.toGlueData i)))
⊢ InvImage (Rel D) (⇑(sigmaIsoSigma D.U).hom)
    ((MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv x'))
    ((MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv x'))

Next tactic:
obtain ⟨⟨i, j⟩, y⟩ := x'
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    

Proof state:
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ InvImage (Rel D) (⇑(sigmaIsoSigma D.U).hom)
    ((MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y }))
    ((MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
      ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y }))

Next tactic:
unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    

Proof state:
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
    ((sigmaIsoSigma D.U).hom
      ((Sigma.desc fun b =>
          MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
            Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b))
        ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y })))
    ((sigmaIsoSigma D.U).hom
      ((Sigma.desc fun b =>
          MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
            Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b))
        ((sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y })))

Next tactic:
simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    

Proof state:
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
    ((sigmaIsoSigma D.U).hom
      ((Sigma.desc fun b =>
          MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
            Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b))
        ((Sigma.ι (GlueData.diagram D.toGlueData).left (i, j)) y)))
    ((sigmaIsoSigma D.U).hom
      ((Sigma.desc fun b =>
          MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
            Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b))
        ((Sigma.ι (GlueData.diagram D.toGlueData).left (i, j)) y)))

Next tactic:
rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    

Proof state:
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
    ((sigmaIsoSigma D.U).hom
      (((Cofan.mk (∐ (GlueData.diagram D.toGlueData).right) fun b =>
                MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
                  Sigma.ι (GlueData.diagram D.toGlueData).right
                    (MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b)).ι.app
          { as := (i, j) })
        y))
    ((sigmaIsoSigma D.U).hom
      (((Cofan.mk (∐ (GlueData.diagram D.toGlueData).right) fun b =>
                MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
                  Sigma.ι (GlueData.diagram D.toGlueData).right
                    (MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b)).ι.app
          { as := (i, j) })
        y))

Next tactic:
erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    

Proof state:
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
  (Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
    (Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
    { fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
      snd := (MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }
    { fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
      snd := (MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }

Next tactic:
exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
  · 

Proof state:
case mpr
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ Rel D { fst := i, snd := x } { fst := j, snd := y } → (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData j) y

Next tactic:
rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
  · rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
    

Proof state:
case mpr.inl.refl
D : GlueData
i : D.J
x : ↑(GlueData.U D.toGlueData i)
⊢ (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData i) x
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : (GlueData.f D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z = { fst := i, snd := x }.snd
e₂ :
  (GlueData.f D.toGlueData { fst := j, snd := y }.fst { fst := i, snd := x }.fst)
      ((GlueData.t D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z) =
    { fst := j, snd := y }.snd
⊢ (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData j) y

Next tactic:
rfl
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
  · rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
    rfl
    

Proof state:
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : (GlueData.f D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z = { fst := i, snd := x }.snd
e₂ :
  (GlueData.f D.toGlueData { fst := j, snd := y }.fst { fst := i, snd := x }.fst)
      ((GlueData.t D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z) =
    { fst := j, snd := y }.snd
⊢ (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData j) y

Next tactic:
dsimp only at *
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
  · rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
    rfl
    dsimp only at *
    -- porting note: there were `subst e₁` and `subst e₂`, instead of the `rw`
    

Proof state:
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : (GlueData.f D.toGlueData i j) z = x
e₂ : (GlueData.f D.toGlueData j i) ((GlueData.t D.toGlueData i j) z) = y
⊢ (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData j) y

Next tactic:
rw [← e₁, ← e₂] at *
theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) :
    𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by
  constructor
  · delta GlueData.ι
    simp_rw [← Multicoequalizer.ι_sigmaπ]
    intro h
    rw [←
      show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    rw [←
      show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
    change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
    rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
    refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
    rintro _ _ ⟨x⟩
    rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from
        ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
    generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
    obtain ⟨⟨i, j⟩, y⟩ := x'
    unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
    simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply,
      Cofan.mk_ι_app]
    rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
    erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
    exact Or.inr ⟨y, ⟨rfl, rfl⟩⟩
  · rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
    rfl
    dsimp only at *
    -- porting note: there were `subst e₁` and `subst e₂`, instead of the `rw`
    rw [← e₁, ← e₂] at *
    

Proof state:
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : (GlueData.f D.toGlueData i j) z = (GlueData.f D.toGlueData i j) z
e₂ :
  (GlueData.f D.toGlueData j i) ((GlueData.t D.toGlueData i j) z) =
    (GlueData.f D.toGlueData j i) ((GlueData.t D.toGlueData i j) z)
⊢ (GlueData.ι D.toGlueData i) ((GlueData.f D.toGlueData i j) z) =
    (GlueData.ι D.toGlueData j) ((GlueData.f D.toGlueData j i) ((GlueData.t D.toGlueData i j) z))

Next tactic:
simp
theorem ι_injective (i : D.J) : Function.Injective (𝖣.ι i) := by
  

Proof state:
D : GlueData
i : D.J
⊢ Function.Injective ⇑(GlueData.ι D.toGlueData i)

Next tactic:
intro x y h
theorem ι_injective (i : D.J) : Function.Injective (𝖣.ι i) := by
  intro x y h
  

Proof state:
D : GlueData
i : D.J
x y : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : (GlueData.ι D.toGlueData i) x = (GlueData.ι D.toGlueData i) y
⊢ x = y

Next tactic:
rcases (D.ι_eq_iff_rel _ _ _ _).mp h with (⟨⟨⟩⟩ | ⟨_, e₁, e₂⟩)