Download data/lean/OAI/MathematicalPhysics/PEPSMove/DoubleCurve.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 12.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/PEPSMove/DoubleCurve.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/PEPSMove/DoubleCurve.lean
-
curl -L -o DoubleCurve.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/PEPSMove/DoubleCurve.lean
12.2 kB
Lean 4 Β· 11
declarations statementsfull
| import Mathlib | |
| import OAI.MathematicalPhysics.PEPSMove.BoundaryEnergy | |
| import OAI.MathematicalPhysics.PEPSMove.ThreeLines | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators ComplexOrder Matrix.Norms.L2Operator MatrixOrder | |
| open Matrix | |
| namespace PolynomialPEPS.PhysicalMove.LocalMove | |
| open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder | |
| open Matrix SupportedCurve SpectralCurve MatrixInterpolation QuantumSSA ConditionalCollision | |
| variable {ΞΉ ΞΊ ΞΆ X Y P F : Type*} | |
| [Fintype ΞΉ] [Fintype ΞΊ] [Fintype ΞΆ] [DecidableEq ΞΉ] [DecidableEq ΞΊ] [DecidableEq ΞΆ] | |
| [Fintype X] [Fintype Y] [Fintype P] [Fintype F] | |
| [DecidableEq X] [DecidableEq Y] [DecidableEq P] [DecidableEq F] | |
| def matrixMulCLM : Matrix ΞΉ ΞΊ β βL[β] Matrix ΞΊ ΞΆ β βL[β] Matrix ΞΉ ΞΆ β := | |
| ( | |
| { 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) | |
| omit [DecidableEq ΞΉ] in | |
| theorem matrixMul_differentiable : | |
| Differentiable β (fun D : Matrix ΞΉ ΞΊ β Γ Matrix ΞΊ ΞΆ β => D.1*D.2) := by | |
| 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β© } | |
| def reshuffleCLM : Matrix (XΓY) (PΓF) β βL[β] Matrix (XΓP) (YΓF) β := | |
| LinearMap.toContinuousLinearMap { | |
| toFun := reshuffle | |
| map_add' := by intros; rfl | |
| map_smul' := by intros; rfl } | |
| def flattenCLM : Matrix ΞΉ ΞΊ β βL[β] EuclideanSpace β (ΞΉΓΞΊ) := | |
| 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 } | |
| omit [DecidableEq ΞΉ] [DecidableEq ΞΊ] in | |
| theorem flatten_norm_sq (C : Matrix ΞΉ ΞΊ β) : βflattenCLM Cβ^2=hsEnergy C := by | |
| rw [EuclideanSpace.norm_sq_eq] | |
| change (β ij : ΞΉΓΞΊ, βC ij.1 ij.2β^2)=hsEnergy C | |
| simp only [Fintype.sum_prod_type,hsEnergy] | |
| 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) β := | |
| 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) | |
| 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 | |
| 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 | |
| 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 | |
| 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β | |
| end PolynomialPEPS.PhysicalMove.LocalMove | |
| namespace PolynomialPEPS.PhysicalMove.LocalMove | |
| open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder | |
| open Matrix SupportedCurve SpectralCurve MatrixInterpolation QuantumSSA ConditionalCollision | |
| variable {X Y P F : Type*} [Fintype X] [Fintype Y] [Fintype P] [Fintype F] | |
| [DecidableEq X] [DecidableEq Y] [DecidableEq P] [DecidableEq F] | |
| omit [Fintype F] [DecidableEq F] in | |
| 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 | |
| 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β] | |
| omit [Fintype F] [DecidableEq F] in | |
| 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 | |
| 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β] | |
| 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) | |
| 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 | |
| end PolynomialPEPS.PhysicalMove.LocalMove | |
| end | |
| end OAI | |
Outline