l3lab/ntp-mathlib huggingface dataset:
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
h✝ : i + 1 = j
⊢ (drop.obj X).obj (op [i + 1]) = HomologicalComplex.X (AlternatingFaceMapComplex.obj (drop.obj X)) j

Next tactic:
congr
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · 

Proof state:
case neg
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
h✝ : ¬i + 1 = j
⊢ HomologicalComplex.X (AlternatingFaceMapComplex.obj (drop.obj X)) i ⟶
    HomologicalComplex.X (AlternatingFaceMapComplex.obj (drop.obj X)) j

Next tactic:
exact 0
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        

Proof state:
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
hij : ¬ComplexShape.Rel (ComplexShape.down ℕ) j i
⊢ (fun i j =>
        if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : (drop.obj X).obj (op [i + 1]) = (drop.obj X).obj (op [j]))
        else 0)
      i j =
    0

Next tactic:
dsimp
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        

Proof state:
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
hij : ¬ComplexShape.Rel (ComplexShape.down ℕ) j i
⊢ (if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : X.left.obj (op [i + 1]) = X.left.obj (op [j])) else 0) = 0

Next tactic:
split_ifs with h
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · 

Proof state:
case pos
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
hij : ¬ComplexShape.Rel (ComplexShape.down ℕ) j i
h : i + 1 = j
⊢ (-s ed i) ≫ eqToHom (_ : X.left.obj (op [i + 1]) = X.left.obj (op [j])) = 0

Next tactic:
exfalso
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          

Proof state:
case pos.h
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
hij : ¬ComplexShape.Rel (ComplexShape.down ℕ) j i
h : i + 1 = j
⊢ False

Next tactic:
exact hij h
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · 

Proof state:
case neg
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i j : ℕ
hij : ¬ComplexShape.Rel (ComplexShape.down ℕ) j i
h : ¬i + 1 = j
⊢ 0 = 0

Next tactic:
simp only [eq_self_iff_true]
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        

Proof state:
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
i : ℕ
⊢ HomologicalComplex.Hom.f
      (AlternatingFaceMapComplex.ε.app X ≫
        (ChainComplex.fromSingle₀Equiv (AlternatingFaceMapComplex.obj (drop.obj X)) (point.obj X)).symm ed.s')
      i =
    (((dNext i) fun i j =>
          if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : (drop.obj X).obj (op [i + 1]) = (drop.obj X).obj (op [j]))
          else 0) +
        (prevD i) fun i j =>
          if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : (drop.obj X).obj (op [i + 1]) = (drop.obj X).obj (op [j]))
          else 0) +
      HomologicalComplex.Hom.f (𝟙 (AlternatingFaceMapComplex.obj (drop.obj X))) i

Next tactic:
rcases i with _|i
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · 

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f
      (AlternatingFaceMapComplex.ε.app X ≫
        (ChainComplex.fromSingle₀Equiv (AlternatingFaceMapComplex.obj (drop.obj X)) (point.obj X)).symm ed.s')
      Nat.zero =
    (((dNext Nat.zero) fun i j =>
          if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : (drop.obj X).obj (op [i + 1]) = (drop.obj X).obj (op [j]))
          else 0) +
        (prevD Nat.zero) fun i j =>
          if h : i + 1 = j then (-s ed i) ≫ eqToHom (_ : (drop.obj X).obj (op [i + 1]) = (drop.obj X).obj (op [j]))
          else 0) +
      HomologicalComplex.Hom.f (𝟙 (AlternatingFaceMapComplex.obj (drop.obj X))) Nat.zero

Next tactic:
rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
          

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f
      (AlternatingFaceMapComplex.ε.app X ≫
        (ChainComplex.fromSingle₀Equiv (AlternatingFaceMapComplex.obj (drop.obj X)) (point.obj X)).symm ed.s')
      Nat.zero =
    (if h : Nat.zero + 1 = Nat.zero + 1 then
          (-s ed Nat.zero) ≫ eqToHom (_ : (drop.obj X).obj (op [Nat.zero + 1]) = (drop.obj X).obj (op [Nat.zero + 1]))
        else 0) ≫
        HomologicalComplex.d (AlternatingFaceMapComplex.obj (drop.obj X)) (Nat.zero + 1) Nat.zero +
      HomologicalComplex.Hom.f (𝟙 (AlternatingFaceMapComplex.obj (drop.obj X))) Nat.zero

Next tactic:
dsimp
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
          dsimp
          

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f (AlternatingFaceMapComplex.ε.app X) 0 ≫
      HomologicalComplex.Hom.f
        ((ChainComplex.fromSingle₀Equiv (AlternatingFaceMapComplex.obj X.left) X.right).symm ed.s') 0 =
    (if 0 + 1 = 0 + 1 then (-s ed 0) ≫ 𝟙 (X.left.obj (op [0 + 1])) else 0) ≫
        HomologicalComplex.d (AlternatingFaceMapComplex.obj X.left) (0 + 1) 0 +
      𝟙 (X.left.obj (op [0]))

Next tactic:
erw [ChainComplex.fromSingle₀Equiv_symm_apply_f_zero]
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
          dsimp
          erw [ChainComplex.fromSingle₀Equiv_symm_apply_f_zero]
          

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f (AlternatingFaceMapComplex.ε.app X) 0 ≫ ed.s' =
    (if 0 + 1 = 0 + 1 then (-s ed 0) ≫ 𝟙 (X.left.obj (op [0 + 1])) else 0) ≫
        HomologicalComplex.d (AlternatingFaceMapComplex.obj X.left) (0 + 1) 0 +
      𝟙 (X.left.obj (op [0]))

Next tactic:
simp only [comp_id, ite_true, zero_add, ComplexShape.down_Rel, not_true,
            AlternatingFaceMapComplex.obj_d_eq, Preadditive.neg_comp]
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
          dsimp
          erw [ChainComplex.fromSingle₀Equiv_symm_apply_f_zero]
          simp only [comp_id, ite_true, zero_add, ComplexShape.down_Rel, not_true,
            AlternatingFaceMapComplex.obj_d_eq, Preadditive.neg_comp]
          

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f (AlternatingFaceMapComplex.ε.app X) 0 ≫ ed.s' =
    (-s ed 0 ≫ Finset.sum Finset.univ fun i => (-1) ^ ↑i • SimplicialObject.δ X.left i) + 𝟙 (X.left.obj (op [0]))

Next tactic:
rw [Fin.sum_univ_two]
/-- If `C` is a preadditive category and `X` is an augmented simplicial object
in `C` that has an extra degeneracy, then the augmentation on the alternating
face map complex of `X` is a homotopy equivalence. -/
noncomputable def homotopyEquiv {C : Type*} [Category C] [Preadditive C] [HasZeroObject C]
    {X : SimplicialObject.Augmented C} (ed : ExtraDegeneracy X) :
    HomotopyEquiv (AlgebraicTopology.AlternatingFaceMapComplex.obj (drop.obj X))
      ((ChainComplex.single₀ C).obj (point.obj X)) where
  hom := AlternatingFaceMapComplex.ε.app X
  inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s')
  homotopyInvHomId := Homotopy.ofEq (by
    ext
    dsimp
    erw [AlternatingFaceMapComplex.ε_app_f_zero,
      ChainComplex.fromSingle₀Equiv_symm_apply_f_zero, s'_comp_ε]
    rfl)
  homotopyHomInvId :=
    { hom := fun i j => by
        by_cases i + 1 = j
        · exact (-ed.s i) ≫ eqToHom (by congr)
        · exact 0
      zero := fun i j hij => by
        dsimp
        split_ifs with h
        · exfalso
          exact hij h
        · simp only [eq_self_iff_true]
      comm := fun i => by
        rcases i with _|i
        · rw [Homotopy.prevD_chainComplex, Homotopy.dNext_zero_chainComplex, zero_add]
          dsimp
          erw [ChainComplex.fromSingle₀Equiv_symm_apply_f_zero]
          simp only [comp_id, ite_true, zero_add, ComplexShape.down_Rel, not_true,
            AlternatingFaceMapComplex.obj_d_eq, Preadditive.neg_comp]
          rw [Fin.sum_univ_two]
          

Proof state:
case zero
C : Type u_1
inst✝² : Category.{?u.354777, u_1} C
inst✝¹ : Preadditive C
inst✝ : HasZeroObject C
X : SimplicialObject.Augmented C
ed : ExtraDegeneracy X
⊢ HomologicalComplex.Hom.f (AlternatingFaceMapComplex.ε.app X) 0 ≫ ed.s' =
    -s ed 0 ≫ ((-1) ^ ↑0 • SimplicialObject.δ X.left 0 + (-1) ^ ↑1 • SimplicialObject.δ X.left 1) +
      𝟙 (X.left.obj (op [0]))

Next tactic:
simp only [Fin.val_zero, pow_zero, one_smul, Fin.val_one, pow_one, neg_smul,
            Preadditive.comp_add, s_comp_δ₀, drop_obj, Preadditive.comp_neg, neg_add_rev,
            neg_neg, neg_add_cancel_right, s₀_comp_δ₁,
            AlternatingFaceMapComplex.ε_app_f_zero]