Download data/lean/OAI/MathematicalPhysics/PEPSSubvolume/FlatDirection.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.27 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/PEPSSubvolume/FlatDirection.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/PEPSSubvolume/FlatDirection.lean
-
curl -L -o FlatDirection.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/PEPSSubvolume/FlatDirection.lean
9.27 kB
| import Mathlib | |
| import OAI.MathematicalPhysics.PEPSFilters.LocalOperators | |
| import OAI.MathematicalPhysics.PEPSSubvolume.Filters | |
| import OAI.MathematicalPhysics.PEPSSubvolume.KernelPerturbation | |
| namespace OAI | |
| /-! Flat second variations and vanishing optimizing kernel directions. -/ | |
| noncomputable section | |
| open scoped BigOperators ComplexOrder | |
| open scoped BigOperators ComplexOrder Matrix.Norms.L2Operator | |
| open scoped BigOperators | |
| open PolynomialPEPS.PinnedEntropy | |
| open scoped Topology | |
| open Filter | |
| namespace PolynomialPEPS.Subvolume.OptimizerFlatDirection | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| theorem second_variation (v u w : E) (C K p : β) (hp : 2 < p) | |
| (h : β t : β, βv + t β’ u + t^2 β’ wβ^2 β€ | |
| (βvβ^2 + C*t^2) * (1 + K*|t|^p)) : | |
| 2 * inner β v w + βuβ^2 β€ C := by | |
| have hb (t : β) (ht : 0 < t) : | |
| 2 * inner β v w + βuβ^2 β€ | |
| C + K*βvβ^2*t^(p-2) + K*C*t^p := by | |
| have hp' := h t | |
| have hm' := h (-t) | |
| have hsum : β(v+t^2 β’ w) + t β’ uβ^2 + β(v+t^2 β’ w) - t β’ uβ^2 β€ | |
| 2 * ((βvβ^2+C*t^2)*(1+K*t^p)) := by | |
| simpa only [neg_smul, neg_sq, abs_neg, abs_of_pos ht, sub_eq_add_neg, | |
| add_assoc, add_left_comm, add_comm, two_mul] using add_le_add hp' hm' | |
| rw [parallelogram_law_with_norm β, norm_add_sq_real] at hsum | |
| simp only [inner_smul_right, norm_smul, Real.norm_eq_abs, | |
| abs_of_nonneg (sq_nonneg t), abs_of_pos ht, mul_pow] at hsum | |
| have hr : t^p = t^2 * t^(p-2) := by | |
| rw [β Real.rpow_natCast t 2, β Real.rpow_add ht] | |
| congr 1 | |
| norm_num | |
| have ht2 : 0 < t^2 := sq_pos_of_pos ht | |
| apply (mul_le_mul_iff_rightβ ht2).mp | |
| have hw : 0 β€ (t^2)^2 * βwβ^2 := mul_nonneg (sq_nonneg _) (sq_nonneg _) | |
| rw [hr] at hsum β’ | |
| nlinarith only [hsum,hw] | |
| have hpow : Tendsto (fun t : β => t^(p-2)) (π[>] 0) (π 0) := by | |
| have ht := (Real.continuousAt_rpow_const 0 (p-2) | |
| (Or.inr (by linarith))).tendsto.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0:β))) | |
| simpa [Real.zero_rpow (show p-2 β 0 by linarith)] using ht | |
| have hpow' : Tendsto (fun t : β => t^p) (π[>] 0) (π 0) := by | |
| have ht := (Real.continuousAt_rpow_const 0 p | |
| (Or.inr (by linarith))).tendsto.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0:β))) | |
| simpa [Real.zero_rpow (ne_of_gt (show 0 < p by linarith))] using ht | |
| have hl : Tendsto (fun t : β => C+K*βvβ^2*t^(p-2)+K*C*t^p) | |
| (π[>] 0) (π C) := by | |
| convert (tendsto_const_nhds.add (tendsto_const_nhds.mul hpow)).add | |
| (tendsto_const_nhds.mul hpow') using 1 | |
| simp | |
| apply ge_of_tendsto hl | |
| filter_upwards [self_mem_nhdsWithin] with t ht | |
| exact hb t ht | |
| theorem first_direction_vanishes (v w : E) (K p : β) (hp : 2 < p) | |
| (h : β t : β, βv + t β’ wβ^2 β€ βvβ^2 * (1+K*|t|^p)) : | |
| w = 0 := by | |
| have hb := second_variation v w 0 0 K p hp (by simpa using h) | |
| simp only [inner_zero_right, mul_zero, zero_add] at hb | |
| simpa using norm_eq_zero.mp (le_antisymm (by nlinarith [norm_nonneg w]) (norm_nonneg w)) | |
| theorem mixed_direction_vanishes (v u w : E) (K p : β) (hp : 2 < p) | |
| (h : β c t : β, βv + t β’ u + (c*t^2) β’ wβ^2 β€ | |
| (βvβ^2+βvβ^2*t^2)*(1+K*|c*t|^p)) : | |
| inner β v w = 0 := by | |
| have hc (c : β) : 2*c*inner β v w + βuβ^2 β€ βvβ^2 := by | |
| have hb := second_variation v u (c β’ w) (βvβ^2) (K*|c|^p) p hp (fun t => by | |
| simpa [smul_smul, mul_comm, mul_left_comm, mul_assoc, abs_mul, | |
| Real.mul_rpow (abs_nonneg c) (abs_nonneg t)] using h c t) | |
| simpa [inner_smul_right, mul_assoc, mul_left_comm, mul_comm] using hb | |
| by_contra hn | |
| have hne : 2 * inner β v w β 0 := mul_ne_zero (by norm_num) hn | |
| have H := hc ((βvβ^2+βuβ^2+1)/(2*inner β v w)) | |
| have heq : 2*((βvβ^2+βuβ^2+1)/(2*inner β v w))*inner β v w = | |
| βvβ^2+βuβ^2+1 := by field_simp | |
| rw [heq] at H | |
| nlinarith [sq_nonneg βuβ] | |
| end PolynomialPEPS.Subvolume.OptimizerFlatDirection | |
| namespace PolynomialPEPS.Subvolume.ActualKernel | |
| open scoped BigOperators ComplexOrder Matrix.Norms.L2Operator | |
| open PolynomialPEPS.Subvolume.SpectralCurve PolynomialPEPS.Subvolume.KernelPerturbation | |
| open PolynomialPEPS.Subvolume.KernelNormalization PolynomialPEPS.Subvolume.OptimizerGauge | |
| variable {L q : β} | |
| theorem affine_output (A : β β Operator L q) (k n : β) (hk : k<n) | |
| (B : Operator L q) (c d : β) (Ο : State L q) : | |
| asMap (L := L) (q := q) (orderedPrefix (Function.update A k (c β’ (A k + d β’ B))) n) Ο = | |
| c β’ (asMap (L := L) (q := q) (orderedPrefix A n) Ο + | |
| d β’ asMap (L := L) (q := q) (orderedPrefix (Function.update A k B) n) Ο) := by | |
| rw [prefix_update_smul A k n hk, prefix_update_add A k n hk, | |
| Function.update_eq_self, prefix_update_smul A k n hk] | |
| change Matrix.toEuclideanCLM (π := β) (_ β’ (_ + _ β’ _)) Ο = _ | |
| simp only [map_smul, map_add, smul_apply, add_apply] | |
| rfl | |
| theorem perturbation_envelope (hq : 0 < q) | |
| (X : β β Finset (Vertex L)) (hX : Monotone X) | |
| (a : β β β) (Ο : State L q) (n : β) | |
| (F : (j : β) β LocalPositiveFilter q (X j)) | |
| (hF : IsFilterOptimizer Ο (fun j : Fin n => a j.val) (fun j : Fin n => F j.val)) | |
| (k : β) (hk : k < n) (hp : 2 < 2/a k) | |
| (U : unitary (Matrix (RegionConfiguration q (X k)) (RegionConfiguration q (X k)) β)) | |
| (e : RegionConfiguration q (X k) β β) (he : β i, 0 β€ e i) | |
| (hrep : (F k).matrix = spectralHom U (fun i => (e i : β))) | |
| (hs : β i, (e i)^(2/a k) = 1) | |
| (ΞΆ : unitary β) (t : β) : | |
| let A : β β Operator L q := fun j => liftLocal (X j) (F j).matrix | |
| let v : State L q := asMap (L := L) (q := q) (orderedPrefix A n) Ο | |
| let w : State L q := asMap (L := L) (q := q) (orderedPrefix (Function.update A k (liftLocal (X k) (kernel U e))) n) Ο | |
| βv + ((t : β)*(ΞΆ : β)) β’ wβ^2 β€ βvβ^2 * cost e (2/a k) t := by | |
| dsimp only | |
| let A : β β Operator L q := fun j => liftLocal (X j) (F j).matrix | |
| let c := scale (cost e (2/a k) t) (2/a k) | |
| let G : LocalPositiveFilter q (X k) := | |
| β¨normalized U e (2/a k) t, normalized_posSemidef U e he (2/a k) tβ© | |
| have hG : filterTracePower G (2/a k) = 1 := | |
| normalized_capacity U e he (2/a k) (by linarith) hs t | |
| have hb := one_replacement_bound hq X hX a Ο n F hF k hk | |
| (perturbUnitary U e ΞΆ t) G hG | |
| have hmat : liftLocal (X k) | |
| ((perturbUnitary U e ΞΆ t : Matrix _ _ β)*G.matrix) = | |
| (c : β) β’ (A k + ((t : β)*(ΞΆ : β)) β’ liftLocal (X k) (kernel U e)) := by | |
| rw [show G.matrix = normalized U e (2/a k) t from rfl, | |
| normalized_factorization, β hrep, liftLocal_smul, liftLocal_add, liftLocal_smul] | |
| have houtput : asMap (L := L) (q := q) (orderedPrefix (Function.update A k | |
| (liftLocal (X k) ((perturbUnitary U e ΞΆ t : Matrix _ _ β)*G.matrix))) n) Ο = | |
| (c : β) β’ (asMap (L := L) (q := q) (orderedPrefix A n) Ο + | |
| ((t : β)*(ΞΆ : β)) β’ | |
| asMap (L := L) (q := q) (orderedPrefix (Function.update A k (liftLocal (X k) (kernel U e))) n) Ο) := by | |
| rw [hmat] | |
| exact affine_output A k n hk _ _ _ Ο | |
| have hfv : filteredVector (fun j : Fin n => F j.val) Ο = asMap (L := L) (q := q) (orderedPrefix A n) Ο := by | |
| unfold filteredVector | |
| rw [PhysicalCurve.orderedFilterProduct_eq_prefix] | |
| have hc : 0 < c := scale_pos _ _ | |
| (lt_of_lt_of_le zero_lt_one (one_le_cost e (2/a k) t)) | |
| have hb' := hb | |
| rw [houtput, hfv, norm_smul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hc] at hb' | |
| exact norm_sq_bound _ _ _ _ (norm_nonneg _) (norm_nonneg _) | |
| (one_le_cost e (2/a k) t) hp hb' | |
| theorem kernel_output_zero (hq : 0 < q) | |
| (X : β β Finset (Vertex L)) (hX : Monotone X) | |
| (a : β β β) (Ο : State L q) (n : β) | |
| (F : (j : β) β LocalPositiveFilter q (X j)) | |
| (hF : IsFilterOptimizer Ο (fun j : Fin n => a j.val) (fun j : Fin n => F j.val)) | |
| (k : β) (hk : k < n) (hp : 2 < 2/a k) | |
| (U : unitary (Matrix (RegionConfiguration q (X k)) (RegionConfiguration q (X k)) β)) | |
| (e : RegionConfiguration q (X k) β β) (he : β i, 0 β€ e i) | |
| (hrep : (F k).matrix = spectralHom U (fun i => (e i : β))) | |
| (hs : β i, (e i)^(2/a k) = 1) : | |
| asMap (L := L) (q := q) (orderedPrefix (Function.update (fun j => liftLocal (X j) (F j).matrix) | |
| k (liftLocal (X k) (kernel U e))) n) Ο = 0 := by | |
| let A : β β Operator L q := fun j => liftLocal (X j) (F j).matrix | |
| let v : State L q := asMap (L := L) (q := q) (orderedPrefix A n) Ο | |
| let w : State L q := asMap (L := L) (q := q) (orderedPrefix (Function.update A k (liftLocal (X k) (kernel U e))) n) Ο | |
| let K : β := β i, if e i = 0 then (1:β) else 0 | |
| have hb (t : β) : βv + t β’ wβ^2 β€ βvβ^2*(1+K*|t|^(2/a k)) := by | |
| have H := perturbation_envelope hq X hX a Ο n F hF k hk hp U e he hrep hs 1 t | |
| change βv + ((t : β)*(1 : unitary β)) β’ wβ^2 β€ βvβ^2*(1+K*|t|^(2/a k)) at H | |
| have htw : (t : β) β’ w = t β’ w := by | |
| ext i | |
| simp [Complex.real_smul] | |
| simpa only [OneMemClass.coe_one, mul_one, htw] using H | |
| exact OptimizerFlatDirection.first_direction_vanishes v w K (2/a k) hp hb | |
| end PolynomialPEPS.Subvolume.ActualKernel | |
| end | |
| end OAI | |