Dimensions[] not working with assumptions?

I am trying to perform some symbolic calculus with tensors and matrices. I have recently noticed that one can set assumptions on variables by using the command $Assumptions$ as described here. However, when I make

$Assumptions$ = U ∈ Matrices[{d, m}, Reals];
$Assumptions$ = P ∈ Matrices[{d, t}, Reals];

Y = Transpose[U].P;
Dimensions[Y]


I get

(* {2} *)

Using TensorDimensions doesn't return a useful result either, as

TensorDimensions[Y]


(* TensorDimensions[Transpose[U].Phi] *)

If I am assuming $U$ to be a $d\times m$ matrix and $P$ to be a $d\times t$ matrix, then the product between $U^{\intercal}P$ should be an $m\times t$ matrix. I am sure I am probably misunderstanding either the usage of $Assumptions$ or the usage of the command Dimensions[] regarding this particular case. But if that is so, why is it not working this way?

• You have syntax errors: it's $Assumptions, not $Assumptions$. Second, when you run $Assumptions twice, you override the first cases with U. You can make either a List of assumptions or connect them with &&. Then you'll get {m,t} as TensorDimensions[Y]. Nov 22, 2016 at 16:12
• $Assumptions, per documentation, is only meaningful when used in functions that take the Assumptions option. Dimensions is not such a function but TensorDimensions is. Nov 22, 2016 at 21:48 1 Answer You just have a small typo in $Assumptions and this works only with TensorDimensions

\$Assumptions = {U ∈ Matrices[{d, m}, Reals],
P ∈ Matrices[{d, t}, Reals]};
Y = Transpose[U].P;
Y // Dimensions
Y // TensorDimensions


{2}

{m, t}