Download data/lean/OAI/Analysis/AllenCahn/EndpointSeparation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.61 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/AllenCahn/EndpointSeparation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/AllenCahn/EndpointSeparation.lean
-
curl -L -o EndpointSeparation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/AllenCahn/EndpointSeparation.lean
7.61 kB
| import OAI.Analysis.AllenCahn.EndpointMaximum | |
| 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 | |
| private lemma no_tangent_zero {n : β} {w : Space n β β} | |
| (hw : ContDiff β 2 w) (hw0 : β x, 0 β€ w x) | |
| (hineq : β x, Laplacian.laplacian w x β€ 2 * w x) | |
| {r : β} (hr : 0 < r) (y z : Space n) (hz : βz - yβ = r) | |
| (hwz : w z = 0) (hball : β x, βx - yβ < r β 0 < w x) : False := by | |
| obtain β¨p, hp, hpminβ© := (isCompact_closedBall y (r / 2)).exists_isMinOn | |
| β¨y, by simp only [Metric.mem_closedBall, dist_self]; positivityβ© hw.continuous.continuousOn | |
| have hppos : 0 < w p := hball p (by | |
| have hnorm : βp - yβ β€ r / 2 := by simpa [Metric.mem_closedBall, dist_eq_norm] using hp | |
| linarith) | |
| let a : β := 1 + (2 * (n : β) + 2) / r ^ 2 | |
| have hr2 : 0 < r ^ 2 := sq_pos_of_pos hr | |
| have ha : 1 β€ a := by | |
| have hq : 0 β€ (2 * (n : β) + 2) / r ^ 2 := by positivity | |
| dsimp [a] | |
| linarith | |
| have hscale : 2 * (n : β) + 2 β€ a * r ^ 2 := by | |
| dsimp [a] | |
| field_simp | |
| nlinarith | |
| have hcomp := annulus_comparison hw hw0 hineq ha hr hppos.le hscale y | |
| (fun x hx => hpmin (by simp [Metric.mem_closedBall, dist_eq_norm, hx])) | |
| let F : Space n β β := fun x => w x - w p * barrier a r y x | |
| let e : Space n := y - z | |
| let f : β β β := fun t => F (z + t β’ e) | |
| have hF : ContDiff β 2 F := hw.sub (contDiff_const.mul (barrier_contDiff a r y)) | |
| have hdline : HasDerivAt (fun t : β => z + t β’ e) e 0 := by | |
| simpa using (hasDerivAt_const (0 : β) z).fun_add ((hasDerivAt_id (0 : β)).smul_const e) | |
| have hd : HasDerivAt f (fderiv β F z e) 0 := by | |
| simpa [f, Function.comp_def] using ((hF.differentiable (by norm_num) (z + (0 : β) β’ e)).hasFDerivAt.comp_hasDerivAt 0 hdline) | |
| have hf0 : f 0 = 0 := by simp [f, F, barrier, gaussian, hz, hwz] | |
| have hpos : βαΆ t in π[>] (0 : β), 0 β€ f t := by | |
| filter_upwards [self_mem_nhdsWithin, | |
| nhdsWithin_le_nhds (Iio_mem_nhds (show (0 : β) < 1 / 2 by norm_num))] with t ht ht2 | |
| change 0 < t at ht | |
| change t < 1 / 2 at ht2 | |
| have hnorm : βz + t β’ e - yβ = (1 - t) * r := by | |
| have heq : z + t β’ e - y = (1 - t) β’ (z - y) := by dsimp [e]; module | |
| rw [heq, norm_smul, Real.norm_eq_abs, abs_of_pos (by linarith : 0 < 1 - t), hz] | |
| have hlow : r / 2 β€ βz + t β’ e - yβ := by rw [hnorm]; nlinarith | |
| have hhigh : βz + t β’ e - yβ β€ r := by rw [hnorm]; nlinarith | |
| have hh := hcomp (z + t β’ e) hlow hhigh | |
| dsimp [f, F] | |
| linarith | |
| have hnonneg := nonneg_right_derivative hd hf0 hpos | |
| have hmin : IsLocalMin w z := Filter.Eventually.of_forall (fun x => by simpa [hwz] using hw0 x) | |
| have hwder := hmin.fderiv_eq_zero | |
| have hi : inner β (z - y) e = -r ^ 2 := by | |
| have heq : e = -(z - y) := by dsimp [e]; abel | |
| rw [heq, inner_neg_right, real_inner_self_eq_norm_sq, hz] | |
| have hcalc : fderiv β F z e = | |
| -(w p * gaussian a y z * (2 * a * r ^ 2)) := by | |
| dsimp only [F] | |
| rw [fderiv_fun_sub (hw.differentiable (by norm_num) z) | |
| (((barrier_contDiff a r y).differentiable (by norm_num)).const_mul _ z)] | |
| simp only [sub_apply, hwder, zero_apply] | |
| rw [fderiv_const_mul ((barrier_contDiff a r y).differentiable (by norm_num) z)] | |
| simp only [smul_apply, smul_eq_mul] | |
| rw [fderiv_barrier, hi] | |
| ring | |
| have hnegative : fderiv β F z e < 0 := by | |
| rw [hcalc] | |
| have hg : 0 < gaussian a y z := Real.exp_pos _ | |
| have hap : 0 < a := lt_of_lt_of_le (by norm_num) ha | |
| exact neg_neg_of_pos (mul_pos (mul_pos hppos hg) (mul_pos (mul_pos (by norm_num) hap) hr2)) | |
| exact not_le_of_gt hnegative hnonneg | |
| lemma nonnegative_supersolution_eq_zero {n : β} {w : Space n β β} | |
| (hw : ContDiff β 2 w) (hw0 : β x, 0 β€ w x) | |
| (hineq : β x, Laplacian.laplacian w x β€ 2 * w x) | |
| {z : Space n} (hwz : w z = 0) : β x, w x = 0 := by | |
| intro y | |
| by_contra hy | |
| have hypos : 0 < w y := lt_of_le_of_ne (hw0 y) (Ne.symm hy) | |
| let Z : Set (Space n) := {x | w x = 0} | |
| have hZ : IsClosed Z := isClosed_eq hw.continuous continuous_const | |
| obtain β¨p, hp, hdistβ© := hZ.exists_infDist_eq_dist β¨z, hwzβ© y | |
| have hne : y β p := by | |
| intro heq | |
| have hpzero : w p = 0 := hp | |
| rw [heq, hpzero] at hypos | |
| exact lt_irrefl _ hypos | |
| have hr : 0 < dist y p := dist_pos.mpr hne | |
| have hball : β x, βx - yβ < dist y p β 0 < w x := by | |
| intro x hx | |
| by_contra hnot | |
| have hwx : w x = 0 := le_antisymm (le_of_not_gt hnot) (hw0 x) | |
| have hd := Metric.infDist_le_dist_of_mem (x := y) (show x β Z from hwx) | |
| rw [hdist] at hd | |
| have he : dist y x = βx - yβ := by rw [dist_comm, dist_eq_norm] | |
| rw [he] at hd | |
| exact not_le_of_gt hx hd | |
| exact no_tangent_zero hw hw0 hineq hr y p (by rw [β dist_eq_norm, dist_comm]) hp hball | |
| lemma constant_one_of_attains_one {n : β} {v : Space n β β} | |
| (hv : ContDiff β 2 v) (hbounded : β x, v x β Set.Icc (-1 : β) 1) | |
| (hAC : AllenCahn v) {z : Space n} (hz : v z = 1) : β x, v x = 1 := by | |
| let w : Space n β β := fun x => 1 - v x | |
| have hw : ContDiff β 2 w := contDiff_const.sub hv | |
| have hw0 : β x, 0 β€ w x := fun x => sub_nonneg.mpr (hbounded x).2 | |
| have hineq : β x, Laplacian.laplacian w x β€ 2 * w x := by | |
| intro x | |
| have hlap : Laplacian.laplacian w x = -(v x ^ 3 - v x) := by | |
| change Laplacian.laplacian ((fun _ : Space n => (1 : β)) - v) x = _ | |
| rw [contDiff_const.contDiffAt.laplacian_sub hv.contDiffAt, | |
| InnerProductSpace.laplacian_const] | |
| simpa using congrArg Neg.neg (hAC x) | |
| rw [hlap] | |
| have hp : 0 β€ (v x - 1) ^ 2 * (v x + 2) := | |
| mul_nonneg (sq_nonneg _) (by linarith [(hbounded x).1]) | |
| dsimp [w] | |
| nlinarith | |
| have H := nonnegative_supersolution_eq_zero hw hw0 hineq (z := z) (by simp [w, hz]) | |
| intro x | |
| have hh := H x | |
| dsimp [w] at hh | |
| linarith | |
| lemma allenCahn_neg {n : β} {v : Space n β β} (hAC : AllenCahn v) : | |
| AllenCahn (-v) := by | |
| intro x | |
| rw [InnerProductSpace.laplacian_neg] | |
| change -(Laplacian.laplacian v x) = (-v x) ^ 3 - (-v x) | |
| rw [hAC x] | |
| ring | |
| lemma constant_neg_one_of_attains_neg_one {n : β} {v : Space n β β} | |
| (hv : ContDiff β 2 v) (hbounded : β x, v x β Set.Icc (-1 : β) 1) | |
| (hAC : AllenCahn v) {z : Space n} (hz : v z = -1) : β x, v x = -1 := by | |
| have hnb : β x, (-v) x β Set.Icc (-1 : β) 1 := by | |
| intro x | |
| constructor <;> dsimp only [Pi.neg_apply] <;> | |
| linarith [(hbounded x).1, (hbounded x).2] | |
| have H := constant_one_of_attains_one hv.neg hnb (allenCahn_neg hAC) | |
| (z := z) (by simp [hz]) | |
| intro x | |
| have hh := H x | |
| change -v x = 1 at hh | |
| linarith | |
| lemma endpoint_separation {n : β} {v : Space n β β} | |
| (hv : ContDiff β 2 v) (hbounded : β x, v x β Set.Icc (-1 : β) 1) | |
| (hAC : AllenCahn v) : | |
| (β x, v x = 1) β¨ (β x, v x = -1) β¨ (β x, v x β Set.Ioo (-1 : β) 1) := by | |
| by_cases h1 : β x, v x = 1 | |
| Β· obtain β¨x, hxβ© := h1 | |
| exact Or.inl (constant_one_of_attains_one hv hbounded hAC hx) | |
| by_cases hneg1 : β x, v x = -1 | |
| Β· obtain β¨x, hxβ© := hneg1 | |
| exact Or.inr (Or.inl (constant_neg_one_of_attains_neg_one hv hbounded hAC hx)) | |
| refine Or.inr (Or.inr (fun x => β¨?_, ?_β©)) | |
| Β· exact lt_of_le_of_ne (hbounded x).1 (fun h => hneg1 β¨x, h.symmβ©) | |
| Β· exact lt_of_le_of_ne (hbounded x).2 (fun h => h1 β¨x, hβ©) | |
| end EndpointSupport.DeGiorgi | |
| end | |
| end OAI | |