feat(Mathematics): add Physlib/Mathematics/GoldenRatio.lean#1122
Open
gHashTag wants to merge 2 commits into
Open
feat(Mathematics): add Physlib/Mathematics/GoldenRatio.lean#1122gHashTag wants to merge 2 commits into
gHashTag wants to merge 2 commits into
Conversation
Adds a thin Physlib-namespace wrapper around mathlib's Mathlib.NumberTheory.Real.GoldenRatio plus physics-flavoured derived identities that mathlib does not state. 33 declarations (31 theorems + 2 abbrevs), 0 sorry, 0 axiom. Contributed by gHashTag/trinity-s3ai Wave 7, W7.3. https://github.com/gHashTag/trinity-s3ai
zhikaip
reviewed
May 23, 2026
| /-! ## Section 1: `Physlib`-level shortcuts -/ | ||
|
|
||
| /-- The golden ratio `φ := (1 + √5) / 2`. Re-export of `Real.goldenRatio`. -/ | ||
| abbrev phi : ℝ := Real.goldenRatio |
Collaborator
There was a problem hiding this comment.
I don't think this is a good idea, there are many uses of phi throughout physics (most notably as a phase, or as a potential) and dedicating it to golden ratio doesn't seem right to me. Maybe you could use local notation here for Real.goldenRatio, and add the API directly around that?
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.
Summary
This PR adds
Physlib/Mathematics/GoldenRatio.lean, a Lean 4 module that provides aPhyslib-namespace wrapper around Mathlib'sMathlib.NumberTheory.Real.GoldenRatio, extended with physics-flavoured derived identities that Mathlib does not state.Motivation
The constant φ = (1 + √5)/2 appears throughout physics:
Mathlib already proves the purely algebraic facts (golden equation, positivity, irrationality, Binet's formula). Physlib downstream code needs both a namespace shortcut and a handful of derived results.
Contents
phi,psi(abbrevs)phi_sq,phi_pos,phi_ne_zero,one_lt_phi,phi_lt_two,psi_neg,psi_ne_zero,psi_sq,phi_psi_sum,phi_psi_prod,phi_inv_eq_neg_psi,psi_inv_eq_neg_phiphi_inv_pos,phi_inv_lt_one,phi_continued_fraction(φ = 1 + 1/φ),phi_two_cos_pi_div_five(φ = 2 cos π/5),phi_quadratic,psi_quadratic,phi_psi_vietaphi_lower_bound,phi_upper_bound,phi_bounds(1.6 < φ < 1.7)phi_pow_three,phi_pow_four,phi_pow_five(Fibonacci-coefficient pattern)phi_irrational,psi_irrational(re-export)Total: 226 lines, 33 declarations (31 theorems + 2 abbrevs), 0 sorry, 0 axiom.
Aggregator
Added
public import Physlib.Mathematics.GoldenRatiotoPhyslib.leanalphabetically betweenGeometry.Metric.Riemannian.DefsandInnerProductSpace.Adjoint.Lean / Mathlib version
leanprover/lean4:v4.29.1lakefile.lean)Origin
Contributed by the trinity-s3ai project, Wave 7 task W7.3. All proofs use standard Mathlib tactics (
linarith,ring,nlinarith,norm_num,Real.sqrt_lt_sqrt,Real.cos_pi_div_five).Co-authored-by: gHashTag uniwatisit79@gmail.com