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