Lean4
/-- Given a left homology data `h` of a short complex `S`, we can construct another left homology
data by choosing another kernel and cokernel that are isomorphic to the ones in `h`. -/
@[simps]
def copy {K' H' : C} (eK : K' ≅ h.K) (eH : H' ≅ h.H) : S.LeftHomologyData
where
K := K'
H := H'
i := eK.hom ≫ h.i
π := eK.hom ≫ h.π ≫ eH.inv
wi := by rw [assoc, h.wi, comp_zero]
hi := IsKernel.isoKernel _ _ h.hi eK (by simp)
wπ := by simp [IsKernel.isoKernel]
hπ :=
IsColimit.equivOfNatIsoOfIso (parallelPair.ext (Iso.refl S.X₁) eK.symm (by simp [IsKernel.isoKernel]) (by simp)) _ _
(Cocones.ext (by exact eH.symm) (by rintro (_ | _) <;> simp [IsKernel.isoKernel])) h.hπ