File: Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean

full_name: CochainComplex.instHasHomotopyCofiberOfHasBinaryBiproductXHAddOfNat
code: instance [∀ p, HasBinaryBiproduct (F.X (p + 1)) (G.X p)] :
    HasHomotopyCofiber φ 
goal: HomologicalComplex.HasHomotopyCofiber φ

full_name: CochainComplex.mappingCone
code: /-- The mapping cone of a morphism of cochain complexes indexed by `ℤ`. -/
noncomputable def mappingCone 
goal: HomologicalComplex C (ComplexShape.up ℤ)

full_name: CochainComplex.mappingCone.inl
code: /-- The left inclusion in the mapping cone, as a cochain of degree `-1`. -/
noncomputable def inl : Cochain F (mappingCone φ) (-1) 
goal: CochainComplex.HomComplex.Cochain F (CochainComplex.mappingCone φ) (-1)

full_name: CochainComplex.mappingCone.inr
code: /-- The right inclusion in the mapping cone. -/
noncomputable def inr : G ⟶ mappingCone φ 
goal: G ⟶ CochainComplex.mappingCone φ

full_name: CochainComplex.mappingCone.fst
code: /-- The first projection from the mapping cone, as a cocyle of degree `1`. -/
noncomputable def fst : Cocycle (mappingCone φ) F 1 
goal: CochainComplex.HomComplex.Cocycle (CochainComplex.mappingCone φ) F 1

full_name: CochainComplex.mappingCone.snd
code: /-- The second projection from the mapping cone, as a cochain of degree `0`. -/
noncomputable def snd : Cochain (mappingCone φ) G 0 
goal: CochainComplex.HomComplex.Cochain (CochainComplex.mappingCone φ) G 0

full_name: CochainComplex.mappingCone.inl_v_fst_v
code: @[reassoc (attr := simp)]
lemma inl_v_fst_v (p q : ℤ) (hpq : q + 1 = p) :
    (inl φ).v p q (by rw [← hpq, add_neg_cancel_right]) ≫
      (fst φ : Cochain (mappingCone φ) F 1).v q p hpq = 𝟙 _ 
goal: (CochainComplex.mappingCone.inl φ).v p q ⋯ ≫ (↑(CochainComplex.mappingCone.fst φ)).v q p hpq = 𝟙 (F.X p)

full_name: CochainComplex.mappingCone.inl_v_snd_v
code: @[reassoc (attr := simp)]
lemma inl_v_snd_v (p q : ℤ) (hpq : p + (-1) = q) :
    (inl φ).v p q hpq ≫ (snd φ).v q q (add_zero q) = 0 
goal: (CochainComplex.mappingCone.inl φ).v p q hpq ≫ (CochainComplex.mappingCone.snd φ).v q q ⋯ = 0

full_name: CochainComplex.mappingCone.inr_f_fst_v
code: @[reassoc (attr := simp)]
lemma inr_f_fst_v (p q : ℤ) (hpq : p + 1 = q) :
    (inr φ).f p ≫ (fst φ).1.v p q hpq = 0 
goal: (CochainComplex.mappingCone.inr φ).f p ≫ (↑(CochainComplex.mappingCone.fst φ)).v p q hpq = 0

full_name: CochainComplex.mappingCone.inr_f_snd_v
code: @[reassoc (attr := simp)]
lemma inr_f_snd_v (p : ℤ) :
    (inr φ).f p ≫ (snd φ).v p p (add_zero p) = 𝟙 _ 
goal: (CochainComplex.mappingCone.inr φ).f p ≫ (CochainComplex.mappingCone.snd φ).v p p ⋯ = 𝟙 (G.X p)

full_name: CochainComplex.mappingCone.inl_fst
code: @[simp]
lemma inl_fst :
    (inl φ).comp (fst φ).1 (neg_add_self 1) = Cochain.ofHom (𝟙 F) 
goal: (CochainComplex.mappingCone.inl φ).comp ↑(CochainComplex.mappingCone.fst φ) ⋯ =
  CochainComplex.HomComplex.Cochain.ofHom (𝟙 F)

full_name: CochainComplex.mappingCone.inl_snd
code: @[simp]
lemma inl_snd :
    (inl φ).comp (snd φ) (add_zero (-1)) = 0 
goal: (CochainComplex.mappingCone.inl φ).comp (CochainComplex.mappingCone.snd φ) ⋯ = 0

full_name: CochainComplex.mappingCone.inr_fst
code: @[simp]
lemma inr_fst :
    (Cochain.ofHom (inr φ)).comp (fst φ).1 (zero_add 1) = 0 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp ↑(CochainComplex.mappingCone.fst φ)
    ⋯ =
  0

full_name: CochainComplex.mappingCone.inr_snd
code: @[simp]
lemma inr_snd :
    (Cochain.ofHom (inr φ)).comp (snd φ) (zero_add 0) = Cochain.ofHom (𝟙 G) 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp (CochainComplex.mappingCone.snd φ) ⋯ =
  CochainComplex.HomComplex.Cochain.ofHom (𝟙 G)

full_name: CochainComplex.mappingCone.inl_fst_assoc
code: @[simp]
lemma inl_fst_assoc {K : CochainComplex C ℤ} {d e : ℤ} (γ : Cochain F K d) (he : 1 + d = e) :
    (inl φ).comp ((fst φ).1.comp γ he) (by rw [← he, neg_add_cancel_left]) = γ 
goal: (CochainComplex.mappingCone.inl φ).comp ((↑(CochainComplex.mappingCone.fst φ)).comp γ he) ⋯ = γ

full_name: CochainComplex.mappingCone.inl_snd_assoc
code: @[simp]
lemma inl_snd_assoc {K : CochainComplex C ℤ} {d e f : ℤ} (γ : Cochain G K d)
    (he : 0 + d = e) (hf : -1 + e = f) :
    (inl φ).comp ((snd φ).comp γ he) hf = 0 
goal: (CochainComplex.mappingCone.inl φ).comp ((CochainComplex.mappingCone.snd φ).comp γ he) hf = 0

full_name: CochainComplex.mappingCone.inr_fst_assoc
code: @[simp]
lemma inr_fst_assoc {K : CochainComplex C ℤ} {d e f : ℤ} (γ : Cochain F K d)
    (he : 1 + d = e) (hf : 0 + e = f) :
    (Cochain.ofHom (inr φ)).comp ((fst φ).1.comp γ he) hf = 0 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp
    ((↑(CochainComplex.mappingCone.fst φ)).comp γ he) hf =
  0

full_name: CochainComplex.mappingCone.inr_snd_assoc
code: @[simp]
lemma inr_snd_assoc {K : CochainComplex C ℤ} {d e : ℤ} (γ : Cochain G K d) (he : 0 + d = e) :
    (Cochain.ofHom (inr φ)).comp ((snd φ).comp γ he) (by simp only [← he, zero_add]) = γ 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp
    ((CochainComplex.mappingCone.snd φ).comp γ he) ⋯ =
  γ

full_name: CochainComplex.mappingCone.ext_to
code: lemma ext_to (i j : ℤ) (hij : i + 1 = j) {A : C} {f g : A ⟶ (mappingCone φ).X i}
    (h₁ : f ≫ (fst φ).1.v i j hij = g ≫ (fst φ).1.v i j hij)
    (h₂ : f ≫ (snd φ).v i i (add_zero i) = g ≫ (snd φ).v i i (add_zero i)) :
    f = g 
goal: f = g

full_name: CochainComplex.mappingCone.ext_to_iff
code: lemma ext_to_iff (i j : ℤ) (hij : i + 1 = j) {A : C} (f g : A ⟶ (mappingCone φ).X i) :
    f = g ↔ f ≫ (fst φ).1.v i j hij = g ≫ (fst φ).1.v i j hij ∧
      f ≫ (snd φ).v i i (add_zero i) = g ≫ (snd φ).v i i (add_zero i) 
goal: f = g ↔
  f ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij = g ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij ∧
    f ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯ = g ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯

full_name: CochainComplex.mappingCone.ext_from
code: lemma ext_from (i j : ℤ) (hij : j + 1 = i) {A : C} {f g : (mappingCone φ).X j ⟶ A}
    (h₁ : (inl φ).v i j (by omega) ≫ f = (inl φ).v i j (by omega) ≫ g)
    (h₂ : (inr φ).f j ≫ f = (inr φ).f j ≫ g) :
    f = g 
goal: f = g

full_name: CochainComplex.mappingCone.ext_from_iff
code: lemma ext_from_iff (i j : ℤ) (hij : j + 1 = i) {A : C} (f g : (mappingCone φ).X j ⟶ A) :
    f = g ↔ (inl φ).v i j (by omega) ≫ f = (inl φ).v i j (by omega) ≫ g ∧
      (inr φ).f j ≫ f = (inr φ).f j ≫ g 
goal: f = g ↔
  (CochainComplex.mappingCone.inl φ).v i j ⋯ ≫ f = (CochainComplex.mappingCone.inl φ).v i j ⋯ ≫ g ∧
    (CochainComplex.mappingCone.inr φ).f j ≫ f = (CochainComplex.mappingCone.inr φ).f j ≫ g

full_name: CochainComplex.mappingCone.decomp_to
code: lemma decomp_to {i : ℤ} {A : C} (f : A ⟶ (mappingCone φ).X i) (j : ℤ) (hij : i + 1 = j) :
    ∃ (a : A ⟶ F.X j) (b : A ⟶ G.X i), f = a ≫ (inl φ).v j i (by omega) + b ≫ (inr φ).f i 
goal: ∃ a b, f = a ≫ (CochainComplex.mappingCone.inl φ).v j i ⋯ + b ≫ (CochainComplex.mappingCone.inr φ).f i

full_name: CochainComplex.mappingCone.decomp_from
code: lemma decomp_from {j : ℤ} {A : C} (f : (mappingCone φ).X j ⟶ A) (i : ℤ) (hij : j + 1 = i) :
    ∃ (a : F.X i ⟶ A) (b : G.X j ⟶ A),
      f = (fst φ).1.v j i hij ≫ a + (snd φ).v j j (add_zero j) ≫ b 
goal: ∃ a b, f = (↑(CochainComplex.mappingCone.fst φ)).v j i hij ≫ a + (CochainComplex.mappingCone.snd φ).v j j ⋯ ≫ b

full_name: CochainComplex.mappingCone.ext_cochain_to_iff
code: lemma ext_cochain_to_iff (i j : ℤ) (hij : i + 1 = j)
    {K : CochainComplex C ℤ} {γ₁ γ₂ : Cochain K (mappingCone φ) i} :
    γ₁ = γ₂ ↔ γ₁.comp (fst φ).1 hij = γ₂.comp (fst φ).1 hij ∧
      γ₁.comp (snd φ) (add_zero i) = γ₂.comp (snd φ) (add_zero i) 
goal: γ₁ = γ₂ ↔
  γ₁.comp (↑(CochainComplex.mappingCone.fst φ)) hij = γ₂.comp (↑(CochainComplex.mappingCone.fst φ)) hij ∧
    γ₁.comp (CochainComplex.mappingCone.snd φ) ⋯ = γ₂.comp (CochainComplex.mappingCone.snd φ) ⋯

full_name: CochainComplex.mappingCone.ext_cochain_from_iff
code: lemma ext_cochain_from_iff (i j : ℤ) (hij : i + 1 = j)
    {K : CochainComplex C ℤ} {γ₁ γ₂ : Cochain (mappingCone φ) K j} :
    γ₁ = γ₂ ↔
      (inl φ).comp γ₁ (show _ = i by omega) = (inl φ).comp γ₂ (by omega) ∧
        (Cochain.ofHom (inr φ)).comp γ₁ (zero_add j) =
          (Cochain.ofHom (inr φ)).comp γ₂ (zero_add j) 
goal: γ₁ = γ₂ ↔
  (CochainComplex.mappingCone.inl φ).comp γ₁ ⋯ = (CochainComplex.mappingCone.inl φ).comp γ₂ ⋯ ∧
    (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp γ₁ ⋯ =
      (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp γ₂ ⋯

full_name: CochainComplex.mappingCone.id
code: lemma id :
    (fst φ).1.comp (inl φ) (add_neg_self 1) +
      (snd φ).comp (Cochain.ofHom (inr φ)) (add_zero 0) = Cochain.ofHom (𝟙 _) 
goal: (↑(CochainComplex.mappingCone.fst φ)).comp (CochainComplex.mappingCone.inl φ) ⋯ +
    (CochainComplex.mappingCone.snd φ).comp (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ))
      ⋯ =
  CochainComplex.HomComplex.Cochain.ofHom (𝟙 (CochainComplex.mappingCone φ))

full_name: CochainComplex.mappingCone.id_X
code: lemma id_X (p q : ℤ) (hpq : p + 1 = q) :
    (fst φ).1.v p q hpq ≫ (inl φ).v q p (by omega) +
      (snd φ).v p p (add_zero p) ≫ (inr φ).f p = 𝟙 ((mappingCone φ).X p) 
goal: (↑(CochainComplex.mappingCone.fst φ)).v p q hpq ≫ (CochainComplex.mappingCone.inl φ).v q p ⋯ +
    (CochainComplex.mappingCone.snd φ).v p p ⋯ ≫ (CochainComplex.mappingCone.inr φ).f p =
  𝟙 ((CochainComplex.mappingCone φ).X p)

full_name: CochainComplex.mappingCone.inl_v_d
code: @[reassoc]
lemma inl_v_d (i j k : ℤ) (hij : i + (-1) = j) (hik : k + (-1) = i) :
    (inl φ).v i j hij ≫ (mappingCone φ).d j i =
      φ.f i ≫ (inr φ).f i - F.d i k ≫ (inl φ).v _ _ hik 
goal: (CochainComplex.mappingCone.inl φ).v i j hij ≫ (CochainComplex.mappingCone φ).d j i =
  φ.f i ≫ (CochainComplex.mappingCone.inr φ).f i - F.d i k ≫ (CochainComplex.mappingCone.inl φ).v k i hik

full_name: CochainComplex.mappingCone.inr_f_d
code: @[reassoc (attr := simp 1100)]
lemma inr_f_d (n₁ n₂ : ℤ) :
    (inr φ).f n₁ ≫ (mappingCone φ).d n₁ n₂ = G.d n₁ n₂ ≫ (inr φ).f n₂ 
goal: (CochainComplex.mappingCone.inr φ).f n₁ ≫ (CochainComplex.mappingCone φ).d n₁ n₂ =
  G.d n₁ n₂ ≫ (CochainComplex.mappingCone.inr φ).f n₂

full_name: CochainComplex.mappingCone.d_fst_v
code: @[reassoc]
lemma d_fst_v (i j k : ℤ) (hij : i + 1 = j) (hjk : j + 1 = k) :
    (mappingCone φ).d i j ≫ (fst φ).1.v j k hjk =
      -(fst φ).1.v i j hij ≫ F.d j k 
goal: (CochainComplex.mappingCone φ).d i j ≫ (↑(CochainComplex.mappingCone.fst φ)).v j k hjk =
  -(↑(CochainComplex.mappingCone.fst φ)).v i j hij ≫ F.d j k

full_name: CochainComplex.mappingCone.d_fst_v'
code: @[reassoc (attr := simp)]
lemma d_fst_v' (i j : ℤ) (hij : i + 1 = j) :
    (mappingCone φ).d (i - 1) i ≫ (fst φ).1.v i j hij =
      -(fst φ).1.v (i - 1) i (by omega) ≫ F.d i j 
goal: (CochainComplex.mappingCone φ).d (i - 1) i ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij =
  -(↑(CochainComplex.mappingCone.fst φ)).v (i - 1) i ⋯ ≫ F.d i j

full_name: CochainComplex.mappingCone.d_snd_v
code: @[reassoc]
lemma d_snd_v (i j : ℤ) (hij : i + 1 = j) :
    (mappingCone φ).d i j ≫ (snd φ).v j j (add_zero _) =
      (fst φ).1.v i j hij ≫ φ.f j + (snd φ).v i i (add_zero i) ≫ G.d i j 
goal: (CochainComplex.mappingCone φ).d i j ≫ (CochainComplex.mappingCone.snd φ).v j j ⋯ =
  (↑(CochainComplex.mappingCone.fst φ)).v i j hij ≫ φ.f j + (CochainComplex.mappingCone.snd φ).v i i ⋯ ≫ G.d i j

full_name: CochainComplex.mappingCone.d_snd_v'
code: @[reassoc (attr := simp)]
lemma d_snd_v' (n : ℤ) :
    (mappingCone φ).d (n - 1) n ≫ (snd φ).v n n (add_zero n) =
    (fst φ : Cochain (mappingCone φ) F 1).v (n - 1) n (by omega) ≫ φ.f n +
      (snd φ).v (n - 1) (n - 1) (add_zero _) ≫ G.d (n - 1) n 
goal: (CochainComplex.mappingCone φ).d (n - 1) n ≫ (CochainComplex.mappingCone.snd φ).v n n ⋯ =
  (↑(CochainComplex.mappingCone.fst φ)).v (n - 1) n ⋯ ≫ φ.f n +
    (CochainComplex.mappingCone.snd φ).v (n - 1) (n - 1) ⋯ ≫ G.d (n - 1) n

full_name: CochainComplex.mappingCone.δ_inl
code: @[simp]
lemma δ_inl :
    δ (-1) 0 (inl φ) = Cochain.ofHom (φ ≫ inr φ) 
goal: CochainComplex.HomComplex.δ (-1) 0 (CochainComplex.mappingCone.inl φ) =
  CochainComplex.HomComplex.Cochain.ofHom (φ ≫ CochainComplex.mappingCone.inr φ)

full_name: CochainComplex.mappingCone.δ_snd
code: @[simp]
lemma δ_snd :
    δ 0 1 (snd φ) = -(fst φ).1.comp (Cochain.ofHom φ) (add_zero 1) 
goal: CochainComplex.HomComplex.δ 0 1 (CochainComplex.mappingCone.snd φ) =
  -(↑(CochainComplex.mappingCone.fst φ)).comp (CochainComplex.HomComplex.Cochain.ofHom φ) ⋯

full_name: CochainComplex.mappingCone.descCochain
code: /-- Given `φ : F ⟶ G`, this is the cochain in `Cochain (mappingCone φ) K n` that is
constructed from two cochains `α : Cochain F K m` (with `m + 1 = n`) and `β : Cochain F K n`. -/
noncomputable def descCochain : Cochain (mappingCone φ) K n 
goal: CochainComplex.HomComplex.Cochain (CochainComplex.mappingCone φ) K n

full_name: CochainComplex.mappingCone.inl_descCochain
code: @[simp]
lemma inl_descCochain :
    (inl φ).comp (descCochain φ α β h) (by omega) = α 
goal: (CochainComplex.mappingCone.inl φ).comp (CochainComplex.mappingCone.descCochain φ α β h) ⋯ = α

full_name: CochainComplex.mappingCone.inr_descCochain
code: @[simp]
lemma inr_descCochain :
    (Cochain.ofHom (inr φ)).comp (descCochain φ α β h) (zero_add n) = β 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp
    (CochainComplex.mappingCone.descCochain φ α β h) ⋯ =
  β

full_name: CochainComplex.mappingCone.inl_v_descCochain_v
code: @[reassoc (attr := simp)]
lemma inl_v_descCochain_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + (-1) = p₂) (h₂₃ : p₂ + n = p₃) :
    (inl φ).v p₁ p₂ h₁₂ ≫ (descCochain φ α β h).v p₂ p₃ h₂₃ =
        α.v p₁ p₃ (by rw [← h₂₃, ← h₁₂, ← h, add_comm m, add_assoc, neg_add_cancel_left]) 
goal: (CochainComplex.mappingCone.inl φ).v p₁ p₂ h₁₂ ≫ (CochainComplex.mappingCone.descCochain φ α β h).v p₂ p₃ h₂₃ =
  α.v p₁ p₃ ⋯

full_name: CochainComplex.mappingCone.inr_f_descCochain_v
code: @[reassoc (attr := simp)]
lemma inr_f_descCochain_v (p₁ p₂ : ℤ) (h₁₂ : p₁ + n = p₂) :
    (inr φ).f p₁ ≫ (descCochain φ α β h).v p₁ p₂ h₁₂ = β.v p₁ p₂ h₁₂ 
goal: (CochainComplex.mappingCone.inr φ).f p₁ ≫ (CochainComplex.mappingCone.descCochain φ α β h).v p₁ p₂ h₁₂ = β.v p₁ p₂ h₁₂

full_name: CochainComplex.mappingCone.δ_descCochain
code: lemma δ_descCochain (n' : ℤ) (hn' : n + 1 = n') :
    δ n n' (descCochain φ α β h) =
      (fst φ).1.comp (δ m n α +
          n'.negOnePow • (Cochain.ofHom φ).comp β (zero_add n)) (by omega) +
      (snd φ).comp (δ n n' β) (zero_add n') 
goal: CochainComplex.HomComplex.δ n n' (CochainComplex.mappingCone.descCochain φ α β h) =
  (↑(CochainComplex.mappingCone.fst φ)).comp
      (CochainComplex.HomComplex.δ m n α + n'.negOnePow • (CochainComplex.HomComplex.Cochain.ofHom φ).comp β ⋯) ⋯ +
    (CochainComplex.mappingCone.snd φ).comp (CochainComplex.HomComplex.δ n n' β) ⋯

full_name: CochainComplex.mappingCone.descCocycle_coe
code: /-- Given `φ : F ⟶ G`, this is the cocycle in `Cocycle (mappingCone φ) K n` that is
constructed from `α : Cochain F K m` (with `m + 1 = n`) and `β : Cocycle F K n`,
when a suitable cocycle relation is satisfied. -/
@[simps!]
noncomputable def descCocycle {K : CochainComplex C ℤ} {n m : ℤ}
    (α : Cochain F K m) (β : Cocycle G K n)
    (h : m + 1 = n) (eq : δ m n α = n.negOnePow • (Cochain.ofHom φ).comp β.1 (zero_add n)) :
    Cocycle (mappingCone φ) K n 
goal: ↑(CochainComplex.mappingCone.descCocycle φ α β h eq) = CochainComplex.mappingCone.descCochain φ α (↑β) h

full_name: CochainComplex.mappingCone.descCocycle
code: /-- Given `φ : F ⟶ G`, this is the cocycle in `Cocycle (mappingCone φ) K n` that is
constructed from `α : Cochain F K m` (with `m + 1 = n`) and `β : Cocycle F K n`,
when a suitable cocycle relation is satisfied. -/
@[simps!]
noncomputable def descCocycle {K : CochainComplex C ℤ} {n m : ℤ}
    (α : Cochain F K m) (β : Cocycle G K n)
    (h : m + 1 = n) (eq : δ m n α = n.negOnePow • (Cochain.ofHom φ).comp β.1 (zero_add n)) :
    Cocycle (mappingCone φ) K n 
goal: CochainComplex.HomComplex.Cocycle (CochainComplex.mappingCone φ) K n

full_name: CochainComplex.mappingCone.desc
code: /-- Given `φ : F ⟶ G`, this is the morphism `mappingCone φ ⟶ K` that is constructed
from a cochain `α : Cochain F K (-1)` and a morphism `β : G ⟶ K` such that
`δ (-1) 0 α = Cochain.ofHom (φ ≫ β)`. -/
noncomputable def desc : mappingCone φ ⟶ K 
goal: CochainComplex.mappingCone φ ⟶ K

full_name: CochainComplex.mappingCone.ofHom_desc
code: @[simp]
lemma ofHom_desc :
    Cochain.ofHom (desc φ α β eq) = descCochain φ α (Cochain.ofHom β) (neg_add_self 1) 
goal: CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.desc φ α β eq) =
  CochainComplex.mappingCone.descCochain φ α (CochainComplex.HomComplex.Cochain.ofHom β) ⋯

full_name: CochainComplex.mappingCone.inl_v_desc_f
code: @[reassoc (attr := simp)]
lemma inl_v_desc_f (p q : ℤ) (h : p + (-1) = q) :
    (inl φ).v p q h ≫ (desc φ α β eq).f q = α.v p q h 
goal: (CochainComplex.mappingCone.inl φ).v p q h ≫ (CochainComplex.mappingCone.desc φ α β eq).f q = α.v p q h

full_name: CochainComplex.mappingCone.inl_desc
code: lemma inl_desc :
    (inl φ).comp (Cochain.ofHom (desc φ α β eq)) (add_zero _) = α 
goal: (CochainComplex.mappingCone.inl φ).comp
    (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.desc φ α β eq)) ⋯ =
  α

full_name: CochainComplex.mappingCone.inr_f_desc_f
code: @[reassoc (attr := simp)]
lemma inr_f_desc_f (p : ℤ) :
    (inr φ).f p ≫ (desc φ α β eq).f p = β.f p 
goal: (CochainComplex.mappingCone.inr φ).f p ≫ (CochainComplex.mappingCone.desc φ α β eq).f p = β.f p

full_name: CochainComplex.mappingCone.inr_desc
code: @[reassoc (attr := simp)]
lemma inr_desc : inr φ ≫ desc φ α β eq = β 
goal: CochainComplex.mappingCone.inr φ ≫ CochainComplex.mappingCone.desc φ α β eq = β

full_name: CochainComplex.mappingCone.desc_f
code: lemma desc_f (p q : ℤ) (hpq : p + 1 = q) :
    (desc φ α β eq).f p = (fst φ).1.v p q hpq ≫ α.v q p (by omega) +
      (snd φ).v p p (add_zero p) ≫ β.f p 
goal: (CochainComplex.mappingCone.desc φ α β eq).f p =
  (↑(CochainComplex.mappingCone.fst φ)).v p q hpq ≫ α.v q p ⋯ + (CochainComplex.mappingCone.snd φ).v p p ⋯ ≫ β.f p

full_name: CochainComplex.mappingCone.descHomotopy
code: /-- Constructor for homotopies between morphisms from a mapping cone. -/
noncomputable def descHomotopy {K : CochainComplex C ℤ} (f₁ f₂ : mappingCone φ ⟶ K)
    (γ₁ : Cochain F K (-2)) (γ₂ : Cochain G K (-1))
    (h₁ : (inl φ).comp (Cochain.ofHom f₁) (add_zero (-1))  =
      δ (-2) (-1) γ₁ + (Cochain.ofHom φ).comp γ₂ (zero_add (-1)) +
      (inl φ).comp (Cochain.ofHom f₂) (add_zero (-1)))
    (h₂ : Cochain.ofHom (inr φ ≫ f₁) = δ (-1) 0 γ₂ + Cochain.ofHom (inr φ ≫ f₂)) :
    Homotopy f₁ f₂ 
goal: Homotopy f₁ f₂

full_name: CochainComplex.mappingCone.liftCochain
code: /-- Given `φ : F ⟶ G`, this is the cochain in `Cochain (mappingCone φ) K n` that is
constructed from two cochains `α : Cochain F K m` (with `m + 1 = n`) and `β : Cochain F K n`. -/
noncomputable def liftCochain : Cochain K (mappingCone φ) n 
goal: CochainComplex.HomComplex.Cochain K (CochainComplex.mappingCone φ) n

full_name: CochainComplex.mappingCone.liftCochain_fst
code: @[simp]
lemma liftCochain_fst :
    (liftCochain φ α β h).comp (fst φ).1 h = α 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).comp (↑(CochainComplex.mappingCone.fst φ)) h = α

full_name: CochainComplex.mappingCone.liftCochain_snd
code: @[simp]
lemma liftCochain_snd :
    (liftCochain φ α β h).comp (snd φ) (add_zero n) = β 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).comp (CochainComplex.mappingCone.snd φ) ⋯ = β

full_name: CochainComplex.mappingCone.liftCochain_v_fst_v
code: @[reassoc (attr := simp)]
lemma liftCochain_v_fst_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + n = p₂) (h₂₃ : p₂ + 1 = p₃) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (fst φ).1.v p₂ p₃ h₂₃ = α.v p₁ p₃ (by omega) 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (↑(CochainComplex.mappingCone.fst φ)).v p₂ p₃ h₂₃ =
  α.v p₁ p₃ ⋯

full_name: CochainComplex.mappingCone.liftCochain_v_snd_v
code: @[reassoc (attr := simp)]
lemma liftCochain_v_snd_v (p₁ p₂ : ℤ) (h₁₂ : p₁ + n = p₂) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (snd φ).v p₂ p₂ (add_zero p₂) = β.v p₁ p₂ h₁₂ 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (CochainComplex.mappingCone.snd φ).v p₂ p₂ ⋯ =
  β.v p₁ p₂ h₁₂

full_name: CochainComplex.mappingCone.δ_liftCochain
code: lemma δ_liftCochain (m' : ℤ) (hm' : m + 1 = m') :
    δ n m (liftCochain φ α β h) = -(δ m m' α).comp (inl φ) (by omega) +
      (δ n m β + α.comp (Cochain.ofHom φ) (add_zero m)).comp
        (Cochain.ofHom (inr φ)) (add_zero m) 
goal: CochainComplex.HomComplex.δ n m (CochainComplex.mappingCone.liftCochain φ α β h) =
  -(CochainComplex.HomComplex.δ m m' α).comp (CochainComplex.mappingCone.inl φ) ⋯ +
    (CochainComplex.HomComplex.δ n m β + α.comp (CochainComplex.HomComplex.Cochain.ofHom φ) ⋯).comp
      (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)) ⋯

full_name: CochainComplex.mappingCone.liftCocycle_coe
code: /-- Given `φ : F ⟶ G`, this is the cocycle in `Cocycle K (mappingCone φ) n` that is
constructed from `α : Cochain K F m` (with `n + 1 = m`) and `β : Cocycle K G n`,
when a suitable cocycle relation is satisfied. -/
@[simps!]
noncomputable def liftCocycle {K : CochainComplex C ℤ} {n m : ℤ}
    (α : Cocycle K F m) (β : Cochain K G n) (h : n + 1 = m)
    (eq : δ n m β + α.1.comp (Cochain.ofHom φ) (add_zero m) = 0) :
    Cocycle K (mappingCone φ) n 
goal: ↑(CochainComplex.mappingCone.liftCocycle φ α β h eq) = CochainComplex.mappingCone.liftCochain φ (↑α) β h

full_name: CochainComplex.mappingCone.liftCocycle
code: /-- Given `φ : F ⟶ G`, this is the cocycle in `Cocycle K (mappingCone φ) n` that is
constructed from `α : Cochain K F m` (with `n + 1 = m`) and `β : Cocycle K G n`,
when a suitable cocycle relation is satisfied. -/
@[simps!]
noncomputable def liftCocycle {K : CochainComplex C ℤ} {n m : ℤ}
    (α : Cocycle K F m) (β : Cochain K G n) (h : n + 1 = m)
    (eq : δ n m β + α.1.comp (Cochain.ofHom φ) (add_zero m) = 0) :
    Cocycle K (mappingCone φ) n 
goal: CochainComplex.HomComplex.Cocycle K (CochainComplex.mappingCone φ) n

full_name: CochainComplex.mappingCone.lift
code: /-- Given `φ : F ⟶ G`, this is the morphism `K ⟶ mappingCone φ` that is constructed
from a cocycle `α : Cochain K F 1` and a cochain `β : Cochain K G 0`
when a suitable cocycle relation is satisfied. -/
noncomputable def lift :
    K ⟶ mappingCone φ 
goal: K ⟶ CochainComplex.mappingCone φ

full_name: CochainComplex.mappingCone.ofHom_lift
code: @[simp]
lemma ofHom_lift :
    Cochain.ofHom (lift φ α β eq) = liftCochain φ α β (zero_add 1) 
goal: CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.lift φ α β eq) =
  CochainComplex.mappingCone.liftCochain φ (↑α) β ⋯

full_name: CochainComplex.mappingCone.lift_f_fst_v
code: @[reassoc (attr := simp)]
lemma lift_f_fst_v (p q : ℤ) (hpq : p + 1 = q) :
    (lift φ α β eq).f p ≫ (fst φ).1.v p q hpq = α.1.v p q hpq 
goal: (CochainComplex.mappingCone.lift φ α β eq).f p ≫ (↑(CochainComplex.mappingCone.fst φ)).v p q hpq = (↑α).v p q hpq

full_name: CochainComplex.mappingCone.lift_fst
code: lemma lift_fst :
    (Cochain.ofHom (lift φ α β eq)).comp (fst φ).1 (zero_add 1) = α.1 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.lift φ α β eq)).comp
    ↑(CochainComplex.mappingCone.fst φ) ⋯ =
  ↑α

full_name: CochainComplex.mappingCone.lift_f_snd_v
code: @[reassoc (attr := simp)]
lemma lift_f_snd_v (p q : ℤ) (hpq : p + 0 = q) :
    (lift φ α β eq).f p ≫ (snd φ).v p q hpq = β.v p q hpq 
goal: (CochainComplex.mappingCone.lift φ α β eq).f p ≫ (CochainComplex.mappingCone.snd φ).v p q hpq = β.v p q hpq

full_name: CochainComplex.mappingCone.lift_snd
code: lemma lift_snd :
    (Cochain.ofHom (lift φ α β eq)).comp (snd φ) (zero_add 0) = β 
goal: (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.lift φ α β eq)).comp
    (CochainComplex.mappingCone.snd φ) ⋯ =
  β

full_name: CochainComplex.mappingCone.lift_f
code: lemma lift_f (p q : ℤ) (hpq : p + 1 = q) :
    (lift φ α β eq).f p = α.1.v p q hpq ≫
      (inl φ).v q p (by omega) + β.v p p (add_zero p) ≫ (inr φ).f p 
goal: (CochainComplex.mappingCone.lift φ α β eq).f p =
  (↑α).v p q hpq ≫ (CochainComplex.mappingCone.inl φ).v q p ⋯ + β.v p p ⋯ ≫ (CochainComplex.mappingCone.inr φ).f p

full_name: CochainComplex.mappingCone.liftHomotopy
code: /-- Constructor for homotopies between morphisms to a mapping cone. -/
noncomputable def liftHomotopy {K : CochainComplex C ℤ} (f₁ f₂ : K ⟶ mappingCone φ)
    (α : Cochain K F 0) (β : Cochain K G (-1))
    (h₁ : (Cochain.ofHom f₁).comp (fst φ).1 (zero_add 1) =
      -δ 0 1 α + (Cochain.ofHom f₂).comp (fst φ).1 (zero_add 1))
    (h₂ : (Cochain.ofHom f₁).comp (snd φ) (zero_add 0) =
      δ (-1) 0 β + α.comp (Cochain.ofHom φ) (zero_add 0) +
        (Cochain.ofHom f₂).comp (snd φ) (zero_add 0)) :
    Homotopy f₁ f₂ 
goal: Homotopy f₁ f₂

full_name: CochainComplex.mappingCone.liftCochain_descCochain
code: @[simp]
lemma liftCochain_descCochain :
    (liftCochain φ α β h).comp (descCochain φ α' β' h') hp =
      α.comp α' (by omega) + β.comp β' (by omega) 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).comp (CochainComplex.mappingCone.descCochain φ α' β' h') hp =
  α.comp α' ⋯ + β.comp β' ⋯

full_name: CochainComplex.mappingCone.liftCochain_v_descCochain_v
code: lemma liftCochain_v_descCochain_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + n = p₂) (h₂₃ : p₂ + n' = p₃)
    (q : ℤ) (hq : p₁ + m = q) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (descCochain φ α' β' h').v p₂ p₃ h₂₃ =
      α.v p₁ q hq ≫ α'.v q p₃ (by omega) + β.v p₁ p₂ h₁₂ ≫ β'.v p₂ p₃ h₂₃ 
goal: (CochainComplex.mappingCone.liftCochain φ α β h).v p₁ p₂ h₁₂ ≫
    (CochainComplex.mappingCone.descCochain φ α' β' h').v p₂ p₃ h₂₃ =
  α.v p₁ q hq ≫ α'.v q p₃ ⋯ + β.v p₁ p₂ h₁₂ ≫ β'.v p₂ p₃ h₂₃

full_name: CochainComplex.mappingCone.lift_desc_f
code: lemma lift_desc_f {K L : CochainComplex C ℤ} (α : Cocycle K F 1) (β : Cochain K G 0)
    (eq : δ 0 1 β + α.1.comp (Cochain.ofHom φ) (add_zero 1) = 0)
    (α' : Cochain F L (-1)) (β' : G ⟶ L)
    (eq' : δ (-1) 0 α' = Cochain.ofHom (φ ≫ β')) (n n' : ℤ) (hnn' : n + 1 = n') :
    (lift φ α β eq).f n ≫ (desc φ α' β' eq').f n =
    α.1.v n n' hnn' ≫ α'.v n' n (by omega) + β.v n n (add_zero n) ≫ β'.f n 
goal: (CochainComplex.mappingCone.lift φ α β eq).f n ≫ (CochainComplex.mappingCone.desc φ α' β' eq').f n =
  (↑α).v n n' hnn' ≫ α'.v n' n ⋯ + β.v n n ⋯ ≫ β'.f n

full_name: CochainComplex.mappingCone.mapHomologicalComplexXIso'
code: /-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism (in each degree `n`) between the image
by `H` of `mappingCone φ` and the mapping cone of the image by `H` of `φ`.
It is an auxiliary definition for `mapHomologicalComplexXIso` and
`mapHomologicalComplexIso`. This definition takes an extra
parameter `m : ℤ` such that `n + 1 = m` which may help getting better
definitional properties. See also the equational lemma `mapHomologicalComplexXIso_eq`. -/
@[simps]
noncomputable def mapHomologicalComplexXIso' (n m : ℤ) (hnm : n + 1 = m) :
    ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (mappingCone φ)).X n ≅
      (mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n 
goal: ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (CochainComplex.mappingCone φ)).X n ≅
  (CochainComplex.mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n

full_name: CochainComplex.mappingCone.mapHomologicalComplexXIso'_hom
code: /-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism (in each degree `n`) between the image
by `H` of `mappingCone φ` and the mapping cone of the image by `H` of `φ`.
It is an auxiliary definition for `mapHomologicalComplexXIso` and
`mapHomologicalComplexIso`. This definition takes an extra
parameter `m : ℤ` such that `n + 1 = m` which may help getting better
definitional properties. See also the equational lemma `mapHomologicalComplexXIso_eq`. -/
@[simps]
noncomputable def mapHomologicalComplexXIso' (n m : ℤ) (hnm : n + 1 = m) :
    ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (mappingCone φ)).X n ≅
      (mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n 
goal: (CochainComplex.mappingCone.mapHomologicalComplexXIso' φ H n m hnm).hom =
  H.map ((↑(CochainComplex.mappingCone.fst φ)).v n m ⋯) ≫
      (CochainComplex.mappingCone.inl ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).v m n ⋯ +
    H.map ((CochainComplex.mappingCone.snd φ).v n n ⋯) ≫
      (CochainComplex.mappingCone.inr ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).f n

full_name: CochainComplex.mappingCone.mapHomologicalComplexXIso'_inv
code: /-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism (in each degree `n`) between the image
by `H` of `mappingCone φ` and the mapping cone of the image by `H` of `φ`.
It is an auxiliary definition for `mapHomologicalComplexXIso` and
`mapHomologicalComplexIso`. This definition takes an extra
parameter `m : ℤ` such that `n + 1 = m` which may help getting better
definitional properties. See also the equational lemma `mapHomologicalComplexXIso_eq`. -/
@[simps]
noncomputable def mapHomologicalComplexXIso' (n m : ℤ) (hnm : n + 1 = m) :
    ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (mappingCone φ)).X n ≅
      (mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n 
goal: (CochainComplex.mappingCone.mapHomologicalComplexXIso' φ H n m hnm).inv =
  (↑(CochainComplex.mappingCone.fst ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ))).v n m ⋯ ≫
      H.map ((CochainComplex.mappingCone.inl φ).v m n ⋯) +
    (CochainComplex.mappingCone.snd ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).v n n ⋯ ≫
      H.map ((CochainComplex.mappingCone.inr φ).f n)

full_name: CochainComplex.mappingCone.mapHomologicalComplexXIso
code: /-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism (in each degree) between the image
by `H` of `mappingCone φ` and the mapping cone of the image by `H` of `φ`. -/
noncomputable def mapHomologicalComplexXIso (n : ℤ) :
    ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (mappingCone φ)).X n ≅
      (mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n 
goal: ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (CochainComplex.mappingCone φ)).X n ≅
  (CochainComplex.mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n

full_name: CochainComplex.mappingCone.mapHomologicalComplexXIso_eq
code: lemma mapHomologicalComplexXIso_eq (n m : ℤ) (hnm : n + 1 = m) :
    mapHomologicalComplexXIso φ H n = mapHomologicalComplexXIso' φ H n m hnm 
goal: CochainComplex.mappingCone.mapHomologicalComplexXIso φ H n =
  CochainComplex.mappingCone.mapHomologicalComplexXIso' φ H n m hnm

full_name: CochainComplex.mappingCone.mapHomologicalComplexIso
code: /-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism between the image by `H`
of `mappingCone φ` and the mapping cone of the image by `H` of `φ`. -/
noncomputable def mapHomologicalComplexIso :
    (H.mapHomologicalComplex _).obj (mappingCone φ) ≅
      mappingCone ((H.mapHomologicalComplex _).map φ) 
goal: (H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (CochainComplex.mappingCone φ) ≅
  CochainComplex.mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)

full_name: CochainComplex.mappingCone.map_inr
code: lemma map_inr :
    (H.mapHomologicalComplex (ComplexShape.up ℤ)).map (inr φ) ≫
      (mapHomologicalComplexIso φ H).hom =
    inr ((Functor.mapHomologicalComplex H (ComplexShape.up ℤ)).map φ) 
goal: (H.mapHomologicalComplex (ComplexShape.up ℤ)).map (CochainComplex.mappingCone.inr φ) ≫
    (CochainComplex.mappingCone.mapHomologicalComplexIso φ H).hom =
  CochainComplex.mappingCone.inr ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)