l3lab/ntp-mathlib huggingface dataset:
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
  · dsimp
    rw [Fin.lt_iff_val_lt_val, Fin.val_succ]
    linarith
  · 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
⊢ j ≠ 0

Next tactic:
intro hj'
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
  · dsimp
    rw [Fin.lt_iff_val_lt_val, Fin.val_succ]
    linarith
  · intro hj'
    

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
hj' : j = 0
⊢ False

Next tactic:
simp only [hnbq, add_comm b, add_assoc, hj', Fin.val_zero, zero_add, add_le_iff_nonpos_right,
      nonpos_iff_eq_zero, add_eq_zero, false_and] at hj
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0

Next tactic:
revert i hi
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
⊢ ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0

Next tactic:
induction' q with q hq
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · 

Proof state:
case zero
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n : ℕ
⊢ ∀ (i : Fin (n + 1)),
    n + 1 ≤ ↑i + Nat.zero → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P Nat.zero) (n + 1) = 0

Next tactic:
intro i (hi : n + 1 ≤ i)
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    

Proof state:
case zero
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n : ℕ
i : Fin (n + 1)
hi : n + 1 ≤ ↑i
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P Nat.zero) (n + 1) = 0

Next tactic:
exfalso
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    

Proof state:
case zero.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n : ℕ
i : Fin (n + 1)
hi : n + 1 ≤ ↑i
⊢ False

Next tactic:
linarith [Fin.is_lt i]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · 

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
⊢ ∀ (i : Fin (n + 1)),
    n + 1 ≤ ↑i + Nat.succ q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (n + 1) = 0

Next tactic:
intro i (hi : n + 1 ≤ i + q + 1)
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (n + 1) = 0

Next tactic:
by_cases h : n + 1 ≤ (i : ℕ) + q
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · 

Proof state:
case pos
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
h : n + 1 ≤ ↑i + q
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (n + 1) = 0

Next tactic:
rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · 

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
h : ¬n + 1 ≤ ↑i + q
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (n + 1) = 0

Next tactic:
replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
h : ¬n + 1 ≤ ↑i + q
⊢ n = ↑i + q

Next tactic:
obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        

Proof state:
case intro
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
h : ¬n + 1 ≤ ↑i + q
j : ℕ
hj : ↑i + q + 1 = n + 1 + j
⊢ n = ↑i + q

Next tactic:
rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        

Proof state:
case intro
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
hi : n + 1 ≤ ↑i + q + 1
j : ℕ
h : j = 0
hj : ↑i + q + 1 = n + 1 + j
⊢ n = ↑i + q

Next tactic:
rw [← add_left_inj 1, hj, self_eq_add_right, h]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
n q : ℕ
hq : ∀ (i : Fin (n + 1)), n + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (n + 1) = 0
i : Fin (n + 1)
h : ¬n + 1 ≤ ↑i + q
hi : n = ↑i + q
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (n + 1) = 0

Next tactic:
rcases n with _|n
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · 

Proof state:
case neg.zero
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
i : Fin (Nat.zero + 1)
h : ¬Nat.zero + 1 ≤ ↑i + q
hi : Nat.zero = ↑i + q
⊢ SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P (Nat.succ q)) (Nat.zero + 1) = 0

Next tactic:
fin_cases i
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬Nat.zero + 1 ≤ ↑{ val := 0, isLt := (_ : 0 < Nat.zero + 1) } + q
hi : Nat.zero = ↑{ val := 0, isLt := (_ : 0 < Nat.zero + 1) } + q
⊢ SimplicialObject.σ X { val := 0, isLt := (_ : 0 < Nat.zero + 1) } ≫
      HomologicalComplex.Hom.f (P (Nat.succ q)) (Nat.zero + 1) =
    0

Next tactic:
dsimp at h hi
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ SimplicialObject.σ X { val := 0, isLt := (_ : 0 < Nat.zero + 1) } ≫
      HomologicalComplex.Hom.f (P (Nat.succ q)) (Nat.zero + 1) =
    0

Next tactic:
rw [show q = 0 by linarith]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        rw [show q = 0 by 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ q = 0

Next tactic:
linarith
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        rw [show q = 0 by linarith]
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ SimplicialObject.σ X { val := 0, isLt := (_ : 0 < Nat.zero + 1) } ≫
      HomologicalComplex.Hom.f (P (Nat.succ 0)) (Nat.zero + 1) =
    0

Next tactic:
change X.σ 0 ≫ (P 1).f 1 = 0
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        rw [show q = 0 by linarith]
        change X.σ 0 ≫ (P 1).f 1 = 0
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ SimplicialObject.σ X 0 ≫ HomologicalComplex.Hom.f (P 1) 1 = 0

Next tactic:
simp only [P_succ, HomologicalComplex.add_f_apply, comp_add,
          HomologicalComplex.id_f, AlternatingFaceMapComplex.obj_d_eq, Hσ,
          HomologicalComplex.comp_f, Homotopy.nullHomotopicMap'_f (c_mk 2 1 rfl) (c_mk 1 0 rfl),
          comp_id]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        rw [show q = 0 by linarith]
        change X.σ 0 ≫ (P 1).f 1 = 0
        simp only [P_succ, HomologicalComplex.add_f_apply, comp_add,
          HomologicalComplex.id_f, AlternatingFaceMapComplex.obj_d_eq, Hσ,
          HomologicalComplex.comp_f, Homotopy.nullHomotopicMap'_f (c_mk 2 1 rfl) (c_mk 1 0 rfl),
          comp_id]
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ SimplicialObject.σ X 0 ≫ HomologicalComplex.Hom.f (P 0) 1 +
      (SimplicialObject.σ X 0 ≫
          HomologicalComplex.Hom.f (P 0) 1 ≫
            (Finset.sum Finset.univ fun i => (-1) ^ ↑i • SimplicialObject.δ X i) ≫
              hσ' 0 0 1 (_ : ComplexShape.Rel c 1 0) +
        SimplicialObject.σ X 0 ≫
          HomologicalComplex.Hom.f (P 0) 1 ≫
            hσ' 0 1 2 (_ : ComplexShape.Rel c 2 1) ≫
              Finset.sum Finset.univ fun i => (-1) ^ ↑i • SimplicialObject.δ X i) =
    0

Next tactic:
erw [hσ'_eq' (zero_add 0).symm, hσ'_eq' (add_zero 1).symm, comp_id, Fin.sum_univ_two,
          Fin.sum_univ_succ, Fin.sum_univ_two]
theorem σ_comp_P_eq_zero (X : SimplicialObject C) {n q : ℕ} (i : Fin (n + 1)) (hi : n + 1 ≤ i + q) :
    X.σ i ≫ (P q).f (n + 1) = 0 := by
  revert i hi
  induction' q with q hq
  · intro i (hi : n + 1 ≤ i)
    exfalso
    linarith [Fin.is_lt i]
  · intro i (hi : n + 1 ≤ i + q + 1)
    by_cases h : n + 1 ≤ (i : ℕ) + q
    · rw [P_succ, HomologicalComplex.comp_f, ← assoc, hq i h, zero_comp]
    · replace hi : n = i + q := by
        obtain ⟨j, hj⟩ := le_iff_exists_add.mp hi
        rw [← Nat.lt_succ_iff, Nat.succ_eq_add_one, hj, not_lt, add_le_iff_nonpos_right,
          nonpos_iff_eq_zero] at h
        rw [← add_left_inj 1, hj, self_eq_add_right, h]
      rcases n with _|n
      · fin_cases i
        dsimp at h hi
        rw [show q = 0 by linarith]
        change X.σ 0 ≫ (P 1).f 1 = 0
        simp only [P_succ, HomologicalComplex.add_f_apply, comp_add,
          HomologicalComplex.id_f, AlternatingFaceMapComplex.obj_d_eq, Hσ,
          HomologicalComplex.comp_f, Homotopy.nullHomotopicMap'_f (c_mk 2 1 rfl) (c_mk 1 0 rfl),
          comp_id]
        erw [hσ'_eq' (zero_add 0).symm, hσ'_eq' (add_zero 1).symm, comp_id, Fin.sum_univ_two,
          Fin.sum_univ_succ, Fin.sum_univ_two]
        

Proof state:
case neg.zero.head
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
hq :
  ∀ (i : Fin (Nat.zero + 1)),
    Nat.zero + 1 ≤ ↑i + q → SimplicialObject.σ X i ≫ HomologicalComplex.Hom.f (P q) (Nat.zero + 1) = 0
h : ¬0 + 1 ≤ 0 + q
hi : 0 = 0 + q
⊢ SimplicialObject.σ X 0 +
      (SimplicialObject.σ X 0 ≫
          HomologicalComplex.Hom.f (P 0) 1 ≫
            ((-1) ^ ↑0 • SimplicialObject.δ X 0 + (-1) ^ ↑1 • SimplicialObject.δ X 1) ≫
              ((-1) ^ 0 • SimplicialObject.σ X { val := 0, isLt := (_ : 0 < Nat.succ 0) }) +
        SimplicialObject.σ X 0 ≫
          HomologicalComplex.Hom.f (P 0) 1 ≫
            ((-1) ^ 1 • SimplicialObject.σ X { val := 1, isLt := (_ : 1 < Nat.succ 1) }) ≫
              ((-1) ^ ↑0 • SimplicialObject.δ X 0 +
                ((-1) ^ ↑(Fin.succ 0) • SimplicialObject.δ X (Fin.succ 0) +
                  (-1) ^ ↑(Fin.succ 1) • SimplicialObject.δ X (Fin.succ 1)))) =
    0

Next tactic:
simp only [Fin.val_zero, pow_zero, pow_one, pow_add, one_smul, neg_smul, Fin.mk_one,
          Fin.val_succ, Fin.val_one, Fin.succ_one_eq_two, P_zero, HomologicalComplex.id_f,
          Fin.val_two, pow_two, mul_neg, one_mul, neg_mul, neg_neg, id_comp, add_comp,
          comp_add, Fin.mk_zero, neg_comp, comp_neg, Fin.succ_zero_eq_one]