Download data/lean/OAI/Probability/InvariantIsing/Pressure/PressureLipschitz.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.63 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/InvariantIsing/Pressure/PressureLipschitz.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/InvariantIsing/Pressure/PressureLipschitz.lean
-
curl -L -o PressureLipschitz.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/InvariantIsing/Pressure/PressureLipschitz.lean
5.63 kB
| import OAI.Probability.InvariantIsing.Haar.MatrixRotation | |
| namespace OAI | |
| /-! | |
| # Frobenius continuity of Haar pressure | |
| The Lipschitz constant is independent of dimension and of a deterministic | |
| magnetic field. This is the finite-volume estimate required to apply the | |
| published SO(N) concentration input. | |
| -/ | |
| noncomputable section | |
| open MeasureTheory | |
| open scoped BigOperators Matrix | |
| namespace InvariantIsing | |
| lemma specialRotation_spin_dist_sq_le {N : β} (U V : SpecialOrthogonal N) | |
| (Ο : Spin N) : | |
| (β i, (specialRotation U (spinVector Ο) i - | |
| specialRotation V (spinVector Ο) i) ^ 2) β€ | |
| (N : β) * frobeniusDistance U V ^ 2 := by | |
| have he (i : Fin N) : specialRotation U (spinVector Ο) i - | |
| specialRotation V (spinVector Ο) i = | |
| β j, ((U : Matrix (Fin N) (Fin N) β) i j - | |
| (V : Matrix (Fin N) (Fin N) β) i j) * spinValue (Ο j) := by | |
| simp only [specialRotation_apply, spinVector_apply, sub_mul, Finset.sum_sub_distrib] | |
| have hrow (i : Fin N) := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ | |
| (fun j => (U : Matrix (Fin N) (Fin N) β) i j - | |
| (V : Matrix (Fin N) (Fin N) β) i j) (fun j => spinValue (Ο j)) | |
| have hsum := Finset.sum_le_sum (s := Finset.univ) (fun i _ => hrow i) | |
| simp only [spinValue_sq, Finset.sum_const, Finset.card_univ, Fintype.card_fin, | |
| nsmul_eq_mul, mul_one, β Finset.sum_mul] at hsum | |
| simp_rw [he] | |
| rw [frobeniusDistance, Real.sq_sqrt (Finset.sum_nonneg fun i _ => | |
| Finset.sum_nonneg fun j _ => sq_nonneg _)] | |
| nlinarith | |
| lemma abs_rotatedEnergy_sub_rotation_le {N : β} (eig : Fin N β β) | |
| (U V : SpecialOrthogonal N) (K : β) (hK : 0 β€ K) | |
| (heig : β i, |eig i| β€ K) (Ο : Spin N) : | |
| |rotatedEnergy eig (specialRotation U) Ο - | |
| rotatedEnergy eig (specialRotation V) Ο| β€ | |
| K * N * frobeniusDistance U V := by | |
| let x := specialRotation U (spinVector Ο) | |
| let y := specialRotation V (spinVector Ο) | |
| let d := frobeniusDistance U V | |
| have hd : 0 β€ d := Real.sqrt_nonneg _ | |
| have hN : (0 : β) β€ N := Nat.cast_nonneg _ | |
| have hx : β i, x i ^ 2 = N := rotated_spin_sq_sum _ _ | |
| have hy : β i, y i ^ 2 = N := rotated_spin_sq_sum _ _ | |
| have hm : (β i, (x i - y i) ^ 2) β€ (N : β) * d ^ 2 := | |
| specialRotation_spin_dist_sq_le U V Ο | |
| have hp : (β i, (x i + y i) ^ 2) β€ 4 * (N : β) := by | |
| have hi := Finset.sum_le_sum (s := Finset.univ) (fun i _ => | |
| show (x i + y i) ^ 2 β€ 2 * x i ^ 2 + 2 * y i ^ 2 by | |
| nlinarith [sq_nonneg (x i - y i)]) | |
| simp only [Finset.sum_add_distrib, β Finset.mul_sum, hx, hy] at hi | |
| linarith | |
| have hw : (β i, (eig i * (x i - y i)) ^ 2) β€ | |
| K ^ 2 * β i, (x i - y i) ^ 2 := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_le_sum | |
| intro i _ | |
| rw [mul_pow] | |
| have hb : eig i ^ 2 β€ K ^ 2 := by | |
| simpa only [sq_abs] using (sq_le_sqβ (abs_nonneg _) hK).mpr (heig i) | |
| exact mul_le_mul_of_nonneg_right hb (sq_nonneg _) | |
| have hcs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ | |
| (fun i => eig i * (x i - y i)) (fun i => x i + y i) | |
| have hs : (β i, (eig i * (x i - y i)) * (x i + y i)) ^ 2 β€ | |
| (2 * K * (N : β) * d) ^ 2 := by | |
| calc | |
| _ β€ (β i, (eig i * (x i - y i)) ^ 2) * β i, (x i + y i) ^ 2 := hcs | |
| _ β€ (K ^ 2 * β i, (x i - y i) ^ 2) * (4 * (N : β)) := | |
| mul_le_mul hw hp (Finset.sum_nonneg fun i _ => sq_nonneg _) (by positivity) | |
| _ β€ (K ^ 2 * ((N : β) * d ^ 2)) * (4 * (N : β)) := | |
| mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hm (sq_nonneg _)) | |
| (by positivity) | |
| _ = _ := by ring | |
| have ha : |β i, (eig i * (x i - y i)) * (x i + y i)| β€ | |
| 2 * K * (N : β) * d := by | |
| apply (sq_le_sqβ (abs_nonneg _) (by positivity)).mp | |
| simpa only [sq_abs] using hs | |
| have he : rotatedEnergy eig (specialRotation U) Ο - | |
| rotatedEnergy eig (specialRotation V) Ο = | |
| (1 / 2 : β) * β i, (eig i * (x i - y i)) * (x i + y i) := by | |
| rw [rotatedEnergy, rotatedEnergy, β mul_sub, β Finset.sum_sub_distrib] | |
| change (1 / 2 : β) * (β i, (eig i * x i ^ 2 - eig i * y i ^ 2)) = _ | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| rw [he, abs_mul, abs_of_pos (by norm_num : (0 : β) < 1 / 2)] | |
| exact (mul_le_mul_of_nonneg_left ha (by norm_num)).trans_eq (by dsimp [d]; ring) | |
| lemma abs_rotatedPressure_sub_rotation_le {N : β} (hN : 0 < N) | |
| (eig : Fin N β β) (U V : SpecialOrthogonal N) (c : Fin N β β) | |
| (K : β) (hK : 0 β€ K) (heig : β i, |eig i| β€ K) : | |
| |rotatedPressure eig (specialRotation U) c - | |
| rotatedPressure eig (specialRotation V) c| β€ K * frobeniusDistance U V := by | |
| have h := abs_logPartition_sub_le | |
| (fun Ο => rotatedEnergy eig (specialRotation U) Ο + fieldEnergy c Ο) | |
| (fun Ο => rotatedEnergy eig (specialRotation V) Ο + fieldEnergy c Ο) | |
| (K * N * frobeniusDistance U V) (fun Ο => by | |
| simpa only [add_sub_add_right_eq_sub] using | |
| abs_rotatedEnergy_sub_rotation_le eig U V K hK heig Ο) | |
| have hn : (N : β) β 0 := by exact_mod_cast Nat.ne_of_gt hN | |
| calc | |
| _ = (N : β)β»ΒΉ * |logPartition (fun Ο => | |
| rotatedEnergy eig (specialRotation U) Ο + fieldEnergy c Ο) - | |
| logPartition (fun Ο => rotatedEnergy eig (specialRotation V) Ο + fieldEnergy c Ο)| := by | |
| rw [rotatedPressure, rotatedPressure, β mul_sub, abs_mul, | |
| abs_of_nonneg (show (0 : β) β€ (N : β)β»ΒΉ by positivity)] | |
| _ β€ (N : β)β»ΒΉ * (K * N * frobeniusDistance U V) := | |
| mul_le_mul_of_nonneg_left h (by positivity) | |
| _ = K * frobeniusDistance U V := by field_simp | |
| end InvariantIsing | |
| end | |
| end OAI | |