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

feat(archive/100-theorems-list): perfect numbers (nr 70) #3094

Closed
wants to merge 17 commits into from

Conversation

awainverse
Copy link
Collaborator

@awainverse awainverse commented Jun 17, 2020

Defining perfect numbers, proving the Euclid-Euler theorem (Theorem 70)


Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Perfect.20Numbers/near/201098280

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.

Some general comments on style (to make the code in mathlib look uniform):
A typical lemma is formatted as

lemma some_name (h : hypothesis) :
  statement indented by 2 spaces :=
begin
  split, -- inside begin..end indent by 2
  { tactic1,
    tactic2 }, -- closing brace on same line as last tactic
  { etc }
end

@bryangingechen bryangingechen added the awaiting-author A reviewer has asked the author a question or requested changes label Jun 17, 2020
@awainverse
Copy link
Collaborator Author

I made fundamental changes to the proof, in a new version which lives in src/multiplicity_vectors.lean and archive/100-theorems-list/pnat_perfect.lean. I have some other ideas (with sorries) not actually necessary for this proof at src/divisibility_lattice.lean.

I think I'm basically happy with the approach in pnat_perfect.lean, so I will mark as resolved any comments that are resolved in that file, and will eventually replace the original file if people agree it's as good.

I'd also like advice on how to break up this PR and where to put the contents of multiplicity_vectors.lean.

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.

A first set of comments.

src/multiplicity_vectors.lean Outdated Show resolved Hide resolved
variable {α : Type}

instance finsupp.has_inf :
has_inf (α →₀ ℕ) :=
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that we want this to be the global has_inf instance for finsupps. I guess you can replace nat with a certain type of lattice X and deduce some other lattice structure for \a →\0 X.
I haven't checked how much of this is already done in the library.

section pnat_facts

@[simp]
lemma pnat.eq_iff {m n : ℕ+} :
Copy link
Member

Choose a reason for hiding this comment

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

There should already be a pnat.coe_inj or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is pnat.eq, but I rewrite the other way several times, and feed it into simp.


end prime_powers

section pnat_facts
Copy link
Member

Choose a reason for hiding this comment

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

This section looks really good to me. It can be PRd to data/pnat/*.
I think all of it can go in xgcd.lean in that directory, but if you find better places, go ahead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
archive/100-theorems-list/pnat_perfect.lean Outdated Show resolved Hide resolved
@jcommelin
Copy link
Member

@awainverse Small tip: if you are done with a review comment, please click "resolve conversation" to mark it as done. That way others can quickly see what's done and what needs attention.

@sgouezel
Copy link
Collaborator

sgouezel commented Jul 7, 2020

If this is ready for review, can you change the label "changes requested" to "request review"? Otherwise, can you say what remains to be done on your side?

@awainverse awainverse added blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jul 7, 2020
@awainverse awainverse changed the title feat(archive/100-theorems-list): perfect numbers (nr 70) feat(archive/100-theorems-list): perfect numbers (nr 70) (deps #3291) Jul 7, 2020
@bryangingechen
Copy link
Collaborator

What's the status of this PR now? #3291 was closed without being merged. Is there another (future) PR that this depends on?

@awainverse awainverse added WIP Work in progress and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Aug 25, 2020
@awainverse
Copy link
Collaborator Author

I've marked this as WIP. I'm working on refactoring unique factorization in general, and I think that'll make factorization for nats nicer, allowing me to make this proof very clean. I can close the PR or revisit it and try to make it work without the new API if you think that'd be better.

@awainverse awainverse changed the title feat(archive/100-theorems-list): perfect numbers (nr 70) (deps #3291) feat(archive/100-theorems-list): perfect numbers (nr 70) Aug 25, 2020
@bryangingechen
Copy link
Collaborator

Thanks for the update! I'm happy to leave this open until the new API is ready.

@jcommelin
Copy link
Member

@awainverse What's the status now? It's not clear to me whether you want to resurrect this PR, or want to build a new one...

@awainverse awainverse closed this Sep 13, 2020
@awainverse awainverse deleted the freek-70 branch October 22, 2020 19:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants