l3lab/ntp-mathlib huggingface dataset:
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · 

Proof state:
case h₀
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ biprod.inl ≫
      biprod.desc (decompId_i P) (decompId_i (complement P)) ≫ biprod.lift (decompId_p P) (decompId_p (complement P)) =
    biprod.inl ≫ 𝟙 (P ⊞ complement P)

Next tactic:
rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      

Proof state:
case h₀
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ (decompId_i P ≫ decompId_p (complement P)) ≫ biprod.inr = 0

Next tactic:
refine' (_ =≫ _).trans zero_comp
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      

Proof state:
case h₀
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ decompId_i P ≫ decompId_p (complement P) = 0

Next tactic:
ext
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      

Proof state:
case h₀.h
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ (decompId_i P ≫ decompId_p (complement P)).f = 0.f

Next tactic:
simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
    · 

Proof state:
case h₁
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ biprod.inr ≫
      biprod.desc (decompId_i P) (decompId_i (complement P)) ≫ biprod.lift (decompId_p P) (decompId_p (complement P)) =
    biprod.inr ≫ 𝟙 (P ⊞ complement P)

Next tactic:
rw [biprod.inr_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_left_eq_self, ← assoc]
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
    · rw [biprod.inr_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_left_eq_self, ← assoc]
      

Proof state:
case h₁
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ (decompId_i (complement P) ≫ decompId_p P) ≫ biprod.inl = 0

Next tactic:
refine' (_ =≫ _).trans zero_comp
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
    · rw [biprod.inr_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_left_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      

Proof state:
case h₁
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ decompId_i (complement P) ≫ decompId_p P = 0

Next tactic:
ext
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
    · rw [biprod.inr_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_left_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      

Proof state:
case h₁.h
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ (decompId_i (complement P) ≫ decompId_p P).f = 0.f

Next tactic:
simp only [complement_X, comp_f, decompId_i_f, complement_p,
        decompId_p_f, sub_comp, id_comp, idem, sub_self, instAddCommGroupHom_zero]
/-- A formal direct factor `P : Karoubi C` of an object `P.X : C` in a
preadditive category is actually a direct factor of the image `(toKaroubi C).obj P.X`
of `P.X` in the category `Karoubi C` -/
def decomposition (P : Karoubi C) : P ⊞ P.complement ≅ (toKaroubi _).obj P.X where
  hom := biprod.desc P.decompId_i P.complement.decompId_i
  inv := biprod.lift P.decompId_p P.complement.decompId_p
  hom_inv_id := by
    apply biprod.hom_ext'
    · rw [biprod.inl_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_right_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [comp_f, toKaroubi_obj_X, decompId_i_f, decompId_p_f,
        complement_p, comp_sub, comp_id, idem, sub_self, instAddCommGroupHom_zero]
    · rw [biprod.inr_desc_assoc, comp_id, biprod.lift_eq, comp_add, ← decompId_assoc,
        add_left_eq_self, ← assoc]
      refine' (_ =≫ _).trans zero_comp
      ext
      simp only [complement_X, comp_f, decompId_i_f, complement_p,
        decompId_p_f, sub_comp, id_comp, idem, sub_self, instAddCommGroupHom_zero]
  inv_hom_id := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{v, u_1} C
inst✝ : Preadditive C
P : Karoubi C
⊢ biprod.lift (decompId_p P) (decompId_p (complement P)) ≫ biprod.desc (decompId_i P) (decompId_i (complement P)) =
    𝟙 ((toKaroubi C).obj P.X)

Next tactic:
simp only [biprod.lift_desc, instAddCommGroupHom_add, toKaroubi_obj_X, comp_f,
      decompId_p_f, decompId_i_f, idem, complement_X, complement_p, comp_sub, comp_id,
      sub_comp, id_comp, sub_self, sub_zero, add_sub_cancel'_right,
      id_eq, toKaroubi_obj_p]
/-- Extensionality for arrows -/
@[ext]
theorem Arrow.ext {α β : TypeVec n} (f g : α ⟹ β) :
    (∀ i, f i = g i) → f = g := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
f g : α ⟹ β
⊢ (∀ (i : Fin2 n), f i = g i) → f = g

Next tactic:
intro h
/-- Extensionality for arrows -/
@[ext]
theorem Arrow.ext {α β : TypeVec n} (f g : α ⟹ β) :
    (∀ i, f i = g i) → f = g := by
  intro h; 

Proof state:
n : ℕ
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
f g : α ⟹ β
h : ∀ (i : Fin2 n), f i = g i
⊢ f = g

Next tactic:
funext i
/-- Extensionality for arrows -/
@[ext]
theorem Arrow.ext {α β : TypeVec n} (f g : α ⟹ β) :
    (∀ i, f i = g i) → f = g := by
  intro h; funext i; 

Proof state:
case h
n : ℕ
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
f g : α ⟹ β
h : ∀ (i : Fin2 n), f i = g i
i : Fin2 n
⊢ f i = g i

Next tactic:
apply h
@[simp]
theorem append1_drop_last (α : TypeVec (n + 1)) : append1 (drop α) (last α) = α :=
  funext fun i => by 

Proof state:
n : ℕ
α : TypeVec.{u_1} (n + 1)
i : Fin2 (n + 1)
⊢ (drop α ::: last α) i = α i

Next tactic:
cases i
@[simp]
theorem append1_drop_last (α : TypeVec (n + 1)) : append1 (drop α) (last α) = α :=
  funext fun i => by cases i <;> 

Proof state:
case fz
n : ℕ
α : TypeVec.{u_1} (n + 1)
⊢ (drop α ::: last α) Fin2.fz = α Fin2.fz

Next tactic:
rfl
@[simp]
theorem append1_drop_last (α : TypeVec (n + 1)) : append1 (drop α) (last α) = α :=
  funext fun i => by cases i <;> 

Proof state:
case fs
n : ℕ
α : TypeVec.{u_1} (n + 1)
a✝ : Fin2 (Nat.add n 0)
⊢ (drop α ::: last α) (Fin2.fs a✝) = α (Fin2.fs a✝)

Next tactic:
rfl
/-- cases on `(n+1)-length` vectors -/
@[elab_as_elim]
def append1Cases {C : TypeVec (n + 1) → Sort u} (H : ∀ α β, C (append1 α β)) (γ) : C γ := by
  

Proof state:
n : ℕ
C : TypeVec.{?u.25676} (n + 1) → Sort u
H : (α : TypeVec.{?u.25676} n) → (β : Type ?u.25676) → C (α ::: β)
γ : TypeVec.{?u.25676} (n + 1)
⊢ C γ

Next tactic:
rw [← @append1_drop_last _ γ]
/-- cases on `(n+1)-length` vectors -/
@[elab_as_elim]
def append1Cases {C : TypeVec (n + 1) → Sort u} (H : ∀ α β, C (append1 α β)) (γ) : C γ := by
  rw [← @append1_drop_last _ γ]; 

Proof state:
n : ℕ
C : TypeVec.{?u.25676} (n + 1) → Sort u
H : (α : TypeVec.{?u.25676} n) → (β : Type ?u.25676) → C (α ::: β)
γ : TypeVec.{?u.25676} (n + 1)
⊢ C (drop γ ::: last γ)

Next tactic:
apply H
/-- arrow in the category of `0-length` vectors -/
def nilFun {α : TypeVec 0} {β : TypeVec 0} : α ⟹ β := fun i => by 

Proof state:
n : ℕ
α : TypeVec.{?u.35408} 0
β : TypeVec.{?u.35421} 0
i : Fin2 0
⊢ α i → β i

Next tactic:
apply Fin2.elim0 i
theorem eq_of_drop_last_eq {α β : TypeVec (n + 1)} {f g : α ⟹ β} (h₀ : dropFun f = dropFun g)
    (h₁ : lastFun f = lastFun g) : f = g := by
  -- porting note: FIXME: congr_fun h₀ <;> ext1 ⟨⟩ <;> apply_assumption
  

Proof state:
n : ℕ
α : TypeVec.{u_1} (n + 1)
β : TypeVec.{u_2} (n + 1)
f g : α ⟹ β
h₀ : dropFun f = dropFun g
h₁ : lastFun f = lastFun g
⊢ f = g

Next tactic:
refine funext (fun x => ?_)
theorem eq_of_drop_last_eq {α β : TypeVec (n + 1)} {f g : α ⟹ β} (h₀ : dropFun f = dropFun g)
    (h₁ : lastFun f = lastFun g) : f = g := by
  -- porting note: FIXME: congr_fun h₀ <;> ext1 ⟨⟩ <;> apply_assumption
  refine funext (fun x => ?_)
  

Proof state:
n : ℕ
α : TypeVec.{u_1} (n + 1)
β : TypeVec.{u_2} (n + 1)
f g : α ⟹ β
h₀ : dropFun f = dropFun g
h₁ : lastFun f = lastFun g
x : Fin2 (n + 1)
⊢ f x = g x

Next tactic:
cases x
theorem eq_of_drop_last_eq {α β : TypeVec (n + 1)} {f g : α ⟹ β} (h₀ : dropFun f = dropFun g)
    (h₁ : lastFun f = lastFun g) : f = g := by
  -- porting note: FIXME: congr_fun h₀ <;> ext1 ⟨⟩ <;> apply_assumption
  refine funext (fun x => ?_)
  cases x
  · 

Proof state:
case fz
n : ℕ
α : TypeVec.{u_1} (n + 1)
β : TypeVec.{u_2} (n + 1)
f g : α ⟹ β
h₀ : dropFun f = dropFun g
h₁ : lastFun f = lastFun g
⊢ f Fin2.fz = g Fin2.fz

Next tactic:
apply h₁
theorem eq_of_drop_last_eq {α β : TypeVec (n + 1)} {f g : α ⟹ β} (h₀ : dropFun f = dropFun g)
    (h₁ : lastFun f = lastFun g) : f = g := by
  -- porting note: FIXME: congr_fun h₀ <;> ext1 ⟨⟩ <;> apply_assumption
  refine funext (fun x => ?_)
  cases x
  · apply h₁
  · 

Proof state:
case fs
n : ℕ
α : TypeVec.{u_1} (n + 1)
β : TypeVec.{u_2} (n + 1)
f g : α ⟹ β
h₀ : dropFun f = dropFun g
h₁ : lastFun f = lastFun g
a✝ : Fin2 (Nat.add n 0)
⊢ f (Fin2.fs a✝) = g (Fin2.fs a✝)

Next tactic:
apply congr_fun h₀
theorem splitFun_inj {α α' : TypeVec (n + 1)} {f f' : drop α ⟹ drop α'} {g g' : last α → last α'}
    (H : splitFun f g = splitFun f' g') : f = f' ∧ g = g' := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} (n + 1)
α' : TypeVec.{u_2} (n + 1)
f f' : drop α ⟹ drop α'
g g' : last α → last α'
H : splitFun f g = splitFun f' g'
⊢ f = f' ∧ g = g'

Next tactic:
rw [← dropFun_splitFun f g, H, ← lastFun_splitFun f g, H]
theorem splitFun_inj {α α' : TypeVec (n + 1)} {f f' : drop α ⟹ drop α'} {g g' : last α → last α'}
    (H : splitFun f g = splitFun f' g') : f = f' ∧ g = g' := by
  rw [← dropFun_splitFun f g, H, ← lastFun_splitFun f g, H]; 

Proof state:
n : ℕ
α : TypeVec.{u_1} (n + 1)
α' : TypeVec.{u_2} (n + 1)
f f' : drop α ⟹ drop α'
g g' : last α → last α'
H : splitFun f g = splitFun f' g'
⊢ dropFun (splitFun f' g') = f' ∧ lastFun (splitFun f' g') = g'

Next tactic:
simp
theorem nilFun_comp {α₀ : TypeVec 0} (f₀ : α₀ ⟹ Fin2.elim0) : nilFun ⊚ f₀ = f₀ :=
  funext fun x => by 

Proof state:
n : ℕ
α₀ : TypeVec.{u_1} 0
f₀ : α₀ ⟹ Fin2.elim0
x : Fin2 0
⊢ (nilFun ⊚ f₀) x = f₀ x

Next tactic:
apply Fin2.elim0 x
instance subsingleton0 : Subsingleton (TypeVec 0) :=
  ⟨fun a b => funext fun a => by 

Proof state:
n : ℕ
a✝ b : TypeVec.{?u.46789} 0
a : Fin2 0
⊢ a✝ a = b a

Next tactic:
apply Fin2.elim0 a
/-- cases distinction for 0-length type vector -/
protected def casesNil {β : TypeVec 0 → Sort*} (f : β Fin2.elim0) : ∀ v, β v :=
  fun v => cast (by 

Proof state:
n : ℕ
β : TypeVec.{?u.46848} 0 → Sort u_1
f : β Fin2.elim0
v : TypeVec.{?u.46848} 0
⊢ β Fin2.elim0 = β v

Next tactic:
congr
/-- cases distinction for 0-length type vector -/
protected def casesNil {β : TypeVec 0 → Sort*} (f : β Fin2.elim0) : ∀ v, β v :=
  fun v => cast (by congr; 

Proof state:
case e_a
n : ℕ
β : TypeVec.{?u.46848} 0 → Sort u_1
f : β Fin2.elim0
v : TypeVec.{?u.46848} 0
⊢ Fin2.elim0 = v

Next tactic:
funext i
/-- cases distinction for 0-length type vector -/
protected def casesNil {β : TypeVec 0 → Sort*} (f : β Fin2.elim0) : ∀ v, β v :=
  fun v => cast (by congr; funext i; 

Proof state:
case e_a.h
n : ℕ
β : TypeVec.{?u.46848} 0 → Sort u_1
f : β Fin2.elim0
v : TypeVec.{?u.46848} 0
i : Fin2 0
⊢ Fin2.elim0 i = v i

Next tactic:
cases i
/-- cases distinction for (n+1)-length type vector -/
protected def casesCons (n : ℕ) {β : TypeVec (n + 1) → Sort*}
    (f : ∀ (t) (v : TypeVec n), β (v ::: t)) :
    ∀ v, β v :=
  fun v : TypeVec (n + 1) => cast (by 

Proof state:
n✝ n : ℕ
β : TypeVec.{?u.47546} (n + 1) → Sort u_1
f : (t : Type ?u.47546) → (v : TypeVec.{?u.47546} n) → β (v ::: t)
v : TypeVec.{?u.47546} (n + 1)
⊢ β (drop v ::: last v) = β v

Next tactic:
simp
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
⊢ β v v' fs

Next tactic:
refine' cast _ f
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
⊢ β Fin2.elim0 Fin2.elim0 nilFun = β v v' fs

Next tactic:
have eq₁ : v = Fin2.elim0 := by funext i; contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by 

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
⊢ v = Fin2.elim0

Next tactic:
funext i
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; 

Proof state:
case h
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
i : Fin2 0
⊢ v i = Fin2.elim0 i

Next tactic:
contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
⊢ β Fin2.elim0 Fin2.elim0 nilFun = β v v' fs

Next tactic:
have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by 

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
⊢ v' = Fin2.elim0

Next tactic:
funext i
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; 

Proof state:
case h
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
i : Fin2 0
⊢ v' i = Fin2.elim0 i

Next tactic:
contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
  

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
eq₂ : v' = Fin2.elim0
⊢ β Fin2.elim0 Fin2.elim0 nilFun = β v v' fs

Next tactic:
have eq₃ : fs = nilFun := by funext i; contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
  have eq₃ : fs = nilFun := by 

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
eq₂ : v' = Fin2.elim0
⊢ fs = nilFun

Next tactic:
funext i
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
  have eq₃ : fs = nilFun := by funext i; 

Proof state:
case h
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
eq₂ : v' = Fin2.elim0
i : Fin2 0
⊢ fs i = nilFun i

Next tactic:
contradiction
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
  have eq₃ : fs = nilFun := by funext i; contradiction
  

Proof state:
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v : TypeVec.{?u.48284} 0
v' : TypeVec.{?u.48297} 0
fs : v ⟹ v'
eq₁ : v = Fin2.elim0
eq₂ : v' = Fin2.elim0
eq₃ : fs = nilFun
⊢ β Fin2.elim0 Fin2.elim0 nilFun = β v v' fs

Next tactic:
cases eq₁
/-- cases distinction for an arrow in the category of 0-length type vectors -/
def typevecCasesNil₃ {β : ∀ v v' : TypeVec 0, v ⟹ v' → Sort*}
    (f : β Fin2.elim0 Fin2.elim0 nilFun) :
    ∀ v v' fs, β v v' fs := fun v v' fs => by
  refine' cast _ f
  have eq₁ : v = Fin2.elim0 := by funext i; contradiction
  have eq₂ : v' = Fin2.elim0 := by funext i; contradiction
  have eq₃ : fs = nilFun := by funext i; contradiction
  cases eq₁; 

Proof state:
case refl
n : ℕ
β : (v : TypeVec.{?u.48284} 0) → (v' : TypeVec.{?u.48297} 0) → v ⟹ v' → Sort u_1
f : β Fin2.elim0 Fin2.elim0 nilFun
v' : TypeVec.{?u.48297} 0
eq₂ : v' = Fin2.elim0
fs : Fin2.elim0 ⟹ v'
eq₃ : fs = nilFun
⊢ β Fin2.elim0 Fin2.elim0 nilFun = β Fin2.elim0 v' fs

Next tactic:
cases eq₂