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
[Merged by Bors] - feat(algebra/homology): redesign of homological complexes #7473
Conversation
Deprecates #7375. This only has part of the content from that PR, but extensively updated. The remainder of that content, and much more, is coming in subsequent PRs! |
Co-authored-by: Johan Commelin <johan@commelin.net>
🎉 Great news! Looks like all the dependencies have been resolved:
💡 To add or remove a dependency please update this issue/PR description. Brought to you by Dependent Issues (:robot: ). Happy coding! |
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.
Thanks a lot for this massive refactor!
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.
Just a few comments for now, but I'll try to come back to this in the next couple of days.
|
||
variables (X₀ X₁ X₂ : V) (d₀ : X₁ ⟶ X₀) (d₁ : X₂ ⟶ X₁) (s : d₁ ≫ d₀ = 0) | ||
(succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ ⟶ X₀) (d₁ : X₂ ⟶ X₁), d₁ ≫ d₀ = 0), | ||
Σ' (X₃ : V) (d₂ : X₃ ⟶ t.2.2.1), d₂ ≫ t.2.2.2.2.1 = 0) |
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 t.2.2.2.2.1
makes me think it might be better to just use mk_struct
instead of the flat version. Is there any benefit to using a sigma 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.
@adamtopaz I don't have sufficient overview, but I feel like Scott need sigma types heavily for construction projective resolutions etc...
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 didn't want mk_struct
to become part of the public API, but rather to stay hidden as an implementation detail of chain_complex.mk
.
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.
Just a few more minor comments, but otherwise LGTM!
Thanks 🎉 bors merge |
This is a complete redesign of our library on homological complexes and homology. This PR replaces the current definition of `chain_complex` which had proved cumbersome to work with. The fundamental change is that chain complexes are now indexed by a type equipped with a `complex_shape`, rather than by a monoid. A `complex_shape ι` contains a relation `r`, with the intent that we will only allow a differential `X i ⟶ X j` when `r i j`. This allows, for example, complexes indexed either by `nat` or `int`, with differentials going either up or down. We set up the initial theory without referring to "successors" and "predecessors" in the type `ι`, to ensure we can avoid dependent type theory hell issues involving arithmetic in the index of a chain group. We achieve this by having a chain complex consist of morphisms `d i j : X i ⟶ X j` for all `i j`, but with an additional axiom saying this map is zero unless `r i j`. This means we can easily talk about, e.g., morphisms from `X (i - 1 + 1)` to `X (i + 1)` when we need to. However after not too long we also set up `option` valued `next` and `prev` functions which make an arbitrary choice of such successors and predecessors if they exist. Using these, we define morphisms `d_to j`, which lands in `X j`, and has source either `X i` for some `r i j`, or the zero object if these isn't such an `i`. These morphisms are very convenient when working "at the edge of a complex", e.g. when indexing by `nat`. Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Johan Commelin <johan@commelin.net>
Pull request successfully merged into master. Build succeeded: |
This is a complete redesign of our library on homological complexes and homology.
This PR replaces the current definition of
chain_complex
which had proved cumbersome to work with.The fundamental change is that chain complexes are now indexed by a type equipped with a
complex_shape
, rather than by a monoid. Acomplex_shape ι
contains a relationr
, with the intent that we will only allow a differentialX i ⟶ X j
whenr i j
. This allows, for example, complexes indexed either bynat
orint
, with differentials going either up or down.We set up the initial theory without referring to "successors" and "predecessors" in the type
ι
, to ensure we can avoid dependent type theory hell issues involving arithmetic in the index of a chain group. We achieve this by having a chain complex consist of morphismsd i j : X i ⟶ X j
for alli j
, but with an additional axiom saying this map is zero unlessr i j
. This means we can easily talk about, e.g., morphisms fromX (i - 1 + 1)
toX (i + 1)
when we need to.However after not too long we also set up
option
valuednext
andprev
functions which make an arbitrary choice of such successors and predecessors if they exist. Using these, we define morphismsd_to j
, which lands inX j
, and has source eitherX i
for somer i j
, or the zero object if these isn't such ani
. These morphisms are very convenient when working "at the edge of a complex", e.g. when indexing bynat
.