Theorem: CategoryTheory.Limits.Types.binaryCofan_isColimit_iff
File: Mathlib/CategoryTheory/Limits/Shapes/Types.lean

tactic: constructor
state_before: X Y : Type u
c : BinaryCofan X Y
⊢ Nonempty (IsColimit c) ↔ Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr)
state_after: case mp
X Y : Type u
c : BinaryCofan X Y
⊢ Nonempty (IsColimit c) → Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr)

case mpr
X Y : Type u
c : BinaryCofan X Y
⊢ Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) → Nonempty (IsColimit c)

tactic: rintro ⟨h⟩
state_before: case mp
X Y : Type u
c : BinaryCofan X Y
⊢ Nonempty (IsColimit c) → Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr)
state_after: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr)

tactic: rw [← show _ = c.inl from
    h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.left⟩,
  ← show _ = c.inr from
    h.comp_coconePointUniqueUpToIso_inv (binaryCoproductColimit X Y) ⟨WalkingPair.right⟩]
state_before: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr)
state_after: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective
      ((binaryCoproductCocone X Y).ι.app { as := left } ≫
        (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
    Injective
        ((binaryCoproductCocone X Y).ι.app { as := right } ≫
          (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
      IsCompl
        (Set.range
          ((binaryCoproductCocone X Y).ι.app { as := left } ≫
            (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
        (Set.range
          ((binaryCoproductCocone X Y).ι.app { as := right } ≫
            (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))

tactic: dsimp [binaryCoproductCocone]
state_before: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective
      ((binaryCoproductCocone X Y).ι.app { as := left } ≫
        (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
    Injective
        ((binaryCoproductCocone X Y).ι.app { as := right } ≫
          (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
      IsCompl
        (Set.range
          ((binaryCoproductCocone X Y).ι.app { as := left } ≫
            (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
        (Set.range
          ((binaryCoproductCocone X Y).ι.app { as := right } ≫
            (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
state_after: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
    Injective (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
      IsCompl (Set.range (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
        (Set.range (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))

tactic: refine
  ⟨(h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp
      Sum.inl_injective,
    (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.injective.comp
      Sum.inr_injective, ?_⟩
state_before: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ Injective (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
    Injective (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv) ∧
      IsCompl (Set.range (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
        (Set.range (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
state_after: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ IsCompl (Set.range (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
    (Set.range (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))

tactic: erw [Set.range_comp, ← eq_compl_iff_isCompl, Set.range_comp _ Sum.inr, ←
  Set.image_compl_eq
    (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv.bijective]
state_before: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ IsCompl (Set.range (Sum.inl ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
    (Set.range (Sum.inr ≫ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv))
state_after: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv '' Set.range Sum.inl =
    ⇑(h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv '' (Set.range Sum.inr)ᶜ

tactic: simp
state_before: case mp.intro
X Y : Type u
c : BinaryCofan X Y
h : IsColimit c
⊢ (h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).inv '' Set.range Sum.inl =
    ⇑(h.coconePointUniqueUpToIso (binaryCoproductColimit X Y)).symm.toEquiv '' (Set.range Sum.inr)ᶜ
state_after: no goals

tactic: rintro ⟨h₁, h₂, h₃⟩
state_before: case mpr
X Y : Type u
c : BinaryCofan X Y
⊢ Injective c.inl ∧ Injective c.inr ∧ IsCompl (Set.range c.inl) (Set.range c.inr) → Nonempty (IsColimit c)
state_after: case mpr.intro.intro
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
⊢ Nonempty (IsColimit c)

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
state_before: case mpr.intro.intro
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
⊢ Nonempty (IsColimit c)
state_after: case mpr.intro.intro
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ Nonempty (IsColimit c)

tactic: refine ⟨BinaryCofan.IsColimit.mk _ ?_ ?_ ?_ ?_⟩
state_before: case mpr.intro.intro
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ Nonempty (IsColimit c)
state_after: case mpr.intro.intro.refine_1
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ {T : Type u} → (X ⟶ T) → (Y ⟶ T) → (c.pt ⟶ T)

case mpr.intro.intro.refine_2
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T), c.inl ≫ ?mpr.intro.intro.refine_1 f g = f

case mpr.intro.intro.refine_3
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T), c.inr ≫ ?mpr.intro.intro.refine_1 f g = g

case mpr.intro.intro.refine_4
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T) (m : c.pt ⟶ T),
    c.inl ≫ m = f → c.inr ≫ m = g → m = ?mpr.intro.intro.refine_1 f g

tactic: rw [eq_compl_iff_isCompl.mpr h₃.symm]
state_before: X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
⊢ ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
state_after: X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
⊢ ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ (Set.range c.inl)ᶜ

tactic: exact fun _ => or_not
state_before: X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
⊢ ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ (Set.range c.inl)ᶜ
state_after: no goals

tactic: intro T f g x
state_before: case mpr.intro.intro.refine_1
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ {T : Type u} → (X ⟶ T) → (Y ⟶ T) → (c.pt ⟶ T)
state_after: case mpr.intro.intro.refine_1
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : c.pt
⊢ T

tactic: exact
  if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective _ h₁).symm ⟨x, h⟩)
  else g ((Equiv.ofInjective _ h₂).symm ⟨x, (this x).resolve_left h⟩)
state_before: case mpr.intro.intro.refine_1
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : c.pt
⊢ T
state_after: no goals

tactic: intro T f g
state_before: case mpr.intro.intro.refine_2
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T),
    (c.inl ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
      f
state_after: case mpr.intro.intro.refine_2
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
⊢ (c.inl ≫ fun x =>
      if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
      else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
    f

tactic: funext x
state_before: case mpr.intro.intro.refine_2
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
⊢ (c.inl ≫ fun x =>
      if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
      else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
    f
state_after: case mpr.intro.intro.refine_2.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := left }
⊢ (c.inl ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))
      x =
    f x

tactic: dsimp
state_before: case mpr.intro.intro.refine_2.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := left }
⊢ (c.inl ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))
      x =
    f x
state_after: case mpr.intro.intro.refine_2.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := left }
⊢ (if h : c.inl x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inl x, h⟩)
    else g ((Equiv.ofInjective c.inr h₂).symm ⟨c.inl x, ⋯⟩)) =
    f x

tactic: simp [h₁.eq_iff]
state_before: case mpr.intro.intro.refine_2.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := left }
⊢ (if h : c.inl x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inl x, h⟩)
    else g ((Equiv.ofInjective c.inr h₂).symm ⟨c.inl x, ⋯⟩)) =
    f x
state_after: no goals

tactic: intro T f g
state_before: case mpr.intro.intro.refine_3
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T),
    (c.inr ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
      g
state_after: case mpr.intro.intro.refine_3
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
⊢ (c.inr ≫ fun x =>
      if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
      else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
    g

tactic: funext x
state_before: case mpr.intro.intro.refine_3
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
⊢ (c.inr ≫ fun x =>
      if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
      else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)) =
    g
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ (c.inr ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))
      x =
    g x

tactic: dsimp
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ (c.inr ≫ fun x =>
        if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
        else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))
      x =
    g x
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ (if h : c.inr x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, h⟩)
    else g ((Equiv.ofInjective c.inr h₂).symm ⟨c.inr x, ⋯⟩)) =
    g x

tactic: simp only [Set.mem_range, Equiv.ofInjective_symm_apply,
  dite_eq_right_iff, forall_exists_index]
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ (if h : c.inr x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, h⟩)
    else g ((Equiv.ofInjective c.inr h₂).symm ⟨c.inr x, ⋯⟩)) =
    g x
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ ∀ (x_1 : X) (h : c.inl x_1 = c.inr x), f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x

tactic: intro y e
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
⊢ ∀ (x_1 : X) (h : c.inl x_1 = c.inr x), f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x

tactic: have : c.inr x ∈ Set.range c.inl ⊓ Set.range c.inr := ⟨⟨_, e⟩, ⟨_, rfl⟩⟩
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this✝ :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
this : c.inr x ∈ Set.range c.inl ⊓ Set.range c.inr
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x

tactic: rw [disjoint_iff.mp h₃.1] at this
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this✝ :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
this : c.inr x ∈ Set.range c.inl ⊓ Set.range c.inr
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x
state_after: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this✝ :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
this : c.inr x ∈ ⊥
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x

tactic: exact this.elim
state_before: case mpr.intro.intro.refine_3.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this✝ :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
f : X ⟶ T
g : Y ⟶ T
x : (pair X Y).obj { as := right }
y : X
e : c.inl y = c.inr x
this : c.inr x ∈ ⊥
⊢ f ((Equiv.ofInjective c.inl h₁).symm ⟨c.inr x, ⋯⟩) = g x
state_after: no goals

tactic: rintro T _ _ m rfl rfl
state_before: case mpr.intro.intro.refine_4
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
⊢ ∀ {T : Type u} (f : X ⟶ T) (g : Y ⟶ T) (m : c.pt ⟶ T),
    c.inl ≫ m = f →
      c.inr ≫ m = g →
        m = fun x =>
          if h : x ∈ Set.range c.inl then f ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
          else g ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)
state_after: case mpr.intro.intro.refine_4
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
⊢ m = fun x =>
    if h : x ∈ Set.range c.inl then (c.inl ≫ m) ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
    else (c.inr ≫ m) ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)

tactic: funext x
state_before: case mpr.intro.intro.refine_4
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
⊢ m = fun x =>
    if h : x ∈ Set.range c.inl then (c.inl ≫ m) ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
    else (c.inr ≫ m) ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)
state_after: case mpr.intro.intro.refine_4.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
x : c.pt
⊢ m x =
    if h : x ∈ Set.range c.inl then (c.inl ≫ m) ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
    else (c.inr ≫ m) ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)

tactic: dsimp
state_before: case mpr.intro.intro.refine_4.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
x : c.pt
⊢ m x =
    if h : x ∈ Set.range c.inl then (c.inl ≫ m) ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩)
    else (c.inr ≫ m) ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩)
state_after: case mpr.intro.intro.refine_4.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
x : c.pt
⊢ m x =
    if h : x ∈ Set.range c.inl then m (c.inl ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩))
    else m (c.inr ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))

tactic: split_ifs <;> exact congr_arg _ (Equiv.apply_ofInjective_symm _ ⟨_, _⟩).symm
state_before: case mpr.intro.intro.refine_4.h
X Y : Type u
c : BinaryCofan X Y
h₁ : Injective c.inl
h₂ : Injective c.inr
h₃ : IsCompl (Set.range c.inl) (Set.range c.inr)
this :
  ∀ (x : ((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }),
    x ∈ Set.range c.inl ∨ x ∈ Set.range c.inr
T : Type u
m : c.pt ⟶ T
x : c.pt
⊢ m x =
    if h : x ∈ Set.range c.inl then m (c.inl ((Equiv.ofInjective c.inl h₁).symm ⟨x, h⟩))
    else m (c.inr ((Equiv.ofInjective c.inr h₂).symm ⟨x, ⋯⟩))
state_after: no goals