l3lab/ntp-mathlib huggingface dataset:
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> 

Proof state:
case succ.succ.succ.succ.zero
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
k j : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k))
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ (Nat.succ j))
⊢ (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        Nat.zero (Nat.succ (Nat.succ j)) ≫
      (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k)) =
    0

Next tactic:
try simp
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try 

Proof state:
case succ.succ.succ.succ.zero
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
k j : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k))
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ (Nat.succ j))
⊢ (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        Nat.zero (Nat.succ (Nat.succ j)) ≫
      (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k)) =
    0

Next tactic:
simp
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> 

Proof state:
case succ.succ.succ.succ.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
k j : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k))
n✝ : ℕ
hij : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ n✝) (Nat.succ (Nat.succ j))
⊢ (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ n✝) (Nat.succ (Nat.succ j)) ≫
      (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k)) =
    0

Next tactic:
try simp
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try 

Proof state:
case succ.succ.succ.succ.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
k j : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k))
n✝ : ℕ
hij : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ n✝) (Nat.succ (Nat.succ j))
⊢ (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ n✝) (Nat.succ (Nat.succ j)) ≫
      (fun x x_1 =>
          match x, x_1 with
          | 0, 1 => f
          | Nat.succ i, Nat.succ j => d C i j
          | x, x_2 => 0)
        (Nat.succ (Nat.succ j)) (Nat.succ (Nat.succ k)) =
    0

Next tactic:
simp
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try simp
    

Proof state:
case succ.succ.succ.zero.zero
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
k : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ Nat.zero) (Nat.succ (Nat.succ k))
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero)
⊢ f ≫ d C 0 (Nat.succ k) = 0

Next tactic:
cases k
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try simp
    cases k
    · 

Proof state:
case succ.succ.succ.zero.zero.zero
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
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero)
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ Nat.zero) (Nat.succ (Nat.succ Nat.zero))
⊢ f ≫ d C 0 (Nat.succ Nat.zero) = 0

Next tactic:
exact w
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try simp
    cases k
    · exact w
    · 

Proof state:
case succ.succ.succ.zero.zero.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
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero)
n✝ : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ Nat.zero) (Nat.succ (Nat.succ (Nat.succ n✝)))
⊢ f ≫ d C 0 (Nat.succ (Nat.succ n✝)) = 0

Next tactic:
rw [C.shape, comp_zero]
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try simp
    cases k
    · exact w
    · rw [C.shape, comp_zero]
      

Proof state:
case succ.succ.succ.zero.zero.succ.a
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
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero)
n✝ : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ Nat.zero) (Nat.succ (Nat.succ (Nat.succ n✝)))
⊢ ¬ComplexShape.Rel (ComplexShape.up ℕ) 0 (Nat.succ (Nat.succ n✝))

Next tactic:
simp only [Nat.zero_eq, ComplexShape.up_Rel, zero_add]
/-- We can "augment" a cochain complex by inserting an arbitrary object in degree zero
(shifting everything else up), along with a suitable differential.
-/
def augment (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0) :
    CochainComplex V ℕ where
  X | 0 => X
    | i + 1 => C.X i
  d | 0, 1 => f
    | i + 1, j + 1 => C.d i j
    | _, _ => 0
  shape i j s := by
    simp? at s says simp only [ComplexShape.up_Rel] at s
    rcases j with (_ | _ | j) <;> cases i <;> try simp
    · contradiction
    · rw [C.shape]
      simp only [ComplexShape.up_Rel]
      contrapose! s
      rw [← s]
      rfl
  d_comp_d' i j k hij hjk := by
    rcases k with (_ | _ | k) <;> rcases j with (_ | _ | j) <;> cases i <;> try simp
    cases k
    · exact w
    · rw [C.shape, comp_zero]
      simp only [Nat.zero_eq, ComplexShape.up_Rel, zero_add]
      

Proof state:
case succ.succ.succ.zero.zero.succ.a
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
hij : ComplexShape.Rel (ComplexShape.up ℕ) Nat.zero (Nat.succ Nat.zero)
n✝ : ℕ
hjk : ComplexShape.Rel (ComplexShape.up ℕ) (Nat.succ Nat.zero) (Nat.succ (Nat.succ (Nat.succ n✝)))
⊢ ¬1 = Nat.succ (Nat.succ n✝)

Next tactic:
exact (Nat.one_lt_succ_succ _).ne
/-- 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
        

Proof state:
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
i j : ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) i j →
    (fun i => 𝟙 (HomologicalComplex.X C i)) i ≫ d (truncate.obj (augment C f w)) i j =
      d C i j ≫ (fun i => 𝟙 (HomologicalComplex.X C i)) j

Next tactic:
cases j
/-- 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 <;>
          · 

Proof state:
case zero
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
i : ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) i Nat.zero →
    (fun i => 𝟙 (HomologicalComplex.X C i)) i ≫ d (truncate.obj (augment C f w)) i Nat.zero =
      d C i Nat.zero ≫ (fun i => 𝟙 (HomologicalComplex.X C i)) Nat.zero

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
            

Proof state:
case zero
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
i : ℕ
⊢ i + 1 = 0 → 𝟙 (HomologicalComplex.X C i) ≫ d C i 0 = d C i 0 ≫ 𝟙 (HomologicalComplex.X C 0)

Next tactic:
simp
/-- 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 <;>
          · 

Proof state:
case 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
i n✝ : ℕ
⊢ ComplexShape.Rel (ComplexShape.up ℕ) i (Nat.succ n✝) →
    (fun i => 𝟙 (HomologicalComplex.X C i)) i ≫ d (truncate.obj (augment C f w)) i (Nat.succ n✝) =
      d C i (Nat.succ n✝) ≫ (fun i => 𝟙 (HomologicalComplex.X C i)) (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
            

Proof state:
case 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
i n✝ : ℕ
⊢ i + 1 = Nat.succ n✝ →
    𝟙 (HomologicalComplex.X C i) ≫ d C i (n✝ + 1) = d C i (Nat.succ n✝) ≫ 𝟙 (HomologicalComplex.X C (Nat.succ n✝))

Next tactic:
simp
/-- 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
    

Proof state:
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
⊢ ((Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i)) ≫
      Hom.mk fun i => 𝟙 (HomologicalComplex.X C i)) =
    𝟙 (truncate.obj (augment C f w))

Next tactic:
ext i
/-- 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
    

Proof state:
case h
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
i : ℕ
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X C i))
      i =
    Hom.f (𝟙 (truncate.obj (augment C f w))) i

Next tactic:
cases i
/-- 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 <;>
      · 

Proof state:
case h.zero
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
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X C i))
      Nat.zero =
    Hom.f (𝟙 (truncate.obj (augment C f w))) Nat.zero

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
        

Proof state:
case h.zero
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
⊢ 𝟙 (HomologicalComplex.X C 0) ≫ 𝟙 (HomologicalComplex.X C 0) = 𝟙 (HomologicalComplex.X C 0)

Next tactic:
simp
/-- 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 <;>
      · 

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 (truncate.obj (augment C f w)) i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X C i))
      (Nat.succ n✝) =
    Hom.f (𝟙 (truncate.obj (augment C f w))) (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
        

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 (n✝ + 1))

Next tactic:
simp
/-- 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
    

Proof state:
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
⊢ ((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 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
    

Proof state:
case h
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
i : ℕ
⊢ Hom.f
      ((Hom.mk fun i => 𝟙 (HomologicalComplex.X C i)) ≫
        Hom.mk fun i => 𝟙 (HomologicalComplex.X (truncate.obj (augment C f w)) i))
      i =
    Hom.f (𝟙 C) i

Next tactic:
cases i
/-- 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.zero
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
⊢ 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 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.zero
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
⊢ 𝟙 (HomologicalComplex.X C 0) ≫ 𝟙 (HomologicalComplex.X C 0) = 𝟙 (HomologicalComplex.X C 0)

Next tactic:
simp