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

[Merged by Bors] - feat: compute Monoid.exponent as the lcm over pi types and Prod #8066

Closed
wants to merge 5 commits into from

Conversation

j-loreaux
Copy link
Collaborator


Open in Gitpod

@j-loreaux j-loreaux added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) labels Oct 31, 2023
Comment on lines 396 to 398
theorem Monoid.exponent_pi_zero {ι : Type*} {M : ι → Type*} [∀ i, Monoid (M i)] {j : ι}
(hj : exponent (M j) = 0) : exponent ((i : ι) → M i) = 0 := by
rw [@exponent_eq_zero_iff, ExponentExists] at hj ⊢
Copy link
Member

Choose a reason for hiding this comment

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

Is this true as an Iff with an existential?

Copy link
Member

Choose a reason for hiding this comment

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

(and is the Prod version too, with an or?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: the version I provided here does not assume Fintype ι as Monoid.exponent_pi does. Without that, the does not hold (consider the product Π n, ZMod n for instance).

With the Fintype ι condition, then yes, it's true, but it follows immediately from Finset.lcm_eq_zero_iff, and I would expect users to use that if they want this result. Similarly, the prod version holds, but follows immediately from lcm_eq_zero_iff (once I switch from Nat.lcm to lcm, which I just realized I should have done).

So, these are the lemmas, but I propose not including them:

@[to_additive]
lemma Monoid.exponent_pi_zero_iff {ι : Type*} [Fintype ι] {M : ι → Type*} [∀ i, Monoid (M i)] :
    exponent ((i : ι) → M i) = 0 ↔ ∃ i, exponent (M i) = 0 := by
  rw [Monoid.exponent_pi, Finset.lcm_eq_zero_iff]
  simp

@[to_additive]
theorem Monoid.exponent_prod_zero_iff {M₁ M₂ : Type*} [Monoid M₁] [Monoid M₂] :
    exponent (M₁ × M₂) = 0 ↔ (exponent M₁ = 0) ∨ (exponent M₂ = 0) := by
  rw [exponent_prod, lcm_eq_zero_iff]

@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Nov 1, 2023
@j-loreaux j-loreaux added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Nov 1, 2023
@eric-wieser
Copy link
Member

bors d+

Copy link

bors bot commented Nov 1, 2023

✌️ j-loreaux can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated and removed awaiting-review The author would like community review of the PR labels Nov 1, 2023
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@j-loreaux
Copy link
Collaborator Author

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Nov 1, 2023
bors bot pushed a commit that referenced this pull request Nov 1, 2023
Copy link

bors bot commented Nov 1, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: compute Monoid.exponent as the lcm over pi types and Prod [Merged by Bors] - feat: compute Monoid.exponent as the lcm over pi types and Prod Nov 1, 2023
@bors bors bot closed this Nov 1, 2023
@bors bors bot deleted the j-loreaux/Monoid.exponent_pi_prod branch November 1, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants