-
Notifications
You must be signed in to change notification settings - Fork 185
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
Colimit library #850
Colimit library #850
Conversation
The file CommutativeSquares.v and a part of the file Diagram.v are from the [hott-limits library](https://github.com/peterlefanulumsdaine/hott-limits/) by Jeremy Avigad, Krzysztof Kapulkin, Peter LeFanu Lumsdaine.
Looks like travis timed out? I wouldn't block on funext or the lack of comments, but I still think we should keep the library ASCII as much as possible. Would you mind doing a search-and-replace? |
Oh, and thanks!! |
Thanks, LGTM once Travis can be fixed. I'm not sure what the problem is; could it be just that the library is now honestly taking too long to compile? Could you attach a timing report? |
Here it is: time-of-build-both.log |
theories/HIT/Colimits/Coequalizer.v
Outdated
Require Import Colimits.Diagram Colimits.Colimit. | ||
Generalizable All Variables. | ||
|
||
Context `{Funext}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should wrap this development in a section. What you are doing here is declaring a Funext
axiom, which is not what we want.
theories/HIT/Colimits/Colimit.v
Outdated
Local Open Scope path_scope. | ||
Generalizable All Variables. | ||
|
||
Context `{Funext}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inside a section, preferably after the record definition and the Arguments
commands, which should stay at top-level
theories/HIT/Colimits/Colimit.v
Outdated
Definition path_cocone {C1 C2: cocone D X} | ||
(eq1 : forall i, C1 i == C2 i) | ||
(eq2 : forall i j g x, qq C1 i j g x @ eq1 i x = eq1 j (D _f g x) @ qq C2 i j g x) | ||
: C1 = C2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: I think we generally add Proof.
after Definition
and Lemma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seconded.
theories/HIT/Colimits/Colimit.v
Outdated
Defined. | ||
|
||
Definition postcompose_cocone (C: cocone D X) {Y: Type} | ||
: (X -> Y) -> cocone D Y. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also Proof.
here
theories/HIT/Colimits/Colimit.v
Outdated
:= Build_cocone colim pp. | ||
|
||
Lemma is_universal_colimit {G: graph} (D: diagram G) | ||
: is_universal (cocone_colimit D). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Lemma
theories/HIT/Colimits/Pushout.v
Outdated
(* We show here that the pushout defined as a colimit *) | ||
(* is equivalent to the pushout defined as a primitive HIT. *) | ||
Section is_PO_pushout. | ||
Require Import Types.Sum HIT.Pushout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Require
inside Section
is unsupported, I think
theories/Types/Paths.v
Outdated
Defined. | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: any reason for this whitespace change?
theories/Types/Paths.v
Outdated
Defined. | ||
|
||
Definition equiv_moveL_transport_V {A : Type} (P : A -> Type) {x y : A} | ||
(p : x = y) (u : P x) (v : P y) | ||
: transport P p u = v <~> u = transport P p^ v | ||
:= BuildEquiv _ _ (moveL_transport_V P p u v) _. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why the extra newline?
theories/Types/Paths.v
Outdated
Defined. | ||
|
||
Definition equiv_moveL_transport_p {A : Type} (P : A -> Type) {x y : A} | ||
(p : y = x) (u : P x) (v : P y) | ||
: transport P p^ u = v <~> u = transport P p v | ||
:= BuildEquiv _ _ (moveL_transport_p P p u v) _. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Why the extra newline?
theories/Types/Sigma.v
Outdated
Proof. | ||
destruct p, q; reflexivity. | ||
Defined. | ||
(* Remark: this is also equals to: *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "equal to" not "equals to"
Regarding travis: the log suggests that the issue is proviola. Comparing the occurrences of "Travis keep-alive spew" to a normal build suggests that it's fine all the way up through running |
theories/Basics/Overture.v
Outdated
@@ -775,6 +775,22 @@ Ltac by_extensionality x := | |||
simpl; auto with path_hints | |||
end. | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tactics should be commented so that people can use them even if they don't know how to write tactics themselves.
theories/HIT/Colimits/Coequalizer.v
Outdated
|
||
(* ***************** *) | ||
(* ***** Coeq ****** *) | ||
(* ***************** *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of these comments? If you are trying to visually serparate parts of the development, please use the coqdoc sectioning mechanism so that the generated documentation will look reasonable.
theories/HIT/Colimits/Colimit.v
Outdated
Coercion q : cocone >-> Funclass. | ||
|
||
|
||
(** *** Definition of colimits *** *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use coqdoc sectioning instead. The documentation says: "Sections are introduced by 1 to 4 leading stars (i.e. at the beginning of the line) followed by a space. One star is a section, two stars a sub-section, etc. The section title is given on the remaining of the line." So this should be something like:
(** ** Definitions of colimits *)
theories/HIT/Colimits/Colimit.v
Outdated
|
||
|
||
(** *** Existence of colimits *** *) | ||
(** The existence is given by an HIT. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above, please use coqdoc sectioning.
theories/HIT/Colimits/Colimit.v
Outdated
|
||
Arguments colim {G D} i x. | ||
|
||
Axiom pp : forall {G: graph} {D: diagram G} (i j: G) (f : G i j) (x: D i), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is pp
really the best possible name here?
theories/HIT/Colimits/Colimit.v
Outdated
intros i j h x; simpl; hott_simpl. apply ap_compose. | ||
Defined. | ||
|
||
(* precompose *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to request lots of good comments, but I'll already be happy with some good comments that help the reader understand what is what. This particular one is not of that kind :-)
theories/HIT/Colimits/Colimit.v
Outdated
f_ap. exact (eisretr (postcompose_cocone HQ1) _)^. | ||
Defined. | ||
|
||
(** Here we prove than two equivalent diagrams have equivalent colimits. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All we ever do in Coq files is proving, no need to emphasize that. So I would say simply "Two equivalent diagrams have equivalent colimits."
Many thanks for your contribution. I would suggest (see also my comments in the code):
|
I did not have the time to look at this very carefully. |
: sigma_diag (fun _ : A => D) ~d~ prod_diag. | ||
Proof. | ||
unshelve econstructor. | ||
- serapply Build_diagram_map; cbn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is `serapply supported already. I do not find it here:
https://coq.inria.fr/refman/tactic-index.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added in the HoTT library: PR #829.
I don't think than it is planed that Coq have such a tactic. Do you have heard something about that?
I had a quick look. It looks like you've made the requested changes. Thanks! |
Yes! I only hope there is not too many spelling errors in the comments ... |
Thanks. Fine with me.
…On Mon, Feb 13, 2017 at 4:19 PM, SimonBoulier ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In theories/HIT/Colimits/Colimit_Prod.v
<#850>:
> simple refine (Build_diagram _ _ _).
exact (fun i => A * (D i)).
simpl; intros i j f x. exact (fst x, D _f f (snd x)).
Defined.
- Definition diagram_map_prod_sigma
- : diagram_map (sigma_diag (fun _ : A => D)) prod_diag.
- simple refine (Build_diagram_map _ _).
- exact (fun i x => (x.1, x.2)).
- reflexivity.
+ Definition diagram_equiv_prod_sigma
+ : sigma_diag (fun _ : A => D) ~d~ prod_diag.
+ Proof.
+ unshelve econstructor.
+ - serapply Build_diagram_map; cbn.
It was added in the HoTT library: PR #829
<#829>.
I don't think than it is planed that Coq have such a tactic. Do you have
heard something about that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#850>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAM2zlThbexdV2YShFvvNel4n-SGFLf1ks5rcHSAgaJpZM4Lq1UK>
.
|
Regarding the time out bug. I can reproduce it on my computer: |
The problem for proviola was with Anyway, it' ok for me for merging. |
If I understand correctly, Travis is now happy? Excellent. Many thanks for the PR. That's one pair of eyes from me. |
I'll let @JasonGross pull this, as I am not sure of the proviola part. It looks good from my perspective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let Travis be the arbiter of proviola. LGTM modulo adding Proof
and either picking more descriptive names where I mentioned, or making those things Local Definition
. Thanks!
|
||
(** We define here the graph ∫D, also denoted G·D *) | ||
|
||
Definition integral : graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
|
||
(** Given a dependent diagram, we can recover a diagram over G by considering the Σ types. *) | ||
|
||
Definition sigma_diagram : diagram G. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
theories/HIT/Colimits/Flattening.v
Outdated
|
||
(** Now, given an equifibered diagram and using univalence, one can define a type family [E' : colimit D -> Type] by recusrion on the colimit. *) | ||
|
||
Definition E' : colimit D -> Type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With such a short name as E'
, you should make this Local Definition
so that the unqualified name never gets exported. (You may also want Local Definition
for the other things that were Let
s; that's up to you.)
theories/HIT/Colimits/Flattening.v
Outdated
Context (A0 : A -> Type) (B0 : B -> Type) (C0 : C -> Type) | ||
(f0 : forall x, A0 x <~> B0 (f x)) (g0 : forall x, A0 x <~> C0 (g x)). | ||
|
||
Definition P : PO f g -> Type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Local Definition
here, or pick a more descriptive name.
theories/HIT/Colimits/Flattening.v
Outdated
etransitivity. symmetry. apply f0. apply g0. | ||
Defined. | ||
|
||
Definition E : dep_diagram (span f g). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
, and make this Local Definition
or pick a more descriptive name.
theories/HIT/Colimits/Flattening.v
Outdated
exact (fun y => p # (g0 x y)). | ||
Defined. | ||
|
||
Definition HE : equifibered _ E. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Proof.
after Definition
, and make this Local Definition
, or pick a more descriptive name.
Thanks for your attention @JasonGross, I missed this file (for the Proof.). And I didn't know about |
Anything blocking? |
Hi everyone,
This PR add the colimit library as described in #845.
Please feel free to comment.
Here are some debatable points on which I could work if you think they prevent merging:
funext
(I find it very convenient, but could be removed if you don't like it.)≃
which is utf8