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:

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