proposition: Lemma AbelianToisPreAdditive : isPreAdditive AbelianTocategoryWithAbgrops.
proof: Proof. use make_isPreAdditive. - intros x y z f. split. + intros x' x'0. unfold to_premor. cbn. unfold Abelian_op. unfold Abelian_minus_op. cbn in x', x'0. rewrite assoc. apply cancel_postcomposition. set (bpz := to_BinProducts A z z). assert (e : BinProductArrow A bpz (f · x') ((BinProductArrow A bpz (ZeroArrow (to_Zero A) x z) (f · x'0)) · CokernelArrow (CokernelOfDiagonal bpz)) = BinProductArrow A bpz (f · x') ((BinProductArrow A bpz (f · ZeroArrow (to_Zero A) y z) (f · x'0)) · CokernelArrow (CokernelOfDiagonal bpz))). { set (tmp := ZeroArrow_comp_right A (to_Zero A) x y z f). apply (maponpaths (λ h : _, BinProductArrow A bpz (f · x') ((BinProductArrow A bpz h (f · x'0)) · CokernelArrow (CokernelOfDiagonal bpz)))) in tmp. apply pathsinv0 in tmp. apply tmp. } use (pathscomp0 _ (!e)). clear e. rewrite <- precompWithBinProductArrow. rewrite <- assoc. rewrite <- precompWithBinProductArrow. apply idpath. + unfold to_premor. cbn. unfold AbelianPreCat_homset_zero. apply ZeroArrow_comp_right. - intros x y z f. split. + intros x' x'0. unfold to_postmor. cbn. unfold Abelian_op. unfold Abelian_minus_op. cbn in x', x'0. set (bpz := to_BinProducts A z z). assert (e : BinProductArrow A bpz (ZeroArrow (to_Zero A) x z) (x'0 · f) = (BinProductArrow A (to_BinProducts A y y) (ZeroArrow (to_Zero A) x y) x'0) · Abelian_mor_from_to_BinProd f f). { use BinProductArrowsEq. - unfold Abelian_mor_from_to_BinProd. rewrite <- assoc. rewrite BinProductPr1Commutes. rewrite BinProductPr1Commutes. rewrite assoc. rewrite BinProductPr1Commutes. rewrite ZeroArrow_comp_left. apply idpath. - unfold Abelian_mor_from_to_BinProd. rewrite <- assoc. rewrite BinProductPr2Commutes. rewrite BinProductPr2Commutes. rewrite assoc. rewrite BinProductPr2Commutes. apply idpath. } rewrite e. clear e. unfold Abelian_mor_from_to_BinProd. repeat rewrite <- assoc. set (tmp := Abelian_op_eq f). cbn zeta in tmp. unfold bpz. rewrite <- tmp. repeat rewrite assoc. rewrite <- (postcompWithBinProductArrow A _ (to_BinProducts A y y)). repeat rewrite <- assoc. apply cancel_precomposition. unfold BinProductOfArrows. apply tmp. + unfold to_postmor. cbn. unfold AbelianPreCat_homset_zero. apply ZeroArrow_comp_left. Qed.
imports: UniMath.Foundations.PartD UniMath.Foundations.Propositions UniMath.Foundations.Sets UniMath.Algebra.Monoids UniMath.CategoryTheory.Core.Categories UniMath.CategoryTheory.Core.Isos UniMath.CategoryTheory.PrecategoryBinProduct UniMath.CategoryTheory.Limits.Zero UniMath.CategoryTheory.Limits.BinProducts UniMath.CategoryTheory.Limits.BinCoproducts UniMath.CategoryTheory.Limits.Equalizers UniMath.CategoryTheory.Limits.Coequalizers UniMath.CategoryTheory.Limits.Kernels UniMath.CategoryTheory.Limits.Cokernels UniMath.CategoryTheory.Limits.Pushouts UniMath.CategoryTheory.Limits.Pullbacks UniMath.CategoryTheory.Limits.BinDirectSums UniMath.CategoryTheory.Monics UniMath.CategoryTheory.Epis UniMath.CategoryTheory.CategoriesWithBinOps UniMath.CategoryTheory.PrecategoriesWithAbgrops UniMath.CategoryTheory.PreAdditive UniMath.CategoryTheory.Additive UniMath.CategoryTheory.Abelian