Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bifunctors #1886

Merged
merged 25 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
63e3847
Move bifunctor coherence to Is1Bifunctor
gio256 Mar 7, 2024
783f5b9
WildCat/Bifunctor.v: Remove bifunctor_hom lemmas
gio256 Mar 8, 2024
a95509d
AbSES/BaerSum.v: fix proof of is1bifunctor_abses
gio256 Mar 8, 2024
1046b48
WildCat/Bifunctor.v: simplify uncurried proofs
gio256 Mar 8, 2024
62b8d2b
AbGroups/AbHom.v: prove is1bifunctor_ab_hom
gio256 Mar 8, 2024
720075a
AbSES/Ext.v: rough proofs of Is1Bifunctor
gio256 Mar 8, 2024
56d82e7
AbSES/Ext.v: simplify bifunctor proofs for ab_ext
gio256 Mar 9, 2024
2c9fce6
AbSES/Ext.v: remove universe annotations
gio256 Mar 9, 2024
d78a876
Simplify building of bifunctors
gio256 Mar 9, 2024
e19d81e
WildCat/Yoneda.v: Add bifunctor instances for hom
gio256 Mar 9, 2024
f5e4d86
WildCat/Prod.v: add product inclusions
gio256 Mar 9, 2024
192a786
WildCat/Bifunctor.v: remove comment
gio256 Mar 9, 2024
beed14d
AbSES/Ext.v: remove universe annotations
gio256 Mar 9, 2024
f930232
WildCat/Yoneda.v: add comment
gio256 Mar 9, 2024
da5cb5a
WildCat/Monoidal: tensor product is a 1-bifunctor
gio256 Mar 9, 2024
c41d397
WildCat equivs: add compose_catie'
gio256 Mar 10, 2024
2ae47ce
Move bifunctor lemmas from Prod.v to Bifunctor.v
gio256 Mar 10, 2024
1426fd9
WildCat/Bifunctor.v: clean up two proofs
gio256 Mar 11, 2024
b662a72
WildCat equivs: re-define compose_catie'
gio256 Mar 11, 2024
f902579
WildCat equivs fix: cate_homotopic to catie_homotopic
gio256 Mar 12, 2024
c2616da
WildCat/Yoneda.v: opyon_0gpd bifunctor instances
gio256 Mar 13, 2024
07b6ff4
contrib/SetoidRewrite.v: formatting
gio256 Mar 13, 2024
2ed1065
WildCat/Yoneda.v: clean up is0functor_hom_0gpd
gio256 Mar 13, 2024
6c975c1
WildCat/Bifunctor.v: formatting
gio256 Mar 14, 2024
31562d0
WildCat/Yoneda.v: add comment
gio256 Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contrib/SetoidRewrite.v
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ Defined.
#[export] Instance Is1Functor_uncurry_bifunctor {A B C : Type}
jdchristensen marked this conversation as resolved.
Show resolved Hide resolved
`{Is1Cat A, Is1Cat B, Is1Cat C}
(F : A -> B -> C)
`{!IsBifunctor F}
`{forall a, Is1Functor (F a)}
`{forall b, Is1Functor (flip F b)}
`{!Is0Bifunctor F, !Is1Bifunctor F}
: Is1Functor (uncurry F).
Proof.
nrapply Build_Is1Functor.
Expand Down
39 changes: 35 additions & 4 deletions theories/Algebra/AbGroups/AbHom.v
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,42 @@ Proof.
by apply equiv_path_grouphomomorphism.
Defined.

Global Instance isbifunctor_ab_hom `{Funext}
: IsBifunctor (ab_hom : Group^op -> AbGroup -> AbGroup).
Global Instance is1functor_ab_hom01 `{Funext} {A : Group^op}
: Is1Functor (ab_hom A).
Proof.
snrapply Build_IsBifunctor.
1-2: exact _.
nrapply Build_Is1Functor.
- intros B B' f g p phi.
apply equiv_path_grouphomomorphism; intro a; cbn.
exact (p (phi a)).
- intros B phi.
by apply equiv_path_grouphomomorphism.
- intros B C D f g phi.
by apply equiv_path_grouphomomorphism.
Defined.

Global Instance is1functor_ab_hom10 `{Funext} {B : AbGroup@{u}}
: Is1Functor (flip (ab_hom : Group^op -> AbGroup -> AbGroup) B).
Proof.
nrapply Build_Is1Functor.
- intros A A' f g p phi.
apply equiv_path_grouphomomorphism; intro a; cbn.
exact (ap phi (p a)).
- intros A phi.
by apply equiv_path_grouphomomorphism.
- intros A C D f g phi.
by apply equiv_path_grouphomomorphism.
Defined.

Global Instance is0bifunctor_ab_hom `{Funext}
: Is0Bifunctor (ab_hom : Group^op -> AbGroup -> AbGroup).
Proof.
rapply Build_Is0Bifunctor.
Defined.

Global Instance is1bifunctor_ab_hom `{Funext}
: Is1Bifunctor (ab_hom : Group^op -> AbGroup -> AbGroup).
Proof.
rapply Build_Is1Bifunctor.
intros A A' f B B' g phi; cbn.
by apply equiv_path_grouphomomorphism.
Defined.
Expand Down
28 changes: 21 additions & 7 deletions theories/Algebra/AbSES/BaerSum.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,19 @@ Proof.
apply abses_pushout_pullback_reorder'.
Defined.

Global Instance isbifunctor_abses' `{Univalence}
: IsBifunctor (AbSES' : AbGroup^op -> AbGroup -> Type).
Global Instance is0bifunctor_abses' `{Univalence}
: Is0Bifunctor (AbSES' : AbGroup^op -> AbGroup -> Type).
Proof.
eapply Build_IsBifunctor.
rapply Build_Is0Bifunctor.
Defined.

Global Instance is1bifunctor_abses' `{Univalence}
: Is1Bifunctor (AbSES' : AbGroup^op -> AbGroup -> Type).
Proof.
snrapply Build_Is1Bifunctor.
1,2: exact _.
intros ? ? g ? ? f E; cbn.
apply abses_pushout_pullback_reorder.
exact (abses_pushout_pullback_reorder E f g).
Defined.

(** Given a short exact sequence [A -> E -> B] and maps [f : A -> A'], [g : B' -> B], we can change the order of pushing out along [f] and pulling back along [g]. *)
Expand Down Expand Up @@ -222,10 +229,17 @@ Proof.
- intro; apply baer_sum_unit_r.
Defined.

Global Instance isbifunctor_abses `{Univalence}
: IsBifunctor (AbSES : AbGroup^op -> AbGroup -> pType).
Global Instance is0bifunctor_abses `{Univalence}
: Is0Bifunctor (AbSES : AbGroup^op -> AbGroup -> pType).
Proof.
rapply Build_Is0Bifunctor.
Defined.

Global Instance is1bifunctor_abses `{Univalence}
: Is1Bifunctor (AbSES : AbGroup^op -> AbGroup -> pType).
Proof.
econstructor.
snrapply Build_Is1Bifunctor.
1,2: exact _.
intros ? ? f ? ? g.
rapply hspace_phomotopy_from_homotopy.
1: apply ishspace_abses.
Expand Down
68 changes: 53 additions & 15 deletions theories/Algebra/AbSES/Ext.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Require Import Basics Types Truncations.Core.
Require Import Pointed WildCat.
Require Import Truncations.SeparatedTrunc.
Require Import AbelianGroup AbHom AbProjective.
Require Import AbSES.Pullback AbSES.BaerSum AbSES.Core.
Require Import AbSES.Pullback AbSES.Pushout AbSES.BaerSum AbSES.Core.

Local Open Scope mc_scope.
Local Open Scope mc_add_scope.
Expand All @@ -11,6 +11,14 @@ Local Open Scope mc_add_scope.

Definition Ext (B A : AbGroup@{u}) := pTr 0 (AbSES B A).

Global Instance is0bifunctor_ext `{Univalence}
: Is0Bifunctor (Ext : AbGroup^op -> AbGroup -> pType)
:= is0bifunctor_compose _ _ (bf:=is0bifunctor_abses).

Global Instance is1bifunctor_ext `{Univalence}
: Is1Bifunctor (Ext : AbGroup^op -> AbGroup -> pType)
:= is1bifunctor_compose _ _ (bf:=is1bifunctor_abses).

(** An extension [E : AbSES B A] is trivial in [Ext B A] if and only if [E] merely splits. *)
Proposition iff_ab_ext_trivial_split `{Univalence} {B A : AbGroup} (E : AbSES B A)
: merely {s : GroupHomomorphism B E & (projection _) $o s == idmap}
Expand All @@ -24,9 +32,13 @@ Defined.

Definition Ext' (B A : AbGroup@{u}) := Tr 0 (AbSES' B A).

Global Instance isbifunctor_ext'@{u v w | u < v, v < w} `{Univalence}
: IsBifunctor@{v v w u u v v} (Ext' : AbGroup@{u}^op -> AbGroup@{u} -> Type@{v})
:= isbifunctor_compose _ _ (P:=isbifunctor_abses').
Global Instance is0bifunctor_ext'@{u v w | u < v, v < w} `{Univalence}
: Is0Bifunctor (Ext' : AbGroup@{u}^op -> AbGroup@{u} -> Type@{v})
:= is0bifunctor_compose _ _ (bf:=is0bifunctor_abses').

Global Instance is1bifunctor_ext'@{u v w | u < v, v < w} `{Univalence}
: Is1Bifunctor (Ext' : AbGroup@{u}^op -> AbGroup@{u} -> Type@{v})
:= is1bifunctor_compose _ _ (bf:=is1bifunctor_abses').

(** [Ext B A] is an abelian group for any [A B : AbGroup]. The proof of commutativity is a bit faster if we separate out the proof that [Ext B A] is a group. *)
Definition grp_ext `{Univalence} (B A : AbGroup@{u}) : Group.
Expand Down Expand Up @@ -60,39 +72,65 @@ Proof.
apply baer_sum_commutative.
Defined.

Global Instance is01functor_ext `{Univalence} (B : AbGroup^op)
Global Instance is0functor_abext01 `{Univalence} (B : AbGroup^op)
: Is0Functor (ab_ext B).
Proof.
srapply Build_Is0Functor; intros ? ? f.
snrapply Build_GroupHomomorphism.
1: exact (fmap01 (A:=AbGroup^op) Ext' B f).
1: exact (fmap (Ext B) f).
rapply Trunc_ind; intro E0.
rapply Trunc_ind; intro E1.
apply (ap tr); cbn.
apply baer_sum_pushout.
Defined.

Global Instance is10functor_ext `{Univalence} (A : AbGroup)
Global Instance is0functor_abext10 `{Univalence} (A : AbGroup)
: Is0Functor (fun B : AbGroup^op => ab_ext B A).
Proof.
srapply Build_Is0Functor; intros ? ? f; cbn.
snrapply Build_GroupHomomorphism.
1: exact (fmap10 (A:=AbGroup^op) Ext' f A).
1: exact (fmap (fun (B : AbGroup^op) => Ext B A) f).
rapply Trunc_ind; intro E0.
rapply Trunc_ind; intro E1.
apply (ap tr); cbn.
apply baer_sum_pullback.
Defined.

Global Instance isbifunctor_ext `{Univalence}
: IsBifunctor (A:=AbGroup^op) ab_ext.
Global Instance is1functor_abext01 `{Univalence} (B : AbGroup^op)
: Is1Functor (ab_ext B).
Proof.
snrapply Build_Is1Functor.
- intros A C f g.
exact (fmap2 (Ext B)).
- exact (fmap_id (Ext B)).
- intros A C D.
exact (fmap_comp (Ext B)).
Defined.

Global Instance is1functor_abext10 `{Univalence} (A : AbGroup)
: Is1Functor (fun B : AbGroup^op => ab_ext B A).
Proof.
snrapply Build_Is1Functor.
- intros B C f g.
exact (fmap2 (fun B : AbGroup^op => Ext B A)).
- exact (fmap_id (fun B : AbGroup^op => Ext B A)).
- intros B C D.
exact (fmap_comp (fun B : AbGroup^op => Ext B A)).
Defined.

Global Instance is0bifunctor_abext `{Univalence}
: Is0Bifunctor (A:=AbGroup^op) ab_ext.
Proof.
rapply Build_Is0Bifunctor.
Defined.

Global Instance is1bifunctor_abext `{Univalence}
: Is1Bifunctor (A:=AbGroup^op) ab_ext.
Proof.
snrapply Build_IsBifunctor.
snrapply Build_Is1Bifunctor.
1,2: exact _.
intros B B' f A A' g.
rapply Trunc_ind; intro E.
apply (ap tr).
apply abses_pushout_pullback_reorder.
intros A B.
exact (bifunctor_isbifunctor (Ext : AbGroup^op -> AbGroup -> pType)).
Defined.

(** We can push out a fixed extension while letting the map vary, and this defines a group homomorphism. *)
Expand Down
27 changes: 17 additions & 10 deletions theories/Homotopy/Join/Core.v
Original file line number Diff line number Diff line change
Expand Up @@ -560,16 +560,23 @@ Section FunctorJoin.
Definition equiv_functor_join {A B C D} (f : A <~> C) (g : B <~> D)
: Join A B <~> Join C D := Build_Equiv _ _ (functor_join f g) _.

Global Instance isbifunctor_join : IsBifunctor Join.
Proof.
snrapply Build_IsBifunctor.
- intro A; snrapply Build_Is0Functor; intros B D g.
exact (functor_join idmap g).
- intro B; snrapply Build_Is0Functor; intros A C f.
exact (functor_join f idmap).
- intros A C f B D g x.
lhs_V nrapply functor_join_compose.
nrapply functor_join_compose.
Global Instance is0bifunctor_join : Is0Bifunctor Join.
Proof.
rapply Build_Is0Bifunctor'.
apply Build_Is0Functor.
intros A B [f g].
exact (functor_join f g).
Defined.

Global Instance is1bifunctor_join : Is1Bifunctor Join.
Proof.
snrapply Build_Is1Bifunctor'.
nrapply Build_Is1Functor.
- intros A B f g [p q].
exact (functor2_join p q).
- intros A; exact functor_join_idmap.
- intros A B C [f g] [h k].
exact (functor_join_compose f g h k).
Defined.

End FunctorJoin.
Expand Down
Loading
Loading