-
Notifications
You must be signed in to change notification settings - Fork 199
associativity of ideal product #2121
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
associativity of ideal product #2121
Conversation
@jdchristensen I managed to carry out the opposite argument you suggested, but it required a lot of refactoring in Ideal. Namely, exploding the Section IdealLemmas which is probably for the best. While the diff is big, it might be a good time to perform some more style changes like changing Lemma to Definition. |
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 started reviewing this, but the change to the indentation made it impossible to see what changed later on in the file, as github got quite confused with the diff it displayed. It's better if large indentation changes can be moved to a separate commit. Maybe you can force push to fix this, replacing just the last commit? (I think the comments I already made should still be visible and understandable after this.)
10c5bf5
to
5f3d2b5
Compare
You're totally right about the diff being hard to read. I've gone ahead and separated that out. Sorry about that. I'll get to your other review suggestions later. |
I pushed three commits. The first two I think are clear benefits. And The third commit is the thing I wrote a comment about. Feel free to revert if you think it is not worth it. Or maybe with the new approach to the assertion, it's not worth using opposite rings here? I do think opposite rings help with ideals in other parts of the file, so that's great. Can you find more places where this helps? I have to run and won't have time to look at this for a while, but hopefully you'll be able to use some of these ideas to clean things up further. |
5cd0c10
to
0e1eb12
Compare
@jdchristensen I've added some material on predicates of types. This generalises all the subset material we had in |
6d987b7
to
ea40cc9
Compare
ea40cc9
to
a063840
Compare
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've carefully looked at Classes.v and Predicate.v, but not at the rest of the PR. I'm about to push a lot of changes involving those two files, so I thought I should pause my review here and see if you like the changes. I broke the changes into small commits, and the library builds after each commit, so you can read them independently.
Feel free to push ahead with this, I won't be able to take a look until the weekend. |
I just pushed a few more changes. I still want to think a bit more about this, hopefully tomorrow. |
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've finished my review and don't plan to push any more changes. There are still a number of comments, but none of them are very important, so some could be handled by just adding TODO items to the file.
A couple more I noticed: ideal_subset_extension_preimage
could be simplified with a _rec
lemma for ideal_generated
. And subgroup_left_ideal_quotient
is really the statement that an arbitrary intersection of subgroups is a subgroup, which could be proved in Subgroup.v and then used here. (Each I (_ * x)
is a subgroup since (_ * x)
is a group homomorphism, and we intersect these over all x
satisfying J x
.)
0feccd5
to
70d7977
Compare
<!-- ps-id: 43ff35d0-6f6a-46c5-94b5-479411cf915c --> Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
We show that the opposite of product ideals is the opposite of the reverse product. This allows us to deduplicate the argument occuring in ideal_product_assoc. Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
c63ed81
to
b22fab3
Compare
Signed-off-by: Ali Caglayan <[email protected]>
@jdchristensen This is ready for another round of review. |
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Both of these facts should be proved in general, and then used in these two places. (Or maybe both of these results can then be dropped, as you can just directly form the left ideal as the intersection.) |
@jdchristensen Good observation. I will try to do that today. |
Signed-off-by: Ali Caglayan <[email protected]>
This is not so straightforward due to the truncation. I can show that |
@jdchristensen I didn't manage to find a nice way to generalise it for the reasons I mentioned before. Did you want to have a go too or should we just merge this now? |
If we have exact (fun r => merely (forall x : sig J, subgroup_preimage (grp_homo_rng_left_mult r) I x.1)). Here An alternative is to use the same predicate we currently have, but then use Definition subgroup_leftideal_quotient {R : Ring} (I : Subgroup R) (J : R -> Type)
: Subgroup R.
Proof.
snapply Build_Subgroup.
1: exact (fun r => merely (forall x, J x -> subgroup_preimage (grp_homo_rng_left_mult r) I x)).
snapply issubgroup_equiv.
- exact (fun r => merely (forall (x : sig J), subgroup_preimage (grp_homo_rng_left_mult r) I x.1)).
- intro r.
apply ReflectiveSubuniverse.equiv_O_functor. (* Need to add an import. *)
symmetry.
napply equiv_sig_ind.
- (* Remaining goal: use that intersections of subgroups are subgroups. *)
Admitted. (This just shows that it is possible. But probably we want to have a general proof that an intersection of ideals is an ideal, and use that, so this result wouldn't appear in this form.) |
Another option, which ties in to things I've been suggesting about subgroups, is to allow subgroups to be defined by non-hprop-predicates. We'd probably need two kinds of subgroups. Maybe the kind I'm talking about could be called "presubgroups". Then we would have a result that says that if |
I like the idea of showing it is equivalent to an uncurried version. I won't be able to finish it tonight, but that's probably the direction we should go in. I had some stuff on showing intersections are subgroups and ideals that I wrote today, so its just going to require some more time. |
@Alizter It would be nice to get this last step finished, as it would be handy to have this in the library. (E.g. Predicate.v will be useful.) |
@jdchristensen I sank too much time into trying to fix the Rocq master build last week. I am not sure when I will have enough time to look at this again. In the meantime, if you feel like pushing ahead with this, I don't mind. |
I merged with master. No conflicts and no changes required. I'll see if I can simplify those last two results. |
The first of the two recent commits introduces intersections of families of subgroups, and uses that to simplify I also experimented with simply defining I haven't looked over the rest of this PR recently, but I think this was the only remaining thing I had asked about, so I think we can merge this if you agree, @Alizter . |
LGTM, thanks for taking this on @jdchristensen. Feel free to merge. Let's not worry about the failures on master for now. |
Very belatedly, https://github.blog/news-insights/product-news/ignore-white-space-in-code-review/ might help with such issues |
This was left as a TODO so I did a quick proof for it. It's possible it can be simplified.
Edit: This PR started as a simple lemma, but I've since hijacked it to do a big cleanup of
Subgroup
andIdeal
. Notably, we introduceBasics/Predicate.v
.