Zulip Chat Archive
Stream: PhysLean
Topic: Normed dual of Schwarz space
Kenny Lau (Jul 12 2025 at 14:37):
@Joseph Tooby-Smith I thought it might be a good idea to make this a separate thread. What are the things I should keep in mind?
Kenny Lau (Jul 12 2025 at 14:40):
For example, the question I would have is, how much stuff do we currently have? and which folder should I put it in?
Kenny Lau (Jul 12 2025 at 14:41):
maybe I should make a separate folder for it, PhysLean/Mathematics/Schwarz/Basic.lean
Kenny Lau (Jul 12 2025 at 14:44):
to document more of my thoughts, I had an idea to enlarge the test functions to continuous piecewise differentiable but ultimately thought it's a bad idea.
Kenny Lau (Jul 12 2025 at 14:45):
I think I'll keep the test function to the Schwarz space, and then I'll make some API to account for the piecewise functions
Joseph Tooby-Smith (Jul 12 2025 at 14:56):
The only thing currently in PhysLean regarding Schwarz maps is the stuff I was doing last week regarding Quantum mechanics which can be found in the Operators and HilbertSpace folders of this directory.
I would even be tempted to put this in the SpaceAndTime directory in a folder like e.g. SpaceAndTime.Distributions., but I think the mathematics folder is also good.
Here are somethings I would like to see:
- Notation that makes the type of distributions look like a function type e.g.
ℝ →d ℂ - API and notation around derivatives so we can use them like we use derivatives of functions.
- API that makes it as easy as possible to treat functions as distributions. This means: Defining distributions from functions, take the derivative of distributions which are actually functions, proving equality of two distributions which are actually functions, etc.
- Important distributions pre-defined as such, e.g. dirac delta, the Heaviside step functions, the inverse potential . These should have good API, for example their derivatives etc.
Kenny Lau (Jul 12 2025 at 15:00):
also another question is, do we want R -> C or R -> R? or R -> R^k?
Kenny Lau (Jul 12 2025 at 15:15):
it seems like in quantum you would want (R -> C) -> C but in variational calculus you would want (R -> R^2) -> R?
Kenny Lau (Jul 12 2025 at 15:16):
or i can allow both
Kenny Lau (Jul 12 2025 at 15:19):
I want to make the decision to only use Type 0 lol
Kenny Lau (Jul 12 2025 at 15:20):
@Joseph Tooby-Smith do you actually use universes? I see that you type universe v u in the beginning of your files but I don't know if you really use them
Joseph Tooby-Smith (Jul 12 2025 at 15:24):
So as physicists we are mainly interested in functions from space (or spacetime) to Euclidean space or the product of R’s etc. So if it can be done to cover all these cases I think this would be good - if indeed possible.
Kenny Lau (Jul 12 2025 at 15:25):
yes but i'm saying in quantum you want C
Joseph Tooby-Smith (Jul 12 2025 at 15:26):
Regarding universes, nope! I’m not sure of anywhere in physlean where universes come in. If they can be avoided here the better I think
Joseph Tooby-Smith (Jul 12 2025 at 15:27):
Yeah sorry, Euclidean spaces over the reals or complex numbers and also factors of C and C^2 etc. (Sorry for the bad formatting - on my phone)
Kenny Lau (Jul 12 2025 at 15:28):
Joseph Tooby-Smith said:
Regarding universes, nope! I’m not sure of anywhere in physlean where universes come in. If they can be avoided here the better I think
https://github.com/search?q=repo%3AHEPLean%2FPhysLean%20universe&type=code
Kenny Lau (Jul 12 2025 at 15:30):
now i'm thinking you might actually want (R -> R/C^k) -> R/C^k!
Kenny Lau (Jul 12 2025 at 15:31):
@Joseph Tooby-Smith what should the output be?
Kenny Lau (Jul 12 2025 at 15:31):
for example, where does dirac delta make sense?
Kenny Lau (Jul 12 2025 at 15:32):
if i start with a function f:R->R^3 defined by f(t) = (sin(t), cos(t), t), and ask you what is (δ*f)(0)?
Kenny Lau (Jul 12 2025 at 15:32):
then you would say (0, 1, 0) right
Joseph Tooby-Smith (Jul 12 2025 at 15:36):
I think the output should be R or C still. In particular a function R->R^k defines a distribution (R->R^k)->R through integration over the inner product
Kenny Lau (Jul 12 2025 at 15:36):
ok but what about my example?
Kenny Lau (Jul 12 2025 at 15:39):
oh you take the inner product first
Joseph Tooby-Smith (Jul 12 2025 at 15:40):
I think (though could be wrong) that you have a direction associated with the delta function
Kenny Lau (Jul 12 2025 at 15:41):
wiki seems to think that it outputs R^n
Joseph Tooby-Smith (Jul 12 2025 at 15:41):
Kenny Lau said:
Joseph Tooby-Smith said:
Regarding universes, nope! I’m not sure of anywhere in physlean where universes come in. If they can be avoided here the better I think
https://github.com/search?q=repo%3AHEPLean%2FPhysLean%20universe&type=code
I can’t open this right now (as I’m not signed into GitHub on my phone) but I’m going to guess that those universes can be trivially removed
Kenny Lau (Jul 12 2025 at 15:41):
but this could just be a different convention
Joseph Tooby-Smith (Jul 12 2025 at 15:42):
could you share the wiki page?
Kenny Lau (Jul 12 2025 at 15:42):
https://en.wikipedia.org/wiki/Dirac_delta_function#Generalizations
Kenny Lau (Jul 12 2025 at 15:42):
Kenny Lau (Jul 12 2025 at 15:43):
oh wait, this is different
Kenny Lau (Jul 12 2025 at 15:43):
this is the dirac delta R^n -> R, sorry for the confusion
Joseph Tooby-Smith (Jul 12 2025 at 15:44):
Yeah! I think f here is a function from R^k->R
Joseph Tooby-Smith (Jul 12 2025 at 16:18):
Kenny Lau said:
Joseph Tooby-Smith said:
Regarding universes, nope! I’m not sure of anywhere in physlean where universes come in. If they can be avoided here the better I think
https://github.com/search?q=repo%3AHEPLean%2FPhysLean%20universe&type=code
Back at a computer, and made a PR removing all universes in PhysLean - none were doing anything.
Kenny Lau (Jul 12 2025 at 17:29):
@Joseph Tooby-Smith I've made a PR to define distributions and dirac delta function. I've provided a custom constructor that a physicist should be able to understand (try it yourself!).
Kenny Lau (Jul 12 2025 at 17:34):
https://github.com/HEPLean/PhysLean/pull/644
Kenny Lau (Jul 12 2025 at 17:34):
cc @ZhiKai Pong
Kenny Lau (Jul 12 2025 at 17:50):
@Joseph Tooby-Smith do you know why the CI is building all the files even though I haven't touched anything?
Joseph Tooby-Smith (Jul 12 2025 at 17:52):
This always happens for PhysLean - I think it is basically down to the fact we don't have a cache like Mathlib does. I would like to set one up at some point, but am not entirely sure how - and think it relies on server space somewhere.
Joseph Tooby-Smith (Jul 12 2025 at 17:53):
BTW you can run the linters locally using (which is quicker then relying on GitHub):
lake exe lint_all
./scripts/lint-style.sh
Kenny Lau (Jul 12 2025 at 18:15):
@Joseph Tooby-Smith i've updated the file
ZhiKai Pong (Jul 12 2025 at 18:43):
what does docs#SchwartzMap.delta do or is it something else entirely?
Kenny Lau (Jul 12 2025 at 18:46):
aha, lol
Kenny Lau (Jul 12 2025 at 18:46):
nice find!
Kenny Lau (Jul 12 2025 at 18:47):
so one difference is that it doesn't output a scalar
Kenny Lau (Jul 12 2025 at 18:53):
https://en.wikipedia.org/wiki/Distribution_(mathematics)
Kenny Lau (Jul 12 2025 at 18:53):
here's an interesting thing
Kenny Lau (Jul 12 2025 at 18:54):
wiki seems to imply that distributions are actually (U -> R) -> R or (U -> C) -> C
Kenny Lau (Jul 12 2025 at 18:54):
wiki wants to make the domain high dimensional rather than the target
Kenny Lau (Jul 12 2025 at 19:04):
what if we just allow (R -> E) -> F because we might need them eventually
Kenny Lau (Jul 12 2025 at 19:08):
on that note why don't we generalise the R too :rofl:
Joseph Tooby-Smith (Jul 12 2025 at 19:11):
Yeah I think R really should be generalized, since in general this represents space or spacetime, not necessarily in 1-dimension. I'm still confused why you want to generalize F though?
Joseph Tooby-Smith (Jul 12 2025 at 19:16):
Maybe my real concern is the following: If you generalize F, I worry that defining e.g. the derivative etc. will become difficult. But maybe it can be done.
Joseph Tooby-Smith (Jul 12 2025 at 19:20):
Let me add to my list above of things I would like to see:
- A constructor of a distribution based on a function
ℝ → ℂsatisfying conditions which can be solved withfun_prop.
Kenny Lau (Jul 12 2025 at 19:26):
Joseph Tooby-Smith said:
Yeah I think R really should be generalized, since in general this represents space or spacetime, not necessarily in 1-dimension. I'm still confused why you want to generalize F though?
i think you're right, we don't need to generalise F; i just thought we might need to because the dirac delta in the library is S(E,F) ->[L] F
Kenny Lau (Jul 12 2025 at 19:27):
but if we stick to R/C then we can still define our own dirac by composing it with a linear function
Joseph Tooby-Smith (Jul 12 2025 at 19:29):
Ok, I'm happy either way, so I am happy for you to make a call on this. I think at some point it will become clear which one is needed anyway :).
Kenny Lau (Jul 12 2025 at 19:35):
@Joseph Tooby-Smith I think a good enough criterion for f to become a distribution is that int_a^b |f(x)| dx should (exist and) be bounded for every a<b? but this would also mean that your 1/r^2 might not work... how do you make sense of 1/r^2?
Kenny Lau (Jul 12 2025 at 19:45):
every continuous function should be able to be interpreted as a distribution
Kenny Lau (Jul 12 2025 at 19:45):
i'll do that in the next PR
Kenny Lau (Jul 12 2025 at 19:54):
actually i hope you don't mind me asking again, i'm not really familiar with these things; do you have an example where we want the test functions (that's the R->E part) to have high dimensional output value?
Kenny Lau (Jul 12 2025 at 19:54):
i actually don't understand why S(R, R) ->L R and S(R, C) ->L C aren't enough...
Kenny Lau (Jul 12 2025 at 19:54):
i thought about the var cal case but actually in that case the test functions are still one dimensional
Joseph Tooby-Smith (Jul 12 2025 at 20:24):
Kenny Lau said:
Joseph Tooby-Smith I think a good enough criterion for f to become a distribution is that int_a^b |f(x)| dx should (exist and) be bounded for every a<b? but this would also mean that your 1/r^2 might not work... how do you make sense of 1/r^2?
Huh - this is worrying. I want to really make sense of the equation given here:
I thought, and what people say, is that this is in terms of distributions. This equation comes up in Maxwell's equations for a point particle, and actually gives an example of why S(R, R) ->L R and S(R, C) ->L C aren't enough.
Joseph Tooby-Smith (Jul 12 2025 at 20:31):
Also the 1/r^2 should be thought of as being in 3d, which may salvage things (r) is the distance from the orgin.
Kenny Lau (Jul 12 2025 at 20:32):
@Joseph Tooby-Smith Thanks for the example.
- This is an interesting example indeed. From the proof given in the most upvoted answer, I'll take the definition to be "the limit of the distributions defined by 1/(r^2+a^2) as a->0". If you want a more intrinsic definition maybe principal values will be the answer?
- The test functions (φ) are actually R^3 -> R, so that's actually not an example I'm looking for. I understand that the first R in my (S(R, R/C) -> R/C) should be generalised, but I'm talking about the first "R/C" in my expression.
Joseph Tooby-Smith (Jul 12 2025 at 20:35):
c.f. 2, yes, sorry you are right. I am interested in the function before taking the divergence, and I want to interpret this as a distribution, which I think would correspond to .
Joseph Tooby-Smith (Jul 12 2025 at 20:36):
I want to interpret this as a distribution, because I want to make sense of the divergence of it, and ending up with a Dirac delta function.
Joseph Tooby-Smith (Jul 12 2025 at 20:38):
If you want a more intrinsic definition maybe principal values will be the answer?
I was thinking that, but I don't think it's actually needed, since I think e.g. the norm of is locally integrable in , namely since the volume measure is , the 's cancel out.
Kenny Lau (Jul 12 2025 at 20:38):
I'm wondering if it's possible to make sense of your f : R^3 -> "R^3" without actually modifying the space of test functions S(R^3, R)
Joseph Tooby-Smith (Jul 12 2025 at 20:39):
(From the
Joseph Tooby-Smith said:
If you want a more intrinsic definition maybe principal values will be the answer?
I was thinking that, but I don't think it's actually needed, since I think e.g. the norm of is locally integrable in , namely since the volume measure is , the 's cancel out.
(From the physics point of view this is actually precisely why the appears in electromagnetism)
Joseph Tooby-Smith (Jul 12 2025 at 20:41):
Kenny Lau said:
I'm wondering if it's possible to make sense of your f : R^3 -> "R^3" without actually modifying the space of test functions S(R^3, R)
I guess the question is how would you treat f : R^3 -> R^3 as a distribution in this sense, what would your integral be?
Kenny Lau (Jul 12 2025 at 20:42):
from a mathematical point of view there's actually nothing "extra" added on by going from a "scalar field" to a "vector field": the behaviour of (f1, f2, f3) is determined by f1, f2, and f3, i think
Kenny Lau (Jul 12 2025 at 20:43):
generalising the codomain is quite different from generalising the domain
Kenny Lau (Jul 12 2025 at 20:44):
i'm actually also a bit confused about the statement that it's integrable because the 1D version 1/x^2 seems to not be integrable? am I missing something here?
Kenny Lau (Jul 12 2025 at 20:46):
oh the 1d version isn't 1/x^2 it's sgn(x)/x^2 right
Joseph Tooby-Smith (Jul 12 2025 at 20:50):
Kenny Lau said:
oh the 1d version isn't 1/x^2 it's sgn(x)/x^2 right
The 2d version is , and the 1d version is . This is explained (for physicists) here:
https://physics.stackexchange.com/questions/629299/does-the-electric-field-in-1d-exist-in-nature
This has a very bizarre physical consequence: A point particle in 1d produces a constant electric field in all of space. (the same way that in 3d an infinite plane of charges produces a constant electric field).
Kenny Lau (Jul 12 2025 at 20:51):
sorry, by 1d version i just meant the naive way of just looking at the x-axis
Kenny Lau (Jul 12 2025 at 20:52):
and then for sgn(x)/x^2 you still need to kinda of "take some limit" -- whether you do it explicitly via sgn(x)/(x^2+a^2), or implicitly by considering "principal value" or taking the complement of (-ε, ε) and letting ε -> 0
Joseph Tooby-Smith (Jul 12 2025 at 20:54):
I agree that the value along the -axis is sgn(x)/x^2, but I don't see why you are trying to integrate along the x-axis, which is of measure zero in 3d.
Kenny Lau (Jul 12 2025 at 20:55):
ah I just wanted to do an "easier" version but maybe this is not the right thing to do
Kenny Lau (Jul 12 2025 at 20:55):
maybe 3d domain is really different from 1d domain
Joseph Tooby-Smith (Jul 12 2025 at 20:58):
Yeah I think it is - I don't think you can just restrict to a 1d line. (which I agree is rather odd intuitively)
Kenny Lau (Jul 13 2025 at 12:24):
@Joseph Tooby-Smith btw im now leaning towards making a function f: R^n -> R^k into a distribution by taking test function η: R^n -> R (!) and outputting int η x • f x dx (in R^k!); I thought I would ask for your opinion on this.
Kenny Lau (Jul 13 2025 at 12:29):
I’m 80% convinced that this is the best approach
Kenny Lau (Jul 13 2025 at 12:52):
update: 90%
Joseph Tooby-Smith (Jul 13 2025 at 12:56):
Ok this makes sense, I think it will make it easier to eg define the divergence as well
Tomas Skrivan (Jul 13 2025 at 18:17):
(deleted)
Tomas Skrivan (Jul 13 2025 at 18:19):
(deleted)
Joseph Tooby-Smith (Jul 16 2025 at 13:49):
Concerning showing is a distribution in 3d, I think what one may need is the generalization of docs#integral_comp_polarCoord_symm to one dimension higher, or something similar. This is related to @ZhiKai Pong 's (as yet unanswered :() post on spherical coordinates: #Is there code for X? > Spherical coordinates . Maybe it is worth developing such an API.
Kenny Lau (Jul 16 2025 at 14:00):
I recall we have something like a "spherical haar measure"
Kenny Lau (Jul 16 2025 at 14:01):
Kenny Lau (Jul 16 2025 at 14:02):
this thing
Joseph Tooby-Smith (Jul 16 2025 at 14:05):
Ah! Nice! Ok, and there is docs#MeasureTheory.integral_fun_norm_addHaar ! Looks very close to what we would want (just over a compact domain not the whole space).
Kenny Lau (Jul 16 2025 at 14:06):
just set the function to 0 outside the compact domain
Joseph Tooby-Smith (Jul 16 2025 at 14:06):
Yep!
Joseph Tooby-Smith (Jul 16 2025 at 14:08):
Honestly I spent a good hour earlier searching loogle for things like
MeasureTheory.integral, "norm"
so don't know how I missed this, maybe I didn't quite use the right words :).
Joseph Tooby-Smith (Jul 17 2025 at 07:11):
Some other distributions which appear in physics:
- A generalization of a dirac delta function to a line e.g. for the
x-axis such that in 3d
Physically this appears when studying e.g. lines of charges, or a the magnetic field around a wire.
- A generalization of a dirac delta function to a plane (and in general any co-dimension
nsurface, e.g. the surface of a ball). - The function which takes a value 'a' inside a ball of radius 'r' and is zero outside. Used e.g. in gravity.
Joseph Tooby-Smith (Jul 18 2025 at 15:36):
Here is the definition of the function in 3d as a distribution, I'm sure this could very much be neatened up etc.
Code
Joseph Tooby-Smith (Jul 18 2025 at 18:07):
I was thinking maybe it would be good to define e.g. the following notation:
scoped notation "¹/r²" => invSq (EuclideanSpace ℝ (Fin 3))
or similar.
(edit: removed part of message which was incorrect).
Joseph Tooby-Smith (Jul 21 2025 at 10:38):
I have a construction of a distribution from a function bounded by in this PR. This is only for EuclideanSpace ℝ (Fin 3), but I'm sure everything should generalize nicely.
I'm not sure if this is something you're still aiming for @Kenny Lau , but if so, I suspect anything you produce here will be better then what I have - in which case this PR can be ignored or overwritten at a later date :).
Kenny Lau (Jul 21 2025 at 10:55):
@Joseph Tooby-Smith there might be a bit of time before my next PR, sorry
ZhiKai Pong (Oct 31 2025 at 15:50):
#PR reviews > Tempered distributions
@Moritz Doll (sorry for pinging) has a series of PRs on tempered distributions which I believe is closely related to what's been done here (e.g. Distribution) and we may want to update our version to match the mathlib version once it stabilizes. (I'm not so confident with the relevant maths yet)
ZhiKai Pong (Oct 31 2025 at 15:51):
on a related note there's also #30329 on generalised distributions
Joseph Tooby-Smith (Oct 31 2025 at 15:58):
Agreed! I wonder if it is possible to set up a Zulip bot that would ping a message when PRs are merged with Mathlib, and/or when a PR becomes a part of a tagged version of Mathlib. I think this would be very helpful in keeping track of these things when they actually get merged, so we can act on them then.
Daniel Morrison (Oct 31 2025 at 23:31):
I do know there's a Zulip topic #rss > Recent Commits to mathlib4:master which posts new merged PRs and includes a link to the PR so it seems like you could tell a bot to watch that topic and message you when certain PRs are mentioned. On the Github side I believe there's a way to link your PR to other ones and a bot there will comment changes. No idea how either of these work though
Moritz Doll (Dec 16 2025 at 00:40):
The definition of tempered distributions has now been merged (sorry forgot to mention it here), there is very little of actual useful objects (there are PRs for embeddings, multiplication and derivatives), just the Fourier transform. Fourier multiplier and convolution are work in progress
Joseph Tooby-Smith (Dec 16 2025 at 05:06):
Great @Moritz Doll - many thanks for postiing here ! We have some stuff specific for PhysLean around distributions in places over PhysLean e.g.
So when we next merge with Mathlib we need to remove our definition of a distribution and update all the lemmas around it.
What do you mean by 'multiplication'? Multiplication of a distribution with what?
Moritz Doll (Dec 16 2025 at 05:12):
Multiplication with a function of temperate growth (i.e., all derivatives are polynomially bounded)
Last updated: Dec 20 2025 at 21:32 UTC