Zulip Chat Archive

Stream: maths

Topic: about fderiv and the transformation of the types


Chenyi Li (Jun 02 2023 at 01:28):

Hi! If I want to express the fderiv of a continuous differentiable function f:RdR f :\mathbb{R}^d \rightarrow \mathbb{R}, that is f:RnRn \nabla f : \mathbb{R}^n \rightarrow \mathbb{R}^n . I found the type of the fderiv at one point is as EL[K]FE →L[\mathbb{K}] F, which is (fin dR)L[R] R(fin \ d \rightarrow \mathbb{R}) \rightarrow L[\mathbb{R}] \ \mathbb{R} in this case. If I want to do the inner product f(x)T(yx)\nabla f(x)^T(y-x), where x,yx,y are points in Rd\mathbb{R}^d. How can I accomplish this goal, or rather how can I transform the type of f(x)\nabla f(x) to a type the same as yxy-x, then I can use has_inner.inner to accomplish the inner product? Thank you very much !

Notification Bot (Jun 02 2023 at 02:09):

This topic was moved here from #mathlib4 > about fderiv and the transformation of the types by Heather Macbeth.

Heather Macbeth (Jun 02 2023 at 02:10):

Hi @Chenyi Li, it sounds like you might implicitly be working with f:ERf : E \to \mathbb{R} where EE is a finite-dimensional inner product space. Can you generalize to this situation?

Heather Macbeth (Jun 02 2023 at 02:24):

If you have f:ERf: E \to \mathbb{R}, then the fderiv DfDf is of type E(EL[R]R)E\to (E\to_{L[\mathbb{R}]}\mathbb{R}), so it already typechecks to consider, for x,y:Ex,y:E, the object Df(x)(yx)Df(x)(y-x). That object is a real number. And in fact, you're not even using an inner product on EE for this.

Chenyi Li (Jun 02 2023 at 07:05):

Let me have a try, thank you very much!


Last updated: Dec 20 2023 at 11:08 UTC