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

full_name: CochainComplex.HomComplex.Triplet.hpq
code: /-- A term of type `HomComplex.Triplet n` consists of two integers `p` and `q`
such that `p + n = q`. (This type is introduced so that the instance
`AddCommGroup (Cochain F G n)` defined below can be found automatically.) -/
structure Triplet (n : ℤ) where
  /-- a first integer -/
  p : ℤ
  /-- a second integer -/
  q : ℤ
  /-- the condition on the two integers -/
  hpq : p + n = q
goal: self.p + n = self.q

full_name: CochainComplex.HomComplex.Triplet.p
code: /-- A term of type `HomComplex.Triplet n` consists of two integers `p` and `q`
such that `p + n = q`. (This type is introduced so that the instance
`AddCommGroup (Cochain F G n)` defined below can be found automatically.) -/
structure Triplet (n : ℤ) where
  /-- a first integer -/
  p : ℤ
  /-- a second integer -/
  q : ℤ
  /-- the condition on the two integers -/
  hpq : p + n = q
goal: ℤ

full_name: CochainComplex.HomComplex.Triplet.q
code: /-- A term of type `HomComplex.Triplet n` consists of two integers `p` and `q`
such that `p + n = q`. (This type is introduced so that the instance
`AddCommGroup (Cochain F G n)` defined below can be found automatically.) -/
structure Triplet (n : ℤ) where
  /-- a first integer -/
  p : ℤ
  /-- a second integer -/
  q : ℤ
  /-- the condition on the two integers -/
  hpq : p + n = q
goal: ℤ

full_name: CochainComplex.HomComplex.Triplet
code: /-- A term of type `HomComplex.Triplet n` consists of two integers `p` and `q`
such that `p + n = q`. (This type is introduced so that the instance
`AddCommGroup (Cochain F G n)` defined below can be found automatically.) -/
structure Triplet (n : ℤ) where
  /-- a first integer -/
  p : ℤ
  /-- a second integer -/
  q : ℤ
  /-- the condition on the two integers -/
  hpq : p + n = q
goal: Type

full_name: CochainComplex.HomComplex.Cochain
code: /-- A cochain of degree `n : ℤ` between to cochain complexes `F` and `G` consists
of a family of morphisms `F.X p ⟶ G.X q` whenever `p + n = q`, i.e. for all
triplets in `HomComplex.Triplet n`. -/
def Cochain 
goal: Type v

full_name: CochainComplex.HomComplex.instAddCommGroupCochain
code: instance : AddCommGroup (Cochain F G n) 
goal: AddCommGroup (CochainComplex.HomComplex.Cochain F G n)

full_name: CochainComplex.HomComplex.instModuleCochain
code: instance : Module R (Cochain F G n) 
goal: Module R (CochainComplex.HomComplex.Cochain F G n)

full_name: CochainComplex.HomComplex.Cochain.mk
code: /-- A practical constructor for cochains. -/
def mk (v : ∀ (p q : ℤ) (_ : p + n = q), F.X p ⟶ G.X q) : Cochain F G n 
goal: CochainComplex.HomComplex.Cochain F G n

full_name: CochainComplex.HomComplex.Cochain.v
code: /-- The value of a cochain on a triplet `⟨p, q, hpq⟩`. -/
def v (γ : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    F.X p ⟶ G.X q 
goal: F.X p ⟶ G.X q

full_name: CochainComplex.HomComplex.Cochain.mk_v
code: @[simp]
lemma mk_v (v : ∀ (p q : ℤ) (_ : p + n = q), F.X p ⟶ G.X q) (p q : ℤ) (hpq : p + n = q) :
    (Cochain.mk v).v p q hpq = v p q hpq 
goal: (CochainComplex.HomComplex.Cochain.mk v).v p q hpq = v p q hpq

full_name: CochainComplex.HomComplex.Cochain.congr_v
code: lemma congr_v {z₁ z₂ : Cochain F G n} (h : z₁ = z₂) (p q : ℤ) (hpq : p + n = q) :
    z₁.v p q hpq = z₂.v p q hpq 
goal: z₁.v p q hpq = z₂.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.ext
code: @[ext]
lemma ext (z₁ z₂ : Cochain F G n)
    (h : ∀ (p q hpq), z₁.v p q hpq = z₂.v p q hpq) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CochainComplex.HomComplex.Cochain.ext₀
code: @[ext 1100]
lemma ext₀ (z₁ z₂ : Cochain F G 0)
    (h : ∀ (p : ℤ), z₁.v p p (add_zero p) = z₂.v p p (add_zero p)) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CochainComplex.HomComplex.Cochain.zero_v
code: @[simp]
lemma zero_v {n : ℤ} (p q : ℤ) (hpq : p + n = q) :
    (0 : Cochain F G n).v p q hpq = 0 
goal: CochainComplex.HomComplex.Cochain.v 0 p q hpq = 0

full_name: CochainComplex.HomComplex.Cochain.add_v
code: @[simp]
lemma add_v {n : ℤ} (z₁ z₂ : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (z₁ + z₂).v p q hpq = z₁.v p q hpq + z₂.v p q hpq 
goal: (z₁ + z₂).v p q hpq = z₁.v p q hpq + z₂.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.sub_v
code: @[simp]
lemma sub_v {n : ℤ} (z₁ z₂ : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (z₁ - z₂).v p q hpq = z₁.v p q hpq - z₂.v p q hpq 
goal: (z₁ - z₂).v p q hpq = z₁.v p q hpq - z₂.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.neg_v
code: @[simp]
lemma neg_v {n : ℤ} (z : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (-z).v p q hpq = - (z.v p q hpq) 
goal: (-z).v p q hpq = -z.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.smul_v
code: @[simp]
lemma smul_v {n : ℤ} (k : R) (z : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (k • z).v p q hpq = k • (z.v p q hpq) 
goal: (k • z).v p q hpq = k • z.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.units_smul_v
code: @[simp]
lemma units_smul_v {n : ℤ} (k : Rˣ) (z : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (k • z).v p q hpq = k • (z.v p q hpq) 
goal: (k • z).v p q hpq = k • z.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.ofHoms
code: /-- A cochain of degree `0` from `F` to `G` can be constructed from a family
of morphisms `F.X p ⟶ G.X p` for all `p : ℤ`. -/
def ofHoms (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) : Cochain F G 0 
goal: CochainComplex.HomComplex.Cochain F G 0

full_name: CochainComplex.HomComplex.Cochain.ofHoms_v
code: @[simp]
lemma ofHoms_v (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) (p : ℤ) :
    (ofHoms ψ).v p p (add_zero p) = ψ p 
goal: (CochainComplex.HomComplex.Cochain.ofHoms ψ).v p p ⋯ = ψ p

full_name: CochainComplex.HomComplex.Cochain.ofHoms_zero
code: @[simp]
lemma ofHoms_zero : ofHoms (fun p => (0 : F.X p ⟶ G.X p)) = 0 
goal: (CochainComplex.HomComplex.Cochain.ofHoms fun p => 0) = 0

full_name: CochainComplex.HomComplex.Cochain.ofHoms_v_comp_d
code: @[simp]
lemma ofHoms_v_comp_d (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) (p q q' : ℤ) (hpq : p + 0 = q) :
    (ofHoms ψ).v p q hpq ≫ G.d q q' = ψ p ≫ G.d p q' 
goal: (CochainComplex.HomComplex.Cochain.ofHoms ψ).v p q hpq ≫ G.d q q' = ψ p ≫ G.d p q'

full_name: CochainComplex.HomComplex.Cochain.d_comp_ofHoms_v
code: @[simp]
lemma d_comp_ofHoms_v (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) (p' p q : ℤ) (hpq : p + 0 = q) :
    F.d p' p ≫ (ofHoms ψ).v p q hpq = F.d p' q ≫ ψ q 
goal: F.d p' p ≫ (CochainComplex.HomComplex.Cochain.ofHoms ψ).v p q hpq = F.d p' q ≫ ψ q

full_name: CochainComplex.HomComplex.Cochain.ofHom
code: /-- The `0`-cochain attached to a morphism of cochain complexes. -/
def ofHom (φ : F ⟶ G) : Cochain F G 0 
goal: CochainComplex.HomComplex.Cochain F G 0

full_name: CochainComplex.HomComplex.Cochain.ofHom_zero
code: @[simp]
lemma ofHom_zero : ofHom (0 : F ⟶ G) = 0 
goal: CochainComplex.HomComplex.Cochain.ofHom 0 = 0

full_name: CochainComplex.HomComplex.Cochain.ofHom_v
code: @[simp]
lemma ofHom_v (φ : F ⟶ G) (p : ℤ) : (ofHom φ).v p p (add_zero p) = φ.f p 
goal: (CochainComplex.HomComplex.Cochain.ofHom φ).v p p ⋯ = φ.f p

full_name: CochainComplex.HomComplex.Cochain.ofHom_v_comp_d
code: @[simp]
lemma ofHom_v_comp_d (φ : F ⟶ G) (p q q' : ℤ) (hpq : p + 0 = q) :
    (ofHom φ).v p q hpq ≫ G.d q q' = φ.f p ≫ G.d p q' 
goal: (CochainComplex.HomComplex.Cochain.ofHom φ).v p q hpq ≫ G.d q q' = φ.f p ≫ G.d p q'

full_name: CochainComplex.HomComplex.Cochain.d_comp_ofHom_v
code: @[simp]
lemma d_comp_ofHom_v (φ : F ⟶ G) (p' p q : ℤ) (hpq : p + 0 = q) :
    F.d p' p ≫ (ofHom φ).v p q hpq = F.d p' q ≫ φ.f q 
goal: F.d p' p ≫ (CochainComplex.HomComplex.Cochain.ofHom φ).v p q hpq = F.d p' q ≫ φ.f q

full_name: CochainComplex.HomComplex.Cochain.ofHom_add
code: @[simp]
lemma ofHom_add (φ₁ φ₂ : F ⟶ G) :
    Cochain.ofHom (φ₁ + φ₂) = Cochain.ofHom φ₁ + Cochain.ofHom φ₂ 
goal: CochainComplex.HomComplex.Cochain.ofHom (φ₁ + φ₂) =
  CochainComplex.HomComplex.Cochain.ofHom φ₁ + CochainComplex.HomComplex.Cochain.ofHom φ₂

full_name: CochainComplex.HomComplex.Cochain.ofHom_sub
code: @[simp]
lemma ofHom_sub (φ₁ φ₂ : F ⟶ G) :
    Cochain.ofHom (φ₁ - φ₂) = Cochain.ofHom φ₁ - Cochain.ofHom φ₂ 
goal: CochainComplex.HomComplex.Cochain.ofHom (φ₁ - φ₂) =
  CochainComplex.HomComplex.Cochain.ofHom φ₁ - CochainComplex.HomComplex.Cochain.ofHom φ₂

full_name: CochainComplex.HomComplex.Cochain.ofHom_neg
code: @[simp]
lemma ofHom_neg (φ : F ⟶ G) :
    Cochain.ofHom (-φ) = -Cochain.ofHom φ 
goal: CochainComplex.HomComplex.Cochain.ofHom (-φ) = -CochainComplex.HomComplex.Cochain.ofHom φ

full_name: CochainComplex.HomComplex.Cochain.ofHomotopy
code: /-- The cochain of degree `-1` given by an homotopy between two morphism of complexes. -/
def ofHomotopy {φ₁ φ₂ : F ⟶ G} (ho : Homotopy φ₁ φ₂) : Cochain F G (-1) 
goal: CochainComplex.HomComplex.Cochain F G (-1)

full_name: CochainComplex.HomComplex.Cochain.ofHomotopy_ofEq
code: @[simp]
lemma ofHomotopy_ofEq {φ₁ φ₂ : F ⟶ G} (h : φ₁ = φ₂) :
    ofHomotopy (Homotopy.ofEq h) = 0 
goal: CochainComplex.HomComplex.Cochain.ofHomotopy (Homotopy.ofEq h) = 0

full_name: CochainComplex.HomComplex.Cochain.ofHomotopy_refl
code: @[simp]
lemma ofHomotopy_refl (φ : F ⟶ G) :
    ofHomotopy (Homotopy.refl φ) = 0 
goal: CochainComplex.HomComplex.Cochain.ofHomotopy (Homotopy.refl φ) = 0

full_name: CochainComplex.HomComplex.Cochain.v_comp_XIsoOfEq_hom
code: @[reassoc]
lemma v_comp_XIsoOfEq_hom
    (γ : Cochain F G n) (p q q' : ℤ) (hpq : p + n = q) (hq' : q = q') :
    γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').hom = γ.v p q' (by rw [← hq', hpq]) 
goal: γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').hom = γ.v p q' ⋯

full_name: CochainComplex.HomComplex.Cochain.v_comp_XIsoOfEq_inv
code: @[reassoc]
lemma v_comp_XIsoOfEq_inv
    (γ : Cochain F G n) (p q q' : ℤ) (hpq : p + n = q) (hq' : q' = q) :
    γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').inv = γ.v p q' (by rw [hq', hpq]) 
goal: γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').inv = γ.v p q' ⋯

full_name: CochainComplex.HomComplex.Cochain.comp
code: /-- The composition of cochains. -/
def comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂) :
    Cochain F K n₁₂ 
goal: CochainComplex.HomComplex.Cochain F K n₁₂

full_name: CochainComplex.HomComplex.Cochain.comp_v
code: lemma comp_v {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (p₁ p₂ p₃ : ℤ) (h₁ : p₁ + n₁ = p₂) (h₂ : p₂ + n₂ = p₃) :
    (z₁.comp z₂ h).v p₁ p₃ (by rw [← h₂, ← h₁, ← h, add_assoc]) =
      z₁.v p₁ p₂ h₁ ≫ z₂.v p₂ p₃ h₂ 
goal: (z₁.comp z₂ h).v p₁ p₃ ⋯ = z₁.v p₁ p₂ h₁ ≫ z₂.v p₂ p₃ h₂

full_name: CochainComplex.HomComplex.Cochain.comp_zero_cochain_v
code: @[simp]
lemma comp_zero_cochain_v (z₁ : Cochain F G n) (z₂ : Cochain G K 0) (p q : ℤ) (hpq : p + n = q) :
    (z₁.comp z₂ (add_zero n)).v p q hpq = z₁.v p q hpq ≫ z₂.v q q (add_zero q) 
goal: (z₁.comp z₂ ⋯).v p q hpq = z₁.v p q hpq ≫ z₂.v q q ⋯

full_name: CochainComplex.HomComplex.Cochain.zero_cochain_comp_v
code: @[simp]
lemma zero_cochain_comp_v (z₁ : Cochain F G 0) (z₂ : Cochain G K n) (p q : ℤ) (hpq : p + n = q) :
    (z₁.comp z₂ (zero_add n)).v p q hpq = z₁.v p p (add_zero p) ≫ z₂.v p q hpq 
goal: (z₁.comp z₂ ⋯).v p q hpq = z₁.v p p ⋯ ≫ z₂.v p q hpq

full_name: CochainComplex.HomComplex.Cochain.comp_assoc
code: /-- The associativity of the composition of cochains. -/
lemma comp_assoc {n₁ n₂ n₃ n₁₂ n₂₃ n₁₂₃ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (z₃ : Cochain K L n₃)
    (h₁₂ : n₁ + n₂ = n₁₂) (h₂₃ : n₂ + n₃ = n₂₃) (h₁₂₃ : n₁ + n₂ + n₃ = n₁₂₃) :
    (z₁.comp z₂ h₁₂).comp z₃ (show n₁₂ + n₃ = n₁₂₃ by rw [← h₁₂, h₁₂₃]) =
      z₁.comp (z₂.comp z₃ h₂₃) (by rw [← h₂₃, ← h₁₂₃, add_assoc]) 
goal: (z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ h₂₃) ⋯

full_name: CochainComplex.HomComplex.Cochain.comp_assoc_of_first_is_zero_cochain
code: @[simp]
lemma comp_assoc_of_first_is_zero_cochain {n₂ n₃ n₂₃ : ℤ}
    (z₁ : Cochain F G 0) (z₂ : Cochain G K n₂) (z₃ : Cochain K L n₃)
    (h₂₃ : n₂ + n₃ = n₂₃) :
    (z₁.comp z₂ (zero_add n₂)).comp z₃ h₂₃ = z₁.comp (z₂.comp z₃ h₂₃) (zero_add n₂₃) 
goal: (z₁.comp z₂ ⋯).comp z₃ h₂₃ = z₁.comp (z₂.comp z₃ h₂₃) ⋯

full_name: CochainComplex.HomComplex.Cochain.comp_assoc_of_second_is_zero_cochain
code: @[simp]
lemma comp_assoc_of_second_is_zero_cochain {n₁ n₃ n₁₃ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K 0) (z₃ : Cochain K L n₃) (h₁₃ : n₁ + n₃ = n₁₃) :
    (z₁.comp z₂ (add_zero n₁)).comp z₃ h₁₃ = z₁.comp (z₂.comp z₃ (zero_add n₃)) h₁₃ 
goal: (z₁.comp z₂ ⋯).comp z₃ h₁₃ = z₁.comp (z₂.comp z₃ ⋯) h₁₃

full_name: CochainComplex.HomComplex.Cochain.comp_assoc_of_third_is_zero_cochain
code: @[simp]
lemma comp_assoc_of_third_is_zero_cochain {n₁ n₂ n₁₂ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (z₃ : Cochain K L 0) (h₁₂ : n₁ + n₂ = n₁₂) :
    (z₁.comp z₂ h₁₂).comp z₃ (add_zero n₁₂) = z₁.comp (z₂.comp z₃ (add_zero n₂)) h₁₂ 
goal: (z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ ⋯) h₁₂

full_name: CochainComplex.HomComplex.Cochain.comp_assoc_of_second_degree_eq_neg_third_degree
code: @[simp]
lemma comp_assoc_of_second_degree_eq_neg_third_degree {n₁ n₂ n₁₂ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K (-n₂)) (z₃ : Cochain K L n₂) (h₁₂ : n₁ + (-n₂) = n₁₂) :
    (z₁.comp z₂ h₁₂).comp z₃
      (show n₁₂ + n₂ = n₁ by rw [← h₁₂, add_assoc, neg_add_self, add_zero]) =
      z₁.comp (z₂.comp z₃ (neg_add_self n₂)) (add_zero n₁) 
goal: (z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ ⋯) ⋯

full_name: CochainComplex.HomComplex.Cochain.zero_comp
code: @[simp]
protected lemma zero_comp {n₁ n₂ n₁₂ : ℤ} (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (0 : Cochain F G n₁).comp z₂ h = 0 
goal: CochainComplex.HomComplex.Cochain.comp 0 z₂ h = 0

full_name: CochainComplex.HomComplex.Cochain.add_comp
code: @[simp]
protected lemma add_comp {n₁ n₂ n₁₂ : ℤ} (z₁ z₁' : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (z₁ + z₁').comp z₂ h = z₁.comp z₂ h + z₁'.comp z₂ h 
goal: (z₁ + z₁').comp z₂ h = z₁.comp z₂ h + z₁'.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.sub_comp
code: @[simp]
protected lemma sub_comp {n₁ n₂ n₁₂ : ℤ} (z₁ z₁' : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (z₁ - z₁').comp z₂ h = z₁.comp z₂ h - z₁'.comp z₂ h 
goal: (z₁ - z₁').comp z₂ h = z₁.comp z₂ h - z₁'.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.neg_comp
code: @[simp]
protected lemma neg_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (-z₁).comp z₂ h = -z₁.comp z₂ h 
goal: (-z₁).comp z₂ h = -z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.smul_comp
code: @[simp]
protected lemma smul_comp {n₁ n₂ n₁₂ : ℤ} (k : R) (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (k • z₁).comp z₂ h = k • (z₁.comp z₂ h) 
goal: (k • z₁).comp z₂ h = k • z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.units_smul_comp
code: @[simp]
lemma units_smul_comp {n₁ n₂ n₁₂ : ℤ} (k : Rˣ) (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (k • z₁).comp z₂ h = k • (z₁.comp z₂ h) 
goal: (k • z₁).comp z₂ h = k • z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.id_comp
code: @[simp]
protected lemma id_comp {n : ℤ} (z₂ : Cochain F G n) :
    (Cochain.ofHom (𝟙 F)).comp z₂ (zero_add n) = z₂ 
goal: (CochainComplex.HomComplex.Cochain.ofHom (𝟙 F)).comp z₂ ⋯ = z₂

full_name: CochainComplex.HomComplex.Cochain.comp_zero
code: @[simp]
protected lemma comp_zero {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁)
    (h : n₁ + n₂ = n₁₂) : z₁.comp (0 : Cochain G K n₂) h = 0 
goal: z₁.comp 0 h = 0

full_name: CochainComplex.HomComplex.Cochain.comp_add
code: @[simp]
protected lemma comp_add {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ z₂' : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : z₁.comp (z₂ + z₂') h = z₁.comp z₂ h + z₁.comp z₂' h 
goal: z₁.comp (z₂ + z₂') h = z₁.comp z₂ h + z₁.comp z₂' h

full_name: CochainComplex.HomComplex.Cochain.comp_sub
code: @[simp]
protected lemma comp_sub {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ z₂' : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : z₁.comp (z₂ - z₂') h = z₁.comp z₂ h - z₁.comp z₂' h 
goal: z₁.comp (z₂ - z₂') h = z₁.comp z₂ h - z₁.comp z₂' h

full_name: CochainComplex.HomComplex.Cochain.comp_neg
code: @[simp]
protected lemma comp_neg {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : z₁.comp (-z₂) h = -z₁.comp z₂ h 
goal: z₁.comp (-z₂) h = -z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.comp_smul
code: @[simp]
protected lemma comp_smul {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (k : R) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂ ) : z₁.comp (k • z₂) h = k • (z₁.comp z₂ h) 
goal: z₁.comp (k • z₂) h = k • z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.comp_units_smul
code: @[simp]
lemma comp_units_smul {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (k : Rˣ) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂ ) : z₁.comp (k • z₂) h = k • (z₁.comp z₂ h) 
goal: z₁.comp (k • z₂) h = k • z₁.comp z₂ h

full_name: CochainComplex.HomComplex.Cochain.comp_id
code: @[simp]
protected lemma comp_id {n : ℤ} (z₁ : Cochain F G n) :
    z₁.comp (Cochain.ofHom (𝟙 G)) (add_zero n) = z₁ 
goal: z₁.comp (CochainComplex.HomComplex.Cochain.ofHom (𝟙 G)) ⋯ = z₁

full_name: CochainComplex.HomComplex.Cochain.ofHoms_comp
code: @[simp]
lemma ofHoms_comp (φ : ∀ (p : ℤ), F.X p ⟶ G.X p) (ψ : ∀ (p : ℤ), G.X p ⟶ K.X p) :
    (ofHoms φ).comp (ofHoms ψ) (zero_add 0) = ofHoms (fun p => φ p ≫ ψ p) 
goal: (CochainComplex.HomComplex.Cochain.ofHoms φ).comp (CochainComplex.HomComplex.Cochain.ofHoms ψ) ⋯ =
  CochainComplex.HomComplex.Cochain.ofHoms fun p => φ p ≫ ψ p

full_name: CochainComplex.HomComplex.Cochain.ofHom_comp
code: @[simp]
lemma ofHom_comp (f : F ⟶ G) (g : G ⟶ K) :
    ofHom (f ≫ g) = (ofHom f).comp (ofHom g) (zero_add 0) 
goal: CochainComplex.HomComplex.Cochain.ofHom (f ≫ g) =
  (CochainComplex.HomComplex.Cochain.ofHom f).comp (CochainComplex.HomComplex.Cochain.ofHom g) ⋯

full_name: CochainComplex.HomComplex.Cochain.diff
code: /-- The differential on a cochain complex, as a cochain of degree `1`. -/
def diff : Cochain K K 1 
goal: CochainComplex.HomComplex.Cochain K K 1

full_name: CochainComplex.HomComplex.Cochain.diff_v
code: @[simp]
lemma diff_v (p q : ℤ) (hpq : p + 1 = q) : (diff K).v p q hpq = K.d p q 
goal: (CochainComplex.HomComplex.Cochain.diff K).v p q hpq = K.d p q

full_name: CochainComplex.HomComplex.δ
code: /-- The differential on the complex of morphisms between cochain complexes. -/
def δ (z : Cochain F G n) : Cochain F G m 
goal: CochainComplex.HomComplex.Cochain F G m

full_name: CochainComplex.HomComplex.δ_v
code: lemma δ_v (hnm : n + 1 = m) (z : Cochain F G n) (p q : ℤ) (hpq : p + m = q) (q₁ q₂ : ℤ)
    (hq₁ : q₁ = q - 1) (hq₂ : p + 1 = q₂) : (δ n m z).v p q hpq =
    z.v p q₁ (by rw [hq₁, ← hpq, ← hnm, ← add_assoc, add_sub_cancel_right]) ≫ G.d q₁ q
      + m.negOnePow • F.d p q₂ ≫ z.v q₂ q
          (by rw [← hq₂, add_assoc, add_comm 1, hnm, hpq]) 
goal: (CochainComplex.HomComplex.δ n m z).v p q hpq = z.v p q₁ ⋯ ≫ G.d q₁ q + m.negOnePow • F.d p q₂ ≫ z.v q₂ q ⋯

full_name: CochainComplex.HomComplex.δ_shape
code: lemma δ_shape (hnm : ¬ n + 1 = m) (z : Cochain F G n) : δ n m z = 0 
goal: CochainComplex.HomComplex.δ n m z = 0

full_name: CochainComplex.HomComplex.δ_hom_apply
code: /-- The differential on the complex of morphisms between cochain complexes, as a linear map. -/
@[simps!]
def δ_hom : Cochain F G n →ₗ[R] Cochain F G m 
goal: (CochainComplex.HomComplex.δ_hom R F G n m) z = CochainComplex.HomComplex.δ n m z

full_name: CochainComplex.HomComplex.δ_hom
code: /-- The differential on the complex of morphisms between cochain complexes, as a linear map. -/
@[simps!]
def δ_hom : Cochain F G n →ₗ[R] Cochain F G m 
goal: CochainComplex.HomComplex.Cochain F G n →ₗ[R] CochainComplex.HomComplex.Cochain F G m

full_name: CochainComplex.HomComplex.δ_add
code: @[simp] lemma δ_add (z₁ z₂ : Cochain F G n) : δ n m (z₁ + z₂) = δ n m z₁ + δ n m z₂ 
goal: CochainComplex.HomComplex.δ n m (z₁ + z₂) = CochainComplex.HomComplex.δ n m z₁ + CochainComplex.HomComplex.δ n m z₂

full_name: CochainComplex.HomComplex.δ_sub
code: @[simp] lemma δ_sub (z₁ z₂ : Cochain F G n) : δ n m (z₁ - z₂) = δ n m z₁ - δ n m z₂ 
goal: CochainComplex.HomComplex.δ n m (z₁ - z₂) = CochainComplex.HomComplex.δ n m z₁ - CochainComplex.HomComplex.δ n m z₂

full_name: CochainComplex.HomComplex.δ_zero
code: @[simp] lemma δ_zero : δ n m (0 : Cochain F G n) = 0 
goal: CochainComplex.HomComplex.δ n m 0 = 0

full_name: CochainComplex.HomComplex.δ_neg
code: @[simp] lemma δ_neg (z : Cochain F G n) : δ n m (-z) = - δ n m z 
goal: CochainComplex.HomComplex.δ n m (-z) = -CochainComplex.HomComplex.δ n m z

full_name: CochainComplex.HomComplex.δ_smul
code: @[simp] lemma δ_smul (k : R) (z : Cochain F G n) : δ n m (k • z) = k • δ n m z 
goal: CochainComplex.HomComplex.δ n m (k • z) = k • CochainComplex.HomComplex.δ n m z

full_name: CochainComplex.HomComplex.δ_units_smul
code: @[simp] lemma δ_units_smul (k : Rˣ) (z : Cochain F G n) : δ n m (k • z) = k • δ n m z 
goal: CochainComplex.HomComplex.δ n m (k • z) = k • CochainComplex.HomComplex.δ n m z

full_name: CochainComplex.HomComplex.δ_δ
code: lemma δ_δ (n₀ n₁ n₂ : ℤ) (z : Cochain F G n₀) : δ n₁ n₂ (δ n₀ n₁ z) = 0 
goal: CochainComplex.HomComplex.δ n₁ n₂ (CochainComplex.HomComplex.δ n₀ n₁ z) = 0

full_name: CochainComplex.HomComplex.δ_comp
code: lemma δ_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (m₁ m₂ m₁₂ : ℤ) (h₁₂ : n₁₂ + 1 = m₁₂) (h₁ : n₁ + 1 = m₁) (h₂ : n₂ + 1 = m₂) :
    δ n₁₂ m₁₂ (z₁.comp z₂ h) = z₁.comp (δ n₂ m₂ z₂) (by rw [← h₁₂, ← h₂, ← h, add_assoc]) +
      n₂.negOnePow • (δ n₁ m₁ z₁).comp z₂
        (by rw [← h₁₂, ← h₁, ← h, add_assoc, add_comm 1, add_assoc]) 
goal: CochainComplex.HomComplex.δ n₁₂ m₁₂ (z₁.comp z₂ h) =
  z₁.comp (CochainComplex.HomComplex.δ n₂ m₂ z₂) ⋯ + n₂.negOnePow • (CochainComplex.HomComplex.δ n₁ m₁ z₁).comp z₂ ⋯

full_name: CochainComplex.HomComplex.δ_zero_cochain_comp
code: lemma δ_zero_cochain_comp {n₂ : ℤ} (z₁ : Cochain F G 0) (z₂ : Cochain G K n₂)
    (m₂ : ℤ) (h₂ : n₂ + 1 = m₂) :
    δ n₂ m₂ (z₁.comp z₂ (zero_add n₂)) =
      z₁.comp (δ n₂ m₂ z₂) (zero_add m₂) +
      n₂.negOnePow • ((δ 0 1 z₁).comp z₂ (by rw [add_comm, h₂])) 
goal: CochainComplex.HomComplex.δ n₂ m₂ (z₁.comp z₂ ⋯) =
  z₁.comp (CochainComplex.HomComplex.δ n₂ m₂ z₂) ⋯ + n₂.negOnePow • (CochainComplex.HomComplex.δ 0 1 z₁).comp z₂ ⋯

full_name: CochainComplex.HomComplex.δ_comp_zero_cochain
code: lemma δ_comp_zero_cochain {n₁ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K 0)
    (m₁ : ℤ) (h₁ : n₁ + 1 = m₁) :
    δ n₁ m₁ (z₁.comp z₂ (add_zero n₁)) =
      z₁.comp (δ 0 1 z₂) h₁ + (δ n₁ m₁ z₁).comp z₂ (add_zero m₁) 
goal: CochainComplex.HomComplex.δ n₁ m₁ (z₁.comp z₂ ⋯) =
  z₁.comp (CochainComplex.HomComplex.δ 0 1 z₂) h₁ + (CochainComplex.HomComplex.δ n₁ m₁ z₁).comp z₂ ⋯

full_name: CochainComplex.HomComplex.δ_zero_cochain_v
code: @[simp]
lemma δ_zero_cochain_v (z : Cochain F G 0) (p q : ℤ) (hpq : p + 1 = q) :
    (δ 0 1 z).v p q hpq = z.v p p (add_zero p) ≫ G.d p q - F.d p q ≫ z.v q q (add_zero q) 
goal: (CochainComplex.HomComplex.δ 0 1 z).v p q hpq = z.v p p ⋯ ≫ G.d p q - F.d p q ≫ z.v q q ⋯

full_name: CochainComplex.HomComplex.δ_ofHom
code: @[simp]
lemma δ_ofHom {p : ℤ} (φ : F ⟶ G) : δ 0 p (Cochain.ofHom φ) = 0 
goal: CochainComplex.HomComplex.δ 0 p (CochainComplex.HomComplex.Cochain.ofHom φ) = 0

full_name: CochainComplex.HomComplex.δ_ofHomotopy
code: @[simp]
lemma δ_ofHomotopy {φ₁ φ₂ : F ⟶ G} (h : Homotopy φ₁ φ₂) :
    δ (-1) 0 (Cochain.ofHomotopy h) = Cochain.ofHom φ₁ - Cochain.ofHom φ₂ 
goal: CochainComplex.HomComplex.δ (-1) 0 (CochainComplex.HomComplex.Cochain.ofHomotopy h) =
  CochainComplex.HomComplex.Cochain.ofHom φ₁ - CochainComplex.HomComplex.Cochain.ofHom φ₂

full_name: CochainComplex.HomComplex.δ_neg_one_cochain
code: lemma δ_neg_one_cochain (z : Cochain F G (-1)) :
    δ (-1) 0 z = Cochain.ofHom (Homotopy.nullHomotopicMap'
      (fun i j hij => z.v i j (by dsimp at hij; rw [← hij, add_neg_cancel_right]))) 
goal: CochainComplex.HomComplex.δ (-1) 0 z =
  CochainComplex.HomComplex.Cochain.ofHom (Homotopy.nullHomotopicMap' fun i j hij => z.v i j ⋯)

full_name: CochainComplex.HomComplex_X
code: /-- The cochain complex of homomorphisms between two cochain complexes `F` and `G`.
In degree `n : ℤ`, it consists of the abelian group `HomComplex.Cochain F G n`. -/
-- We also constructed the `d_apply` lemma using `@[simps]`
-- until we made `AddCommGrp.coe_of` a simp lemma,
-- after which the simp normal form linter complains.
-- It was not used a simp lemma in Mathlib.
-- Possible solution: higher priority function coercions that remove the `of`?
-- @[simp]
@[simps! X]
def HomComplex : CochainComplex AddCommGrp ℤ 
goal: (F.HomComplex G).X i = AddCommGrp.of (CochainComplex.HomComplex.Cochain F G i)

full_name: CochainComplex.HomComplex
code: /-- The cochain complex of homomorphisms between two cochain complexes `F` and `G`.
In degree `n : ℤ`, it consists of the abelian group `HomComplex.Cochain F G n`. -/
-- We also constructed the `d_apply` lemma using `@[simps]`
-- until we made `AddCommGrp.coe_of` a simp lemma,
-- after which the simp normal form linter complains.
-- It was not used a simp lemma in Mathlib.
-- Possible solution: higher priority function coercions that remove the `of`?
-- @[simp]
@[simps! X]
def HomComplex : CochainComplex AddCommGrp ℤ 
goal: CochainComplex AddCommGrp ℤ

full_name: CochainComplex.HomComplex.cocycle
code: /-- The subgroup of cocycles in `Cochain F G n`. -/
def cocycle : AddSubgroup (Cochain F G n) 
goal: AddSubgroup (CochainComplex.HomComplex.Cochain F G n)

full_name: CochainComplex.HomComplex.Cocycle
code: /-- The type of `n`-cocycles, as a subtype of `Cochain F G n`. -/
def Cocycle : Type v 
goal: Type v

full_name: CochainComplex.HomComplex.instAddCommGroupCocycle
code: instance : AddCommGroup (Cocycle F G n) 
goal: AddCommGroup (CochainComplex.HomComplex.Cocycle F G n)

full_name: CochainComplex.HomComplex.Cocycle.mem_iff
code: lemma mem_iff (hnm : n + 1 = m) (z : Cochain F G n) :
    z ∈ cocycle F G n ↔ δ n m z = 0 
goal: z ∈ CochainComplex.HomComplex.cocycle F G n ↔ CochainComplex.HomComplex.δ n m z = 0

full_name: CochainComplex.HomComplex.Cocycle.instCoeCochain
code: instance : Coe (Cocycle F G n) (Cochain F G n) 
goal: Coe (CochainComplex.HomComplex.Cocycle F G n) (CochainComplex.HomComplex.Cochain F G n)

full_name: CochainComplex.HomComplex.Cocycle.ext
code: @[ext]
lemma ext (z₁ z₂ : Cocycle F G n) (h : (z₁ : Cochain F G n) = z₂) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CochainComplex.HomComplex.Cocycle.ext_iff
code: protected lemma ext_iff (z₁ z₂ : Cocycle F G n) : z₁ = z₂ ↔ (z₁ : Cochain F G n) = z₂ 
goal: z₁ = z₂ ↔ ↑z₁ = ↑z₂

full_name: CochainComplex.HomComplex.Cocycle.instSMul
code: instance : SMul R (Cocycle F G n) 
goal: SMul R (CochainComplex.HomComplex.Cocycle F G n)

full_name: CochainComplex.HomComplex.Cocycle.coe_zero
code: @[simp]
lemma coe_zero : (↑(0 : Cocycle F G n) : Cochain F G n) = 0 
goal: ↑0 = 0

full_name: CochainComplex.HomComplex.Cocycle.coe_add
code: @[simp]
lemma coe_add (z₁ z₂ : Cocycle F G n) :
    (↑(z₁ + z₂) : Cochain F G n) = (z₁ : Cochain F G n) + (z₂ : Cochain F G n) 
goal: ↑(z₁ + z₂) = ↑z₁ + ↑z₂

full_name: CochainComplex.HomComplex.Cocycle.coe_neg
code: @[simp]
lemma coe_neg (z : Cocycle F G n) :
    (↑(-z) : Cochain F G n) = -(z : Cochain F G n) 
goal: ↑(-z) = -↑z

full_name: CochainComplex.HomComplex.Cocycle.coe_smul
code: @[simp]
lemma coe_smul (z : Cocycle F G n) (x : R) :
    (↑(x • z) : Cochain F G n) = x • (z : Cochain F G n) 
goal: ↑(x • z) = x • ↑z

full_name: CochainComplex.HomComplex.Cocycle.coe_units_smul
code: @[simp]
lemma coe_units_smul (z : Cocycle F G n) (x : Rˣ) :
    (↑(x • z) : Cochain F G n) = x • (z : Cochain F G n) 
goal: ↑(x • z) = x • ↑z

full_name: CochainComplex.HomComplex.Cocycle.coe_sub
code: @[simp]
lemma coe_sub (z₁ z₂ : Cocycle F G n) :
    (↑(z₁ - z₂) : Cochain F G n) = (z₁ : Cochain F G n) - (z₂ : Cochain F G n) 
goal: ↑(z₁ - z₂) = ↑z₁ - ↑z₂

full_name: CochainComplex.HomComplex.Cocycle.instModule
code: instance : Module R (Cocycle F G n) 
goal: Module R (CochainComplex.HomComplex.Cocycle F G n)

full_name: CochainComplex.HomComplex.Cocycle.mk
code: /-- Constructor for `Cocycle F G n`, taking as inputs `z : Cochain F G n`, an integer
`m : ℤ` such that `n + 1 = m`, and the relation `δ n m z = 0`. -/
@[simps]
def mk (z : Cochain F G n) (m : ℤ) (hnm : n + 1 = m) (h : δ n m z = 0) : Cocycle F G n 
goal: CochainComplex.HomComplex.Cocycle F G n

full_name: CochainComplex.HomComplex.Cocycle.mk_coe
code: /-- Constructor for `Cocycle F G n`, taking as inputs `z : Cochain F G n`, an integer
`m : ℤ` such that `n + 1 = m`, and the relation `δ n m z = 0`. -/
@[simps]
def mk (z : Cochain F G n) (m : ℤ) (hnm : n + 1 = m) (h : δ n m z = 0) : Cocycle F G n 
goal: ↑(CochainComplex.HomComplex.Cocycle.mk z m hnm h) = z

full_name: CochainComplex.HomComplex.Cocycle.δ_eq_zero
code: @[simp]
lemma δ_eq_zero {n : ℤ} (z : Cocycle F G n) (m : ℤ) : δ n m (z : Cochain F G n) = 0 
goal: CochainComplex.HomComplex.δ n m ↑z = 0

full_name: CochainComplex.HomComplex.Cocycle.ofHom_coe
code: /-- The `0`-cocycle associated to a morphism in `CochainComplex C ℤ`. -/
@[simps!]
def ofHom (φ : F ⟶ G) : Cocycle F G 0 
goal: ↑(CochainComplex.HomComplex.Cocycle.ofHom φ) = CochainComplex.HomComplex.Cochain.ofHom φ

full_name: CochainComplex.HomComplex.Cocycle.ofHom
code: /-- The `0`-cocycle associated to a morphism in `CochainComplex C ℤ`. -/
@[simps!]
def ofHom (φ : F ⟶ G) : Cocycle F G 0 
goal: CochainComplex.HomComplex.Cocycle F G 0

full_name: CochainComplex.HomComplex.Cocycle.homOf_f
code: /-- The morphism in `CochainComplex C ℤ` associated to a `0`-cocycle. -/
@[simps]
def homOf (z : Cocycle F G 0) : F ⟶ G 
goal: z.homOf.f i = (↑z).v i i ⋯

full_name: CochainComplex.HomComplex.Cocycle.homOf
code: /-- The morphism in `CochainComplex C ℤ` associated to a `0`-cocycle. -/
@[simps]
def homOf (z : Cocycle F G 0) : F ⟶ G 
goal: F ⟶ G

full_name: CochainComplex.HomComplex.Cocycle.homOf_ofHom_eq_self
code: @[simp]
lemma homOf_ofHom_eq_self (φ : F ⟶ G) : homOf (ofHom φ) = φ 
goal: (CochainComplex.HomComplex.Cocycle.ofHom φ).homOf = φ

full_name: CochainComplex.HomComplex.Cocycle.ofHom_homOf_eq_self
code: @[simp]
lemma ofHom_homOf_eq_self (z : Cocycle F G 0) : ofHom (homOf z) = z 
goal: CochainComplex.HomComplex.Cocycle.ofHom z.homOf = z

full_name: CochainComplex.HomComplex.Cocycle.cochain_ofHom_homOf_eq_coe
code: @[simp]
lemma cochain_ofHom_homOf_eq_coe (z : Cocycle F G 0) :
    Cochain.ofHom (homOf z) = (z : Cochain F G 0) 
goal: CochainComplex.HomComplex.Cochain.ofHom z.homOf = ↑z

full_name: CochainComplex.HomComplex.Cocycle.equivHom_apply
code: /-- The additive equivalence between morphisms in `CochainComplex C ℤ` and `0`-cocycles. -/
@[simps]
def equivHom : (F ⟶ G) ≃+ Cocycle F G 0 
goal: (CochainComplex.HomComplex.Cocycle.equivHom F G) φ = CochainComplex.HomComplex.Cocycle.ofHom φ

full_name: CochainComplex.HomComplex.Cocycle.equivHom
code: /-- The additive equivalence between morphisms in `CochainComplex C ℤ` and `0`-cocycles. -/
@[simps]
def equivHom : (F ⟶ G) ≃+ Cocycle F G 0 
goal: (F ⟶ G) ≃+ CochainComplex.HomComplex.Cocycle F G 0

full_name: CochainComplex.HomComplex.Cocycle.equivHom_symm_apply
code: /-- The additive equivalence between morphisms in `CochainComplex C ℤ` and `0`-cocycles. -/
@[simps]
def equivHom : (F ⟶ G) ≃+ Cocycle F G 0 
goal: (CochainComplex.HomComplex.Cocycle.equivHom F G).symm z = z.homOf

full_name: CochainComplex.HomComplex.Cocycle.diff_coe
code: /-- The `1`-cocycle given by the differential on a cochain complex. -/
@[simps!]
def diff : Cocycle K K 1 
goal: ↑(CochainComplex.HomComplex.Cocycle.diff K) = CochainComplex.HomComplex.Cochain.diff K

full_name: CochainComplex.HomComplex.Cocycle.diff
code: /-- The `1`-cocycle given by the differential on a cochain complex. -/
@[simps!]
def diff : Cocycle K K 1 
goal: CochainComplex.HomComplex.Cocycle K K 1

full_name: CochainComplex.HomComplex.δ_comp_zero_cocycle
code: @[simp]
lemma δ_comp_zero_cocycle {n : ℤ} (z₁ : Cochain F G n) (z₂ : Cocycle G K 0) (m : ℤ) :
    δ n m (z₁.comp z₂.1 (add_zero n)) =
      (δ n m z₁).comp z₂.1 (add_zero m) 
goal: CochainComplex.HomComplex.δ n m (z₁.comp ↑z₂ ⋯) = (CochainComplex.HomComplex.δ n m z₁).comp ↑z₂ ⋯

full_name: CochainComplex.HomComplex.δ_comp_ofHom
code: @[simp]
lemma δ_comp_ofHom {n : ℤ} (z₁ : Cochain F G n) (f : G ⟶ K) (m : ℤ) :
    δ n m (z₁.comp (Cochain.ofHom f) (add_zero n)) =
      (δ n m z₁).comp (Cochain.ofHom f) (add_zero m) 
goal: CochainComplex.HomComplex.δ n m (z₁.comp (CochainComplex.HomComplex.Cochain.ofHom f) ⋯) =
  (CochainComplex.HomComplex.δ n m z₁).comp (CochainComplex.HomComplex.Cochain.ofHom f) ⋯

full_name: CochainComplex.HomComplex.δ_zero_cocycle_comp
code: @[simp]
lemma δ_zero_cocycle_comp {n : ℤ} (z₁ : Cocycle F G 0) (z₂ : Cochain G K n) (m : ℤ) :
    δ n m (z₁.1.comp z₂ (zero_add n)) =
      z₁.1.comp (δ n m z₂) (zero_add m) 
goal: CochainComplex.HomComplex.δ n m ((↑z₁).comp z₂ ⋯) = (↑z₁).comp (CochainComplex.HomComplex.δ n m z₂) ⋯

full_name: CochainComplex.HomComplex.δ_ofHom_comp
code: @[simp]
lemma δ_ofHom_comp {n : ℤ} (f : F ⟶ G) (z : Cochain G K n) (m : ℤ) :
    δ n m ((Cochain.ofHom f).comp z (zero_add n)) =
      (Cochain.ofHom f).comp (δ n m z) (zero_add m) 
goal: CochainComplex.HomComplex.δ n m ((CochainComplex.HomComplex.Cochain.ofHom f).comp z ⋯) =
  (CochainComplex.HomComplex.Cochain.ofHom f).comp (CochainComplex.HomComplex.δ n m z) ⋯

full_name: CochainComplex.HomComplex.Cochain.equivHomotopy
code: /-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of an homotopy between `φ₁` and
`φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference
of the zero cochains associated to `φ₂` and `φ₁`. -/
@[simps]
def equivHomotopy (φ₁ φ₂ : F ⟶ G) :
    Homotopy φ₁ φ₂ ≃
      { z : Cochain F G (-1) // Cochain.ofHom φ₁ = δ (-1) 0 z + Cochain.ofHom φ₂ } 
goal: Homotopy φ₁ φ₂ ≃
  { z //
    CochainComplex.HomComplex.Cochain.ofHom φ₁ =
      CochainComplex.HomComplex.δ (-1) 0 z + CochainComplex.HomComplex.Cochain.ofHom φ₂ }

full_name: CochainComplex.HomComplex.Cochain.equivHomotopy_symm_apply_hom
code: /-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of an homotopy between `φ₁` and
`φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference
of the zero cochains associated to `φ₂` and `φ₁`. -/
@[simps]
def equivHomotopy (φ₁ φ₂ : F ⟶ G) :
    Homotopy φ₁ φ₂ ≃
      { z : Cochain F G (-1) // Cochain.ofHom φ₁ = δ (-1) 0 z + Cochain.ofHom φ₂ } 
goal: ((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂).symm z).hom i j =
  if hij : i + -1 = j then (↑z).v i j hij else 0

full_name: CochainComplex.HomComplex.Cochain.equivHomotopy_apply_coe
code: /-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of an homotopy between `φ₁` and
`φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference
of the zero cochains associated to `φ₂` and `φ₁`. -/
@[simps]
def equivHomotopy (φ₁ φ₂ : F ⟶ G) :
    Homotopy φ₁ φ₂ ≃
      { z : Cochain F G (-1) // Cochain.ofHom φ₁ = δ (-1) 0 z + Cochain.ofHom φ₂ } 
goal: ↑((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂) ho) = CochainComplex.HomComplex.Cochain.ofHomotopy ho

full_name: CochainComplex.HomComplex.Cochain.equivHomotopy_apply_of_eq
code: @[simp]
lemma equivHomotopy_apply_of_eq {φ₁ φ₂ : F ⟶ G} (h : φ₁ = φ₂) :
    (equivHomotopy _ _ (Homotopy.ofEq h)).1 = 0 
goal: ↑((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂) (Homotopy.ofEq h)) = 0

full_name: CochainComplex.HomComplex.Cochain.ofHom_injective
code: lemma ofHom_injective {f₁ f₂ : F ⟶ G} (h : ofHom f₁ = ofHom f₂) : f₁ = f₂ 
goal: f₁ = f₂

full_name: CochainComplex.HomComplex.Cochain.map
code: /-- If `Φ : C ⥤ D` is an additive functor, a cochain `z : Cochain K L n` between
cochain complexes in `C` can be mapped to a cochain between the cochain complexes
in `D` obtained by applying the functor
`Φ.mapHomologicalComplex _ : CochainComplex C ℤ ⥤ CochainComplex D ℤ`. -/
def map : Cochain ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n 
goal: CochainComplex.HomComplex.Cochain ((Φ.mapHomologicalComplex (ComplexShape.up ℤ)).obj K)
  ((Φ.mapHomologicalComplex (ComplexShape.up ℤ)).obj L) n

full_name: CochainComplex.HomComplex.Cochain.map_v
code: @[simp]
lemma map_v (p q : ℤ) (hpq : p + n = q) : (z.map Φ).v p q hpq = Φ.map (z.v p q hpq) 
goal: (z.map Φ).v p q hpq = Φ.map (z.v p q hpq)

full_name: CochainComplex.HomComplex.Cochain.map_add
code: @[simp]
lemma map_add : (z + z').map Φ = z.map Φ + z'.map Φ 
goal: (z + z').map Φ = z.map Φ + z'.map Φ

full_name: CochainComplex.HomComplex.Cochain.map_neg
code: @[simp]
lemma map_neg : (-z).map Φ = -z.map Φ 
goal: (-z).map Φ = -z.map Φ

full_name: CochainComplex.HomComplex.Cochain.map_sub
code: @[simp]
lemma map_sub : (z - z').map Φ = z.map Φ - z'.map Φ 
goal: (z - z').map Φ = z.map Φ - z'.map Φ

full_name: CochainComplex.HomComplex.Cochain.map_zero
code: @[simp]
lemma map_zero : (0 : Cochain K L n).map Φ = 0 
goal: CochainComplex.HomComplex.Cochain.map 0 Φ = 0

full_name: CochainComplex.HomComplex.Cochain.map_comp
code: @[simp]
lemma map_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (Φ : C ⥤ D) [Φ.Additive] :
    (Cochain.comp z₁ z₂ h).map Φ = Cochain.comp (z₁.map Φ) (z₂.map Φ) h 
goal: (z₁.comp z₂ h).map Φ = (z₁.map Φ).comp (z₂.map Φ) h

full_name: CochainComplex.HomComplex.Cochain.map_ofHom
code: @[simp]
lemma map_ofHom :
    (Cochain.ofHom f).map Φ = Cochain.ofHom ((Φ.mapHomologicalComplex _).map f) 
goal: (CochainComplex.HomComplex.Cochain.ofHom f).map Φ =
  CochainComplex.HomComplex.Cochain.ofHom ((Φ.mapHomologicalComplex (ComplexShape.up ℤ)).map f)

full_name: CochainComplex.HomComplex.δ_map
code: @[simp]
lemma δ_map : δ n m (z.map Φ) = (δ n m z).map Φ 
goal: CochainComplex.HomComplex.δ n m (z.map Φ) = (CochainComplex.HomComplex.δ n m z).map Φ