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] - refactor(Mathlib/Algebra/ContinuedFractions/*): generalize determinant formula for continued fraction computation to simple continued fraction #13555

Closed
wants to merge 39 commits into from

Conversation

Komyyy
Copy link
Collaborator

@Komyyy Komyyy commented Jun 6, 2024

Determinant formula for continued fractions in Mathlib is specialized for continued fraction computation:

theorem GenContFract.determinant (not_terminated_at_n : ¬(of v).TerminatedAt n) :
    (of v).numerators n * (of v).denominators (n + 1) -
      (of v).denominators n * (of v).numerators (n + 1) = (-1) ^ (n + 1) :=
  determinant_aux <| Or.inr <| not_terminated_at_n

This formula can be generalized for arbitrary simple continued fractions, so we generalize:

theorem SimpContFract.determinant (not_terminatedAt_n : ¬(↑s : GenContFract K).TerminatedAt n) :
    (↑s : GenContFract K).nums n * (↑s : GenContFract K).dens (n + 1) -
      (↑s : GenContFract K).dens n * (↑s : GenContFract K).nums (n + 1) = (-1) ^ (n + 1)

Also, this PR renames Real.exists_genContFract_convs_eq_rat to Real.exists_convs_eq_rat which is forgotten to rename in #13210.


This PR consists Continued fractions makes an isomorphism between irrationals and baire space
project

Open in Gitpod

@Komyyy Komyyy added blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) awaiting-review awaiting-CI t-algebra Algebra (groups, rings, fields, etc) labels Jun 6, 2024
Copy link

github-actions bot commented Jun 7, 2024

Import summary

No significant changes to the import graph

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 7, 2024
@Komyyy Komyyy removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 7, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 19, 2024
@Komyyy Komyyy removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 2, 2024
@Komyyy Komyyy added WIP Work in progress and removed blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) awaiting-review labels Jul 4, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

@Komyyy Komyyy force-pushed the Komyyy/SCF.determinant branch from e1edb59 to bcf87c7 Compare July 4, 2024 04:09
@Komyyy Komyyy added awaiting-review awaiting-CI and removed WIP Work in progress labels Jul 4, 2024
@Komyyy Komyyy force-pushed the Komyyy/SCF.determinant branch from bcf87c7 to d4f93a1 Compare July 4, 2024 04:14
@kim-em
Copy link
Contributor

kim-em commented Jul 15, 2024

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Jul 15, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 15, 2024
…t formula for continued fraction computation to simple continued fraction (#13555)

Determinant formula for continued fractions in Mathlib is specialized for continued fraction computation:
```lean
theorem GenContFract.determinant (not_terminated_at_n : ¬(of v).TerminatedAt n) :
    (of v).numerators n * (of v).denominators (n + 1) -
      (of v).denominators n * (of v).numerators (n + 1) = (-1) ^ (n + 1) :=
  determinant_aux <| Or.inr <| not_terminated_at_n
```
This formula can be generalized for arbitrary simple continued fractions, so we generalize:
```lean
theorem SimpContFract.determinant (not_terminatedAt_n : ¬(↑s : GenContFract K).TerminatedAt n) :
    (↑s : GenContFract K).nums n * (↑s : GenContFract K).dens (n + 1) -
      (↑s : GenContFract K).dens n * (↑s : GenContFract K).nums (n + 1) = (-1) ^ (n + 1)
```

Also, this PR renames `Real.exists_genContFract_convs_eq_rat` to `Real.exists_convs_eq_rat` which is forgotten to rename in #13210.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 15, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Mathlib/Algebra/ContinuedFractions/*): generalize determinant formula for continued fraction computation to simple continued fraction [Merged by Bors] - refactor(Mathlib/Algebra/ContinuedFractions/*): generalize determinant formula for continued fraction computation to simple continued fraction Jul 15, 2024
@mathlib-bors mathlib-bors bot closed this Jul 15, 2024
@mathlib-bors mathlib-bors bot deleted the Komyyy/SCF.determinant branch July 15, 2024 22:23
@Ruben-VandeVelde
Copy link
Collaborator

Is there a reason we didn't add a deprecated alias for the renamed lemma?

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. t-algebra Algebra (groups, rings, fields, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants