refactor: replace d.succ with d (1 of 2)#1183
Conversation
|
Thank you for this PR, which will now be reviewed. Please If you want to bring attention to this PR, please write a message on this |
morrison-daniel
left a comment
There was a problem hiding this comment.
I think this is a good improvement, just the one question about the two removed lemmas
| lemma volume_eq_addHaar {d} : (volume (α := Space d)) = Space.basis.toBasis.addHaar := by | ||
| exact (OrthonormalBasis.addHaar_eq_volume _).symm | ||
|
|
||
| lemma volume_closedBall_ne_zero {d : ℕ} (x : Space d.succ) {r : ℝ} (hr : 0 < r) : |
There was a problem hiding this comment.
Why is this and the next one removed? Are they redundant now?
There was a problem hiding this comment.
oops I probably should've split this off as they are unrelated to this refactor, but (nevermind I remembered I was checking because they were also stated with d.succ)
basically I found out that they are one-liners with what's already in Mathlib and I don't feel they're necessary, i.e.
lemma volume_closedBall_ne_zero {d : ℕ} (x : Space d.succ) {r : ℝ} (hr : 0 < r) :
volume (Metric.closedBall x r) ≠ 0 := by
apply (Metric.measure_closedBall_pos volume _ hr).ne'
lemma volume_closedBall_ne_top {d : ℕ} (x : Space d.succ) (r : ℝ) :
volume (Metric.closedBall x r) ≠ ⊤ := by
apply measure_closedBall_lt_top.ne
These only affect the changes in Physlib/ClassicalMechanics/RigidBody/SolidSphere.lean (at the very beginning of the diff page).
There was a problem hiding this comment.
Updated PR summary to document this change as well
several results were stated over
Space d.succ, meaning the parameterdwas actually dimension − 1. This is confusing (dshould be the dimension) and forces awkwardd.succ/d.succ.succexpressions. This PR migrates the Space.Integrals / IsDistBounded lemmas sodis the true dimension.dimension ≥ 1 → [NeZero d] (typeclass): auto-infers for concrete dims (Space 2/3) contexts
dimension ≥ 2 → (hd : 2 ≤ d := by omega) (autoParam Prop): keeps @[fun_prop] working and auto-discharges at concrete dims contexts. (note: if used with dot notation still requires (by norm_num), but I prefer the clarity)
The distributional-norm results in Space/Norm.lean (distGrad/distDiv/distLaplacian of norm powers and logs, plus the fundamental-solution Laplacian) are still on Space d.succ/.succ.succ/.succ.succ.succ and will migrate in the next PR.
(PR summary partially based on claude code summary but I went through all the changes myself)
Edit: Also remove two duplicate lemmas from mathlib (
volume_closedBall_ne_topandvolume_closedBall_ne_top)