Classify short exact sequences by maps of Eilenberg-Mac Lane spaces#2369
Classify short exact sequences by maps of Eilenberg-Mac Lane spaces#2369CharlesCNorton wants to merge 11 commits into
Conversation
|
It's great to see this! I'll wait until you ping me before looking at the details, but feel free to ask me any questions. I've marked this as a draft for now, since you said that there is still more to come. I took a quick look a ClassifyingSpace.v, but nothing else yet.
I'm not sure what you mean by "component-level half" and "global equivalence". |
ed3b07e to
b3c2a65
Compare
40be009 to
1f130d6
Compare
|
@jdchristensen - I've removed the higher Ext development (§2.4–2.7); this PR is now just the §2.2 classification by Eilenberg-Mac Lane spaces. Is that worth landing on its own or would you still like for me to break it up? We're at ~2000 lines |
|
Forgot to remove LoopGroup.v - now removed. 👍 |
This is a pretty good thing to target, since it's a part of that material that is specifically about abelian groups. (One can then deduce smallness for Ext of R-modules, but not for a general abelian category.) I think it's still too big, but I think it might be reasonable to review everything in this PR except for the large, new file Classification.v. That file is ~1100 lines, and the other changes are ~700 lines. Since it's easy to ignore one file, and that file provides context, I think it's ok to leave the PR as it is for now. After review, we could merge the 700 lines, and then start a separate PR for the big file. At that point I might ask you to break up the big file, but let's leave that until we get there. So far I just skimmed through a few parts and made some comments about various things. A careful review is going to take a while, and hopefully I'll get some help from others: @jarlg @Alizter @ThomatoTomato . |
|
|
||
| Section ClassifyingSpace. | ||
|
|
||
| Local Set Polymorphic Inductive Cumulativity. |
There was a problem hiding this comment.
Can you annotate the universes for the HIT so that its clear the behaviour you gain by setting this. I'm having some trouble working out why its necessary.
There was a problem hiding this comment.
I'm not sure it changes the universes for the HIT. The point is supposed to be that it makes WildCat machinery work when groups are in different universes. I think there should be a comment at this spot in the file explaining this more precisely. (Or maybe pointing to another spot, where there is a comment saying "This line is an example of a place that uses that ClassifyingSpace is a cumulative inductive.")
There was a problem hiding this comment.
Is the slowness related to this PR? If not, this could be raised in a separate issue. But even so, it would be good to give timing info showing everything that is changed by this PR. I'll post a top-level comment with some instructions.
|
I have a feeling (and only a feeling) that the proofs in pFiber.v can be simplified in a way that will make them easier to reason about in later lemmas. I didn't have enough time to do this, but I suspect if we explicitly lay out the equivalence in some steps, it might help with reasoning about the homotopies in the naturality lemmas. I've ran out of time to have a look, but its really encouraging to see such progress in the library. I hope I can find some more time in the future to have a closer look. |
|
One more thing worth mentioning is that we really need to add some infra to the library to help LLMs navigate proofs. I have been using Claude to read and try some things out, but obviously there is still a gap between what I can do and what it is able to do. The way I did this was make a simple python wrapper around rocq-lsp and told Claude to use that to inspect the proofs in the file. That seemed to give it a better understanding of how to use tactics, but the setup was very adhoc and fragile. rocq-lsp has very rich information such as per-line timings, which can indicate when a proof is "bad". It would be good to invest some time so that we have a sturdy setup and we can let some LLMs in loops try different things out quickly and efficiently, and generally codify some implicit knowledge we have in proof writing. |
Is this better than using https://github.com/LLM4Rocq/rocq-mcp ? I've only tried this a bit. |
|
@CharlesCNorton, it would be good to measure the timing of all the files that get rebuilt by this PR. I have included a dump of various methods of timing below, and probably the most relevant part for you is the part about @Alizter , should I put this info somewhere on the repo website? It would be great if some part of this could be done by the CI, e.g. when triggered by an appropriate message here like happens for Rocq. (It would also be nice if most of this could be done using dune instead of make. E.g. dune's cache could make some of the set-up much faster.) [Edit: fixed incorrect tag of Ali.] Timing: It's important to have an idle machine, so stop other processes, including browsers. Timing also is affected by thermal issues on some machines (particularly laptops). One could consider using a ram disk, but I don't do so. It may help to be on A/C power, depending on the machine. Unless said otherwise, all of the commands should be run from the top-level repo dir, above the theories dir.
It's often better to get per file timing, as it's easier to see changes that way. The coq-scripts repo can help with this. For some reason, it needs to be within the repo you are timing. I clone it into the top-level dir of the HoTT repo. See coq-scripts/timing/README.md for documentation. Currently, most fine-grained timing tests have to be done using
|
There was a problem hiding this comment.
Pull request overview
This PR adds a full classification result for short exact sequences of abelian groups via pointed maps between Eilenberg–Mac Lane spaces (Christensen–Flaten Thm 2.2.2), and extends the homotopical infrastructure needed to state/prove it in the HoTT Coq library.
Changes:
- Introduces
Algebra/AbSES/Classification.v, constructing the classifying mapAbSES B A -> (K(B,2) ->* K(A,3)), its inverse via fibers, both round trips, the resulting equivalence, essential smallness ofAbSES/Ext, and naturality. - Adds functoriality for
K(-,n)(em_fmap) and supporting lemmas (identity/composition, connectivity/equivalence/naturality) plus a delooping equivalence on certain EM mapping types. - Strengthens exact-sequence and pointed-fiber infrastructure (naturality/rotation of connecting maps, and supporting lemmas about surjectivity/connectedness/fiber algebra).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| theories/Truncations/Connectedness.v | Adds a lemma showing maps from merely inhabited types into 0-connected types are surjective. |
| theories/Pointed/pFiber.v | Extends fiber/loops infrastructure with beta + naturality lemmas for pfiber2_loops. |
| theories/Homotopy/ExactSequence.v | Adds naturality/rotation results for connecting maps, built on new pfiber2_loops naturality. |
| theories/Homotopy/EMSpace.v | Adds em_fmap functoriality for K(-,n) and delooping-related mapping-type equivalences/lemmas. |
| theories/Homotopy/ClassifyingSpace.v | Adds contractibility and connectivity results for B G under group-level hypotheses. |
| theories/Algebra/AbSES/Classification.v | New classification theorem file connecting AbSES to EM-space mapping types, plus smallness + naturality. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@CharlesCNorton I think we've only scratched the surface, but the comments so far will probably cause enough changes that it would be best to handle them before we review any further. |
Add theories/Algebra/Rings/ZBezout.v: integer absolute value and its multiplicativity, the integral-domain instance for cring_Z, the lift of NatBezout to an integer Bézout combination, and the IsBezoutDomain instance. Move rng_divides_plus from FreeModule.v to Bezout.v.
A house-style cleanup over the higher-Ext and rings development. Imports trimmed to what each file uses: - AbInjective.v: drop Modalities.ReflectiveSubuniverse. - Classification.v: drop AbHom. - HigherExtMorphism.v: drop Truncations.Core and AbHom. - HigherExtResolution.v: drop WildCat.Core. - LoopGroup.v: drop AbGroups.Biproduct. - FinitelyPresented.v: drop Types, WildCat.Core, AbGroups.AbelianGroup. - ZBezout.v: drop WildCat.Core, AbGroups.AbelianGroup, AbGroups.Z. Dead definitions removed: - HigherExt.v: ab_biprod_trivial_r. - HigherExtResolution.v: abses_ext_vanish_two, subsumed by abses_ext_vanish_resolution. - FreeModule.v: the unused span layer sm_gen_type, submodule_generated, submodule_generated_in, submodule_generated_rec, and isfreemodule_image_from_contr. - ZBezout.v: rng_divides_neg_r, rng_divides_neg_l, rng_divides_int_abs_l, nat_divides_of_rng_divides. Lemmas relocated to their proper files: - int_abs and its lemmas (int_abs_of_nat, int_abs_neg, int_abs_decomp, int_abs_of_nat_mul, int_abs_mul) move from ZBezout.v to Spaces/Int.v. - nat_mul_is_zero moves from ZBezout.v to Spaces/Nat/Core.v. - rng_divides_negate_r is generalized from cring_Z to any CRing and added to Rings/Bezout.v beside rng_divides_plus; ZBezout.v uses it. Other: - Eliminate the znat synonym, together with znat_mul and znat_add; int_bezout_nat and int_abs_to_var are now stated over Int and int_of_nat directly.
The remaining changes classify short exact sequences by pointed maps of Eilenberg-Mac Lane spaces, in Classification.v and LoopGroup.v, with supporting changes to EMSpace.v, ExactSequence.v, ClassifyingSpace.v, pFiber.v and Connectedness.v.
Reduce the file headers to the title and the result, and trim the multi-sentence docstrings in Classification.v to a single statement each.
The classification in Classification.v does not depend on LoopGroup.v (the computation of Pi 1 (AbSES B A) and the path components as classifying spaces), so it is removed from this PR.
42cbc0b to
777f889
Compare
- Remove line breaks from the added comments (STYLE.md). - Move contr_pi_succ_istrunc from EMSpace.v to HomotopyGroup.v. - Generalize pmap_punit_pconst to a contractible codomain (phomotopy_pconst_contr); drop the local copy in EMSpace.v.
Register K(-,n) as an Is0Functor, Is1Functor and IsPointedFunctor from abelian groups to pointed types, with em_fmap as the action on morphisms. em_fmap_const now follows from fmap_zero_morphism and pequiv_em_fmap from emap, removing their bespoke proofs.
Also rewrite the isequiv_em_fmap proof using lhs'/rhs'.
|
Timing of the files rebuilt by this PR vs the base, from |
Short exact sequences of abelian groups are classified by pointed maps of Eilenberg-Mac Lane spaces:
This is Theorem 2.2.2 of Christensen and Flaten, "Ext groups in homotopy type theory". It follows that
AbSES B AandExt B Aare essentially small.New file
Algebra/AbSES/Classification.v: the classifying map of a short exact sequence (the connecting map ofK(-,3)applied to it), its inverse built from the fibre of a pointed map, the two round trips, the resulting equivalence, smallness ofAbSESandExt, and naturality of the classifying map in both variables.Supporting changes
Homotopy/EMSpace.v: functoriality ofK(-,n)(em_fmap), with its identity, composition, connectivity and equivalence lemmas; the delooping equivalence on mapping types; and that every(n-1)-connectedn-type isK(Pi n, n).Homotopy/ExactSequence.v: naturality and rotation of the connecting map.Homotopy/ClassifyingSpace.v,Pointed/pFiber.v,Truncations/Connectedness.v: supporting lemmas.