feat(Algebra/DirectSum): equivalence between direct sum indexed by ι₁ and double sum indexed by ι₂ and fibres of f : ι₁ → ι₂#39607
Conversation
…_apply lemma 2. add …_of lemmas for both equivCongrLeft and equivCongrLeft' re 1: Mathematically, I don't see why one version should be preferred over the other, but the existing equivCongrLeft is more difficult to work with when the equivalence h : ι ≃ κ is naturally given in the opposite direction. (I could not avoid explicit type casts through the equality h.symm.symm = h when defining sigmaFiberEquiv in terms of equivCongrLeft.) Very unsure about the name of equivCongrLeft'. The name equivCongrLeft was chosen in analogy with Equiv.piCongrLeft. Equiv.piCongrRight looks very different.
…by a type ι₁ and the double sum indexed by a type ι₂ and the fibres of a map f : ι₁ → ι₂. Add two …_apply lemmas and an …_of lemma. Unsure about the naming of the two different …_apply lemmas; called them …_apply and …_apply' for now. The second (…_apply') cannot be a simp lemma as it would prevent the first (…_apply) from firing.
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 3a427c0baeImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
|
-awaiting-author |
| equivCongrLeft h (of β (h.symm k) x) = of (fun k ↦ β (h.symm k)) k x := by | ||
| exact DFinsupp.comapDomain'_single (⇑h.symm) h.right_inv _ _ |
There was a problem hiding this comment.
why are you doing by exact lemmaname and not just := lemmaname? (here and throughout)
| equivCongrLeft h (of β (h.symm k) x) = of (fun k ↦ β (h.symm k)) k x := by | |
| exact DFinsupp.comapDomain'_single (⇑h.symm) h.right_inv _ _ | |
| equivCongrLeft h (of β (h.symm k) x) = of (fun k ↦ β (h.symm k)) k x := | |
| DFinsupp.comapDomain'_single (⇑h.symm) h.right_inv _ _ |
There was a problem hiding this comment.
Only because I noticed this in other places in Mathlib. I get 800+ hits when searching for "by exact" in Mathlib, and I've just checked a few such occurrences at random to verify that they could be rephrased the way you suggest. And I don't see anything on this in the style guide.
Anyway, happy to switch from one to the other if you believe I should.
There was a problem hiding this comment.
I think sometimes (in other parts of the library maybe) there are reasons to do so, but here I see no reason to do so
There was a problem hiding this comment.
What about the proof of equivCongrLeft_apply right above? I did not write this. It uses by exact, even though that seems completely unnecessary. If I remove by exact from the proof of equivCongrLeft_of, should I also remove it from the proof of equivCongrLeft_apply?
There was a problem hiding this comment.
remove them from everywhere :)
There was a problem hiding this comment.
Indeed, by exact e should (preferrably) be avoided unless it's necessary. Note that by exact e and e are not identical: the former is a bit stronger and does some defeq-stuff.
However, I can't find anything about this in any convention, so before library-wide (automated) cleanups happen, it should probably be written down in the style guide.
|
-awaiting-author |
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
themathqueen
left a comment
There was a problem hiding this comment.
I think this is fine, thanks! Not entirely sure about the name sigmaFiberAddEquiv, but can't think of a better name, so I'll let someone else review this too.
joneugster
left a comment
There was a problem hiding this comment.
I see @themathqueen already did extensive reviewing, thanks! And thank you for the PR! I suggest,
maintainer merge
| equivCongrLeft h (of β (h.symm k) x) = of (fun k ↦ β (h.symm k)) k x := by | ||
| exact DFinsupp.comapDomain'_single (⇑h.symm) h.right_inv _ _ |
There was a problem hiding this comment.
Indeed, by exact e should (preferrably) be avoided unless it's necessary. Note that by exact e and e are not identical: the former is a bit stronger and does some defeq-stuff.
However, I can't find anything about this in any convention, so before library-wide (automated) cleanups happen, it should probably be written down in the style guide.
|
🚀 Pull request has been placed on the maintainer queue by joneugster. |
equivCongrLeft'ofequivCongrLeft, and corresponding…_applylemma.…_of lemmasfor bothequivCongrLeftandequivCongrLeft'.…of lemmaforsigmaCurry, i.e.sigmaCurry_of.sigmaFiberAddEquiv: the equivalence between a direct sum indexed by a typeι₁and the double sum indexed by a typeι₂and the fibres of a mapf : ι₁ → ι₂. Add two…_applylemmas and an…_oflemma.This is supposed to be a first step towards merging the draft PR #39356.
re 1: Mathematically, I don't see why one version should be preferred over the other, but I found the existing
equivCongrLeftmore difficult to work with when the equivalenceh : ι ≃ κis naturally given in the opposite direction. (I could not avoid explicit type casts through the equalityh.symm.symm = hwhen definingsigmaFiberAddEquivin terms ofequivCongrLeft.)Very unsure about the name of
equivCongrLeft'. (I see that the nameequivCongrLeftwas chosen in analogy withEquiv.piCongrLeft.Equiv.piCongrRightlooks very different, so presumablyequivCongrLeft'should not be calledequivCongrRight.)re 4: Very unsure about the naming of the two different
…_applylemmas; called them…_applyand…_apply'for now. The second (…_apply') cannot be asimplemma as it would prevent the first (…_apply) from firing.I've used Claude Opus for understanding error messages and git interaction, but everything is hand coded.