Zulip Chat Archive
Stream: Is there code for X?
Topic: Trace of linear maps on EuclideanSpace
Ivรกn Renison (May 23 2025 at 14:19):
Hi, do we have something like this?
import Mathlib.Analysis.InnerProductSpace.PiL2
variable {ฮน ๐ : Type*} [RCLike ๐]
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ๐ E]
variable [Fintype ฮน]
lemma aux : โs : Finset (EuclideanSpace ๐ ฮน), Nonempty (Basis { x // x โ s } ๐ (EuclideanSpace ๐ ฮน)) :=
sorry
I so there are some things about bases of the EuclideanSpace, but not proving that in particular.
The reason for witch I want this is to work with the trace of a linear mal of type EuclideanSpace ๐ ฮน โโ[๐] EuclideanSpace ๐ ฮน, because the definition of LinearMap.trace makes cases with that existential
In particular I'm working with ฮน = Fin 2 and I want to prove the traces of concrete linear maps, so if you have any suggestions for that they are welcome
Aaron Liu (May 23 2025 at 14:26):
import Mathlib.Analysis.InnerProductSpace.PiL2
noncomputable example {ฮน ๐ : Type*} [RCLike ๐] [Fintype ฮน] : Basis ฮน ๐ (EuclideanSpace ๐ ฮน) :=
PiLp.basisFun 2 ๐ ฮน
Ivรกn Renison (May 23 2025 at 14:42):
And how would you prove the โ using that? I have not being able
Eric Wieser (May 23 2025 at 14:47):
Why do you need the exists?
Eric Wieser (May 23 2025 at 14:47):
(the answer is going to be something like Finset.univ.image theBasisAaronPosted as the witness)
Ivรกn Renison (May 23 2025 at 14:57):
Here is a simplified version of what I'm, trying to prove:
import Mathlib
section outerProduct
variable (๐ : Type*) {E : Type*} [RCLike ๐]
variable [NormedAddCommGroup E] [InnerProductSpace ๐ E] [FiniteDimensional ๐ E]
/-- The outer product of two vectors -/
def outerProduct (x : E) (y : E) : E โโ[๐] E where
toFun := fun z => (inner ๐ y z) โข x
map_add' z w := by
rw [โ Module.add_smul, inner_add_right y z w]
map_smul' m z := by
rw [RingHom.id_apply, inner_smul_right_eq_smul y z m]
exact IsScalarTower.smul_assoc m (inner ๐ y z) x
end outerProduct
variable {๐ : Type*} [RCLike ๐]
local notation "๐ยฒ" => EuclideanSpace ๐ (Fin 2)
def ket0 : ๐ยฒ := !โ[1, 0]
def ketbra0 : ๐ยฒ โโ[๐] ๐ยฒ := outerProduct ๐ ket0 ket0
example : LinearMap.trace ๐ ๐ยฒ ketbra0 = 1 :=
sorry
So I what to somehow unfold thing, and the โ is in an if in LinearMap.trace
Ivรกn Renison (May 23 2025 at 14:57):
I can use Finset.univ.image (PiLp.basisFun 2 ๐ ฮน), but then I'm not able to prove that that set satisfies the โ
Eric Wieser (May 23 2025 at 15:15):
You shouldn't care that the exists is in there
Eric Wieser (May 23 2025 at 15:15):
There should be a theorem that you can use instead
Eric Wieser (May 23 2025 at 15:15):
@loogle LinearMap.trace, Basis
loogle (May 23 2025 at 15:15):
:search: LinearMap.trace.eq_1, LinearMap.trace_eq_matrix_trace, and 3 more
Eric Wieser (May 23 2025 at 15:15):
It's the second one
Ivรกn Renison (May 23 2025 at 15:40):
Ok, thanks
Last updated: Dec 20 2025 at 21:32 UTC