Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into coq-8.17
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Jan 31, 2024
2 parents 2aaea15 + 5ff107d commit 3bfc550
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 77 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coq-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
matrix:
image:
- 'coqorg/coq:dev'
- 'coqorg/coq:8.19'
- 'coqorg/coq:8.18'
- 'coqorg/coq:8.17'
- 'coqorg/coq:8.16'
Expand Down
24 changes: 8 additions & 16 deletions Adjunction/Hom.v
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ Qed.
Next Obligation.
simpl.
rewrite <- !comp_assoc.
srewrite_r (naturality[unit]).
srewrite_r (@naturality _ _ _ _ unit _ _ h).
rewrite !comp_assoc.
rewrite <- !fmap_comp.
reflexivity.
Qed.
Next Obligation.
simpl.
rewrite <- !comp_assoc.
srewrite_r (naturality[unit]).
srewrite_r (@naturality _ _ _ _ unit _ _ h).
rewrite !comp_assoc.
rewrite <- !fmap_comp.
reflexivity.
Expand All @@ -169,15 +169,15 @@ Qed.
Next Obligation.
simpl.
rewrite !comp_assoc.
srewrite (naturality[counit]).
srewrite (@naturality _ _ _ _ counit _ _ h0).
rewrite <- !comp_assoc.
rewrite <- !fmap_comp.
reflexivity.
Qed.
Next Obligation.
simpl.
rewrite !comp_assoc.
srewrite (naturality[counit]).
srewrite (@naturality _ _ _ _ counit _ _ h0).
rewrite <- !comp_assoc.
rewrite <- !fmap_comp.
reflexivity.
Expand All @@ -186,15 +186,15 @@ Next Obligation.
simpl; cat.
rewrite fmap_comp.
rewrite <- comp_assoc.
srewrite (naturality[unit]).
srewrite (@naturality _ _ _ _ unit _ _ x0).
rewrite comp_assoc.
srewrite (@fmap_counit_unit _ _ _ _ A); cat.
Qed.
Next Obligation.
simpl; cat.
rewrite fmap_comp.
rewrite comp_assoc.
srewrite_r (naturality[counit]).
srewrite_r (@naturality _ _ _ _ counit _ _ x0).
rewrite <- comp_assoc.
srewrite (@counit_fmap_unit _ _ _ _ A); cat.
Qed.
Expand Down Expand Up @@ -237,14 +237,9 @@ Qed.

Program Definition Adjunction_Universal_to_Hom (A : F ⊣ U) : Adjunction_Hom := {|
hom_adj :=
{| to := {| transform := fun _ =>
{| morphism := fun f => to adj f |} |}
; from := {| transform := fun _ =>
{| morphism := fun f => from adj f |} |} |}
{| to := {| transform := fun _ => {| morphism := to adj |} |}
; from := {| transform := fun _ => {| morphism := from adj |} |} |}
|}.
Next Obligation.
proper; rewrites; reflexivity.
Qed.
Next Obligation.
rewrite <- comp_assoc.
rewrite to_adj_nat_l.
Expand All @@ -259,9 +254,6 @@ Next Obligation.
rewrite to_adj_nat_l.
reflexivity.
Qed.
Next Obligation.
proper; rewrites; reflexivity.
Qed.
Next Obligation.
rewrite <- comp_assoc.
rewrite from_adj_nat_l.
Expand Down
38 changes: 16 additions & 22 deletions Adjunction/Natural/Transformation/Universal.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,49 @@ Context {U : C ⟶ D}.

Program Definition Adjunction_from_Transform (A : F ∹ U) : F ⊣ U := {|
adj := fun a b =>
{| to := {| morphism := fun f =>
fmap f ∘ @Transformation.unit _ _ _ _ A a |}
; from := {| morphism := fun f =>
@Transformation.counit _ _ _ _ A b ∘ fmap f |} |}
{| to := {| morphism := fun f => fmap f ∘ transform[unit[A]] a |}
; from := {| morphism := fun f => transform[counit[A]] b ∘ fmap f |} |}
|}.
Next Obligation. proper; rewrites; reflexivity. Qed.
Next Obligation. proper; rewrites; reflexivity. Qed.
Next Obligation. proper; now rewrites. Qed.
Next Obligation. proper; now rewrites. Qed.
Next Obligation.
rewrite fmap_comp.
rewrite <- comp_assoc.
srewrite (naturality[Transformation.unit]).
rewrite comp_assoc.
rewrite (@naturality _ _ _ _ unit[A] _ _ x).
rewrite comp_assoc; simpl.
srewrite (@Transformation.fmap_counit_unit); cat.
Qed.
Next Obligation.
rewrite fmap_comp.
rewrite comp_assoc.
srewrite_r (naturality[Transformation.counit]).
rewrite <- comp_assoc.
rewrite <- (@naturality _ _ _ _ counit[A] _ _ x).
rewrite <- comp_assoc; simpl.
srewrite (@Transformation.counit_fmap_unit); cat.
Qed.
Next Obligation.
rewrite fmap_comp.
rewrite <- comp_assoc.
srewrite (naturality[Transformation.unit]).
rewrite comp_assoc.
reflexivity.
rewrite (@naturality _ _ _ _ unit[A] _ _ g).
now rewrite comp_assoc.
Qed.
Next Obligation.
rewrite fmap_comp.
rewrite comp_assoc.
reflexivity.
now rewrite comp_assoc.
Qed.
Next Obligation.
rewrite fmap_comp.
rewrite comp_assoc.
reflexivity.
now rewrite comp_assoc.
Qed.
Next Obligation.
rewrite fmap_comp.
rewrite comp_assoc.
srewrite_r (naturality[Transformation.counit]).
rewrite <- comp_assoc.
reflexivity.
rewrite <- (@naturality _ _ _ _ counit[A] _ _ f).
now rewrite <- comp_assoc.
Qed.

Program Definition Adjunction_to_Transform {A : F ⊣ U} : F ∹ U := {|
Transformation.unit := {| transform := fun a => @unit _ _ _ _ A a |};
Transformation.counit := {| transform := fun b => @counit _ _ _ _ A b |}
Transformation.unit := {| transform := fun _ => unit |};
Transformation.counit := {| transform := fun _ => counit |}
|}.
Next Obligation.
unfold unit.
Expand Down
8 changes: 4 additions & 4 deletions Functor/Traversable/Product.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Proof.
rewrite comp_assoc.
rewrites.
rewrite <- !comp_assoc.
pose proof (naturality[@sequence _ _ _ O _ X]) as X3; simpl in *.
pose proof (naturality[@sequence _ _ _ P _ X]) as X4; simpl in *.
pose proof (naturality[@sequence _ _ _ O _ X] _ _ f) as X3; simpl in *.
pose proof (naturality[@sequence _ _ _ P _ X] _ _ f) as X4; simpl in *.
rewrite !comp_assoc.
comp_left.
rewrite bimap_fmap.
Expand All @@ -55,8 +55,8 @@ Proof.
rewrite comp_assoc.
rewrites.
rewrite <- !comp_assoc.
pose proof (naturality[@sequence _ _ _ O _ X]) as X3; simpl in *.
pose proof (naturality[@sequence _ _ _ P _ X]) as X4; simpl in *.
pose proof (naturality[@sequence _ _ _ O _ X] _ _ f) as X3; simpl in *.
pose proof (naturality[@sequence _ _ _ P _ X] _ _ f) as X4; simpl in *.
rewrite !comp_assoc.
comp_left.
rewrite bimap_fmap.
Expand Down
4 changes: 3 additions & 1 deletion Monad/Adjunction.v
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ Proof.
- simpl.
srewrite (@fmap_counit_unit); cat.
- rewrite <- !fmap_comp.
srewrite (naturality[counit]); cat.
apply fmap_respects.
symmetry.
apply (naturality[counit]).
Qed.

End AdjunctionMonad.
26 changes: 6 additions & 20 deletions Theory/Kan/Extension.v
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,8 @@ Class LocalRightKan (X : A ⟶ C) := {
#[export] Program Instance RightKan_to_LocalRightKan {R : RightKan} (X : A ⟶ C) :
LocalRightKan X := {|
LocalRan := Ran X;
ran_transform :=
let adj_from := from (@adj _ _ _ _ ran_adjoint (Ran X) X) nat_id in
{| transform := transform[adj_from]
; naturality := naturality[adj_from] |}
ran_transform := from (@adj _ _ _ _ ran_adjoint (Ran X) X) nat_id
|}.
Next Obligation.
srewrite_r (naturality[from (@adj _ _ _ _ ran_adjoint (Ran X) X) nat_id]).
reflexivity.
Qed.
Next Obligation.
exists (to (@adj _ _ _ _ (@ran_adjoint R) M X) μ).
- intros.
Expand Down Expand Up @@ -112,15 +105,8 @@ Class LocalLeftKan (X : A ⟶ C) := {
#[export] Program Instance LeftKan_to_LocalLeftKan {R : LeftKan} (X : A ⟶ C) :
LocalLeftKan X := {|
LocalLan := Lan X;
lan_transform :=
let adj_to := to (@adj _ _ _ _ lan_adjoint X (Lan X)) nat_id in
{| transform := transform[adj_to]
; naturality := naturality[adj_to] |}
lan_transform := to (@adj _ _ _ _ lan_adjoint X (Lan X)) nat_id
|}.
Next Obligation.
srewrite_r (naturality[to (@adj _ _ _ _ lan_adjoint X (Lan X)) nat_id]).
reflexivity.
Qed.
Next Obligation.
exists (from (@adj _ _ _ _ (@lan_adjoint R) X M) ε).
- intros.
Expand Down Expand Up @@ -201,11 +187,11 @@ Proof.
* simpl.
rewrite <- to_adj_nat_l.
rewrite <- to_adj_nat_r.
now srewrite (naturality[X0]).
now srewrite (@naturality _ _ _ _ X0 _ _ f).
* simpl.
rewrite <- to_adj_nat_l.
rewrite <- to_adj_nat_r.
now srewrite (naturality[X0]).
now srewrite (@naturality _ _ _ _ X0 _ _ f).
+ simpl.
proper.
apply to_adj_respects.
Expand All @@ -218,11 +204,11 @@ Proof.
* simpl.
rewrite <- from_adj_nat_l.
rewrite <- from_adj_nat_r.
now srewrite (naturality[X0]).
now srewrite (@naturality _ _ _ _ X0 _ _ f).
* simpl.
rewrite <- from_adj_nat_l.
rewrite <- from_adj_nat_r.
now srewrite (naturality[X0]).
now srewrite (@naturality _ _ _ _ X0 _ _ f).
+ simpl.
proper.
apply from_adj_respects.
Expand Down
10 changes: 4 additions & 6 deletions Theory/Natural/Transformation.v
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ Qed.
End Transform.

Arguments transform {_ _ _ _} _ _.
Arguments naturality
{_ _ _ _ _ _ _ _}, {_ _ _ _} _ {_ _ _}, {_ _ _ _} _ _ _ _.
Arguments naturality_sym
{_ _ _ _ _ _ _ _}, {_ _ _ _} _ {_ _ _}, {_ _ _ _} _ _ _ _.
Arguments naturality {_ _ _ _} _ _ _ _.
Arguments naturality_sym {_ _ _ _} _ _ _ _.

Declare Scope transform_scope.
Declare Scope transform_type_scope.
Expand Down Expand Up @@ -214,8 +212,8 @@ Program Definition whisker_right {C D : Category} {F G : C ⟶ D} `(N : F ⟹ G)
{E : Category} (X : E ⟶ C) : F ◯ X ⟹ G ◯ X := {|
transform := λ x, N (X x);

naturality := λ _ _ _, naturality;
naturality_sym := λ _ _ _, naturality_sym
naturality := λ _ _ _, naturality _ _ _ _;
naturality_sym := λ _ _ _, naturality_sym _ _ _ _
|}.

Notation "N ⊲ F" := (whisker_right N F) (at level 10).
Expand Down
5 changes: 4 additions & 1 deletion check
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ git clean -dfx
nix-build --cores 4 . --argstr coqPackages coqPackages_8_14 > log_8_14.txt 2>&1 &
nix-build --cores 4 . --argstr coqPackages coqPackages_8_15 > log_8_15.txt 2>&1 &
nix-build --cores 4 . --argstr coqPackages coqPackages_8_16 > log_8_16.txt 2>&1 &
nix-build --cores 4 . --argstr coqPackages coqPackages_8_17 > log_8_17.txt 2>&1 &
nix-build --cores 4 . --argstr coqPackages coqPackages_8_18 > log_8_18.txt 2>&1 &
nix-build --cores 4 . --argstr coqPackages coqPackages_8_19 > log_8_19.txt 2>&1 &

docker run -t coqorg/coq:8.16 bash -c '
docker run -t coqorg/coq:dev bash -c '
git clone https://github.com/jwiegley/category-theory;
cd category-theory;
opam update;
Expand Down
2 changes: 1 addition & 1 deletion coq-category-theory.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ practical work.
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {(>= "8.14" & < "8.19~") | (= "dev")}
"coq" {(>= "8.14" & < "8.20~") | (= "dev")}
"coq-equations" {(>= "1.2" & < "1.4~") | (= "dev")}
]

Expand Down
19 changes: 13 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
args@{
rev ? "8b5ab8341e33322e5b66fb46ce23d724050f6606"
, sha256 ? "05ynih3wc7shg324p7icz21qx71ckivzdhkgf5xcvdz6a407v53h"
rev ? "90f456026d284c22b3e3497be980b2e47d0b28ac"
, sha256 ? "164lsq7xjjvpga6l6lfi9wfsnshgfxnpa8lvb2imscdwgmajakrc"

, pkgs ? import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
Expand Down Expand Up @@ -45,6 +45,11 @@ equations = coqPackages:
then {
rev = "v1.3-8.18";
sha256 = "sha256-8MZO9vWdr8wlAov0lBTYMnde0RuMyhaiM99zp7Zwfao=";
} else {}) //
(if coqPackages == "coqPackages_8_19"
then {
rev = "v1.3-8.19";
sha256 = "sha256-roBCWfAHDww2Z2JbV5yMI3+EOfIsv3WvxEcUbBiZBsk=";
} else {}));

phases = [
Expand All @@ -70,7 +75,7 @@ equations = coqPackages:
env = pkgs.buildEnv { inherit name; paths = buildInputs; };
passthru = {
compatibleCoqVersions = v:
builtins.elem v [ "8.14" "8.15" "8.16" "8.17" "8.18" ];
builtins.elem v [ "8.14" "8.15" "8.16" "8.17" "8.18" "8.19" ];
};
};

Expand All @@ -87,7 +92,8 @@ category-theory = coqPackages:
coq coq.ocaml coq.findlib (equations coqPackages)
] ++ pkgs.lib.optionals (coqPackages != "coqPackages_8_16" &&
coqPackages != "coqPackages_8_17" &&
coqPackages != "coqPackages_8_18") [
coqPackages != "coqPackages_8_18" &&
coqPackages != "coqPackages_8_19") [
dpdgraph
];
enableParallelBuilding = true;
Expand All @@ -105,7 +111,7 @@ category-theory = coqPackages:
env = pkgs.buildEnv { inherit name; paths = buildInputs; };
passthru = {
compatibleCoqVersions = v:
builtins.elem v [ "8.14" "8.15" "8.16" "8.17" "8.18" ];
builtins.elem v [ "8.14" "8.15" "8.16" "8.17" "8.18" "8.19" ];
};
};

Expand All @@ -116,5 +122,6 @@ in rec {
category-theory_8_16 = category-theory "coqPackages_8_16";
category-theory_8_17 = category-theory "coqPackages_8_17";
category-theory_8_18 = category-theory "coqPackages_8_18";
category-theory_cur = category-theory_8_18;
category-theory_8_19 = category-theory "coqPackages_8_19";
category-theory_cur = category-theory_8_19;
}

0 comments on commit 3bfc550

Please sign in to comment.