l3lab/ntp-mathlib huggingface dataset:
/-- Truncating an augmented cochain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 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
    cases i <;>
      · dsimp
        simp
  inv_hom_id := by
    ext i
    cases i <;>
      · 

Proof state:
case h.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
X : V
f : X ⟶ HomologicalComplex.X C 0
w : f ≫ d C 0 1 = 0
n✝ : ℕ
⊢ 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 n✝) =
    Hom.f (𝟙 C) (Nat.succ n✝)

Next tactic:
dsimp
/-- Truncating an augmented cochain complex is isomorphic (with components the identity)
to the original complex.
-/
def truncateAugment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 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
    cases i <;>
      · dsimp
        simp
  inv_hom_id := by
    ext i
    cases i <;>
      · dsimp
        

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

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

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

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

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

Next tactic:
simp only [ComplexShape.up_Rel, zero_add]
@[simp]
theorem cochainComplex_d_succ_succ_zero (C : CochainComplex V ℕ) (i : ℕ) : C.d 0 (i + 2) = 0 := by
  rw [C.shape]
  simp only [ComplexShape.up_Rel, zero_add]
  

Proof state:
case a
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
i : ℕ
⊢ ¬1 = i + 2

Next tactic:
exact (Nat.one_lt_succ_succ _).ne
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (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 : CochainComplex V ℕ
i : ℕ
⊢ X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (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 : CochainComplex V ℕ
⊢ X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (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 : CochainComplex V ℕ
n✝ : ℕ
⊢ X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        

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

Next tactic:
rcases 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> 

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

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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> 

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

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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> 

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

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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · 

Proof state:
case zero.zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero Nat.zero →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          Nat.zero ≫
        d C Nat.zero Nat.zero =
      d (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero Nat.zero ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · dsimp
            -- Porting note: simp can't handle this now but aesop does
            

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

Next tactic:
aesop
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · 

Proof state:
case zero.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
n✝ : ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ n✝) Nat.zero →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          (Nat.succ n✝) ≫
        d C (Nat.succ n✝) Nat.zero =
      d (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n✝) Nat.zero ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · dsimp
            -- Porting note: simp can't handle this now but aesop does
            

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

Next tactic:
aesop
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · 

Proof state:
case succ.zero.zero
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero) →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          Nat.zero ≫
        d C Nat.zero (Nat.succ Nat.zero) =
      d (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero (Nat.succ Nat.zero) ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          (Nat.succ 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · dsimp
            -- Porting note: simp can't handle this now but aesop does
            

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

Next tactic:
aesop
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · 

Proof state:
case succ.zero.succ
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
n✝ : ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ n✝) (Nat.succ Nat.zero) →
    (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          (Nat.succ n✝) ≫
        d C (Nat.succ n✝) (Nat.succ Nat.zero) =
      d (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n✝) (Nat.succ Nat.zero) ≫
        (fun i =>
            Nat.casesOn (motive := fun t =>
              i = t → (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) i ⟶ X C i)) i
              (fun h =>
                (_ : Nat.zero = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) Nat.zero))
              (fun n h =>
                (_ : Nat.succ n = i) ▸
                  𝟙 (X (augment (truncate.obj C) (d C 0 1) (_ : d C 0 1 ≫ d C 1 (1 + 1) = 0)) (Nat.succ n)))
              (_ : i = i))
          (Nat.succ 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 : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · dsimp
            -- Porting note: simp can't handle this now but aesop does
            

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

Next tactic:
aesop
/-- Augmenting a truncated complex with the original object and morphism is isomorphic
(with components the identity) to the original complex.
-/
def augmentTruncate (C : CochainComplex V ℕ) :
    augment (truncate.obj C) (C.d 0 1) (C.d_comp_d _ _ _) ≅ C where
  hom :=
    { f := fun i => by cases i <;> exact 𝟙 _
      comm' := fun i j => by
        rcases j with (_ | _ | j) <;> cases i <;>
          · 

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

Next tactic:
dsimp