feat: PositiveTemperature#969
Draft
ichxorya wants to merge 19 commits intoleanprover-community:masterfrom
Draft
Conversation
…he Thermodynamics module (with some extend to StatisticalMechanics since it depends on Thermodynamics)
…ine comments TODO: from `tendsto_const_inv_mul_bound_pos` downwards
* TODO: From `tendsto_ofβ_atTop` downwards
* Note: In `Calculus relating T and β`, the proofs are not really cleaned and humanized since it's kinda out of my league.
…ut the type definition)
* Introduce `TemperatureScale` structure with detailed documentation. * Implement conversion functions between kelvin and affine scales. * Add lemmas to verify the identity of conversions. * Define specific temperature scales: Celsius, Fahrenheit, and Rankine. * Improve documentation for clarity and completeness. * Refactor existing functions for better readability and maintainability.
* Added import for `TemperatureScales` in `PhysLean.lean`. * Reformatted code for better readability in several lemmas across temperature-related files. * Removed unnecessary blank lines to improve code clarity.
…itions (breaking change warning, currently only Basic.lean is compilable)
…lean (breaking change warning, currently only Basic.lean is compilable)
…ture and the Beta function; add Calculus.lean for PositiveTemperature (breaking change warning)
Contributor
Author
|
@jstoobysmith I would like to ask for direction from here. As of now, the code in Temperature is compilable. However, when it comes to the dependency at CanonicalEnsemble, I don't know what would actually work. Can you break the necessary rework for me (i.e. in terms of types, theorems, lemmas) so that I can follow it to finish this PR. @hungle0503 would you also mind looking at this too? Note that a vibe-coded solution is available at c853862 but I think it is wrong since it defines this /-- Construct a `PositiveTemperature` from a real-valued inverse temperature,
defaulting to a junk value for non-positive inputs. Used for `derivWithin` helpers
that need a total function `ℝ → PositiveTemperature`. -/
noncomputable def ofβ_real (b : ℝ) : PositiveTemperature :=
if h : 0 < b then ofβ ⟨b, h⟩ else ofβ ⟨1, one_pos⟩Thus, it shouldn't be right due to that junk value when we define the total function (could a partial function work?) |
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.
Ref: #958 #861 #860
In this PR I will construct relevant API for PositiveTemperature as discussed in #958