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: The descending factorial in ZMod #8465

Closed
wants to merge 5 commits into from

Conversation

mo271
Copy link
Collaborator

@mo271 mo271 commented Nov 17, 2023


Open in Gitpod

@mo271
Copy link
Collaborator Author

mo271 commented Nov 17, 2023

I think this proof would be much nicer using

cast_self_sub {n p : ℕ} (h : n ≤ p) : ((p - n) : ℕ) = - (n : ZMod p)

but I don't know where to put such a lemma best. See [question on zulip].(https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/cast.20from.20.60.E2.84.95.60.20to.20.60ZMod.20p.60.20after.20adding.20or.20subtracting.20p)

@alexjbest
Copy link
Member

We already have wilsons theorem somewhere right? Can this be used to simplify the proof there. Or move one version of that theorem to this file if indeed a new file is warranted. Or at least provide a link to wilson in the module doc if nothing else

@mo271
Copy link
Collaborator Author

mo271 commented Nov 24, 2023

We already have wilsons theorem somewhere right? Can this be used to simplify the proof there. Or move one version of that theorem to this file if indeed a new file is warranted. Or at least provide a link to wilson in the module doc if nothing else

I think, although a similar statement it has not too much to do with Wilson. When setting n := p - 1, the left hand side is indeed equal to what we see in Wilson, namley (p - 1)! : ZMod p, but the right hand side then simplifies to the same thing and not to -1.
Added a link to Wilson in any case.

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer merge

Mathlib/Data/ZMod/Factorial.lean Outdated Show resolved Hide resolved
Mathlib/Data/ZMod/Factorial.lean Outdated Show resolved Hide resolved
Copy link

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

1 similar comment
Copy link

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@YaelDillies YaelDillies changed the title feat: ZMod.descFactorial feat: The descending factorial in ZMod Dec 12, 2023
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

bors r+

Mathlib/Data/ZMod/Factorial.lean Show resolved Hide resolved
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Dec 12, 2023
mathlib-bors bot pushed a commit that referenced this pull request Dec 12, 2023
Co-authored-by: Moritz Firsching <firsching@google.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Dec 12, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: The descending factorial in ZMod [Merged by Bors] - feat: The descending factorial in ZMod Dec 12, 2023
@mathlib-bors mathlib-bors bot closed this Dec 12, 2023
@mathlib-bors mathlib-bors bot deleted the mo271/descFactorialZMod branch December 12, 2023 10:22
awueth pushed a commit that referenced this pull request Dec 19, 2023
Co-authored-by: Moritz Firsching <firsching@google.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants