Download data/lean/OAI/Analysis/AllenCahn/EndpointMaximum.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 14.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/AllenCahn/EndpointMaximum.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/AllenCahn/EndpointMaximum.lean
-
curl -L -o EndpointMaximum.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/AllenCahn/EndpointMaximum.lean
14.4 kB
| import OAI.Analysis.AllenCahn.JetProducts | |
| namespace OAI | |
| noncomputable section | |
| namespace EndpointSupport.DeGiorgi | |
| open Filter Set Topology | |
| open scoped NNReal | |
| open scoped SchwartzMap Laplacian ContDiff | |
| open FourierTransform | |
| open Filter Topology | |
| open scoped ContDiff | |
| open MeasureTheory | |
| open scoped ENNReal | |
| abbrev Space (n : β) := EuclideanSpace β (Fin n) | |
| def potential (t : β) : β := (1 - t ^ 2) ^ 2 / 4 | |
| def profile (s : β) : β := Real.tanh (s / Real.sqrt 2) | |
| def surfaceTension : β := 2 * Real.sqrt 2 / 3 | |
| def AllenCahn {n : β} (v : Space n β β) : Prop := | |
| β x, Laplacian.laplacian v x = v x ^ 3 - v x | |
| def SecondVariation {n : β} (v Ο : Space n β β) : β := | |
| β« x, (βgradient Ο xβ ^ 2 + (3 * v x ^ 2 - 1) * Ο x ^ 2) | |
| def Stable {n : β} (v : Space n β β) : Prop := | |
| β Ο : Space n β β, ContDiff β 1 Ο β HasCompactSupport Ο β | |
| 0 β€ SecondVariation v Ο | |
| def Energy {n : β} (v : Space n β β) (Ξ© : Set (Space n)) : β := | |
| β« x in Ξ©, (βgradient v xβ ^ 2 / 2 + potential (v x)) | |
| def unitBallVolume (m : β) : β := | |
| volume.real (Metric.ball (0 : Space m) 1) | |
| def density {n : β} (v : Space n β β) (R : β) (y : Space n) : β := | |
| Energy v (Metric.ball y R) / (surfaceTension * unitBallVolume (n - 1) * R ^ (n - 1)) | |
| def densityAtInfinity {n : β} (v : Space n β β) : ββ₯0β := | |
| β¨ R : { R : β // 0 < R }, ENNReal.ofReal (density v R.val 0) | |
| def Classified {n : β} (v : Space n β β) : Prop := | |
| (β x, v x = 1) β¨ (β x, v x = -1) β¨ | |
| β (a : Space n) (b : β), βaβ = 1 β§ β x, v x = profile (inner β a x - b) | |
| def StableRigiditySeven : Prop := | |
| β v : Space 7 β β, ContDiff β 2 v β | |
| (β x, v x β Set.Icc (-1 : β) 1) β AllenCahn v β Stable v β Classified v | |
| def MonotoneRigidityEight : Prop := | |
| β u : Space 8 β β, ContDiff β 2 u β | |
| (β x, u x β Set.Ioo (-1 : β) 1) β AllenCahn u β | |
| (β x, 0 < fderiv β u x (EuclideanSpace.single (7 : Fin 8) 1)) β | |
| β (e : Space 8) (c : β), βeβ = 1 β§ 0 < e 7 β§ | |
| β x, u x = profile (inner β e x - c) | |
| def FiniteDensityRigidity : Prop := | |
| β (n : β), 4 β€ n β n β€ 7 β | |
| β v : Space n β β, ContDiff β 2 v β | |
| (β x, v x β Set.Icc (-1 : β) 1) β AllenCahn v β Stable v β | |
| densityAtInfinity v < β€ β Classified v | |
| end EndpointSupport.DeGiorgi | |
| end | |
| noncomputable section | |
| namespace EndpointSupport.DeGiorgi | |
| open Filter Set Topology | |
| open scoped NNReal | |
| open scoped SchwartzMap Laplacian ContDiff | |
| open FourierTransform | |
| open Filter Topology | |
| open scoped ContDiff | |
| open MeasureTheory | |
| open scoped ENNReal | |
| lemma second_deriv_nonneg_of_local_min {f : β β β} {x : β} | |
| (hf : ContinuousAt f x) (hm : IsLocalMin f x) : 0 β€ deriv (deriv f) x := by | |
| by_contra h | |
| have hn : deriv (deriv f) x < 0 := lt_of_not_ge h | |
| have hmax := isLocalMax_of_deriv_deriv_neg hn hm.deriv_eq_zero hf | |
| have he : f =αΆ [π x] fun _ => f x := by | |
| filter_upwards [hm, hmax] with y hy hz using le_antisymm hz hy | |
| have hz := he.deriv.deriv_eq | |
| have hz0 : deriv (deriv f) x = 0 := by | |
| calc deriv (deriv f) x = deriv (deriv (fun _ : β => f x)) x := hz | |
| _ = 0 := by simp | |
| linarith | |
| private def basis (n : β) := EuclideanSpace.basisFun (Fin n) β | |
| def coordDeriv {n : β} (f : Space n β β) (i : Fin n) (x : Space n) : β := | |
| fderiv β f x (basis n i) | |
| lemma coordDeriv_contDiff {n : β} {f : Space n β β} | |
| (hf : ContDiff β 2 f) (i : Fin n) : ContDiff β 1 (coordDeriv f i) := by | |
| exact (hf.fderiv_right (m := 1) (by norm_num)).clm_apply contDiff_const | |
| lemma laplacian_eq_sum_coordDeriv {n : β} {f : Space n β β} (hf : ContDiff β 2 f) | |
| (x : Space n) : | |
| Laplacian.laplacian f x = β i : Fin n, coordDeriv (coordDeriv f i) i x := by | |
| rw [InnerProductSpace.laplacian_eq_iteratedFDeriv_orthonormalBasis f (basis n)] | |
| apply Finset.sum_congr rfl | |
| intro i hi | |
| rw [iteratedFDeriv_two_apply] | |
| change _ = fderiv β (fun y => fderiv β f y (basis n i)) x (basis n i) | |
| simp [fderiv_clm_apply | |
| ((hf.fderiv_right (m := 1) (by norm_num)).differentiable (by norm_num) x) | |
| (differentiableAt_const (c := basis n i))] | |
| lemma deriv_line {n : β} {f : Space n β β} (hf : Differentiable β f) | |
| (x e : Space n) (t : β) : | |
| deriv (fun s : β => f (x + s β’ e)) t = fderiv β f (x + t β’ e) e := by | |
| have hd : HasDerivAt (fun s : β => x + s β’ e) e t := by | |
| simpa using (hasDerivAt_const t x).fun_add ((hasDerivAt_id t).smul_const e) | |
| exact ((hf _).hasFDerivAt.comp_hasDerivAt t hd).deriv | |
| lemma laplacian_nonneg_of_local_min {n : β} {f : Space n β β} | |
| (hf : ContDiff β 2 f) {x : Space n} (hm : IsLocalMin f x) : | |
| 0 β€ Laplacian.laplacian f x := by | |
| rw [laplacian_eq_sum_coordDeriv hf] | |
| apply Finset.sum_nonneg | |
| intro i _ | |
| let g : β β β := fun s => f (x + s β’ basis n i) | |
| have hg : ContinuousAt g 0 := hf.continuous.continuousAt.comp | |
| (continuous_const.add (continuous_id.smul continuous_const)).continuousAt | |
| have hmin : IsLocalMin g 0 := by | |
| have ht : Tendsto (fun s : β => x + s β’ basis n i) (π 0) (π x) := by | |
| have hc : Continuous (fun s : β => x + s β’ basis n i) := | |
| continuous_const.add (continuous_id.smul continuous_const) | |
| simpa only [ContinuousAt, zero_smul, add_zero] using hc.continuousAt (x := 0) | |
| change βαΆ s in π (0 : β), g 0 β€ g s | |
| simpa [g] using ht.eventually hm | |
| have hder : deriv g = fun s => coordDeriv f i (x + s β’ basis n i) := by | |
| funext s | |
| exact deriv_line (hf.differentiable (by norm_num)) x (basis n i) s | |
| have hh := second_deriv_nonneg_of_local_min hg hmin | |
| rw [hder, deriv_line ((coordDeriv_contDiff hf i).differentiable (by norm_num))] at hh | |
| simpa [coordDeriv] using hh | |
| lemma compact_minimum_principle {n : β} {f : Space n β β} | |
| (hf : ContDiff β 2 f) {K : Set (Space n)} (hK : IsCompact K) | |
| (hboundary : β x β K, x β interior K β 0 β€ f x) | |
| (hineq : β x β interior K, Laplacian.laplacian f x β€ 2 * f x) : | |
| β x β K, 0 β€ f x := by | |
| intro x hx | |
| by_contra hn | |
| have hneg : f x < 0 := lt_of_not_ge hn | |
| obtain β¨y, hy, hminβ© := hK.exists_isMinOn β¨x, hxβ© hf.continuous.continuousOn | |
| have hyneg : f y < 0 := lt_of_le_of_lt (hmin hx) hneg | |
| have hyint : y β interior K := by | |
| by_contra hh | |
| exact (not_le_of_gt hyneg) (hboundary y hy hh) | |
| have hlap := laplacian_nonneg_of_local_min hf | |
| (hmin.isLocalMin (mem_interior_iff_mem_nhds.mp hyint)) | |
| have hle := hineq y hyint | |
| linarith | |
| def gaussian {n : β} (a : β) (y : Space n) (x : Space n) : β := | |
| Real.exp (-a * βx - yβ ^ 2) | |
| private lemma gaussian_contDiff {n : β} (a : β) (y : Space n) : | |
| ContDiff β 2 (gaussian a y) := by | |
| exact ((contDiff_const.mul ((contDiff_norm_sq β).comp | |
| (contDiff_id.sub contDiff_const)))).exp | |
| private lemma fderiv_gaussian {n : β} (a : β) (y x e : Space n) : | |
| fderiv β (gaussian a y) x e = | |
| gaussian a y x * (-2 * a * inner β (x - y) e) := by | |
| have h := (((hasFDerivAt_id x).sub (hasFDerivAt_const y x)).norm_sq.const_mul (-a)).exp | |
| rw [show fderiv β (gaussian a y) x = _ from h.fderiv] | |
| simp [gaussian, inner_sub_left] | |
| ring | |
| private lemma second_coord_gaussian {n : β} (a : β) (y x : Space n) (i : Fin n) : | |
| coordDeriv (coordDeriv (gaussian a y) i) i x = | |
| gaussian a y x * (4 * a ^ 2 * (inner β (x - y) (basis n i)) ^ 2 - 2 * a) := by | |
| have hfun : coordDeriv (gaussian a y) i = fun z => | |
| gaussian a y z * (-2 * a * inner β (z - y) (basis n i)) := by | |
| funext z | |
| exact fderiv_gaussian a y z (basis n i) | |
| rw [hfun] | |
| unfold coordDeriv | |
| have hg := (gaussian_contDiff a y).differentiable (by norm_num) | |
| have hl : Differentiable β (fun z : Space n => inner β (z - y) (basis n i)) := | |
| (differentiable_id.sub (differentiable_const y)).inner β (differentiable_const _) | |
| rw [fderiv_fun_mul (hg x) ((hl.const_mul (-2 * a)) x)] | |
| simp only [add_apply, smul_apply, smul_eq_mul] | |
| rw [fderiv_gaussian] | |
| have hi : fderiv β (fun z : Space n => -2 * a * inner β (z - y) (basis n i)) x | |
| (basis n i) = -2 * a := by | |
| rw [fderiv_const_mul (hl x) (-2 * a)] | |
| simp only [smul_apply, smul_eq_mul] | |
| have hs : DifferentiableAt β (fun z : Space n => z - y) x := | |
| differentiableAt_id.sub (differentiableAt_const y) | |
| rw [fderiv_inner_apply β hs (differentiableAt_const (c := basis n i))] | |
| simp [basis, fderiv_fun_sub] | |
| rw [hi] | |
| ring | |
| private lemma laplacian_gaussian {n : β} (a : β) (y x : Space n) : | |
| Laplacian.laplacian (gaussian a y) x = | |
| gaussian a y x * (4 * a ^ 2 * βx - yβ ^ 2 - 2 * a * n) := by | |
| rw [laplacian_eq_sum_coordDeriv (gaussian_contDiff a y)] | |
| simp_rw [second_coord_gaussian] | |
| rw [β Finset.mul_sum, Finset.sum_sub_distrib, β Finset.mul_sum, | |
| (basis n).sum_sq_inner_left] | |
| simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] | |
| ring | |
| def barrier {n : β} (a r : β) (y : Space n) (x : Space n) : β := | |
| gaussian a y x - Real.exp (-a * r ^ 2) | |
| lemma barrier_contDiff {n : β} (a r : β) (y : Space n) : | |
| ContDiff β 2 (barrier a r y) := (gaussian_contDiff a y).sub contDiff_const | |
| private lemma laplacian_barrier {n : β} (a r : β) (y x : Space n) : | |
| Laplacian.laplacian (barrier a r y) x = | |
| gaussian a y x * (4 * a ^ 2 * βx - yβ ^ 2 - 2 * a * n) := by | |
| change Laplacian.laplacian ((gaussian a y) - (fun _ : Space n => Real.exp (-a * r ^ 2))) x = _ | |
| rw [(gaussian_contDiff a y).contDiffAt.laplacian_sub contDiff_const.contDiffAt, | |
| InnerProductSpace.laplacian_const] | |
| simpa using laplacian_gaussian a y x | |
| private lemma barrier_le_one {n : β} {a : β} (ha : 0 β€ a) (r : β) (y x : Space n) : | |
| barrier a r y x β€ 1 := by | |
| have he : gaussian a y x β€ 1 := by | |
| rw [gaussian, Real.exp_le_one_iff] | |
| exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr ha) (sq_nonneg _) | |
| have hh := Real.exp_pos (-a * r ^ 2) | |
| dsimp [barrier] | |
| linarith | |
| private lemma barrier_subsolution {n : β} {a r : β} (ha : 1 β€ a) (hr : 0 < r) | |
| (hscale : 2 * (n : β) + 2 β€ a * r ^ 2) (y x : Space n) | |
| (hx : r / 2 β€ βx - yβ) : | |
| 2 * barrier a r y x β€ Laplacian.laplacian (barrier a r y) x := by | |
| have han : 0 β€ a := le_trans (by norm_num) ha | |
| have hs : r ^ 2 β€ 4 * βx - yβ ^ 2 := by nlinarith [norm_nonneg (x - y)] | |
| have h1 := mul_le_mul_of_nonneg_left hscale han | |
| have h2 := mul_le_mul_of_nonneg_left hs (sq_nonneg a) | |
| have hcoeff : 0 β€ 4 * a ^ 2 * βx - yβ ^ 2 - 2 * a * n - 2 := by | |
| nlinarith | |
| have hp : 0 β€ gaussian a y x := le_of_lt (Real.exp_pos _) | |
| have hm := mul_nonneg hp hcoeff | |
| have he := Real.exp_pos (-a * r ^ 2) | |
| rw [laplacian_barrier] | |
| dsimp only [barrier] | |
| nlinarith | |
| private lemma laplacian_sub_const_mul {n : β} {w b : Space n β β} | |
| (hw : ContDiff β 2 w) (hb : ContDiff β 2 b) (Ξ΅ : β) (x : Space n) : | |
| Laplacian.laplacian (fun z => w z - Ξ΅ * b z) x = | |
| Laplacian.laplacian w x - Ξ΅ * Laplacian.laplacian b x := by | |
| change Laplacian.laplacian (w - Ξ΅ β’ b) x = _ | |
| have hs : ContDiff β 2 (Ξ΅ β’ b) := hb.const_smul Ξ΅ | |
| rw [hw.contDiffAt.laplacian_sub hs.contDiffAt, | |
| InnerProductSpace.laplacian_smul Ξ΅ hb.contDiffAt] | |
| rfl | |
| lemma annulus_comparison {n : β} {w : Space n β β} | |
| (hw : ContDiff β 2 w) (hw0 : β x, 0 β€ w x) | |
| (hineq : β x, Laplacian.laplacian w x β€ 2 * w x) | |
| {a r Ξ΅ : β} (ha : 1 β€ a) (hr : 0 < r) (hΞ΅ : 0 β€ Ξ΅) | |
| (hscale : 2 * (n : β) + 2 β€ a * r ^ 2) (y : Space n) | |
| (hinner : β x, βx - yβ = r / 2 β Ξ΅ β€ w x) : | |
| β x, r / 2 β€ βx - yβ β βx - yβ β€ r β Ξ΅ * barrier a r y x β€ w x := by | |
| let K : Set (Space n) := {x | r / 2 β€ βx - yβ β§ βx - yβ β€ r} | |
| have hn : Continuous (fun x : Space n => βx - yβ) := | |
| (continuous_id.sub continuous_const).norm | |
| have hclosed : IsClosed K := | |
| (isClosed_le continuous_const hn).inter (isClosed_le hn continuous_const) | |
| have hK : IsCompact K := (isCompact_closedBall y r).of_isClosed_subset hclosed (by | |
| intro x hx | |
| simpa only [Metric.mem_closedBall, dist_eq_norm] using hx.2) | |
| have hF : ContDiff β 2 (fun x => w x - Ξ΅ * barrier a r y x) := | |
| hw.sub (contDiff_const.mul (barrier_contDiff a r y)) | |
| have hboundary : β x β K, x β interior K β 0 β€ w x - Ξ΅ * barrier a r y x := by | |
| intro x hx hxout | |
| by_cases hilow : βx - yβ = r / 2 | |
| Β· have hb := mul_le_mul_of_nonneg_left (barrier_le_one (le_trans (by norm_num) ha) r y x) hΞ΅ | |
| have hi := hinner x hilow | |
| linarith | |
| by_cases hihigh : βx - yβ = r | |
| Β· simpa [barrier, gaussian, hihigh] using hw0 x | |
| exfalso | |
| apply hxout | |
| rw [mem_interior_iff_mem_nhds] | |
| have ho : IsOpen {z : Space n | r / 2 < βz - yβ β§ βz - yβ < r} := | |
| (isOpen_lt continuous_const hn).inter (isOpen_lt hn continuous_const) | |
| have hxstrict : x β {z : Space n | r / 2 < βz - yβ β§ βz - yβ < r} := | |
| β¨lt_of_le_of_ne hx.1 (Ne.symm hilow), lt_of_le_of_ne hx.2 hihighβ© | |
| exact Filter.mem_of_superset (ho.mem_nhds hxstrict) (fun z hz => β¨hz.1.le, hz.2.leβ©) | |
| have hFineq : β x β interior K, | |
| Laplacian.laplacian (fun x => w x - Ξ΅ * barrier a r y x) x β€ | |
| 2 * (w x - Ξ΅ * barrier a r y x) := by | |
| intro x hx | |
| have hxb : x β K := interior_subset hx | |
| rw [laplacian_sub_const_mul hw (barrier_contDiff a r y)] | |
| have h1 := hineq x | |
| have h2 := mul_le_mul_of_nonneg_left (barrier_subsolution ha hr hscale y x hxb.1) hΞ΅ | |
| linarith | |
| have H := compact_minimum_principle hF hK hboundary hFineq | |
| intro x hxlo hxhi | |
| have hh := H x β¨hxlo, hxhiβ© | |
| linarith | |
| lemma fderiv_barrier {n : β} (a r : β) (y x e : Space n) : | |
| fderiv β (barrier a r y) x e = | |
| gaussian a y x * (-2 * a * inner β (x - y) e) := by | |
| unfold barrier | |
| rw [fderiv_fun_sub ((gaussian_contDiff a y).differentiable (by norm_num) x) | |
| (differentiableAt_const _)] | |
| simpa using fderiv_gaussian a y x e | |
| lemma nonneg_right_derivative {f : β β β} {d : β} | |
| (hd : HasDerivAt f d 0) (h0 : f 0 = 0) | |
| (hpos : βαΆ t in π[>] (0 : β), 0 β€ f t) : 0 β€ d := by | |
| apply ge_of_tendsto hd.tendsto_slope_zero_right | |
| filter_upwards [self_mem_nhdsWithin, hpos] with t ht hp | |
| simpa [h0] using mul_nonneg (inv_nonneg.mpr (le_of_lt ht)) hp | |
| end EndpointSupport.DeGiorgi | |
| end | |
| end OAI | |