Flattening lemma for colimits#36
Conversation
Co-authored-by: Dan Christensen <jdc+github@uwo.ca>
Colimit: generalize functor_Colimit_homotopy
Add flattening and characterize path spaces through descent
|
|
||
| Context `{Univalence}. | ||
|
|
||
| (** Descent data over [f g : B -> A] is an "equifibrant" or "cartesian" type family [cd_fam : A -> Type]. This means that if [b : B], then the fibers [cd_fam (f b)] and [cd_fam (g b)] are equivalent, witnessed by [cd_e]. *) |
There was a problem hiding this comment.
The comments all need updating.
| rhs nrapply concat_p1. | ||
| lhs nrapply ap_sig_rec_path_sigma. | ||
| lhs nrapply (ap (fun x => _ (ap10 x _) @ _)). | ||
| { nrapply Colimit_ind_beta_colimp. } |
There was a problem hiding this comment.
| { nrapply Colimit_ind_beta_colimp. } | |
| 1: nrapply Colimit_ind_beta_colimp. |
I prefer 1: tactic. to { tactic } when it is a single tactic.
| { lhs nrapply (1 @@ concat_pp_p _ _ _). | ||
| lhs nrapply (1 @@ concat_pp_p _ _ _). | ||
| lhs nrapply concat_V_pp. | ||
| lhs nrapply (1 @@ concat_pp_p _ _ _). | ||
| lhs nrapply (1 @@ (1 @@ (1 @@ (ap _ (concat_p1 _))))). | ||
| nrapply (1 @@ (1 @@ concat_pV_p _ _)). } | ||
| nrapply concat_V_pp. |
There was a problem hiding this comment.
Here I think bullets would be better. In general, I'd only use braces when you need to avoid the bullets getting too deep, which is rare.
| rapply (eissect (cold_e _ _ _)). | ||
| * snrapply (@colimp _ diagram_coldescent i j g (di; cold_e Pe g di pdg)). | ||
| - snrapply Colimit_rec. | ||
| + snrapply Build_Cocone. |
There was a problem hiding this comment.
The + bullet isn't needed, since there is only one goal.
| { nrapply colimp. } | ||
| { lhs nrapply transport_fam_coldescent_colimp. | ||
| nrapply eisretr. } |
There was a problem hiding this comment.
These should use bullets. (I've just given some examples, and you can apply the same ideas elsewhere.)
| { nrapply (ap (path_sigma' _ _)). | ||
| exact (1 @@ (eisadj _ _)). } |
There was a problem hiding this comment.
I think this is a good use of braces. A temporary hole was produced that takes two tactics to fill. If you used bullets each time you had a step like this, the indentation would keep growing. And if you use 1:, then you need to chain the tactics with ; which makes it harder to step through.
Note: one set of parentheses can be removed on the last line.
| (transport_fam_coldescent_colimp _ _ _ x)) _)^. | ||
| Defined. (** This is slow. <0.2s *) | ||
|
|
||
| End Flattening. (** <0.15s *) |
There was a problem hiding this comment.
Include the word "slow" at each of these spots to make them easy to search for.
|
This is great. The slow lines aren't too bad, but here are some ideas that might (or might not) help if you want to speed them up: I think there's not much you can do about slow closing of Sections, except to remove the Section. In one case, the section is long and provides enough benefit that I don't think it's worth removing it. But in one other case, there are only a couple of results in the section, so the context could be repeated. If you do this, time the build of the whole file to see if things improve. Sometimes the slowness can just move somewhere else. Slow Defined lines are also tricky. Almost always it comes down to definitional equalities needing to be computed in order for type checking to go through. Some ideas:
Here's a replacement for Axiom proof_admitted : False.
Tactic Notation "admit" := abstract case proof_admitted. |
|
Can you rebase the last two commits on the latest master, now that the functor colimit material is merged? (Rebasing avoids merge commits giving a cleaner history.) |
|
@ThomatoTomato What's the status of this? (We can discuss at our next meeting if that's easier.) |
|
I have been ignoring this for sometime, let us talk about it at our next meeting. I will have a look at your comments and try to find subresults to generalize before that. I don't know how possible that is, since the proof of flattening is very streamlined from the recipe that you gave me. Anyways, the most important thing to do before considering a serious commit is to remove duplicate code. |
|
@ThomatoTomato Is this still something you are planning to finish? |
|
I have not been thinking about this for a while, but I think it is good to finish this once I've dealt with the other PR in my backlog. |
We reprove the flattening lemma for colimits using descent. This particular method has the perk of being the same method as used for graph quotients, coequalizers, and pushouts. A lot of the proofs involved in the flattening lemma simplifies a lot, and become completely analogous to the other three cases. The only major difference appears first after we're done with proving all the necessary lemmata, and we're proving the flattening lemma.
This approach suffers from some of the same slowness problems as the first proof. The functions are in general a lot faster, but more parts are acting slowly.
With this approach we also get a characterization of path spaces of colimits basicly for free, using Kraus-von Raumer.
There are still a couple of cleanups that can be done. I think there are some overlap with the Descent section and some files in the Diagrams subdirectory.
(This work is done on an old version of some of the files found here. Consider only the parts after descent, as that are the only relevant parts.)