2
$\begingroup$

Is there a way to make this work?

THM = TensorDimensions[M];
Assuming[ Element[M, Vectors[n]], 
    THM
]

Which gives:

TensorDimensions[M]

But I would like it to try executing the expression again, and get

{n}

None of these potential solutions work:

 Assuming[ Element[T, Vectors[n]],
      {THM, 
       Simplify[THM],
       Evaluate[THM]}
 ]  

This works, but is a profoundly ugly kludge:

 Assuming[ Element[T, Vectors[n]],
      {THM /. TensorDimensions[x_] :> TensorDimensions[x]}
 ]  

Can anyone explain what is happening here?

$\endgroup$

1 Answer 1

2
$\begingroup$

You need to use Update to tell Mathematica that hidden changes have been made that can affect results:

THM=TensorDimensions[M];
Assuming[Element[M,Vectors[n]],THM]

TensorDimensions[M]

Using Update:

Update[M];
Assuming[Element[M,Vectors[n]],THM]

{n}

$\endgroup$
2
  • $\begingroup$ Thanks Carl. vv $\endgroup$ Commented Feb 8, 2019 at 20:03
  • $\begingroup$ One question -- what else does Update[] do? Does it empty the cache of previous Simplify results? (And I realized Wolfram may change what it does whenever they want.) $\endgroup$ Commented Feb 8, 2019 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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