openAI-math-dataset / lean /OAI /LinearAlgebra /MatrixMultiplication /Tensor /ComplexDotPairing.lean
Download lean/OAI/LinearAlgebra/MatrixMultiplication/Tensor/ComplexDotPairing.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/LinearAlgebra/MatrixMultiplication/Tensor/ComplexDotPairing.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/LinearAlgebra/MatrixMultiplication/Tensor/ComplexDotPairing.lean
-
curl -L -o ComplexDotPairing.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/LinearAlgebra/MatrixMultiplication/Tensor/ComplexDotPairing.lean
778 Bytes
| import OAI.LinearAlgebra.MatrixMultiplication.Tensor.ComplexTensor | |
| namespace OAI | |
| /-! Finite coefficient tensors and their algebraic transformations. -/ | |
| open scoped BigOperators | |
| namespace MatrixMultiplication.Foundation | |
| namespace Tensor | |
| section Pairing | |
| variable {K U : Type*} [CommSemiring K] [DecidableEq U] | |
| def dotPairing (U : Type*) [DecidableEq U] : Tensor K U U Unit := | |
| fun i j _ => if i = j then 1 else 0 | |
| @[simp] theorem dotPairing_matching (i : U) : | |
| dotPairing (K := K) U i i () = 1 := by | |
| simp [dotPairing] | |
| theorem contract_dotPairing [Fintype U] (a b : U → K) : | |
| contract (dotPairing (K := K) U) a b () = ∑ i, a i * b i := by | |
| classical | |
| simp [contract, dotPairing, ite_mul] | |
| end Pairing | |
| end Tensor | |
| end MatrixMultiplication.Foundation | |
| end OAI | |