Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Alizter
Copy link
Collaborator

@Alizter Alizter commented Oct 10, 2024

This was left as a TODO so I did a quick proof for it. It's possible it can be simplified.

@Alizter Alizter requested a review from jdchristensen October 20, 2024 17:15
@Alizter
Copy link
Collaborator Author

Alizter commented Nov 7, 2024

@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.

Copy link
Collaborator

@jdchristensen jdchristensen left a 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.)

theories/Algebra/Rings/Ideal.v Outdated Show resolved Hide resolved
theories/Algebra/Rings/Ideal.v Outdated Show resolved Hide resolved
Comment on lines +185 to +186
(** We define the subset relation on ideals in the usual way: *)
Definition ideal_subset {R : Ring} (I J : Subgroup R) := (forall x, I x -> J x).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is about Subgroups, not Ideals, it should go in Groups/Subgroup.v. Same with reflexivity, transitivity and antisymmetry. But really, this is just about any predicates on any type, so maybe it just belongs in Types/Forall or Basics/Overture or something like that?

Comment on lines +208 to +209
Definition isleftideal_eq {R : Ring} (I J : Subgroup R) (p : ideal_eq I J)
: IsLeftIdeal I -> IsLeftIdeal J.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be strengthened: If I is an ideal, and J is any predicate on R which is pointwise logically equivalent to I, then J is a subgroup and an ideal.

Copy link
Collaborator Author

@Alizter Alizter Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just the composition of two results then? Any J logically equivalent to a subgroup I is also a subgroup, furthermore also an ideal when I is one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But we may as well state the stronger version if we generalize these predicate comparisons to any predicates on any types.

Signed-off-by: Ali Caglayan <[email protected]>

<!-- ps-id: 43ff35d0-6f6a-46c5-94b5-479411cf915c -->
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]>
@Alizter Alizter force-pushed the ps/rr/associativity_of_ideal_product branch from 10c5bf5 to 5f3d2b5 Compare November 18, 2024 11:51
@Alizter
Copy link
Collaborator Author

Alizter commented Nov 18, 2024

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.

Signed-off-by: Ali Caglayan <[email protected]>
Comment on lines 972 to 978
apply ideal_product_op.
nrapply (ideal_product_subset_pres_l (R:=rng_op R)).
1: rapply ideal_product_op.
apply f.
apply (ideal_product_op (R:=rng_op R)).
nrapply (ideal_product_subset_pres_l (R:=R)).
1: rapply (ideal_product_op (R:=rng_op R)).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using opposite rings didn't really save many lines here. (Moreover, with another change I'm going to suggest, the proof of the first case will become a lot shorter, making the use of opposite rings even less efficient here.) This part can be made a bit cleaner using a helper definition:

Definition ideal_product_op_triple {R : Ring} (I J K : Ideal R)
  : ideal_op R ((K ⋅ J) ⋅ I)
      ⊆ (ideal_op R I) ⋅ ((ideal_op R J) ⋅ (ideal_op R K)).
Proof.
  intros x i.
  apply (ideal_product_op (R:=rng_op R)).
  nrapply (ideal_product_subset_pres_l (R:=R)).
  1: nrapply (ideal_product_op (R:=rng_op R)).
  apply i.
Defined.

Then this proof can become:

    apply (ideal_product_op_triple (R:=rng_op R) I J K).
    nrapply f.
    apply ideal_product_op_triple.

(That helper definition is one-sided, though, so it's not a perfect solution. Maybe using transitivity of ideal_eq (or its generalization to predicates on any type) could make it symmetrical?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll just push this along with my other idea to see what you think.

@jdchristensen
Copy link
Collaborator

I pushed three commits. The first two I think are clear benefits. And subgroup_generated_subset_subgroup can be used in other places in Ideal.v and probably in other places in Subgroup.v or maybe elsewhere. Look for places using ideal_in_zero and ideal_in_plus_negate.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants