proposition: Lemma ComplexHomotisSubgrop (C1 C2 : Complex A) : @issubgr (@to_abgr (ComplexPreCat_Additive A) C1 C2) (ComplexHomotSubset C1 C2).
proof: Proof. use tpair. - use tpair. + intros f g. induction f as [f1 f2]. induction g as [g1 g2]. use (squash_to_prop f2). { apply propproperty. } intros f3. use (squash_to_prop g2). { apply propproperty. } intros g3. induction f3 as [f3 f4]. induction g3 as [g3 g4]. use hinhpr. cbn. use tpair. * intros i. use to_binop. -- exact (f3 i). -- exact (g3 i). * cbn. rewrite <- f4. rewrite <- g4. use MorphismEq. intros i. cbn. rewrite to_postmor_linear'. rewrite to_premor_linear'. assert (e0 : (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (to_binop (C1 i) (C2 (i + 1 - 1)) (Diff C1 i · f3 (i + 1)) (Diff C1 i · g3 (i + 1)))) = to_binop (C1 i) (C2 i) (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (Diff C1 i · f3 (i + 1))) (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (Diff C1 i · g3 (i + 1)))). { induction (hzrplusminus i 1). apply idpath. } cbn in e0. rewrite e0. clear e0. assert (e1 : (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrminusplus i 1)) (to_binop (C1 i) (C2 (i - 1 + 1)) (f3 i · Diff C2 (i - 1)) (g3 i · Diff C2 (i - 1)))) = to_binop (C1 i) (C2 i) (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrminusplus i 1)) (f3 i · Diff C2 (i - 1))) (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrminusplus i 1)) (g3 i · Diff C2 (i - 1)))). { induction (hzrminusplus i 1). apply idpath. } cbn in e1. rewrite e1. clear e1. set (tmp := @assocax (@to_abgr A (C1 i) (C2 i))). cbn in tmp. rewrite tmp. rewrite tmp. apply maponpaths. rewrite <- tmp. rewrite <- tmp. set (tmp' := @commax (@to_abgr A (C1 i) (C2 i))). cbn in tmp'. rewrite tmp'. rewrite (tmp' _ (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (Diff C1 i · g3 (i + 1)))). apply maponpaths. apply tmp'. + use hinhpr. use tpair. * intros i. exact (ZeroArrow (Additive.to_Zero A) _ _). * cbn. use MorphismEq. intros i. cbn. rewrite ZeroArrow_comp_left. rewrite transport_target_ZeroArrow. rewrite ZeroArrow_comp_right. rewrite transport_target_ZeroArrow. rewrite <- PreAdditive_unel_zero. rewrite to_lunax'. apply idpath. - intros f H. use (squash_to_prop H). { apply propproperty. } intros H'. clear H. induction H' as [homot eq]. use hinhpr. use tpair. + intros i. exact (grinv (to_abgr (C1 i) (C2 (i - 1))) (homot i)). + cbn. rewrite <- eq. use MorphismEq. intros i. cbn. set (tmp := @PreAdditive_invrcomp A _ _ _ (Diff C1 i) (homot (i + 1))). unfold to_inv in tmp. cbn in tmp. cbn. rewrite <- tmp. clear tmp. assert (e0 : (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (grinv (to_abgr (C1 i) (C2 (i + 1 - 1))) (Diff C1 i · homot (i + 1)))) = to_inv (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrplusminus i 1)) (Diff C1 i · homot (i + 1)))). { unfold to_inv. cbn. induction (hzrplusminus i 1). apply idpath. } cbn in e0. rewrite e0. clear e0. assert (e1 : (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrminusplus i 1)) (grinv (to_abgr (C1 i) (C2 (i - 1))) (homot i) · Diff C2 (i - 1))) = to_inv (transportf (precategory_morphisms (C1 i)) (maponpaths C2 (hzrminusplus i 1)) (homot i · Diff C2 (i - 1)))). { unfold to_inv. cbn. induction (hzrminusplus i 1). cbn. set (tmp := @PreAdditive_invlcomp A (C1 i) (C2 (i - 1)) (C2 (i - 1 + 1)) (homot i) (Diff C2 (i - 1))). apply pathsinv0. unfold to_inv in tmp. apply tmp. } cbn in e1. rewrite e1. clear e1. set (tmp' := @commax (@to_abgr A (C1 i) (C2 i))). cbn in tmp'. rewrite tmp'. clear tmp'. set (tmp := @grinvop (@to_abgr A (C1 i) (C2 i))). cbn in tmp. unfold to_inv. apply pathsinv0. apply tmp. Qed.
imports: UniMath.Foundations.UnivalenceAxiom UniMath.Foundations.PartD UniMath.Foundations.Propositions UniMath.Foundations.Sets UniMath.Foundations.NaturalNumbers UniMath.MoreFoundations.Tactics UniMath.Algebra.BinaryOperations UniMath.Algebra.Monoids UniMath.Algebra.Groups UniMath.NumberSystems.Integers UniMath.CategoryTheory.Core.Categories UniMath.CategoryTheory.Core.TransportMorphisms 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.Core.Functors UniMath.CategoryTheory.Equivalences.Core UniMath.CategoryTheory.CategoriesWithBinOps UniMath.CategoryTheory.PrecategoriesWithAbgrops UniMath.CategoryTheory.PreAdditive UniMath.CategoryTheory.Additive UniMath.CategoryTheory.Abelian UniMath.CategoryTheory.AbelianToAdditive UniMath.CategoryTheory.AdditiveFunctors UniMath.HomologicalAlgebra.Complexes