Repository navigation
feat(Algebra/Group/Submonoid): type class to indicate that supremum in a SubmonoidClass agrees with supremum of submonoids - #39687
Conversation
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 592d5f3468Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
…tes a loop. Add simp attribute to iSup_toSubmonoid.
|
Hi @TentativeConvert , From my current understanding, the idea of this PR could be generalize to any |
|
I've now linked |
|
I'm sure this can be generalized in many different directions. I was intentionally trying to spell out only the bare minimum I need in order to move on with #39356. Whether this is an elegant approach is an entire different question, and I'd be happy for thoughts on this. |
|
-awaiting-author |
e8f4ad4 to
592d5f3
Compare
Vierkantor
left a comment
There was a problem hiding this comment.
Thanks for the PR! Could you write some more to show that this is indeed the right way to do things? Namely, the following seem to be important drawbacks:
- The coercion from one subobject type to another is usually custom, e.g.
Subgroup.toSubmonoid, which needs a rewrite to turn intoofClass. - We'd need a new class for every subobject, not just
SubmonoidClass. - Defining a whole class needs quite a bit of work.
What kind of alternatives have you considered or tried out? For example, a very simple approach would be to pass around the hypothesis ∀ (s : Set S), ofClass (sSup s) = sSup (ofClass '' s) explicitly, instead of using typeclasses.
This is not a definitive no, please do try to convince me :)
| @@ -0,0 +1,55 @@ | |||
| /- | |||
| Copyright (c) 2024 Joe Cool. All rights reserved. | |||
There was a problem hiding this comment.
Please don't forget to update the author info. Maybe also the year, or did you already start working on this a while ago? :)
| Copyright (c) 2024 Joe Cool. All rights reserved. | |
| Copyright (c) 2026 Marcus Zibrowius. All rights reserved. |
| [SupSet S] [IsConcreteSSup S M] | ||
| {ι : Sort*} (ℳ : ι → S) : | ||
| ofClass (⨆ i, ℳ i) = ⨆ i, ofClass (ℳ i) := by | ||
| rw [iSup,IsConcreteSSup.sSup_toSubmonoid,←Set.range_comp] |
There was a problem hiding this comment.
A bit pedantic:
| rw [iSup,IsConcreteSSup.sSup_toSubmonoid,←Set.range_comp] | |
| rw [iSup, IsConcreteSSup.sSup_toSubmonoid, ← Set.range_comp] |
|
|
||
| open Submonoid | ||
|
|
||
| @[to_additive, simp] |
There was a problem hiding this comment.
If you add the attribute like this, it also gets applied to the to_additive copy.
| @[to_additive, simp] | |
| @[to_additive (attr := simp)] |
| [AddSubmonoidClass S M] [SupSet S] : Prop where | ||
| sSup_toAddSubmonoid (s : Set S) : ofClass (sSup s) = sSup (ofClass '' s) | ||
|
|
||
| attribute [to_additive existing] SubmonoidClass.IsConcreteSSup |
There was a problem hiding this comment.
Let's also make the sSup lemma @[simp], like iSup is too:
| attribute [to_additive existing] SubmonoidClass.IsConcreteSSup | |
| attribute [to_additive existing] SubmonoidClass.IsConcreteSSup | |
| attribute [simp] | |
| SubmonoidClass.IsConcreteSSup.sSup_toSubmonoid | |
| AddSubmonoidClass.IsConcreteSSup.sSup_toAddSubmonoid | |
|
IMO the concept is a good idea, but as discussed in the Zulips linked in the thread above (#mathlib4 > Abstracting the substructure lattice construction and #mathlib4 > More `IsConcrete` classes for `SetLike`) and in similar PRs, this should be defined using I think this should be marked dependent on #42661, to first land |
|
As mentioned in that PR, the PR to depend on is instead #43726 |
Add a type class
SubmonoidClass.IsConcreteSSupto indicate that the canonical map.ofClassfrom a classSof submonoids ofMtoSubmonoid Mpreserves suprema.This PR implements the minimal type class assumption needed to make „pushfoward of gradings along maps of indexing sets“ – see draft PR #39356 – work in some
SetLikegenerality.Given
{S M : Type*} [SetLike S M] [Monoid M] [SubmonoidClass S M], we have canonical mapsThe first is
Submonoid.ofClass, the second and the composition arecoemaps coming from theSetLikestructures. Depending onS, these maps may or may not satisfy various properties with respect the lattice structures onSubmonoid MandSet M. Mathlib so far includes the type class[IsConcreteLE S M], which asserts that the compositionS → Set Mis order-preserving and order-reflecting. The type class defined here asserts that the first map,S → Submonoid M, preserves suprema.In examples such as
S = Subgroup M,S = Submodule R M, much more is true – in these cases,Sis a complete sublattice ofSubmonoid M. But there are also examples where only the weaker property defined here holds, e.g.S = OpenSubgroup Mfor a topological groupM.Zulip discussion thead about this PR
Note on
outParam: I did not write(M : outParam Type*)in the assumptions ofSubmonoidClass.IsConcreteSSupin accordance with the DocString ofSetlike. However, we do have(B : outParam Type*)in the definition ofIsConcreteLE, so perhaps I'm misinterpreting the DocString.