File size: 4,869 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | 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
|