l3lab/ntp-mathlib huggingface dataset:
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> 

Proof state:
case left
C : Type u
inst✝ : Category.{v, u} C
⊢ left ∈
    WalkingParallelPair.recOn zero
      (WalkingParallelPair.recOn one (List.toFinset [WalkingParallelPairHom.id zero]) (List.toFinset [left, right]))
      (WalkingParallelPair.recOn one ∅ (List.toFinset [WalkingParallelPairHom.id one]))

Next tactic:
simp
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> 

Proof state:
case right
C : Type u
inst✝ : Category.{v, u} C
⊢ right ∈
    WalkingParallelPair.recOn zero
      (WalkingParallelPair.recOn one (List.toFinset [WalkingParallelPairHom.id zero]) (List.toFinset [left, right]))
      (WalkingParallelPair.recOn one ∅ (List.toFinset [WalkingParallelPairHom.id one]))

Next tactic:
simp
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> 

Proof state:
case id
C : Type u
inst✝ : Category.{v, u} C
j : WalkingParallelPair
⊢ WalkingParallelPairHom.id j ∈
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j (List.toFinset [WalkingParallelPairHom.id zero]) (List.toFinset [left, right]))
      (WalkingParallelPair.recOn j ∅ (List.toFinset [WalkingParallelPairHom.id one]))

Next tactic:
simp
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> simp
    · 

Proof state:
case id
C : Type u
inst✝ : Category.{v, u} C
j : WalkingParallelPair
⊢ 𝟙 j ∈
    WalkingParallelPair.rec (WalkingParallelPair.rec {𝟙 zero} {left, right} j) (WalkingParallelPair.rec ∅ {𝟙 one} j) j

Next tactic:
cases j
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> simp
    · cases j <;> 

Proof state:
case id.zero
C : Type u
inst✝ : Category.{v, u} C
⊢ 𝟙 zero ∈
    WalkingParallelPair.rec (WalkingParallelPair.rec {𝟙 zero} {left, right} zero)
      (WalkingParallelPair.rec ∅ {𝟙 one} zero) zero

Next tactic:
simp
instance instFintypeWalkingParallelPairHom (j j' : WalkingParallelPair) :
    Fintype (WalkingParallelPairHom j j') where
  elems :=
    WalkingParallelPair.recOn j
      (WalkingParallelPair.recOn j' [WalkingParallelPairHom.id zero].toFinset
        [left, right].toFinset)
      (WalkingParallelPair.recOn j' ∅ [WalkingParallelPairHom.id one].toFinset)
  complete := by
    rintro (_|_) <;> simp
    · cases j <;> 

Proof state:
case id.one
C : Type u
inst✝ : Category.{v, u} C
⊢ 𝟙 one ∈
    WalkingParallelPair.rec (WalkingParallelPair.rec {𝟙 zero} {left, right} one) (WalkingParallelPair.rec ∅ {𝟙 one} one)
      one

Next tactic:
simp
/-- Equalizers are finite limits, so if `C` has all finite limits, it also has all equalizers -/
example [HasFiniteLimits C] : HasEqualizers C := by 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : HasFiniteLimits C
⊢ HasEqualizers C

Next tactic:
infer_instance
/-- Coequalizers are finite colimits, of if `C` has all finite colimits, it also has all
    coequalizers -/
example [HasFiniteColimits C] : HasCoequalizers C := by 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : HasFiniteColimits C
⊢ HasCoequalizers C

Next tactic:
infer_instance
instance fintypeObj [Fintype J] : Fintype (WidePullbackShape J) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type v
inst✝ : Fintype J
⊢ Fintype (WidePullbackShape J)

Next tactic:
rw [WidePullbackShape]
instance fintypeObj [Fintype J] : Fintype (WidePullbackShape J) := by
  rw [WidePullbackShape]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type v
inst✝ : Fintype J
⊢ Fintype (Option J)

Next tactic:
infer_instance
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j j' : WidePullbackShape J
⊢ Finset (j ⟶ j')

Next tactic:
cases' j' with j'
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · 

Proof state:
case none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
⊢ Finset (j ⟶ none)

Next tactic:
cases' j with j
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · 

Proof state:
case none.none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ Finset (none ⟶ none)

Next tactic:
exact {Hom.id none}
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · 

Proof state:
case none.some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : J
⊢ Finset (some j ⟶ none)

Next tactic:
exact {Hom.term j}
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · 

Proof state:
case some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
j' : J
⊢ Finset (j ⟶ some j')

Next tactic:
by_cases h : some j' = j
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · 

Proof state:
case pos
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
j' : J
h : some j' = j
⊢ Finset (j ⟶ some j')

Next tactic:
rw [h]
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        

Proof state:
case pos
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
j' : J
h : some j' = j
⊢ Finset (j ⟶ j)

Next tactic:
exact {Hom.id j}
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · 

Proof state:
case neg
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
j' : J
h : ¬some j' = j
⊢ Finset (j ⟶ some j')

Next tactic:
exact ∅
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · exact ∅
  complete := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j j' : WidePullbackShape J
⊢ ∀ (x : j ⟶ j'),
    x ∈
      Option.casesOn (motive := fun t => j' = t → Finset (j ⟶ j')) j'
        (fun h =>
          (_ : none = j') ▸
            Option.casesOn (motive := fun t => j = t → Finset (j ⟶ none)) j (fun h => (_ : none = j) ▸ {Hom.id none})
              (fun j_1 h => (_ : some j_1 = j) ▸ {Hom.term j_1}) (_ : j = j))
        (fun j'_1 h =>
          (_ : some j'_1 = j') ▸
            if h : some j'_1 = j then Eq.mpr (_ : Finset (j ⟶ some j'_1) = Finset (j ⟶ j)) {Hom.id j} else ∅)
        (_ : j' = j')

Next tactic:
rintro (_|_)
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · exact ∅
  complete := by
    rintro (_|_)
    · 

Proof state:
case id
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePullbackShape J
⊢ Hom.id j ∈
    Option.casesOn (motive := fun t => j = t → Finset (j ⟶ j)) j
      (fun h =>
        (_ : none = j) ▸
          Option.casesOn (motive := fun t => j = t → Finset (j ⟶ none)) j (fun h => (_ : none = j) ▸ {Hom.id none})
            (fun j_1 h => (_ : some j_1 = j) ▸ {Hom.term j_1}) (_ : j = j))
      (fun j' h =>
        (_ : some j' = j) ▸
          if h : some j' = j then Eq.mpr (_ : Finset (j ⟶ some j') = Finset (j ⟶ j)) {Hom.id j} else ∅)
      (_ : j = j)

Next tactic:
cases j
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> 

Proof state:
case id.none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ Hom.id none ∈
    Option.casesOn (motive := fun t => none = t → Finset (none ⟶ none)) none
      (fun h =>
        (_ : none = none) ▸
          Option.casesOn (motive := fun t => none = t → Finset (none ⟶ none)) none
            (fun h => (_ : none = none) ▸ {Hom.id none}) (fun j h => (_ : some j = none) ▸ {Hom.term j})
            (_ : none = none))
      (fun j' h =>
        (_ : some j' = none) ▸
          if h : some j' = none then Eq.mpr (_ : Finset (none ⟶ some j') = Finset (none ⟶ none)) {Hom.id none} else ∅)
      (_ : none = none)

Next tactic:
simp
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> 

Proof state:
case id.some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
val✝ : J
⊢ Hom.id (some val✝) ∈
    Option.casesOn (motive := fun t => some val✝ = t → Finset (some val✝ ⟶ some val✝)) (some val✝)
      (fun h =>
        (_ : none = some val✝) ▸
          Option.casesOn (motive := fun t => some val✝ = t → Finset (some val✝ ⟶ none)) (some val✝)
            (fun h => (_ : none = some val✝) ▸ {Hom.id none}) (fun j h => (_ : some j = some val✝) ▸ {Hom.term j})
            (_ : some val✝ = some val✝))
      (fun j' h =>
        (_ : some j' = some val✝) ▸
          if h : some j' = some val✝ then
            Eq.mpr (_ : Finset (some val✝ ⟶ some j') = Finset (some val✝ ⟶ some val✝)) {Hom.id (some val✝)}
          else ∅)
      (_ : some val✝ = some val✝)

Next tactic:
simp
instance fintypeHom (j j' : WidePullbackShape J) : Fintype (j ⟶ j')
    where
  elems := by
    cases' j' with j'
    · cases' j with j
      · exact {Hom.id none}
      · exact {Hom.term j}
    · by_cases h : some j' = j
      · rw [h]
        exact {Hom.id j}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> simp
    · 

Proof state:
case term
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j✝ : J
⊢ Hom.term j✝ ∈
    Option.casesOn (motive := fun t => none = t → Finset (some j✝ ⟶ none)) none
      (fun h =>
        (_ : none = none) ▸
          Option.casesOn (motive := fun t => some j✝ = t → Finset (some j✝ ⟶ none)) (some j✝)
            (fun h => (_ : none = some j✝) ▸ {Hom.id none}) (fun j h => (_ : some j = some j✝) ▸ {Hom.term j})
            (_ : some j✝ = some j✝))
      (fun j' h =>
        (_ : some j' = none) ▸
          if h : some j' = some j✝ then
            Eq.mpr (_ : Finset (some j✝ ⟶ some j') = Finset (some j✝ ⟶ some j✝)) {Hom.id (some j✝)}
          else ∅)
      (_ : none = none)

Next tactic:
simp
instance fintypeObj [Fintype J] : Fintype (WidePushoutShape J) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type v
inst✝ : Fintype J
⊢ Fintype (WidePushoutShape J)

Next tactic:
rw [WidePushoutShape]
instance fintypeObj [Fintype J] : Fintype (WidePushoutShape J) := by
  rw [WidePushoutShape]; 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type v
inst✝ : Fintype J
⊢ Fintype (Option J)

Next tactic:
infer_instance
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j j' : WidePushoutShape J
⊢ Finset (j ⟶ j')

Next tactic:
cases' j with j
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · 

Proof state:
case none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : WidePushoutShape J
⊢ Finset (none ⟶ j')

Next tactic:
cases' j' with j'
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · 

Proof state:
case none.none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ Finset (none ⟶ none)

Next tactic:
exact {Hom.id none}
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · 

Proof state:
case none.some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : J
⊢ Finset (none ⟶ some j')

Next tactic:
exact {Hom.init j'}
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · 

Proof state:
case some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : WidePushoutShape J
j : J
⊢ Finset (some j ⟶ j')

Next tactic:
by_cases h : some j = j'
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · 

Proof state:
case pos
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : WidePushoutShape J
j : J
h : some j = j'
⊢ Finset (some j ⟶ j')

Next tactic:
rw [h]
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        

Proof state:
case pos
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : WidePushoutShape J
j : J
h : some j = j'
⊢ Finset (j' ⟶ j')

Next tactic:
exact {Hom.id j'}
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · 

Proof state:
case neg
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j' : WidePushoutShape J
j : J
h : ¬some j = j'
⊢ Finset (some j ⟶ j')

Next tactic:
exact ∅
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · exact ∅
  complete := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j j' : WidePushoutShape J
⊢ ∀ (x : j ⟶ j'),
    x ∈
      Option.casesOn (motive := fun t => j = t → Finset (j ⟶ j')) j
        (fun h =>
          (_ : none = j) ▸
            Option.casesOn (motive := fun t => j' = t → Finset (none ⟶ j')) j'
              (fun h => (_ : none = j') ▸ {Hom.id none}) (fun j'_1 h => (_ : some j'_1 = j') ▸ {Hom.init j'_1})
              (_ : j' = j'))
        (fun j_1 h =>
          (_ : some j_1 = j) ▸
            if h : some j_1 = j' then Eq.mpr (_ : Finset (some j_1 ⟶ j') = Finset (j' ⟶ j')) {Hom.id j'} else ∅)
        (_ : j = j)

Next tactic:
rintro (_|_)
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · exact ∅
  complete := by
    rintro (_|_)
    · 

Proof state:
case id
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j : WidePushoutShape J
⊢ Hom.id j ∈
    Option.casesOn (motive := fun t => j = t → Finset (j ⟶ j)) j
      (fun h =>
        (_ : none = j) ▸
          Option.casesOn (motive := fun t => j = t → Finset (none ⟶ j)) j (fun h => (_ : none = j) ▸ {Hom.id none})
            (fun j' h => (_ : some j' = j) ▸ {Hom.init j'}) (_ : j = j))
      (fun j_1 h =>
        (_ : some j_1 = j) ▸
          if h : some j_1 = j then Eq.mpr (_ : Finset (some j_1 ⟶ j) = Finset (j ⟶ j)) {Hom.id j} else ∅)
      (_ : j = j)

Next tactic:
cases j
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> 

Proof state:
case id.none
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ Hom.id none ∈
    Option.casesOn (motive := fun t => none = t → Finset (none ⟶ none)) none
      (fun h =>
        (_ : none = none) ▸
          Option.casesOn (motive := fun t => none = t → Finset (none ⟶ none)) none
            (fun h => (_ : none = none) ▸ {Hom.id none}) (fun j' h => (_ : some j' = none) ▸ {Hom.init j'})
            (_ : none = none))
      (fun j h =>
        (_ : some j = none) ▸
          if h : some j = none then Eq.mpr (_ : Finset (some j ⟶ none) = Finset (none ⟶ none)) {Hom.id none} else ∅)
      (_ : none = none)

Next tactic:
simp
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> 

Proof state:
case id.some
C : Type u
inst✝ : Category.{v, u} C
J : Type v
val✝ : J
⊢ Hom.id (some val✝) ∈
    Option.casesOn (motive := fun t => some val✝ = t → Finset (some val✝ ⟶ some val✝)) (some val✝)
      (fun h =>
        (_ : none = some val✝) ▸
          Option.casesOn (motive := fun t => some val✝ = t → Finset (none ⟶ some val✝)) (some val✝)
            (fun h => (_ : none = some val✝) ▸ {Hom.id none}) (fun j' h => (_ : some j' = some val✝) ▸ {Hom.init j'})
            (_ : some val✝ = some val✝))
      (fun j h =>
        (_ : some j = some val✝) ▸
          if h : some j = some val✝ then
            Eq.mpr (_ : Finset (some j ⟶ some val✝) = Finset (some val✝ ⟶ some val✝)) {Hom.id (some val✝)}
          else ∅)
      (_ : some val✝ = some val✝)

Next tactic:
simp
instance fintypeHom (j j' : WidePushoutShape J) : Fintype (j ⟶ j') where
  elems := by
    cases' j with j
    · cases' j' with j'
      · exact {Hom.id none}
      · exact {Hom.init j'}
    · by_cases h : some j = j'
      · rw [h]
        exact {Hom.id j'}
      · exact ∅
  complete := by
    rintro (_|_)
    · cases j <;> simp
    · 

Proof state:
case init
C : Type u
inst✝ : Category.{v, u} C
J : Type v
j✝ : J
⊢ Hom.init j✝ ∈
    Option.casesOn (motive := fun t => none = t → Finset (none ⟶ some j✝)) none
      (fun h =>
        (_ : none = none) ▸
          Option.casesOn (motive := fun t => some j✝ = t → Finset (none ⟶ some j✝)) (some j✝)
            (fun h => (_ : none = some j✝) ▸ {Hom.id none}) (fun j' h => (_ : some j' = some j✝) ▸ {Hom.init j'})
            (_ : some j✝ = some j✝))
      (fun j h =>
        (_ : some j = none) ▸
          if h : some j = some j✝ then
            Eq.mpr (_ : Finset (some j ⟶ some j✝) = Finset (some j✝ ⟶ some j✝)) {Hom.id (some j✝)}
          else ∅)
      (_ : none = none)

Next tactic:
simp
instance hasLimitsOfShape_widePullbackShape (J : Type) [Finite J] [HasFiniteWidePullbacks C] :
    HasLimitsOfShape (WidePullbackShape J) C := by
  

Proof state:
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePullbacks C
⊢ HasLimitsOfShape (WidePullbackShape J) C

Next tactic:
cases nonempty_fintype J
instance hasLimitsOfShape_widePullbackShape (J : Type) [Finite J] [HasFiniteWidePullbacks C] :
    HasLimitsOfShape (WidePullbackShape J) C := by
  cases nonempty_fintype J
  

Proof state:
case intro
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePullbacks C
val✝ : Fintype J
⊢ HasLimitsOfShape (WidePullbackShape J) C

Next tactic:
haveI := @HasFiniteWidePullbacks.out C _ _ J
instance hasLimitsOfShape_widePullbackShape (J : Type) [Finite J] [HasFiniteWidePullbacks C] :
    HasLimitsOfShape (WidePullbackShape J) C := by
  cases nonempty_fintype J
  haveI := @HasFiniteWidePullbacks.out C _ _ J
  

Proof state:
case intro
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePullbacks C
val✝ : Fintype J
this : ∀ [inst : Fintype J], HasLimitsOfShape (WidePullbackShape J) C
⊢ HasLimitsOfShape (WidePullbackShape J) C

Next tactic:
infer_instance
instance hasColimitsOfShape_widePushoutShape (J : Type) [Finite J] [HasFiniteWidePushouts C] :
    HasColimitsOfShape (WidePushoutShape J) C := by
  

Proof state:
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePushouts C
⊢ HasColimitsOfShape (WidePushoutShape J) C

Next tactic:
cases nonempty_fintype J
instance hasColimitsOfShape_widePushoutShape (J : Type) [Finite J] [HasFiniteWidePushouts C] :
    HasColimitsOfShape (WidePushoutShape J) C := by
  cases nonempty_fintype J
  

Proof state:
case intro
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePushouts C
val✝ : Fintype J
⊢ HasColimitsOfShape (WidePushoutShape J) C

Next tactic:
haveI := @HasFiniteWidePushouts.out C _ _ J
instance hasColimitsOfShape_widePushoutShape (J : Type) [Finite J] [HasFiniteWidePushouts C] :
    HasColimitsOfShape (WidePushoutShape J) C := by
  cases nonempty_fintype J
  haveI := @HasFiniteWidePushouts.out C _ _ J
  

Proof state:
case intro
C : Type u
inst✝² : Category.{v, u} C
J✝ : Type v
J : Type
inst✝¹ : Finite J
inst✝ : HasFiniteWidePushouts C
val✝ : Fintype J
this : ∀ [inst : Fintype J], HasColimitsOfShape (WidePushoutShape J) C
⊢ HasColimitsOfShape (WidePushoutShape J) C

Next tactic:
infer_instance
instance fintypeWalkingPair : Fintype WalkingPair where
  elems := {WalkingPair.left, WalkingPair.right}
  complete x := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
J : Type v
x : WalkingPair
⊢ x ∈ {WalkingPair.left, WalkingPair.right}

Next tactic:
cases x
instance fintypeWalkingPair : Fintype WalkingPair where
  elems := {WalkingPair.left, WalkingPair.right}
  complete x := by cases x <;> 

Proof state:
case left
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ WalkingPair.left ∈ {WalkingPair.left, WalkingPair.right}

Next tactic:
simp
instance fintypeWalkingPair : Fintype WalkingPair where
  elems := {WalkingPair.left, WalkingPair.right}
  complete x := by cases x <;> 

Proof state:
case right
C : Type u
inst✝ : Category.{v, u} C
J : Type v
⊢ WalkingPair.right ∈ {WalkingPair.left, WalkingPair.right}

Next tactic:
simp