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(continued_fractions) add equivalence of convergents computations #2459

Closed
wants to merge 10 commits into from

Conversation

kappelmann
Copy link
Collaborator

@kappelmann kappelmann commented Apr 19, 2020

What

Add lemmas showing that the two methods for computing the convergents of a continued fraction (recurrence relation vs direct evaluation) coincide. A high-level overview on how the proof works is given in the header of the file.

Why

One wants to be able to relate both computations. The recurrence relation can be faster to compute, the direct evaluation is more intuitive and might be easier for some proofs.

How

The proof of the equivalence is by induction. To make the induction work, one needs to "squash" a sequence into a shorter one while maintaining the value of the convergents computations. Most lemmas in this commit deal with this squashing operation.

TO CONTRIBUTORS:

Please include a summary of the changes made in this PR above "TO CONTRIBUTORS:", as that text will become the commit message. You are also encouraged to append the following co-authorship template if you'd like to acknowledge suggestions / commits made by other users:

Co-authored-by: name name@example.com

Make sure you have:

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

For reviewers: code review check list

If you're confused by comments on your PR like bors r+ or bors d+, please see our notes on bors for information on our merging workflow.

Copy link
Collaborator

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

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

Just some typos and style nitpicks.

src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
@semorrison semorrison added the awaiting-author A reviewer has asked the author a question or requested changes label Apr 21, 2020
@kappelmann
Copy link
Collaborator Author

Just some typos and style nitpicks.

Thanks! Sorry for the typos D: I should get a spellchecker.

@urkud urkud 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 Apr 22, 2020
docs/references.bib Outdated Show resolved Hide resolved
Copy link
Collaborator

@sgouezel sgouezel left a comment

Choose a reason for hiding this comment

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

The Lean looks great (as you can see, I only have minor formatting comments).

What would be extremely helpful, I think, would be to have a sketch of the proof at the beginning of the file, in informal math talk and without details or computations (but pointers to the relevant lemmas in the file), and maybe also recall what the two definitions of convergents and convergents' are, to help the reader understand where the file is going.

From a math point of view, I would probably have done things using a formalism based on matrix products and homographies instead of the more elementary point of view that you develop, but in the end it is also nice like this.

src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
@sgouezel sgouezel 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 Apr 23, 2020
@sgouezel
Copy link
Collaborator

Also, you should change the header text of the PR to reflect the changes you have made (for instance, you have removed private but it still shows up in the header). Indeed, this header will become the commit message.

kappelmann and others added 2 commits April 25, 2020 18:55
Co-Authored-By: sgouezel <sebastien.gouezel@univ-rennes1.fr>
@kappelmann
Copy link
Collaborator Author

Also, you should change the header text of the PR to reflect the changes you have made (for instance, you have removed private but it still shows up in the header). Indeed, this header will become the commit message.

Also fixed this. Thanks for the kind and detailled review :)

Copy link
Collaborator

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM!

src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
src/algebra/continued_fractions/convergents_equiv.lean Outdated Show resolved Hide resolved
@bryangingechen bryangingechen removed the awaiting-author A reviewer has asked the author a question or requested changes label Apr 25, 2020
@bryangingechen
Copy link
Collaborator

bors r+

@github-actions github-actions bot 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 Apr 25, 2020
bors bot pushed a commit that referenced this pull request Apr 25, 2020
…#2459)

### What
Add lemmas showing that the two methods for computing the convergents of a continued fraction (recurrence relation vs direct evaluation) coincide. A high-level overview on how the proof works is given in the header of the file. 

### Why
One wants to be able to relate both computations. The recurrence relation can be faster to compute, the direct evaluation is more intuitive and might be easier for some proofs.

### How
The proof of the equivalence is by induction. To make the induction work, one needs to "squash" a sequence into a shorter one while maintaining the value of the convergents computations. Most lemmas in this commit deal with this squashing operation.



Co-authored-by: Kevin Kappelmann <kappelmann@users.noreply.github.com>
@bors
Copy link

bors bot commented Apr 25, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(continued_fractions) add equivalence of convergents computations [Merged by Bors] - feat(continued_fractions) add equivalence of convergents computations Apr 25, 2020
@bors bors bot closed this Apr 25, 2020
@bors bors bot deleted the kappelmann_cf_convergents_equiv branch April 25, 2020 19:55
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…leanprover-community#2459)

### What
Add lemmas showing that the two methods for computing the convergents of a continued fraction (recurrence relation vs direct evaluation) coincide. A high-level overview on how the proof works is given in the header of the file. 

### Why
One wants to be able to relate both computations. The recurrence relation can be faster to compute, the direct evaluation is more intuitive and might be easier for some proofs.

### How
The proof of the equivalence is by induction. To make the induction work, one needs to "squash" a sequence into a shorter one while maintaining the value of the convergents computations. Most lemmas in this commit deal with this squashing operation.



Co-authored-by: Kevin Kappelmann <kappelmann@users.noreply.github.com>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
…leanprover-community#2459)

### What
Add lemmas showing that the two methods for computing the convergents of a continued fraction (recurrence relation vs direct evaluation) coincide. A high-level overview on how the proof works is given in the header of the file. 

### Why
One wants to be able to relate both computations. The recurrence relation can be faster to compute, the direct evaluation is more intuitive and might be easier for some proofs.

### How
The proof of the equivalence is by induction. To make the induction work, one needs to "squash" a sequence into a shorter one while maintaining the value of the convergents computations. Most lemmas in this commit deal with this squashing operation.



Co-authored-by: Kevin Kappelmann <kappelmann@users.noreply.github.com>
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
…leanprover-community#2459)

### What
Add lemmas showing that the two methods for computing the convergents of a continued fraction (recurrence relation vs direct evaluation) coincide. A high-level overview on how the proof works is given in the header of the file. 

### Why
One wants to be able to relate both computations. The recurrence relation can be faster to compute, the direct evaluation is more intuitive and might be easier for some proofs.

### How
The proof of the equivalence is by induction. To make the induction work, one needs to "squash" a sequence into a shorter one while maintaining the value of the convergents computations. Most lemmas in this commit deal with this squashing operation.



Co-authored-by: Kevin Kappelmann <kappelmann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

None yet

5 participants