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 <;> dsimp [augment, truncate] <;> 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 : ChainComplex V ℕ
i : ℕ
⊢ Hom.f
      ((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))
      i =
    Hom.f (𝟙 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 <;> 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
    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 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))
      Nat.zero =
    Hom.f (𝟙 C) 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
        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 : 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 <;>
      · 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 : ChainComplex V ℕ
n✝ : ℕ
⊢ Hom.f
      ((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))
      (Nat.succ n✝) =
    Hom.f (𝟙 C) (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
        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 : ChainComplex V ℕ
n✝ : ℕ
⊢ 𝟙 (X C (Nat.succ n✝)) ≫ 𝟙 (X C (n✝ + 1)) = 𝟙 (X C (Nat.succ n✝))

Next tactic:
simp
/-- The truncation of an `ℕ`-indexed cochain complex,
deleting the object at `0` and shifting everything else down.
-/
@[simps]
def truncate [HasZeroMorphisms V] : CochainComplex V ℕ ⥤ CochainComplex V ℕ where
  obj C :=
    { X := fun i => C.X (i + 1)
      d := fun i j => C.d (i + 1) (j + 1)
      shape := fun i j w => by
        

Proof state:
V : Type u
inst✝¹ : Category.{v, u} V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
i j : ℕ
w : ¬ComplexShape.Rel (ComplexShape.up ℕ) i j
⊢ (fun i j => d C (i + 1) (j + 1)) i j = 0

Next tactic:
apply C.shape
/-- The truncation of an `ℕ`-indexed cochain complex,
deleting the object at `0` and shifting everything else down.
-/
@[simps]
def truncate [HasZeroMorphisms V] : CochainComplex V ℕ ⥤ CochainComplex V ℕ where
  obj C :=
    { X := fun i => C.X (i + 1)
      d := fun i j => C.d (i + 1) (j + 1)
      shape := fun i j w => by
        apply C.shape
        

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

Next tactic:
simpa
/-- There is a canonical chain map from the truncation of a cochain complex `C` to
the "single object" cochain complex consisting of the truncated object `C.X 0` in degree 0.
The components of this chain map are `C.d 0 1` in degree 0, and zero otherwise.
-/
def toTruncate [HasZeroObject V] [HasZeroMorphisms V] (C : CochainComplex V ℕ) :
    (single₀ V).obj (C.X 0) ⟶ truncate.obj C :=
  (fromSingle₀Equiv (truncate.obj C) (C.X 0)).symm ⟨C.d 0 1, by 

Proof state:
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroObject V
inst✝ : HasZeroMorphisms V
C : CochainComplex V ℕ
⊢ d C 0 1 ≫ d (truncate.obj C) 0 1 = 0

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

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 : ℕ
s : ¬ComplexShape.Rel (ComplexShape.up ℕ) i 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)
      i j =
    0

Next tactic:
simp? at s says simp only [ComplexShape.up_Rel] at s
/-- 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 

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 : ℕ
s : ¬ComplexShape.Rel (ComplexShape.up ℕ) i 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)
      i j =
    0

Next tactic:
simp only [ComplexShape.up_Rel] at s
/-- 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
    

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 : ℕ
s : ¬i + 1 = 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)
      i j =
    0

Next tactic:
rcases j with (_ | _ | j)
/-- 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) <;> 

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 : ℕ
s : ¬i + 1 = Nat.zero
⊢ (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)
      i Nat.zero =
    0

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

Proof state:
case 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
i : ℕ
s : ¬i + 1 = Nat.succ Nat.zero
⊢ (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)
      i (Nat.succ Nat.zero) =
    0

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

Proof state:
case 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
i j : ℕ
s : ¬i + 1 = 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)
      i (Nat.succ (Nat.succ j)) =
    0

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

Proof state:
case 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
s : ¬Nat.zero + 1 = Nat.zero
⊢ (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.zero =
    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 

Proof state:
case 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
s : ¬Nat.zero + 1 = Nat.zero
⊢ (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.zero =
    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 <;> 

Proof state:
case 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
n✝ : ℕ
s : ¬Nat.succ n✝ + 1 = Nat.zero
⊢ (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.zero =
    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 

Proof state:
case 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
n✝ : ℕ
s : ¬Nat.succ n✝ + 1 = Nat.zero
⊢ (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.zero =
    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 <;> 

Proof state:
case 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
s : ¬Nat.zero + 1 = Nat.succ Nat.zero
⊢ (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.zero) =
    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 

Proof state:
case 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
s : ¬Nat.zero + 1 = Nat.succ Nat.zero
⊢ (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.zero) =
    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 <;> 

Proof state:
case succ.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
n✝ : ℕ
s : ¬Nat.succ n✝ + 1 = Nat.succ Nat.zero
⊢ (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.zero) =
    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 

Proof state:
case succ.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
n✝ : ℕ
s : ¬Nat.succ n✝ + 1 = Nat.succ Nat.zero
⊢ (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.zero) =
    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 <;> 

Proof state:
case 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
j : ℕ
s : ¬Nat.zero + 1 = 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)) =
    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 

Proof state:
case 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
j : ℕ
s : ¬Nat.zero + 1 = 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)) =
    0

Next tactic:
simp