Zulip Chat Archive
Stream: mathlib4
Topic: transform type from a vector in R^n to a matrix of n by 1
Chenyi Li (Apr 07 2024 at 14:05):
In natural language, it is easy to see that any vectors in is equivalent to a matrix of . However, things seem to be harder for me in mathlib4. If we have a vector v : EuclideanSpace ℝ (Fin n)
, how to tranform the type to a matrix with Matrix (Fin n) (Fin 1) ℝ
. Is there any theorem in mathlib4 correlated to this problem? Thanks very much for your help!
Adam Topaz (Apr 07 2024 at 14:20):
You could uncurry and use an equiv on the indexing type, for example, but this is probably an #xy problem
Fabrizio Barroero (Apr 08 2024 at 07:18):
I am not sure this is what you are looking for, but you could have a look at Matrix.col
.
Matrix.col u is the column matrix whose entries are given by u.
Last updated: May 02 2025 at 03:31 UTC