math / data /lean /OAI /MathematicalPhysics /PEPSMove /DoubleCurve.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
12.2 kB
19
def matrixMulCLM : Matrix ΞΉ ΞΊ β„‚ β†’L[β„‚] Matrix ΞΊ ΞΆ β„‚ β†’L[β„‚] Matrix ΞΉ ΞΆ β„‚ :=
body Β· 11 lines
  (
    { toFun := fun A =>
        { toFun := fun B => A*B
          map_add' := fun B D => Matrix.mul_add A B D
          map_smul' := fun a B => Matrix.mul_smul A a B }
      map_add' := fun A B => LinearMap.ext (fun D => Matrix.add_mul A B D)
      map_smul' := fun a A => LinearMap.ext (fun B => Matrix.smul_mul a A B) } :
    Matrix ΞΉ ΞΊ β„‚ β†’β‚—[β„‚] Matrix ΞΊ ΞΆ β„‚ β†’β‚—[β„‚] Matrix ΞΉ ΞΆ β„‚).mkContinuousβ‚‚ 1 (by
    intro A B
    change β€–A*B‖≀1*β€–Aβ€–*β€–Bβ€–
    simpa only [one_mul] using Matrix.l2_opNorm_mul A B)
33
theorem matrixMul_differentiable :
    Differentiable β„‚ (fun D : Matrix ΞΉ ΞΊ β„‚ Γ— Matrix ΞΊ ΞΆ β„‚ => D.1*D.2) := by
proof Β· 7 lines
  apply IsBoundedBilinearMap.differentiable
  exact {
    add_left := Matrix.add_mul
    smul_left := Matrix.smul_mul
    add_right := Matrix.mul_add
    smul_right := fun a A B => Matrix.mul_smul A a B
    bound := ⟨1,by norm_num,fun A B => by simpa only [one_mul] using Matrix.l2_opNorm_mul A B⟩ }
43
def reshuffleCLM : Matrix (XΓ—Y) (PΓ—F) β„‚ β†’L[β„‚] Matrix (XΓ—P) (YΓ—F) β„‚ :=
body Β· 4 lines
  LinearMap.toContinuousLinearMap {
    toFun := reshuffle
    map_add' := by intros; rfl
    map_smul' := by intros; rfl }
49
def flattenCLM : Matrix ΞΉ ΞΊ β„‚ β†’L[β„‚] EuclideanSpace β„‚ (ΞΉΓ—ΞΊ) :=
body Β· 4 lines
  LinearMap.toContinuousLinearMap {
    toFun := fun C => WithLp.toLp 2 (fun ij => C ij.1 ij.2)
    map_add' := by intros; rfl
    map_smul' := by intros; rfl }
56
theorem flatten_norm_sq (C : Matrix ΞΉ ΞΊ β„‚) : β€–flattenCLM Cβ€–^2=hsEnergy C := by
proof Β· 3 lines
  rw [EuclideanSpace.norm_sq_eq]
  change (βˆ‘ ij : ΞΉΓ—ΞΊ, β€–C ij.1 ij.2β€–^2)=hsEnergy C
  simp only [Fintype.sum_prod_type,hsEnergy]
63
def doubleCurve (C : Matrix (XΓ—Y) (PΓ—F) β„‚) (p : P β†’ ℝ) (r : Y β†’ ℝ)
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ)
    (Ξ² : ℝ) (z : β„‚) : Matrix (XΓ—P) (YΓ—F) β„‚ :=
body Β· 2 lines
  stripProduct S 1 s (fun j : XΓ—P => p j.2) (Ξ²/2) (-Ξ²/2) z *
    reshuffle (stripProduct V 1 v (fun j : XΓ—Y => r j.2) (Ξ²/2) (-Ξ²/2) (1-z)*C)
70
theorem doubleCurve_differentiable (C : Matrix (XΓ—Y) (PΓ—F) β„‚) (p : P β†’ ℝ) (r : Y β†’ ℝ)
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ) (Ξ² : ℝ) :
    Differentiable β„‚ (fun z => flattenCLM (doubleCurve C p r S s V v Ξ² z)) := by
proof Β· 15 lines
  have hL := differentiable_stripProduct S 1 s (fun j : XΓ—P => p j.2) (Ξ²/2) (-Ξ²/2)
  have hR := differentiable_stripProduct V 1 v (fun j : XΓ—Y => r j.2) (Ξ²/2) (-Ξ²/2)
  have hRi := hR.comp (differentiable_const (1:β„‚) |>.sub differentiable_id)
  have hRC : Differentiable β„‚ (fun z => stripProduct V 1 v (fun j : XΓ—Y => r j.2)
      (Ξ²/2) (-Ξ²/2) (1-z)*C) :=
    by
      simpa only [Function.comp_def, Pi.sub_apply, id_eq] using
        (matrixMul_differentiable (ΞΉ:=XΓ—Y) (ΞΊ:=XΓ—Y) (ΞΆ:=PΓ—F)).comp
          (hRi.prodMk (differentiable_const C))
  have hRR := reshuffleCLM.differentiable.comp hRC
  have hM : Differentiable β„‚ (doubleCurve C p r S s V v Ξ²) :=
    by
      convert! (matrixMul_differentiable (ΞΉ:=XΓ—P) (ΞΊ:=XΓ—P) (ΞΆ:=YΓ—F)).comp
        (hL.prodMk hRR) using 1
  exact flattenCLM.differentiable.comp hM
90
theorem doubleCurve_bounded (C : Matrix (XΓ—Y) (PΓ—F) β„‚) (p : P β†’ ℝ) (r : Y β†’ ℝ)
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ) (Ξ² : ℝ) :
    βˆƒ K : ℝ,βˆ€ z : β„‚,0≀z.re β†’ z.re≀1 β†’
      β€–flattenCLM (doubleCurve C p r S s V v Ξ² z)‖≀K := by
proof Β· 18 lines
  obtain ⟨K₁,hβ‚βŸ© := stripProduct_bounded S 1 s (fun j : XΓ—P => p j.2) (Ξ²/2) (-Ξ²/2)
  obtain ⟨Kβ‚‚,hβ‚‚βŸ© := stripProduct_bounded V 1 v (fun j : XΓ—Y => r j.2) (Ξ²/2) (-Ξ²/2)
  have hK₁ : 0≀K₁ := (norm_nonneg _).trans (h₁ 0 (by simp) (by simp))
  have hKβ‚‚ : 0≀Kβ‚‚ := (norm_nonneg _).trans (hβ‚‚ 0 (by simp) (by simp))
  let R : Matrix (XΓ—Y) (PΓ—F) β„‚ β†’L[β„‚] Matrix (XΓ—P) (YΓ—F) β„‚ := reshuffleCLM
  let T : Matrix (XΓ—P) (YΓ—F) β„‚ β†’L[β„‚] EuclideanSpace β„‚ ((XΓ—P)Γ—(YΓ—F)) := flattenCLM
  refine βŸ¨β€–Tβ€–*(K₁*(β€–Rβ€–*(Kβ‚‚*β€–Cβ€–))),?_⟩
  intro z h0 h1
  have h2 : β€–stripProduct V 1 v (fun j : XΓ—Y => r j.2) (Ξ²/2) (-Ξ²/2) (1-z)*C‖≀Kβ‚‚*β€–Cβ€– :=
    (Matrix.l2_opNorm_mul _ _).trans (mul_le_mul_of_nonneg_right
      (hβ‚‚ (1-z) (by simp only [Complex.sub_re,Complex.one_re]; linarith)
        (by simp only [Complex.sub_re,Complex.one_re]; linarith)) (norm_nonneg _))
  have hh : β€–R (stripProduct V 1 v (fun j : XΓ—Y => r j.2) (Ξ²/2) (-Ξ²/2) (1-z)*C)‖≀
      β€–Rβ€–*(Kβ‚‚*β€–Cβ€–) := (R.le_opNorm _).trans (mul_le_mul_of_nonneg_left h2 (norm_nonneg _))
  apply (T.le_opNorm _).trans
  apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
  apply (Matrix.l2_opNorm_mul _ _).trans
  exact mul_le_mul (h₁ z h0 h1) hh (norm_nonneg _) hK₁
123
theorem doubleCurve_left (C : Matrix (XΓ—Y) (PΓ—F) β„‚) (p : P β†’ ℝ) (r : Y β†’ ℝ)
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ)
    (Ξ² : ℝ) (z : β„‚) (hz : z.re=0) :
    let t := Ξ²*z.im/2
proof Β· 19 lines
    doubleCurve C p r S s V v Ξ² z=
      power S s (Complex.I*(t:β„‚))*power 1 (fun j : XΓ—P => p j.2) (-Complex.I*(t:β„‚))*
      reshuffle (power V v (((Ξ²/2:ℝ):β„‚)-Complex.I*(t:β„‚))*
        power 1 (fun j : XΓ—Y => r j.2) (((-Ξ²/2:ℝ):β„‚)+Complex.I*(t:β„‚))*C) := by
  dsimp only
  have hz' : z=Complex.I*(z.im:β„‚) := by apply Complex.ext <;> simp [hz]
  have h₁ : ((Ξ²/2:ℝ):β„‚)*z=Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have hβ‚‚ : ((-Ξ²/2:ℝ):β„‚)*z=-Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have h₃ : ((Ξ²/2:ℝ):β„‚)*(1-z)=((Ξ²/2:ℝ):β„‚)-Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have hβ‚„ : ((-Ξ²/2:ℝ):β„‚)*(1-z)=((-Ξ²/2:ℝ):β„‚)+Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  simp only [doubleCurve,stripProduct,h₁,hβ‚‚,h₃,hβ‚„]
149
theorem doubleCurve_right (C : Matrix (XΓ—Y) (PΓ—F) β„‚) (p : P β†’ ℝ) (r : Y β†’ ℝ)
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ)
    (Ξ² : ℝ) (z : β„‚) (hz : z.re=0) :
    let t := Ξ²*z.im/2
proof Β· 20 lines
    doubleCurve C p r S s V v Ξ² (z+1)=
      power S s (((Ξ²/2:ℝ):β„‚)+Complex.I*(t:β„‚))*
      power 1 (fun j : XΓ—P => p j.2) (((-Ξ²/2:ℝ):β„‚)-Complex.I*(t:β„‚))*
      reshuffle (power V v (-Complex.I*(t:β„‚))*
        power 1 (fun j : XΓ—Y => r j.2) (Complex.I*(t:β„‚))*C) := by
  dsimp only
  have hz' : z=Complex.I*(z.im:β„‚) := by apply Complex.ext <;> simp [hz]
  have h₁ : ((Ξ²/2:ℝ):β„‚)*(z+1)=((Ξ²/2:ℝ):β„‚)+Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have hβ‚‚ : ((-Ξ²/2:ℝ):β„‚)*(z+1)=((-Ξ²/2:ℝ):β„‚)-Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have h₃ : ((Ξ²/2:ℝ):β„‚)*(1-(z+1))=-Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  have hβ‚„ : ((-Ξ²/2:ℝ):β„‚)*(1-(z+1))=Complex.I*((Ξ²*z.im/2:ℝ):β„‚) := by
    conv_lhs => rw [hz']
    push_cast; ring
  simp only [doubleCurve,stripProduct,h₁,hβ‚‚,h₃,hβ‚„]
178
theorem one_copy_interpolation_fullrank [Nonempty X] [Nonempty P]
    (W : Matrix Y (XΓ—(PΓ—F)) β„‚) (r : Y β†’ ℝ) (hr : βˆ€ i,0≀r i)
    (hW : W*W.conjTranspose=diagonal (fun y => (r y:β„‚))) (hrsum : βˆ‘ i,r i=1)
    (p : P β†’ ℝ) (hp : βˆ€ i,0≀p i) (hpsum : βˆ‘ i,p i=1)
    (hP : ptrL (reshuffle (coefficient W)*(reshuffle (coefficient W)).conjTranspose)=
      diagonal (fun i => (p i:β„‚)))
    (S : unitary (Matrix (XΓ—P) (XΓ—P) β„‚)) (s : (XΓ—P) β†’ ℝ)
    (hs : βˆ€ i,0 ≀ s i) (hsum : βˆ‘ i,s i≀1)
    (V : unitary (Matrix (XΓ—Y) (XΓ—Y) β„‚)) (v : (XΓ—Y) β†’ ℝ)
    (hv : βˆ€ i,0 ≀ v i) (hvsum : βˆ‘ i,v i≀1) (hvne : βˆ€ i,v iβ‰ 0)
    (Ξ² l : ℝ) (hΞ² : 0<Ξ²) (hΞ²fourth : β≀1/4)
    (hl : 1≀l) (hl' : Real.log (Fintype.card X:ℝ)≀l)
    (hsmall : (Ξ²/(1-Ξ²))*Real.log (Fintype.card X:ℝ)≀1) :
    let Ξ΅ := 3*Ξ²^2/(1-Ξ²)*(16*Real.exp 1*(Real.log (Fintype.card X:ℝ))^2+32)
proof Β· 45 lines
    let H := QuantumSSA.conditionalEntropy (reshuffle (coefficient W)*
      (reshuffle (coefficient W)).conjTranspose)
    β€–flattenCLM (power S s ((Ξ²/4:ℝ):β„‚)*
      power 1 (fun j : XΓ—P => p j.2) ((-Ξ²/4:ℝ):β„‚)*
      reshuffle (power V v ((Ξ²/4:ℝ):β„‚)*
        power 1 (fun j : XΓ—Y => r j.2) ((-Ξ²/4:ℝ):β„‚)*coefficient W))‖≀
      Real.exp (-Ξ²*(conditionalEntropy W r+H)/4+Ξ΅/2+
        (17/64:ℝ)*100000*Real.rpow Ξ² (5/4:ℝ)*l^2) := by
  dsimp only
  let Ξ΅ := 3*Ξ²^2/(1-Ξ²)*(16*Real.exp 1*(Real.log (Fintype.card X:ℝ))^2+32)
  let H := QuantumSSA.conditionalEntropy (reshuffle (coefficient W)*(reshuffle (coefficient W)).conjTranspose)
  let Q := 100000*Real.rpow Ξ² (5/4:ℝ)*l^2
  let G := fun z => flattenCLM (doubleCurve (coefficient W) p r S s V v Ξ² z)
  have hB : 0≀Q/4 := by
    have := Real.rpow_nonneg hΞ².le (5/4:ℝ)
    dsimp only [Q]; positivity
  have hpair (z : β„‚) (hz : z.re=0) :
      β€–G zβ€–^2*β€–G (z+1)β€–^2≀Real.exp ((-Ξ²*(conditionalEntropy W r+H)+2*Ξ΅+Q)+(Q/4)*z.im^2) := by
    dsimp only [G]
    rw [flatten_norm_sq,flatten_norm_sq,doubleCurve_left _ _ _ _ _ _ _ _ _ hz,
      doubleCurve_right _ _ _ _ _ _ _ _ _ hz]
    have hh := boundary_pair_energy W r hr hW hrsum p hp hpsum hP S s hs hsum V v hv hvsum hvne
      Ξ² (Ξ²*z.im/2) l hΞ² hΞ²fourth hl hl' hsmall
    dsimp only at hh
    convert hh using 1
    congr 1
    dsimp only [Ξ΅,H,Q]
    field_simp [ne_of_gt hΞ²]
    ring
  have hg := paired_three_lines_vector_sq G (doubleCurve_differentiable _ _ _ _ _ _ _ _)
    (doubleCurve_bounded _ _ _ _ _ _ _ _) (-Ξ²*(conditionalEntropy W r+H)+2*Ξ΅+Q) (Q/4) hB hpair
  have hc : G (1/2)=flattenCLM (power S s ((Ξ²/4:ℝ):β„‚)*
      power 1 (fun j : XΓ—P => p j.2) ((-Ξ²/4:ℝ):β„‚)*
      reshuffle (power V v ((Ξ²/4:ℝ):β„‚)*
        power 1 (fun j : XΓ—Y => r j.2) ((-Ξ²/4:ℝ):β„‚)*coefficient W)) := by
    dsimp only [G,doubleCurve,stripProduct]
    have h₁ : ((Ξ²/2:ℝ):β„‚)*(1/2)=((Ξ²/4:ℝ):β„‚) := by push_cast; ring
    have hβ‚‚ : ((-Ξ²/2:ℝ):β„‚)*(1/2)=((-Ξ²/4:ℝ):β„‚) := by push_cast; ring
    have h₃ : (1:β„‚)-1/2=1/2 := by norm_num
    rw [h₃,h₁,hβ‚‚]
  rw [hc] at hg
  convert hg using 1
  congr 1
  dsimp only [Ξ΅,H,Q]
  ring