Skip to content

feat(FluidDynamics): add pressure field API#1272

Closed
Robby955 wants to merge 1 commit into
leanprover-community:masterfrom
Robby955:pressure-api
Closed

feat(FluidDynamics): add pressure field API#1272
Robby955 wants to merge 1 commit into
leanprover-community:masterfrom
Robby955:pressure-api

Conversation

@Robby955

Copy link
Copy Markdown
Contributor

This adds a small pressure-field layer to FluidDynamics, built on the existing FluidState, stress-tensor, and momentum-balance API. It is meant as a starting point for the pressure API discussed in #862; I kept it to the parts the current library supports cleanly, and can adjust the shape to fit the intended requirements.

Added

Physlib/FluidDynamics/Pressure.lean:

  • PressureField: a scalar pressure field.
  • FluidWithPressure: a FluidState together with a pressure field.
  • pressureStress: the isotropic pressure stress -p • I; pressureStress_apply, pressureStress_offDiag, and pressureStress_symm give its components and symmetry.
  • pressureForce: the pressure force density -∇p, with pressureForce_apply.
  • matrixDiv_pressureStress: the divergence of the pressure stress equals the pressure force, the bridge into the momentum balance.
  • toMomentumBalance: packages a FluidWithPressure as momentum-balance data.

Physlib.lean: imports the new module.

Reviewer map

Pressure.lean reads top to bottom: the field and FluidWithPressure, then the stress tensor and its lemmas, then the force and the matrixDiv_pressureStress bridge, and finally toMomentumBalance.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for this PR, which will now be reviewed. If submitting to ./Physlib or ./QuantumInfo, please see our review guidelines if you are not familiar with the process. You should expect a back and forth with a reviewer before your PR is merged. See also that link for how to add appropriate labels to your PR. The PR will also go through a number of automated checks. You can learn more about these here, including how to run them locally.

If you are submitting to ./PhyslibAlpha there will be a lighter review process, though your PR must still pass the automated checks.

If you want to bring attention to this PR, please write a message on this thread of the Lean Zulip.

Important: If a reviewer adds an awaiting-author label to your PR, once you have addressed the review comments, please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

@Robby955 Robby955 marked this pull request as ready for review June 25, 2026 19:03
@jstoobysmith

Copy link
Copy Markdown
Member

See the changes and discussion here #1125 related to setting up Fluid mechanics properly. Maybe if you want to go in this direction you can adapt some of the work of @FloWsnr there (adding them as a co-author on the relevant commits).

@jstoobysmith jstoobysmith added the awaiting-author A reviewer has asked the author a question or requested changes label Jun 26, 2026
@Robby955

Copy link
Copy Markdown
Contributor Author

Yes sure, I will study #1125 and I am interested to see if my approach even makes sense with the discussion and @FloWsnr expert work.

@Robby955

Copy link
Copy Markdown
Contributor Author

I will read #1125 and @FloWsnr's fluid-mechanics setup and align the pressure layer with that direction rather than the standalone shape here.

@Robby955

Robby955 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

closing this as I believe @FloWsnr approach already has this covered properly

@Robby955 Robby955 closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants