feat(Algebra): graded heterogeneous multiplication#6678
feat(Algebra): graded heterogeneous multiplication#6678
Conversation
eric-wieser
left a comment
There was a problem hiding this comment.
I have two main concerns with this PR:
- The design does not follow the existing design of the heterogenous version,
GradedMonoid.GSmul - Heterogenous scalar multiplication
HSMulis dangerously prone to diamonds, more so than regular scalar multiplication. I'm afraid I don't have the example to hand right now.
| /-- The condition that graded heterogeneous multiplications are associative. -/ | ||
| class IsAssocGradedHMul : Prop where | ||
| /-- The associativity condition on graded heterogeneous multiplications. -/ | ||
| γhmul_assoc : ∀ ⦃a b c : M⦄ (α : X a) (β : Y b) (γ : Z c) (ab bc abc : M) | ||
| (hab : a + b = ab) (hbc : b + c = bc) (habc : ab + c = abc), | ||
| (α •[hab] β) •[habc] γ = | ||
| α •[show a + bc = abc by rw [← hbc, ← add_assoc, hab, habc]] (β •[hbc] γ) |
There was a problem hiding this comment.
This is essentially option 6 from https://link.springer.com/chapter/10.1007/978-3-031-16681-5_8#Sec4, which we ultimately rejected for the homogenous version.
Note that this typeclass is effectively the GradedMonoid.GMulAction in master, at least when Y = Z.
I really need three different graded objects (not just 1 or 2), and for my main purposes (composition of cochains in the Hom complex between two cochain complexes |
To be clear, my claim is mostly "we should not have both designs in mathlib simultaneously", and not necessarily "the current design is better than this one". If you feel the currently design makes things hard, then presumably it makes things hard for the existing algebraic uses too. |
|
The current design seems to be more focused on the situation where we have a ring, which happens to have an internal decomposition into homogeneous components. For the applications I am considering (certain types of cochains, Ext-groups), it does not seem to me that the current API would enable me to conveniently consider the multiplication as a map Indeed, when the degrees are related to categorical constructions, replacing Would you consider changing the definition of |
This was indeed the original motivation, but it also works for graded monoids, taking the approach of bundling the index into a sigma type to avoid having to deal with dependent types.
Do you have a specific hunk of this PR in mind that I could compare to?
Note that I could make the same claim in the other direction, by defining your |
There is not much to compare because it would be a comparison between a proof of https://github.com/leanprover-community/mathlib4/pull/6379/files#diff-bdcce763b9b5b027315a99b7d248b577247fb39d8c4eca5106845cce8ea4bdafR615 and a sorry. The proof builds on definitions/lemmas like https://github.com/leanprover-community/mathlib4/pull/6379/files#diff-bdcce763b9b5b027315a99b7d248b577247fb39d8c4eca5106845cce8ea4bdafR306-R309 (the key point is that the assumption
Of course, we can use The suggestion I made would not be detrimental to the current API, and at the same time it would enable other uses. I certainly do not want to go to the sigma type: I want to be able to state equalities of cochains (e.g. associativity of the composition) as an equality of two cochains of a certain degree, certainly not just as an equality in a larger type. |
|
In #6701 I define the cochains I have been mentioning above and their composition, which would be an example of "graded heterogeneous multiplication". |
|
Using |
This PR introduces the notion of graded heterogeneous multiplication.