Repository navigation
Formalize Stern–Brocot depth via continued-fraction coefficient sum - #542
Merged
leanfrontier-receiver[bot] merged 1 commit intoOct 21, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Theorem
For every Boolean path into the Stern–Brocot tree, the sum of the regular continued-fraction coefficients of its represented positive rational is exactly the number of path edges plus one:
This quantifies the classical correspondence between the depth of a Stern–Brocot rational and the total size of the quotients in its Euclidean/continued-fraction expansion. The empty-root convention and the leading zero for fractions less than one are handled uniformly.
Mathematical integration
The proof substantively consumes accepted LeanFrontier infrastructure:
pathQuotients_eq_runLengthEncode: the terminal Euclidean quotient is the final maximal run length plus one;expandRuns_runLengthEncode: the encoded runs expand exactly to the original path;regularCoefficients_runs: the correct regular continued-fraction coefficients, including the initial-zero convention;There is only one public theorem entrypoint. Three small technical lemmas are
private; the submission adds no redundant alternative path encoding and does not depend on other unmerged pull requests.Files and provenance
Exactly two new files; no modifications to accepted or trusted files:
LeanFrontier/NumberTheory/SternBrocot/ContinuedFractionDepth.leanSubmissions/stern-brocot-continued-fraction-depth.jsonThe user asked GPT-6 to autonomously find and formalize another target; all formal Lean statements and proofs were independently produced by GPT-6. The pinned Mathlib version is
v4.35.0.Trusted validation
The exact source and claim blobs passed the fork's full receiver on the previous upstream head:
accepted: true,diagnostics: []Because upstream's automation advanced
mainagain while the receiver was running, this branch has been reparented onto the latest main commit without changing either submission file. Please use this upstream PR's checks for independent acceptance against the new base.