Zulip Chat Archive
Stream: PhysLean
Topic: PhsyLean suitable for a mathematics undergrad student
Jard (Sep 01 2025 at 11:41):
Today I officially started my bachelor thesis in mathematics on LEAN4 under the supervision of @Marcello Seri . As part of my thesis, I would love to make one or two contributions to the PhysLean library. Looking at the to-do list, I saw "divergence_smul" that is currently a sorryful result and looks to be within my scope of knowledge. Before I start working on that one however, I was wondering if anyone was already working on it, or if there are other results that are more pressing/in greater need by people to advance their own projects. I am so excited to be part of the community!
Joseph Tooby-Smith (Sep 01 2025 at 12:24):
Hi @Jard ! Welcome to the channel :). I think this is a great place to start, and Iβm pretty confident no one else is working on this. If you do this and are keen to contribute more, I can help find somewhere for you to help :).
Jard (Sep 26 2025 at 07:27):
I have since almost finished this lemma, there is just one detail I am incredibly stuck on. I have the following goal
**π**Β :Β Type u_1
**instββ΄**Β :Β RCLike π
**E**Β :Β Type u_2
**instβΒ³**Β :Β NormedAddCommGroup E
**instβΒ²**Β :Β NormedSpace π E
**instβΒΉ**Β :Β InnerProductSpace' π E
**f**Β :Β E β π
**g**Β :Β E β E
**x**Β :Β E
**hf**Β :Β DifferentiableAt π f x
**hg**Β :Β DifferentiableAt π g x
**instβ**Β :Β FiniteDimensional π E
**s**Β :Β Set E
**s_fin**Β :Β Fintype βs
**basis**Β :Β Basis { x // x β s.toFinset } π E
**b**Β :Β Nonempty (Basis { x // x β s } π E)
**β’** HasAdjoint π (β(fderiv π f x)) (adjoint π β(fderiv π f x))
Would anyone be able to point me in the right direction on how to show this adjoint exists?
Joseph Tooby-Smith (Sep 26 2025 at 08:12):
Hi Jard! Could you possibly make a mwe for this, as it will allow us to more easily interact with the code?
BTW I think in the meantime @Miyahara KΕ has added a proof of this result to PhysLean. But please don't let this stop you finishing your proof, as I think it will be a useful learning experience, and it would be great to have more people familiar with this part of the library.
Jard (Sep 26 2025 at 09:03):
Hi! I think this is a minimal working example:
lemma divergence_smul_mwe [InnerProductSpace' π E] {f : E β π} {g : E β E} {x : E}
(hf : DifferentiableAt π f x) (hg : DifferentiableAt π g x)
[FiniteDimensional π E] :
divergence π (fun x => f x β’ g x) x
= f x * divergence π g x + βͺadjFDeriv π f x 1, g xβ« := by
unfold divergence
simp [fderiv_fun_smul hf hg]
obtain β¨s, bβ© := Basis.exists_basis π E
let basis := Classical.choice b
have s_fin : Fintype s := FiniteDimensional.fintypeBasisIndex basis
have h_basis : Basis (βs) π E = Basis s.toFinset π E := by
simp only [Set.mem_toFinset]
rw [h_basis] at basis
have hβ : βͺadjoint π (β(fderiv π f x)) 1, g xβ« = (fderiv π f x) (g x):= by
rw [HasAdjoint.adjoint_inner_left]
Β· simp_all only [RCLike.inner_apply, map_one, mul_one]
rfl
Β· sorry
It is then the last sorry point.
I did see the proof was added to physlean, and a much more elegant proof than I have at that! It has been an amazing learning experience indeed. Thank you for your help!
Joseph Tooby-Smith (Sep 26 2025 at 09:29):
Thanks - ideally one would want to make the mwe independent of PhysLean totally, but I think in this case this would be extremely difficult, so what you have done is great :).
Filling this last sorry is difficult, but there is a quick way of doing this. Let me give you a hint: there are parts of the proof of divergence_smul which appears in PhysLean which can be adapted to fill in this sorry. I'm happy to be more explicit if this would help.
Jard (Sep 26 2025 at 09:34):
I got it! Thanks for your help!
Jard (Sep 29 2025 at 09:39):
Hi again, and sorry for all the questions! My supervisor and I were looking at other places where I could contribute. We were thinking either working on something in the harmonic oscillator areas, or potentially working on "Module doc-string improvementsΒ #713". Do you have any other suggestions or do you think these are good places to work in?
Joseph Tooby-Smith (Sep 29 2025 at 09:47):
Hi Jard! Either of these would be amazing, and I think would be a good place to work. There are a number of things which need doing for the harmonic oscillator, and generalizations (e.g. including damping) which could be made.
If you end up doing one of these, I would recommend making a quick comment on the relevant threads here:
- #PhysLean > Priority documentation tracker for documentation.
- #PhysLean > Classical Harmonic Oscillator for the harmonic oscillator.
There is also some conversation there about each of these.
Notification Bot (Sep 29 2025 at 14:37):
5 messages were moved from this topic to #PhysLean > Quantum computing by Joseph Tooby-Smith.
Last updated: Dec 20 2025 at 21:32 UTC