Skip to content

feat(Relativity/LorentzAlgebra): add the rapidity-boost tangent at zero - #1852

Merged
jstoobysmith merged 2 commits into
leanprover-community:masterfrom
scottdhughes:feat/boost-tangent-20261018
Oct 21, 2026
Merged

jstoobysmith merged 2 commits into
leanprover-community:masterfrom
scottdhughes:feat/boost-tangent-20261018

Conversation

@scottdhughes

@scottdhughes scottdhughes commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Relate the existing finite boost to its named generator: for every i : Fin 3, the underlying matrix of LorentzGroup.boost i (Real.tanh r) (Real.abs_tanh_lt_one r) has derivative -lorentzAlgebra.boostGenerator i at r = 0, with no additional hypotheses. The negative sign follows the native boost's off-diagonal entries −γ(β)β.

Add two public lemmas:

  • In Physlib/Relativity/LorentzGroup/Boosts/Basic.lean, LorentzGroup.γ_tanh (r : ℝ): γ (Real.tanh r) = Real.cosh r, for every real rapidity without further hypotheses.
  • In Physlib/Relativity/LorentzAlgebra/Basis.lean, lorentzAlgebra.hasDerivAt_boost_tanh_zero: the ambient real matrix derivative above. The elementary cosh r * tanh r = sinh r calculation is a local have hcosh inside its proof.

Update both modules' documentation, including the boost sign convention, and remove their two entries from scripts/lint/exemptions/module_doc_no_lint.txt. Move the Artanh import to the gamma identity's module and remove two direct imports it makes redundant.

Reviewer map: inspect the native boost and generator signs, then the public gamma identity, then the componentwise derivative proof and documentation changes.

Validation against master 4ed4eb11f943324eaa0d4e5c85fb36a8b9a47922 (Lean 4.35.0, Mathlib 56a005855ea17e0b0958f73ec801ae140b0a1679): full Physlib/QuantumInfo and explicit PhyslibAlpha builds, all direct required checks, committed-state Python style, API-map and spelling checks pass. Native-only consumer probes compile eight examples; all 15 default declaration linters pass on both public additions. Their axiom reports contain only propext, Classical.choice and Quot.sound.

Baseline exceptions, reproduced on a separate pristine checkout at that master:

  • Optional style_lint exits 1 with the same four complete compiler-error blocks at lines 47, 50, 68 and 71 (Substring.Raw.findAllSubstr / stopPos).
  • redundant_imports exits 0 with exactly the same 39 advisory groups, with none added, removed or changed.
  • lint_all exits 0 but masks child failures; the direct results above are recorded separately.

The pristine comparison covers the default build, optional style, redundant imports and module documentation; the revision's remaining required checks were run directly. No Nanoda replay or hosted CI has been run for this revision.

Developed with OpenAI Codex assistance for proof development, implementation, documentation, validation and this description.

Relate the finite rapidity boost to the negative named boost generator
with hasDerivAt_boost_tanh_zero and two private hyperbolic identities.
Clarify the sign convention and check the module documentation normally
by removing its existing exemption.

Developed with assistance from OpenAI Codex.

AI-assisted-by: OpenAI Codex
@github-actions github-actions Bot added the small label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for this pull-request (PR). If this is your first PR, welcome to the community!

While you wait for a review, note that you can review PRs too; reviewing is not restricted to maintainers. Our review guidelines explain what to look for.

Over time, contributions such as reviews, maintenance and documentation are recorded on contributions.physlib.io.

Four main points:

  • Comment -awaiting-author on its own line to remove that label from your PR.
  • Comment blocked-by-PR or -blocked-by-PR on its own line to add or remove that label, respectively.
  • The first review might take several days to arrive. If in doubt message on the Zulip.

For the author: Please read

Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.

  1. Some automated checks will be run on your PR. You can see the results of these checks at the buttom of your PR page. If any of these checks fail, you will need to fix the issues before your PR can be merged. You can learn more about these here, including how to run them locally, which is sometimes quicker than relying on the GitHub Actions. If you have never had a PR merged before, you may have to wait for a reviewer to manually start these checks (this is for security).

  2. A reviewer will look at your PR and may ask you to make changes. This may happen a couple of days after you submit your PR, so you may need to be patient. But it should not be longer than that - if it is please bring it to the attention of the community on the Zulip. The level of review will depend on where your PR is submitted. If it is submitted to ./Physlib or ./QuantumInfo, the review will be more thorough than if it is submitted to ./PhyslibAlpha. You can find out more about what the review process is looking for in our review guidelines. If a reviewer adds an awaiting-author label to your PR, address the review comments, then please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

  3. The reviewer will either approve your PR, or request more changes (in which case we return to step 2). Once your PR is approved, it will be merged by a maintainer, this should happen shortly after approval, though you may get more comments at this stage.

Tip: The easiest way to get a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your changes.

If you have any problems or questions, please reach out to the community on the Zulip.

For reviewers: Summary of your PR

Found differences:
@@ Physlib.Relativity.LorentzAlgebra.Basis @@
! module modified Physlib.Relativity.LorentzAlgebra.Basis (+55 -14)
  namespaces lorentzAlgebra
+ added lemma hasDerivAt_boost_tanh_zero
@@ Physlib.Relativity.LorentzGroup.Boosts.Basic @@
! module modified Physlib.Relativity.LorentzGroup.Boosts.Basic (+37 -3)
  namespaces LorentzGroup
+ added lemma γ_tanh
@@ scripts/lint/exemptions/module_doc_no_lint.txt @@
! file modified scripts/lint/exemptions/module_doc_no_lint.txt (+0 -2)
5 differences

The declarations are found by reading the diff as text, without regard for namespaces, so a declaration whose keyword and name are on different lines is missed, and two declarations of the same name in different namespaces are listed as one. A change to a proof, or to the body of a definition, does not appear. See scripts/alpha/github/pr_summary.lean.

Summary of commit efe0917, remade whenever a commit is pushed.

@scottdhughes
scottdhughes marked this pull request as ready for review October 18, 2026 20:36
Copilot AI balanced review requested due to automatic review settings October 18, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

simpa only [LorentzGroup.γ, Real.artanh_tanh] using
(Real.cosh_artanh ⟨Real.neg_one_lt_tanh r, Real.tanh_lt_one r⟩).symm

private lemma cosh_mul_tanh (r : ℝ) :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we can get aay without this lemma, then I think we should include it in the proof of hasDerivAt_boost_tanh_zero


/-! ## C. Rapidity derivatives -/

private lemma gamma_tanh (r : ℝ) : LorentzGroup.γ (Real.tanh r) = Real.cosh r := by

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be near the definition of LorentzGroup.γ and made non-private, as it seems an important result

Comment on lines +177 to +181
lemma hasDerivAt_boost_tanh_zero (i : Fin 3) :
HasDerivAt
(fun r : ℝ =>
(LorentzGroup.boost i (Real.tanh r) (Real.abs_tanh_lt_one r)).1)
(-boostGenerator i) 0 := by

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would try and put as much of this on one line as possible to clean up the text

@jstoobysmith

Copy link
Copy Markdown
Member

awaiting-author

@github-actions github-actions Bot added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 19, 2026
Make LorentzGroup.γ_tanh public beside γ in Boosts.Basic. Keep the
cosh/tanh calculation local to hasDerivAt_boost_tanh_zero and compact
its unchanged statement. Update Boosts.Basic module documentation,
remove its documentation exemption, and drop redundant imports.

Developed with assistance from OpenAI Codex.

AI-assisted-by: OpenAI Codex
@github-actions github-actions Bot added medium and removed small labels Oct 20, 2026
@scottdhughes

Copy link
Copy Markdown
Contributor Author

-awaiting-author
t-relativity

@github-actions github-actions Bot added t-relativity Relativity and removed awaiting-author A reviewer has asked the author a question or requested changes labels Oct 20, 2026

@jstoobysmith jstoobysmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved. Will merge now

@jstoobysmith jstoobysmith added the ready-to-merge This PR is approved and will be merged shortly label Oct 21, 2026
@jstoobysmith
jstoobysmith added this pull request to the merge queue Oct 21, 2026
Merged via the queue into leanprover-community:master with commit cdbc936 Oct 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium ready-to-merge This PR is approved and will be merged shortly t-relativity Relativity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants