Computations with Function Spaces
Computations with Function Spaces
Reflexive Spaces
Reflexive Spaces
Here we reproduce an example from our blog involving symbolic computation on entities. One of the beautiful things about computational encoding (and part of the reason it is so desirable for mathematics as a whole) is that known results can be easily tested or verified (and new ones proposed or tested). As an example, consider the duality of Lebesgue spaces and for with . First, define a variable to represent the entity:
p
L
q
L
1/p+1/q1
p≥1
p
L
In[1]:=
lp=;
Now, use the "DualSpace" property to obtain the dual entity:
In[2]:=
lq=lp
Out[2]=
As can be seen, this formulation allows computation to be performed and expressed through the elegant paradigm of symbolic transformation of the entity canonical name. Taking the dual space of in turn then gives:
q
L
In[3]:=
lq
Out[3]=
Finally, applying symbolic simplification to the entity canonical name:
In[4]:=
%//Simplify
Out[4]=
This verifies we have obtained the same space we originally started with:
In[5]:=
%lp
Out[5]=
True
... in other words, that the double dual , where * denotes the dual space, is equivalent to .
**
()
p
L
p
L
Function spaces with this property are said to be reflexive, so let's now verify that we have correctly categorized Lebesgue spaces among such spaces. Here, we use a Lebesgue space with a concrete value of (which is a requirement for reflexivity) for checking the "Classifications" property:
p
L
p≥1
In[6]:=
Out[6]=
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Taking the canonical names of these:
In[7]:=
CanonicalName[%]
Out[7]=
{BaireSpace,BanachSpace,BarrelledSpace,BornologicalSpace,CompactlyGeneratedSpace,CompleteSpace,ConvenientSpace,FrechetSpace,FSpace,HilbertSpace,InnerProductSpace,LocallyCompleteSpace,LocallyConvexSpace,LusinSpace,MackeySpace,MetrizableSpace,NormedSpace,PolishSpace,PseudoCompleteSpace,PseudoMetrizableSpace,QuasiBanachSpace,QuasiBarrelledSpace,QuasiCompleteSpace,QuasiNormedSpace,RadonSpace,ReflexiveSpace,SemiNormedSpace,SemiReflexiveSpace,SeparableSpace,SequentiallyCompleteSpace,StereotypeSpace,SuslinSpace,TopologicalVectorSpace,WebbedSpace}
... we now indeed see that this space is reflexive:
In[8]:=
MemberQ[%,"ReflexiveSpace"]
Out[8]=
True
We can easily get a list of all reflexive function spaces in our curated set of function spaces either directly by considering reflexive spaces as an entity in the "TopologicalSpaceType" domain:
In[9]:=
Entity["TopologicalSpaceType","ReflexiveSpace"]["ExampleFunctionSpaces"]
Out[9]=
,,,,,,,,,,,,,,
Or by creating an implicitly defined entity class of function spaces whose "Classifications" include "ReflexiveSpace":
In[10]:=
EntityClass["FunctionSpace","Classifications"ContainsAny[{"ReflexiveSpace"}]]
Out[10]=
In[11]:=
EntityList[%]
Out[11]=
,,,,,,,,,,,,,,
Norms, Inner Products and the Schwarz Inequality
Norms, Inner Products and the Schwarz Inequality
To illustrate how the symbolic representation of function space properties can be used to perform actual computations, consider the Lebesgue space :
2
L
In[12]:=
l2=;
Its norm, as expressed using the "Norm" property, involves a number of PureMath` extensions to the Wolfram Language:
In[13]:=
l2norm=l2["Norm"]
Out[13]=
Functionf.,Integrate,{x.,PureMath`MeasureSpace[,PureMath`LebesgueMeasure[n.]]}
2
Abs[f.[x.]]
n.
Reals
... in particular, the symbols MeasureSpace and LebesgueMeasure. The Lebesgue measure is an extension of the classical notions of length and area to more complicated sets, and the Lebesgue integral (an integral over a measure space with Lebesgue measure) covers a wider class of functions than does the Wolfram Language's standard Riemann integral.
Consider the simple case of wanting to compute the norm of a univariate real function. In that case, we can write a set of transformations that effectively map the full mathematical result to one that can be evaluated for concrete univariate real functions:
In[14]:=
fromentity[fn_]:=fn/.{{x.,PureMath`MeasureSpace[,PureMath`LebesgueMeasure[n_]]}{x.,-∞,∞},Inactive[Integrate]Integrate,Conjugate[f_][x_]:>Conjugate[f[x]]}
n_
Reals
Applying this transformation function to the norm given above and then to an arbitrary function f gives the unevaluated result:
In[15]:=
fromentity[l2norm][f]
Out[15]=
∞
∫
-∞
2
Abs[f[x.]]
For particular functions, say:
In[16]:=
f1[x_]:=Exp[-x^2]f2[x_]:=Piecewise[{{1-x^2,Abs[x]<1},{0,True}}]
In[18]:=
fromentity[l2norm][f1]
Out[18]=
1/4
π
2
In[19]:=
fromentity[l2norm][f2]
Out[19]=
4
15
We do the same thing with the inner product, applying the general result:
In[20]:=
l2inner=l2["InnerProduct"]
Out[20]=
Function[{f1,f2},Integrate[f1[x.]Conjugate[f2][x.],{x.,PureMath`MeasureSpace[,PureMath`LebesgueMeasure[n.]]}]]
n.
Reals
... to our chosen functions:
In[21]:=
l2inner[f1,f2]
Out[21]=
IntegrateConjugate[f2][x.],{x.,PureMath`MeasureSpace[,PureMath`LebesgueMeasure[n.]]}
-
2
x.
n.
Reals
... and thus obtaining the result:
In[22]:=
fromentity[%]
Out[22]=
2+
π
Erf[1]2
We are now in a position to verify that famous Schwarz (or Cauchy–Schwarz) inequality, which states in bra–ket notation that for any two integrable complex functions (x) and (x):
ψ
1
ψ
2
2
〈|〉
ψ
1
*
ψ
2
ψ
1
*
ψ
1
ψ
2
*
ψ
2
Written out in terms of explicit integrals:
2
∫(x)(x)x
ψ
1
*
ψ
2
2
(x)
ψ
1
2
(x)
ψ
2
Here is the statement of the inequality returned by the "CauchySchwarzInequality" property:
In[23]:=
EntityValue[l2/.n.1,"CauchySchwarzInequality"][f1,f2]
Out[23]=
Abs[PureMath`InnerProduct[{f1,f2},{{LebesgueL,{{Reals,1},{LebesgueMeasure,1}}},2}]]≤Norm[f1,{{LebesgueL,{{Reals,1},{LebesgueMeasure,1}}},2}]Norm[f2,{{LebesgueL,{{Reals,1},{LebesgueMeasure,1}}},2}]
... which we can verify is indeed satisfied in the specific case of our functions f1 and f2: