Skip to content

feat(Cosmology/FLRW): define Hubble constant H₀ and present Hubble radius - #2169

Open
cthierfelder wants to merge 2 commits into
leanprover-community:masterfrom
cthierfelder:flrw-present-hubble-constant
Open

cthierfelder wants to merge 2 commits into
leanprover-community:masterfrom
cthierfelder:flrw-present-hubble-constant

Conversation

@cthierfelder

@cthierfelder cthierfelder commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Defines the Hubble constant H₀ and the present Hubble radius c / H₀ in FLRW/Basic.lean, closing the TODO there. Following review, both are taken at a t₀ : TimeNow, a new type in Cosmology/TimeNow.lean that records a chosen instant as the present, since Time itself has no origin. Distances.lean gets a rfl lemma linking the existing time-dependent Hubble radius to the new one.

Open question: whether TimeNow should live under Cosmology or with Time. Other FLRW definitions still take the present as a free Time; converting them would be a follow-up.

@github-actions

github-actions Bot commented Nov 24, 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.

Three 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.Cosmology.TimeNow @@
+ module added Physlib.Cosmology.TimeNow (+70 -0)
  namespaces Cosmology, Cosmology.TimeNow
+ added instance : Coe TimeNow Time
+ added instance : Nonempty TimeNow
+ added structure TimeNow
@@ Physlib @@
! module modified Physlib (+1 -0)
@@ Physlib/Cosmology/FLRW/API-map.md @@
! file modified Physlib/Cosmology/FLRW/API-map.md (+10 -3)
@@ Physlib.Cosmology.FLRW.Basic @@
! module modified Physlib.Cosmology.FLRW.Basic (+33 -4)
  namespaces Cosmology, Cosmology.SpatialGeometry, Cosmology.FLRW, Cosmology.FLRW.FriedmannEquation
+ added def presentHubbleConstant
+ added def presentHubbleRadius
+ added lemma presentHubbleConstant_eq
+ added lemma presentHubbleConstant_mul_presentHubbleRadius
+ added lemma presentHubbleRadius_pos
@@ Physlib.Cosmology.FLRW.Distances @@
! module modified Physlib.Cosmology.FLRW.Distances (+7 -1)
  namespaces Cosmology.FLRW
+ added lemma hubbleRadius_eq_presentHubbleRadius
14 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 689c88f, remade whenever a commit is pushed.

@jstoobysmith
jstoobysmith requested a review from doxtor6 November 24, 2026 06:53
Comment thread Physlib/Cosmology/FLRW/Basic.lean Outdated

The time-dependent Hubble parameter `H(t) = (dₜ a) / a` is the function `hubbleConstant`;
`presentHubbleConstant a t₀` is the number `H₀`, its value today. -/
noncomputable def presentHubbleConstant (a : Time → ℝ) (t₀ : Time) : ℝ :=

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.

I think it might be worth mirroring the sort of construction we have done for the Boltzman constant for the time now, that is define a type TimeNow or similar. At the moment this is just a rewrite of the definition of the hubble constant, and I adding such a type would help this.

@cthierfelder cthierfelder Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks (I am new here - just trying to learn). I've added Physlib/Cosmology/TimeNow.lean with a structure TimeNow wrapping an instant of Time, plus a Coe TimeNow Time, and presentHubbleConstant / presentHubbleRadius now take t₀ : TimeNow. Since Time is a torsor with no origin, the present is a datum of the model, which the type now records. I kept it minimal (no positivity or dimension, since an instant has neither) and put it under Cosmology rather than SpaceAndTime/Time; happy to move it if you'd rather it lived with Time. Several other FLRW declarations take a free t₀ : Time for the present (comovingDistance, redshift, ReducedHubble); switching those to TimeNow seems a natural follow-up PR if you agree with the design.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, I think a type for the present is the right idea. Some thoughts on its form and location:

  • Tie it to the model. The present should be an instant inside the interval U.I of a given FLRW model: a structure over U : FLRW holding a Time and the fact that it lies in U.I. This gives the type actual content (the module doc already calls the present "a datum of the cosmological model"), matches the physics (t₀ depends on the model: for the same H₀ the age differs between models), and removes the repeated t₀ ∈ U.I hypotheses downstream. The Nonempty instance can then go, and the coercion to Time will need CoeOut rather than Coe.
  • Location. A single "now" for the whole universe only makes sense because FLRW cosmic time picks out a family of simultaneous instants, so I'd put it in FLRW/Basic.lean right after structure FLRW, rather than next to Time or in its own file.
  • Names. PresentTime, with the field toTime (integrals over Time are written on the coordinate, where t₀.val.val reads badly), and H₀ as presentHubbleParameter, taking the model. The present Hubble radius is then just hubbleRadius at t₀, so the separate presentHubbleRadius and its bridge lemma aren't needed.
  • Payoff. redshift and comovingDistance take the present in opposite argument positions; with a PresentTime argument, swapping them becomes a type error. In integrals with the present as a limit, such as ∫_{t₀}^{t} H dt = ln(a(t)/a(t₀)), only t then needs a hypothesis. For the follow-up, I'd convert only the t₀s that mean the present, not the normalisation epochs of the specific solutions or the reference time of the tangent-line bound.

@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 Nov 24, 2026
@github-actions github-actions Bot added medium and removed small labels Nov 24, 2026
@cthierfelder

Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes label Nov 24, 2026
@doxtor6

doxtor6 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

claim

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants