Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

feat(data/zmod): lemmas about totient and zmod#2158

Merged
mergify[bot] merged 8 commits intomasterfrom
pow_totient
Mar 20, 2020
Merged

feat(data/zmod): lemmas about totient and zmod#2158
mergify[bot] merged 8 commits intomasterfrom
pow_totient

Conversation

@ChrisHughes24
Copy link
Member

@ChrisHughes24 ChrisHughes24 commented Mar 15, 2020

The theorem pow_totient ended up in field_theory/finite, which is not quite right, since it's not about fields, but the imports were most appropriate there.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • reviewed and applied the documentation requirements
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@cipher1024
Copy link
Collaborator

Thanks for writing up the PR

left_inv := λ ⟨_, _, _, _⟩, units.ext (by simp),
right_inv := λ ⟨_, _⟩, by simp }

instance units.fintype {n : ℕ+} : fintype (units (zmod n)) :=
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be generalised? zmod n is a fintype, hence units is a fintype.

Copy link
Member Author

Choose a reason for hiding this comment

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

We are moving away from constructivism by defining things in that generality, but I'm okay with that.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'm certainly ok with that.
But I would expect that in a finite ring you can constructively build the fintype of units. Anyway, I don't really care.

Copy link
Member Author

Choose a reason for hiding this comment

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

With a decidable_eq assumption it can be made computable by just searching for the inverse, but this is getting towards pointless computability I think, where the most general algorithm is so slow it's kind of pointless, so I just made a noncomputable instance.

@jcommelin jcommelin added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Mar 19, 2020

instance decidable_eq : decidable_eq (zmodp p hp) := fin.decidable_eq _

instance (h : prime 2) : subsingleton (units (zmodp 2 h)) :=
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to provide a similar instance for units (zmod 2)?

@mergify mergify bot merged commit d12bbc0 into master Mar 20, 2020
@mergify mergify bot deleted the pow_totient branch March 20, 2020 01:36
cipher1024 pushed a commit that referenced this pull request Apr 20, 2020
* feat(data/zmod): lemmas about totient and zmod

* docstring

* Changes based on Johan's comments

* fix build

* subsingleton (units(zmod 2))

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
butterthebuddha pushed a commit to butterthebuddha/mathlib that referenced this pull request May 15, 2020
…2158)

* feat(data/zmod): lemmas about totient and zmod

* docstring

* Changes based on Johan's comments

* fix build

* subsingleton (units(zmod 2))

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
butterthebuddha pushed a commit to butterthebuddha/mathlib that referenced this pull request May 16, 2020
…2158)

* feat(data/zmod): lemmas about totient and zmod

* docstring

* Changes based on Johan's comments

* fix build

* subsingleton (units(zmod 2))

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants