l3lab/ntp-mathlib huggingface dataset:
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
⊢ a ≤ ↑j

Next tactic:
linarith
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        σ X { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } ≫ δ X (Fin.succ j)

Next tactic:
have hj₃ := j.is_lt
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        σ X { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } ≫ δ X (Fin.succ j)

Next tactic:
have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
⊢ a ≤ m

Next tactic:
by_contra h
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
h : ¬a ≤ m
⊢ False

Next tactic:
rw [not_le, ← Nat.succ_le_iff] at h
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
h : Nat.succ m ≤ a
⊢ False

Next tactic:
linarith
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        σ X { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } ≫ δ X (Fin.succ j)

Next tactic:
rw [X.δ_comp_σ_of_gt', j.pred_succ]
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        δ X j ≫
          σ X
            (Fin.castLT { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) }
              (_ : ↑{ val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < m + 1))
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ Fin.succ { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < Fin.succ j
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ Fin.succ { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < Fin.succ j

Next tactic:
swap
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  swap
  · 

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ Fin.succ { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < Fin.succ j

Next tactic:
rw [Fin.lt_iff_val_lt_val]
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  swap
  · rw [Fin.lt_iff_val_lt_val]
    

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ ↑(Fin.succ { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) }) < ↑(Fin.succ j)

Next tactic:
simpa only [Fin.val_mk, Fin.val_succ, add_lt_add_iff_right] using haj
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  swap
  · rw [Fin.lt_iff_val_lt_val]
    simpa only [Fin.val_mk, Fin.val_succ, add_lt_add_iff_right] using haj
  

Proof state:
case neg
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        δ X j ≫
          σ X
            (Fin.castLT { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) }
              (_ : ↑{ val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < m + 1))

Next tactic:
obtain _ | ham'' := ham.lt_or_eq
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  swap
  · rw [Fin.lt_iff_val_lt_val]
    simpa only [Fin.val_mk, Fin.val_succ, add_lt_add_iff_right] using haj
  obtain _ | ham'' := ham.lt_or_eq
  · -- case where `a<m`
    

Proof state:
case neg.inl
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
h✝ : a < m
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≫
        δ X j ≫
          σ X
            (Fin.castLT { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) }
              (_ : ↑{ val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < m + 1))

Next tactic:
rw [← X.δ_comp_δ''_assoc]
theorem induction {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    HigherFacesVanish (q + 1) (φ ≫ (𝟙 _ + Hσ q).f (n + 1)) := by
  intro j hj₁
  dsimp
  simp only [comp_add, add_comp, comp_id]
  -- when n < q, the result follows immediately from the assumption
  by_cases hqn : n < q
  · rw [v.comp_Hσ_eq_zero hqn, zero_comp, add_zero, v j (by linarith)]
  -- we now assume that n≥q, and write n=a+q
  cases' Nat.le.dest (not_lt.mp hqn) with a ha
  rw [v.comp_Hσ_eq (show n = a + q by linarith), neg_comp, add_neg_eq_zero, assoc, assoc]
  cases' n with m hm
  -- the boundary case n=0
  · simp only [Nat.eq_zero_of_add_eq_zero_left ha, Fin.eq_zero j, Fin.mk_zero, Fin.mk_one,
      δ_comp_σ_succ, comp_id]
    rfl
  -- in the other case, we need to write n as m+1
  -- then, we first consider the particular case j = a
  by_cases hj₂ : a = (j : ℕ)
  · simp only [hj₂, Fin.eta, δ_comp_σ_succ, comp_id]
    rfl
  -- now, we assume j ≠ a (i.e. a < j)
  have haj : a < j := (Ne.le_iff_lt hj₂).mp (by linarith)
  have hj₃ := j.is_lt
  have ham : a ≤ m := by
    by_contra h
    rw [not_le, ← Nat.succ_le_iff] at h
    linarith
  rw [X.δ_comp_σ_of_gt', j.pred_succ]
  swap
  · rw [Fin.lt_iff_val_lt_val]
    simpa only [Fin.val_mk, Fin.val_succ, add_lt_add_iff_right] using haj
  obtain _ | ham'' := ham.lt_or_eq
  · -- case where `a<m`
    rw [← X.δ_comp_δ''_assoc]
    

Proof state:
case neg.inl
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
h✝ : a < m
⊢ φ ≫ δ X (Fin.succ j) =
    φ ≫
      δ X (Fin.succ j) ≫
        δ X
            (Fin.castLT { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) }
              (_ : ↑{ val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } < m + 2)) ≫
          σ X
            (Fin.castLT { val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) }
              (_ : ↑{ val := a, isLt := (_ : a < Nat.succ (Nat.succ m)) } < m + 1))
case neg.inl.H
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
q a m : ℕ
φ : Y ⟶ X.obj (Opposite.op [Nat.succ m + 1])
v : HigherFacesVanish q φ
j : Fin (Nat.succ m + 1)
hj₁ : Nat.succ m + 1 ≤ ↑j + (q + 1)
hqn : ¬Nat.succ m < q
ha : q + a = Nat.succ m
hj₂ : ¬a = ↑j
haj : a < ↑j
hj₃ : ↑j < Nat.succ m + 1
ham : a ≤ m
h✝ : a < m
⊢ { val := a + 1, isLt := (_ : Nat.succ a < Nat.succ (Nat.succ m + 1)) } ≤ Fin.castSucc j

Next tactic:
swap