AFTD Auto-Formalizing Theoretical Domains

MatrixMap.of_choi_matrix

defimported Lean

Given the Choi matrix, generate the corresponding R-linear map between matrices as a MatrixMap. This is the inverse of MatrixMap.choi_matrix.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {A B C D E F R : Type*} [Fintype A] [DecidableEq A] in
variable [Semiring R] in
set_option backward.isDefEq.respectTransparency false in
def MatrixMap.of_choi_matrix (M : Matrix (B × A) (B × A) R) : MatrixMap A B R
Defined in
QuantumInfo, `MatrixMap.of_choi_matrix`
Lean proof
By Alex Meiburg, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
16 Oct 2026
Axioms
none listed
Built on 1
  • MatrixMapA MatrixMap is a linear map between squares matrices of size A to size B, over R.
Used by 4

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {A B C D E F R : Type*} [Fintype A] [DecidableEq A] in
variable [Semiring R] in
set_option backward.isDefEq.respectTransparency false in
/-- Given the Choi matrix, generate the corresponding R-linear map between matrices as a MatrixMap. This is the inverse of `MatrixMap.choi_matrix`. -/
def MatrixMap.of_choi_matrix (M : Matrix (B × A) (B × A) R) : MatrixMap A B R where
  toFun X := fun b₁ b₂ ↦ ∑ (a₁ : A), ∑ (a₂ : A), X a₁ a₂ * M (b₁, a₁) (b₂, a₂)
  map_add' x y := by funext b₁ b₂; simp [add_mul, Finset.sum_add_distrib]
  map_smul' r x := by
    funext b₁ b₂
    simp only [Matrix.smul_apply, smul_eq_mul, RingHom.id_apply, Finset.mul_sum, mul_assoc]
See it in the graphDiscuss this resultChallenge it