3
$\begingroup$

Following the advice here, I tried to replace part of an expression guided by the FullForm details:

-B + b - ((-A + 
      a) \[\[DoubleStruckCapitalE]][(-A + a) (-B + 
         b) | \[ScriptCapitalF]])/\[DoubleStruckCapitalE][(-A + 
       a)^2 | \[ScriptCapitalF]] & // FullForm

Function[Plus[Times[-1, B], b, Times[-1, Times[Plus[Times[-1, A], a], [DoubleStruckCapitalE][ Alternatives[ Times[Plus[Times[-1, A], a], Plus[Times[-1, B], b]], [ScriptCapitalF]]], Power[ [DoubleStruckCapitalE][ Alternatives[ Power[Plus[Times[-1, A], a], 2], [ScriptCapitalF]]], -1]]]]]

However, the replacement rule still does not take effect

{-B + b - ((-A + 
       a) \[DoubleStruckCapitalE][(-A + a) (-B + 
          b) | \[ScriptCapitalF]])/\[DoubleStruckCapitalE][(-A + 
        a)^2 | \[ScriptCapitalF]] &} //. {\[DoubleStruckCapitalE][
    Alternatives[
     Power[Plus[Times[-1, a_], b_], 2], \[ScriptCapitalF]]] -> 
   Power[Plus[Times[-1, a], b], 2]}

I'm obviously struggling how to do things in MMA. Appreciate any hints or tips.

$\endgroup$
6
$\begingroup$

I am guessing that you meant to use Conditioned instead of Alternatives:

expr = -B + b - ((-A + a) ℰ[(-A + a) (-B + b) | ℱ])/ℰ[(-A + a)^2 | ℱ] &

enter image description here

InputForm @ %

-B + b - ((-A + a)ℰ[(-A + a)(-B + b) | ℱ])/ℰ[(-A + a)^2 | ℱ] &

expr2 = expr /. Alternatives -> Conditioned

enter image description here

InputForm @ %

-B + b - ((-A + a)ℰ[Conditioned[(-A + a)(-B + b), ℱ]])/ℰ[Conditioned[(-A + a)^2, ℱ]] &

expr2 /. ℰ[Conditioned[Power[Plus[Times[-1, a_], b_], 2], ℱ]] :> 
  Power[Plus[Times[-1, a], b], 2]

enter image description here

InputForm @ %

-B + b - ((-A + a)ℰ[Conditioned[(-A + a)(-B + b), ℱ]])/(-A + a)^2 &

Note: I replaced \[DoubleStruckCapitalE] with .

$\endgroup$
  • $\begingroup$ Hmm, does this work using the \[Conditioned] symbol? Checking... yes it does. Thanks! Can update your answer to reflect the original question notation, then I'll be able to accept. $\endgroup$ – Hedgehog Dec 12 '19 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.