l3lab/ntp-mathlib huggingface dataset:
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 1 (Nat.succ j) →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          1 ≫
        d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 1 (Nat.succ j) =
      d C 1 (Nat.succ j) ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          (Nat.succ j)

Next tactic:
dsimp [augment, truncate]
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ 0 + 1 = 1 → 𝟙 (X C (Nat.succ 0)) ≫ d C 1 0 = d C 1 0 ≫ 𝟙 (X C 0)

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ Nat.succ j + 1 = 1 → 𝟙 (X C (Nat.succ 0)) ≫ d C (0 + 1) (j + 1) = d C 1 (Nat.succ j) ≫ 𝟙 (X C (Nat.succ j))

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => 

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j n : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) (n + 2) j →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          (n + 2) ≫
        d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (n + 2) j =
      d C (n + 2) j ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          j

Next tactic:
cases' j with j
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i n : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) (n + 2) Nat.zero →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          (n + 2) ≫
        d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (n + 2) Nat.zero =
      d C (n + 2) Nat.zero ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          Nat.zero

Next tactic:
dsimp [augment, truncate]
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i n j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) (n + 2) (Nat.succ j) →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          (n + 2) ≫
        d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (n + 2) (Nat.succ j) =
      d C (n + 2) (Nat.succ j) ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i))
              i (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero))
              (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n))) (_ : i = i))
          (Nat.succ j)

Next tactic:
dsimp [augment, truncate]
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i n : ℕ
⊢ 0 + 1 = n + 2 →
    (𝟙 (X C (Nat.succ (n + 1))) ≫
        match n + 2, 0 with
        | 1, 0 => d C 1 0
        | Nat.succ i, Nat.succ j => d C (i + 1) (j + 1)
        | x, x_1 => 0) =
      d C (n + 2) 0 ≫ 𝟙 (X C 0)

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i n j : ℕ
⊢ Nat.succ j + 1 = n + 2 →
    (𝟙 (X C (Nat.succ (n + 1))) ≫
        match n + 2, Nat.succ j with
        | 1, 0 => d C 1 0
        | Nat.succ i, Nat.succ j => d C (i + 1) (j + 1)
        | x, x_1 => 0) =
      d C (n + 2) (Nat.succ j) ≫ 𝟙 (X C (Nat.succ j))

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
⊢ ((Hom.mk fun i =>
        Nat.casesOn (motive := fun t =>
          i = t → (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i ⟶ X C i)) i
          (fun h =>
            (_ : Nat.zero = i) ▸
              𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero))
          (fun n h =>
            (_ : Nat.succ n = i) ▸
              𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n)))
          (_ : i = i)) ≫
      Hom.mk fun i =>
        Nat.casesOn (motive := fun t =>
          i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i)) i
          (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero)) (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n)))
          (_ : i = i)) =
    𝟙 (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0))

Next tactic:
ext i
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    

Proof state:
case h
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ Hom.f
      ((Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i ⟶ X C i)) i
            (fun h =>
              (_ : Nat.zero = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero))
            (fun n h =>
              (_ : Nat.succ n = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n)))
            (_ : i = i)) ≫
        Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i)) i
            (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero)) (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n)))
            (_ : i = i))
      i =
    Hom.f (𝟙 (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0))) i

Next tactic:
cases i
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    cases i <;>
      · 

Proof state:
case h.zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
⊢ Hom.f
      ((Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i ⟶ X C i)) i
            (fun h =>
              (_ : Nat.zero = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero))
            (fun n h =>
              (_ : Nat.succ n = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n)))
            (_ : i = i)) ≫
        Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i)) i
            (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero)) (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n)))
            (_ : i = i))
      Nat.zero =
    Hom.f (𝟙 (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0))) Nat.zero

Next tactic:
dsimp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    cases i <;>
      · dsimp
        

Proof state:
case h.zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
⊢ 𝟙 (X C 0) ≫ 𝟙 (X C 0) = 𝟙 (X C 0)

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    cases i <;>
      · 

Proof state:
case h.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
n✝ : ℕ
⊢ Hom.f
      ((Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i ⟶ X C i)) i
            (fun h =>
              (_ : Nat.zero = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero))
            (fun n h =>
              (_ : Nat.succ n = i) ▸
                𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n)))
            (_ : i = i)) ≫
        Hom.mk fun i =>
          Nat.casesOn (motive := fun t =>
            i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i)) i
            (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero)) (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n)))
            (_ : i = i))
      (Nat.succ n✝) =
    Hom.f (𝟙 (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0))) (Nat.succ n✝)

Next tactic:
dsimp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    cases i <;>
      · dsimp
        

Proof state:
case h.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
n✝ : ℕ
⊢ 𝟙 (X C (n✝ + 1)) ≫ 𝟙 (X C (Nat.succ n✝)) = 𝟙 (X C (n✝ + 1))

Next tactic:
simp
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : ChainComplex V ℕ) :
    augment (truncate.obj C) (C.d 1 0) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  inv :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        -- Porting note: was an rcases n with (_|_|n) but that was causing issues
        match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> simp }
  hom_inv_id := by
    ext i
    cases i <;>
      · dsimp
        simp
  inv_hom_id := by
    

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
⊢ ((Hom.mk fun i =>
        Nat.casesOn (motive := fun t =>
          i = t → (X C i ⟶ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i)) i
          (fun h => (_ : Nat.zero = i) ▸ 𝟙 (X C Nat.zero)) (fun n h => (_ : Nat.succ n = i) ▸ 𝟙 (X C (Nat.succ n)))
          (_ : i = i)) ≫
      Hom.mk fun i =>
        Nat.casesOn (motive := fun t =>
          i = t → (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i ⟶ X C i)) i
          (fun h =>
            (_ : Nat.zero = i) ▸
              𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero))
          (fun n h =>
            (_ : Nat.succ n = i) ▸
              𝟙 (X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n)))
          (_ : i = i)) =
    𝟙 C

Next tactic:
ext i