Download data/lean/OAI/Probability/BinarySweep/TensorBounds/PiTensorMatrices.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.87 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BinarySweep/TensorBounds/PiTensorMatrices.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/BinarySweep/TensorBounds/PiTensorMatrices.lean
-
curl -L -o PiTensorMatrices.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BinarySweep/TensorBounds/PiTensorMatrices.lean
4.87 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators Classical ComplexOrder MatrixOrder | |
| open Matrix | |
| namespace BinaryCoordinateSweeps.Density | |
| variable {I : Type*} [Fintype I] [DecidableEq I] | |
| {A B C : I β Type*} [β i, Fintype (A i)] [β i, DecidableEq (A i)] | |
| [β i, Fintype (B i)] [β i, DecidableEq (B i)] | |
| [β i, Fintype (C i)] [β i, DecidableEq (C i)] | |
| def piTensorMatrices (M : β i, Matrix (A i) (B i) β) : | |
| Matrix (β i, A i) (β i, B i) β := fun x y => β i, M i (x i) (y i) | |
| omit [β index, Fintype (A index)] [β index, DecidableEq (A index)] | |
| [β index, DecidableEq (B index)] [β index, Fintype (C index)] | |
| [β index, DecidableEq (C index)] in | |
| lemma piTensorMatrices_mul (M : β i, Matrix (A i) (B i) β) | |
| (N : β i, Matrix (B i) (C i) β) : | |
| piTensorMatrices M * piTensorMatrices N = piTensorMatrices (fun i => M i*N i) := by | |
| ext x z | |
| simp only [Matrix.mul_apply,piTensorMatrices,β Finset.prod_mul_distrib] | |
| exact (Fintype.prod_sum (fun i b => M i (x i) b * N i b (z i))).symm | |
| omit [DecidableEq I] [β index, Fintype (A index)] [β index, DecidableEq (A index)] | |
| [β index, Fintype (B index)] [β index, DecidableEq (B index)] in | |
| lemma piTensorMatrices_star (M : β i, Matrix (A i) (B i) β) : | |
| (piTensorMatrices M).conjTranspose = piTensorMatrices (fun i => (M i).conjTranspose) := by | |
| ext x y | |
| simp [piTensorMatrices] | |
| omit [DecidableEq I] [β index, Fintype (A index)] in | |
| lemma piTensorMatrices_one : piTensorMatrices (fun i : I => (1 : Matrix (A i) (A i) β))=1 := by | |
| ext x y | |
| by_cases h : x=y | |
| Β· subst y; simp [piTensorMatrices] | |
| Β· obtain β¨i,hiβ© := Function.ne_iff.mp h | |
| simp only [piTensorMatrices,Matrix.one_apply,ite_eq_right h] | |
| exact Finset.prod_eq_zero (Finset.mem_univ i) (ite_eq_right hi) | |
| lemma piTensorMatrices_psd (M : β i, Matrix (A i) (A i) β) (hM : β i, (M i).PosSemidef) : | |
| (piTensorMatrices M).PosSemidef := by | |
| have hx (i : I) : β X : Matrix (A i) (A i) β, M i=X.conjTranspose*X := | |
| CStarAlgebra.nonneg_iff_eq_star_mul_self.mp (hM i).nonneg | |
| choose X hX using hx | |
| have he : piTensorMatrices M = (piTensorMatrices X).conjTranspose*piTensorMatrices X := by | |
| rw [piTensorMatrices_star,piTensorMatrices_mul] | |
| congr 1 | |
| funext i | |
| exact hX i | |
| rw [he] | |
| exact Matrix.posSemidef_conjTranspose_mul_self _ | |
| omit [β index, DecidableEq (A index)] in | |
| lemma piTensorMatrices_trace (M : β i, Matrix (A i) (A i) β) : | |
| (piTensorMatrices M).trace = β i, (M i).trace := by | |
| simp only [Matrix.trace,Matrix.diag,piTensorMatrices] | |
| exact (Fintype.prod_sum (fun i a => M i a a)).symm | |
| omit [DecidableEq I] [β index, Fintype (A index)] [β index, DecidableEq (A index)] | |
| [β index, Fintype (B index)] [β index, DecidableEq (B index)] in | |
| lemma piTensorMatrices_smul (c : I β β) (M : β i, Matrix (A i) (B i) β) : | |
| piTensorMatrices (fun i => c i β’ M i) = (βi, c i) β’ piTensorMatrices M := by | |
| ext x y | |
| simp only [piTensorMatrices,Matrix.smul_apply,smul_eq_mul,Finset.prod_mul_distrib] | |
| omit [β index, Fintype (A index)] [β index, DecidableEq (A index)] | |
| [β index, Fintype (B index)] [β index, DecidableEq (B index)] in | |
| lemma piTensorMatrices_sum {W : I β Type*} [β i, Fintype (W i)] | |
| (M : β i, W i β Matrix (A i) (B i) β) : | |
| piTensorMatrices (fun i => βw, M i w) = βf : β i, W i, piTensorMatrices (fun i => M i (f i)) := by | |
| ext x y | |
| simp only [piTensorMatrices,Matrix.sum_apply] | |
| exact Fintype.prod_sum (fun i w => M i w (x i) (y i)) | |
| lemma piTensorMatrices_mono (M N : β i, Matrix (A i) (A i) β) | |
| (hM : β i, (M i).PosSemidef) (hMN : β i, (N i-M i).PosSemidef) : | |
| (piTensorMatrices N-piTensorMatrices M).PosSemidef := by | |
| let T (i : I) (b : Bool) := if b then N i-M i else M i | |
| have he : piTensorMatrices N = βf : I β Bool, piTensorMatrices (fun i => T i (f i)) := by | |
| rw [β piTensorMatrices_sum] | |
| congr 1 | |
| funext i | |
| simp [T] | |
| have hf : piTensorMatrices M = piTensorMatrices (fun i => T i false) := by simp [T] | |
| rw [he,hf,β Finset.sum_erase_add _ _ (Finset.mem_univ (fun _ : I => false)),add_sub_cancel_right] | |
| apply Matrix.posSemidef_sum | |
| intro f _ | |
| apply piTensorMatrices_psd | |
| intro i | |
| dsimp [T] | |
| split | |
| Β· exact hMN i | |
| Β· exact hM i | |
| theorem piTensor_density_domination {W : I β Type*} [β i, Fintype (W i)] | |
| (P : β i, Matrix (A i) (A i) β) (r : β i, W i β Matrix (A i) (A i) β) | |
| (c : I β β) (hP : β i, (P i).PosSemidef) | |
| (hdom : β i, (c i β’ βw, r i w-P i).PosSemidef) : | |
| ((βi, c i) β’ (βf : β i, W i, piTensorMatrices (fun i => r i (f i)))-piTensorMatrices P).PosSemidef := by | |
| have h := piTensorMatrices_mono P (fun i => c i β’ βw, r i w) hP hdom | |
| rwa [piTensorMatrices_smul,piTensorMatrices_sum] at h | |
| end BinaryCoordinateSweeps.Density | |
| end | |
| end OAI | |