Skip to content

Conversation

@or4nge19
Copy link

hope it is not impolite to work on this; apologies but I'd like to use GibbsMeasure in a few applications in PhysLean :)

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! In the future, it's always good to discuss your plans on Zulip first, but here you got lucky and nobody was working on that. I personally find the possibility of GibbsMeasure being used in PhysLean very exciting!

Here are a few initial comments. Your PR is coming at a very busy time for me, so I will likely not be able to comment further before another month. However, more or less all of your code could go straight into mathlib, so I would encourage you to PR it there, where there will be reviewers available for you. No need to close this PR, at least for now.

Comment on lines +26 to +29
lemma measure_univ_of_marg_snd_dirac
(μ : Measure (X × Y)) (y : Y)
(marg_Y : Measure.map Prod.snd μ = Measure.dirac y) :
μ univ = 1 := by
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really a theorem about product and Dirac measures? It seems to me like you can state everything in the generality of HasLaw

This reverts commit 0bbdfcc, reversing
changes made to 38b5000.
@or4nge19
Copy link
Author

Thank you very much for your review. I'm going to have another take on them soon and will try to PR them to mathlib. Next time will use the GibbsMeasure zulip channel :)

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Let's make the review process kind of like mathlib's.

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 13, 2025
@or4nge19
Copy link
Author

oh sorry, I have just seen your comments :), will try to address them now. Thanks

@or4nge19
Copy link
Author

-awaiting-author

@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 16, 2025
Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

This PR is too big for me to review properly. Do you think you could find constituent parts that each make sense on their own? I expect there could be two to three parts here.

@@ -1,17 +1,349 @@
import Mathlib.MeasureTheory.Measure.Prod
import Mathlib.Probability.HasLaw
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mathlib.Probability.HasLaw imports Mathlib.MeasureTheory.Measure.Prod, not the other way around. Therefore all your material that depends on HasLaw should go to GibbsMeasure.Mathlib.Probability.HasLaw instead of GibbsMeasure.Mathlib.MeasureTheory.Measure.Prod

Comment on lines +130 to +135
[SigmaFinite (μ.trim hm)] {g : α → ℝ≥0∞} {s : Set α}
(hs_meas : MeasurableSet s) (hs_finite : μ s ≠ ⊤)
(hgm : AEStronglyMeasurable[m] g μ)
(hg_fin : ∀ᵐ a ∂ μ, g a ≠ ⊤) :
(fun a ↦ (g a).toReal) =ᵐ[μ] μ[s.indicator 1| m] ↔
∀ t, MeasurableSet[m] t → μ (s ∩ t) = ∫⁻ a in t, g a ∂μ := by
Copy link
Collaborator

Choose a reason for hiding this comment

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

Statement is indented by four spaces

Suggested change
[SigmaFinite (μ.trim hm)] {g : α → ℝ≥0∞} {s : Set α}
(hs_meas : MeasurableSet s) (hs_finite : μ s ≠ ⊤)
(hgm : AEStronglyMeasurable[m] g μ)
(hg_fin : ∀ᵐ a ∂ μ, g a ≠ ⊤) :
(fun a ↦ (g a).toReal) =ᵐ[μ] μ[s.indicator 1| m] ↔
∀ t, MeasurableSet[m] t → μ (s ∩ t) = ∫⁻ a in t, g a ∂μ := by
[SigmaFinite (μ.trim hm)] {g : α → ℝ≥0∞} {s : Set α}
(hs_meas : MeasurableSet s) (hs_finite : μ s ≠ ⊤)
(hgm : AEStronglyMeasurable[m] g μ)
(hg_fin : ∀ᵐ a ∂ μ, g a ≠ ⊤) :
(fun a ↦ (g a).toReal) =ᵐ[μ] μ[s.indicator 1| m] ↔
∀ t, MeasurableSet[m] t → μ (s ∩ t) = ∫⁻ a in t, g a ∂μ := by

Same everywhere else

MeasureTheory.Measure.eq_mapMk_of_marg_fst_dirac (μ := μ) (x := x) (marg_X := margX)
simpa [μ, margY', hY.map_eq] using hμ
end
section
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
section
section

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 16, 2025
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.

3 participants