l3lab/ntp-mathlib huggingface dataset:
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        

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

Next tactic:
simp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · 

Proof state:
case h.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
X : V
f : HomologicalComplex.X C 0 ⟶ X
w : d C 1 0 ≫ f = 0
i : ℕ
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X C i))
      (Nat.succ i) =
    Hom.f (𝟙 (truncate.obj (augment C f w))) (Nat.succ i)

Next tactic:
dsimp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        

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

Next tactic:
simp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        simp
  inv_hom_id := by
    

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
X : V
f : HomologicalComplex.X C 0 ⟶ X
w : d C 1 0 ≫ f = 0
⊢ ((Hom.mk fun i => 𝟙 (HomologicalComplex.X C i)) ≫
      Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i)) =
    𝟙 C

Next tactic:
ext (_ | i)
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        simp
  inv_hom_id := by
    ext (_ | i) <;>
      · 

Proof state:
case h.zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
X : V
f : HomologicalComplex.X C 0 ⟶ X
w : d C 1 0 ≫ f = 0
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X C i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i))
      Nat.zero =
    Hom.f (𝟙 C) Nat.zero

Next tactic:
dsimp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        simp
  inv_hom_id := by
    ext (_ | i) <;>
      · dsimp
        

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

Next tactic:
simp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        simp
  inv_hom_id := by
    ext (_ | i) <;>
      · 

Proof state:
case h.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
X : V
f : HomologicalComplex.X C 0 ⟶ X
w : d C 1 0 ≫ f = 0
i : ℕ
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X C i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i))
      (Nat.succ i) =
    Hom.f (𝟙 C) (Nat.succ i)

Next tactic:
dsimp
/-- Truncating an augmented chain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    truncate.obj (augment C f w) ≅ C where
  hom := { f := fun i => 𝟙 _ }
  inv :=
    { f := fun i => 𝟙 _
      comm' := fun i j => by
        cases j <;>
          · dsimp
            simp }
  hom_inv_id := by
    ext (_ | i) <;>
      · dsimp
        simp
  inv_hom_id := by
    ext (_ | i) <;>
      · dsimp
        

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

Next tactic:
simp
@[simp]
theorem chainComplex_d_succ_succ_zero (C : ChainComplex V ℕ) (i : ℕ) : C.d (i + 2) 0 = 0 := by
  

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ d C (i + 2) 0 = 0

Next tactic:
rw [C.shape]
@[simp]
theorem chainComplex_d_succ_succ_zero (C : ChainComplex V ℕ) (i : ℕ) : C.d (i + 2) 0 = 0 := by
  rw [C.shape]
  

Proof state:
case a
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ ¬ComplexShape.Rel (ComplexShape.down ℕ) (i + 2) 0

Next tactic:
exact i.succ_succ_ne_one.symm
/-- 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 

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ 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

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 <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
⊢ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) Nat.zero ⟶ X C Nat.zero

Next tactic:
exact 𝟙 _
/-- 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 <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
n✝ : ℕ
⊢ X (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) (Nat.succ n✝) ⟶ X C (Nat.succ n✝)

Next tactic:
exact 𝟙 _
/-- 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
        

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) i j →
    (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))
          i ≫
        d C i j =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) i j ≫
        (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))
          j

Next tactic:
match i with
        | 0 | 1 | n+2 => cases' j with j <;> dsimp [augment, truncate] <;> 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 => 

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 0 j →
    (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))
          0 ≫
        d C 0 j =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 0 j ≫
        (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))
          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 <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 0 Nat.zero →
    (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))
          0 ≫
        d C 0 Nat.zero =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 0 Nat.zero ≫
        (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))
          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 <;> 

Proof state:
case succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 0 (Nat.succ j) →
    (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))
          0 ≫
        d C 0 (Nat.succ j) =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 0 (Nat.succ j) ≫
        (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))
          (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] <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ 0 + 1 = 0 → 𝟙 (X C 0) ≫ d C 0 0 = 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] <;> 

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

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 1 j →
    (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))
          1 ≫
        d C 1 j =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 1 j ≫
        (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))
          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 <;> 

Proof state:
case zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : ChainComplex V ℕ
i : ℕ
⊢ ComplexShape.Rel (ComplexShape.down ℕ) 1 Nat.zero →
    (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))
          1 ≫
        d C 1 Nat.zero =
      d (augment (truncate.obj C) (d C 1 0) (_ : d C (1 + 1) (0 + 1) ≫ d C (0 + 1) 0 = 0)) 1 Nat.zero ≫
        (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))
          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 <;> 

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 (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))
          1 ≫
        d C 1 (Nat.succ j) =
      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) ≫
        (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))
          (Nat.succ j)

Next tactic:
dsimp [augment, truncate]