Download data/lean/OAI/Analysis/CardinalInterpolation/ModTwelve.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 27.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/CardinalInterpolation/ModTwelve.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/CardinalInterpolation/ModTwelve.lean
-
curl -L -o ModTwelve.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/CardinalInterpolation/ModTwelve.lean
27.3 kB
| import Mathlib | |
| namespace OAI | |
| /-! Modulo-twelve cardinal functions and Gaussian-damped radial Schwartz realization. -/ | |
| noncomputable section | |
| open scoped BigOperators Topology FourierTransform SchwartzMap ComplexConjugate | |
| open MeasureTheory Set Filter | |
| namespace Triangular | |
| abbrev Plane := EuclideanSpace β (Fin 2) | |
| def b : β := Real.sqrt 3 / 2 | |
| def h : β := 2 / 5 | |
| def L : Finset β€ := {0, 1, 3, 4, 7, 9} | |
| def zeroSet : Set β := | |
| {s | β j : β€, β a : β€, a β L β§ s = 12 * (j : β) + (a : β)} | |
| def nodes : Set β := zeroSet β© Set.Ioi 0 | |
| def T (k : β) (s : β) : β := kβ»ΒΉ * Real.exp (-k * (s - 1)) | |
| def IsRadial (f : Plane β β) : Prop := | |
| β x y : Plane, βxβ = βyβ β f x = f y | |
| def realFourier (f : Plane β β) : Plane β β := | |
| π (fun x : Plane => (f x : β)) | |
| lemma b_pos : 0 < b := by | |
| unfold b | |
| positivity | |
| lemma h_pos : 0 < h := by norm_num [h] | |
| lemma b_sq : b ^ 2 = 3 / 4 := by | |
| unfold b | |
| rw [div_pow, Real.sq_sqrt (by norm_num : (0 : β) β€ 3)] | |
| norm_num | |
| lemma k_pos {k : β} (hk : (59 : β) / 25 β€ k) : 0 < k := by linarith | |
| lemma hasDerivAt_T {k : β} (hk : k β 0) (s : β) : | |
| HasDerivAt (T k) (-Real.exp (-k * (s - 1))) s := by | |
| have hd := ((((hasDerivAt_id s).sub_const 1).const_mul (-k)).exp).const_mul kβ»ΒΉ | |
| convert! hd using 1 | |
| simp only [id_eq, mul_one] | |
| field_simp | |
| lemma deriv_T {k : β} (hk : k β 0) (s : β) : | |
| deriv (T k) s = -Real.exp (-k * (s - 1)) := | |
| (hasDerivAt_T hk s).deriv | |
| lemma T_pos {k : β} (hk : (59 : β) / 25 β€ k) (s : β) : 0 < T k s := | |
| mul_pos (inv_pos.mpr (k_pos hk)) (Real.exp_pos _) | |
| lemma realFourier_eq_integral (f : Plane β β) (ΞΎ : Plane) : | |
| realFourier f ΞΎ = | |
| β« x : Plane, (f x : β) * | |
| Complex.exp (-(2 * (Real.pi : β)) * Complex.I * (inner β x ΞΎ : β)) := by | |
| rw [realFourier, Real.fourier_eq'] | |
| apply integral_congr_ae | |
| filter_upwards [] with x | |
| simp only [smul_eq_mul] | |
| rw [mul_comm] | |
| apply congrArg (fun z : β => (f x : β) * Complex.exp z) | |
| push_cast | |
| ring | |
| lemma zero_mem_zeroSet : (0 : β) β zeroSet := by | |
| exact β¨0, 0, by simp [L], by norm_numβ© | |
| lemma twentyFour_mem_nodes : (24 : β) β nodes := by | |
| exact β¨β¨2, 0, by simp [L], by norm_numβ©, by norm_numβ© | |
| def nodesβ : Set β := {0} βͺ nodes | |
| abbrev Node := {n : β // n β nodesβ} | |
| lemma Node.mem_zeroSet (n : Node) : n.val β zeroSet := by | |
| rcases n.property with hn | hn | |
| Β· rw [Set.mem_singleton_iff.mp hn] | |
| exact zero_mem_zeroSet | |
| Β· exact hn.1 | |
| namespace Cardinal | |
| def sineFactor (a : β€) (s : β) : β := | |
| 2 * Complex.sin (((Real.pi / 12 : β) : β) * (s - (a : β))) | |
| def rootProduct (s : β) : β := β a β L, sineFactor a s | |
| def P (s : β) : β := β a β L, (sineFactor a s) ^ 2 | |
| lemma P_eq_square (s : β) : P s = rootProduct s ^ 2 := by | |
| simp only [P, rootProduct, Finset.prod_pow] | |
| lemma sineFactor_add_twelve (a : β€) (s : β) : | |
| sineFactor a (s + 12) = -sineFactor a s := by | |
| unfold sineFactor | |
| have he : ((Real.pi / 12 : β) : β) * (s + 12 - (a : β)) = | |
| ((Real.pi / 12 : β) : β) * (s - (a : β)) + (Real.pi : β) := by | |
| push_cast | |
| ring | |
| rw [he, Complex.sin_add_pi] | |
| ring | |
| lemma P_periodic : Function.Periodic P 12 := by | |
| intro s | |
| simp only [P, sineFactor_add_twelve, neg_sq] | |
| lemma P_ofReal (s : β) : | |
| P (s : β) = ((β a β L, (2 * Real.sin (Real.pi / 12 * (s - (a : β)))) ^ 2 : β) : β) := by | |
| simp only [P, sineFactor, Complex.ofReal_prod, Complex.ofReal_pow, | |
| Complex.ofReal_mul, Complex.ofReal_sin, Complex.ofReal_sub, Complex.ofReal_intCast, | |
| Complex.ofReal_ofNat] | |
| lemma P_nonneg (s : β) : 0 β€ (P (s : β)).re := by | |
| rw [P_ofReal] | |
| simp only [Complex.ofReal_re] | |
| exact Finset.prod_nonneg (fun _ _ => sq_nonneg _) | |
| lemma differentiable_rootProduct : Differentiable β rootProduct := by | |
| unfold rootProduct sineFactor | |
| fun_prop | |
| lemma differentiable_P : Differentiable β P := by | |
| unfold P sineFactor | |
| fun_prop | |
| lemma rootProduct_zero {n : β} (hn : n β zeroSet) : rootProduct (n : β) = 0 := by | |
| obtain β¨j, a, ha, hnβ© := hn | |
| apply Finset.prod_eq_zero ha | |
| have he : ((n : β) - (a : β)) = 12 * (j : β) := by | |
| exact_mod_cast (show n - (a : β) = 12 * (j : β) by linarith) | |
| have hh : (((Real.pi / 12 : β) : β) * (12 * (j : β))) = | |
| (j : β) * (Real.pi : β) := by push_cast; ring | |
| have hz : Complex.sin ((j : β) * (Real.pi : β)) = 0 := by | |
| have hh := congrArg Complex.ofReal (Real.sin_int_mul_pi j) | |
| simpa only [Complex.ofReal_zero, Complex.ofReal_sin, Complex.ofReal_mul, | |
| Complex.ofReal_intCast] using hh | |
| simp only [sineFactor, he, hh, hz, mul_zero] | |
| lemma P_zero {n : β} (hn : n β zeroSet) : P (n : β) = 0 := by | |
| rw [P_eq_square, rootProduct_zero hn] | |
| norm_num | |
| lemma P_real_zero_iff (s : β) : P (s : β) = 0 β s β zeroSet := by | |
| constructor | |
| Β· intro hP | |
| rw [P_eq_square, sq_eq_zero_iff] at hP | |
| obtain β¨a, ha, hzβ© := Finset.prod_eq_zero_iff.mp hP | |
| have hs : Complex.sin (((Real.pi / 12 : β) : β) * ((s : β) - a)) = 0 := | |
| (mul_eq_zero.mp hz).resolve_left (by norm_num) | |
| obtain β¨j, hjβ© := Complex.sin_eq_zero_iff.mp hs | |
| have hpi : (Real.pi : β) β 0 := by exact_mod_cast Real.pi_ne_zero | |
| have he : (Real.pi : β) * ((s : β) - (12 * (j : β) + a)) = 0 := by | |
| push_cast at hj | |
| linear_combination 12 * hj | |
| have he' := sub_eq_zero.mp ((mul_eq_zero.mp he).resolve_left hpi) | |
| exact β¨j, a, ha, by exact_mod_cast he'β© | |
| Β· exact P_zero | |
| lemma hasDerivAt_P_zero {n : β} (hn : n β zeroSet) : | |
| HasDerivAt P 0 (n : β) := by | |
| have hd := (differentiable_rootProduct (n : β)).hasDerivAt.pow 2 | |
| have he : rootProduct ^ 2 = P := funext fun s => (P_eq_square s).symm | |
| simpa [he, rootProduct_zero hn] using hd | |
| lemma deriv_P_zero {n : β} (hn : n β zeroSet) : deriv P (n : β) = 0 := | |
| (hasDerivAt_P_zero hn).deriv | |
| lemma P_node (n : Node) : P (n.val : β) = 0 := P_zero n.mem_zeroSet | |
| lemma deriv_P_node (n : Node) : deriv P (n.val : β) = 0 := | |
| deriv_P_zero n.mem_zeroSet | |
| def dBasis (n : Node) : β β β := dslope P (n.val : β) | |
| def cBasis (n : Node) : β β β := dslope (dBasis n) (n.val : β) | |
| lemma differentiable_dBasis (n : Node) : Differentiable β (dBasis n) := by | |
| rw [β differentiableOn_univ] | |
| exact (Complex.differentiableOn_dslope Filter.univ_mem).mpr | |
| differentiable_P.differentiableOn | |
| lemma differentiable_cBasis (n : Node) : Differentiable β (cBasis n) := by | |
| rw [β differentiableOn_univ] | |
| exact (Complex.differentiableOn_dslope Filter.univ_mem).mpr | |
| (differentiable_dBasis n).differentiableOn | |
| lemma dBasis_node (n : Node) : dBasis n (n.val : β) = 0 := by | |
| simp [dBasis, dslope_same, deriv_P_node] | |
| lemma dBasis_eq (n : Node) {s : β} (hs : s β (n.val : β)) : | |
| dBasis n s = P s / (s - n.val) := by | |
| simp [dBasis, dslope_of_ne _ hs, slope_def_field, P_node] | |
| lemma cBasis_eq (n : Node) {s : β} (hs : s β (n.val : β)) : | |
| cBasis n s = P s / (s - n.val) ^ 2 := by | |
| rw [cBasis, dslope_of_ne _ hs, slope_def_field, dBasis_node, | |
| sub_zero, dBasis_eq n hs, div_div, pow_two] | |
| lemma node_cast_ne {m n : Node} (hmn : m β n) : (m.val : β) β (n.val : β) := by | |
| intro hh | |
| exact hmn (Subtype.ext (Complex.ofReal_injective hh)) | |
| lemma dBasis_other {m n : Node} (hmn : m β n) : dBasis n (m.val : β) = 0 := by | |
| rw [dBasis_eq n (node_cast_ne hmn), P_node, zero_div] | |
| lemma cBasis_other {m n : Node} (hmn : m β n) : cBasis n (m.val : β) = 0 := by | |
| rw [cBasis_eq n (node_cast_ne hmn), P_node, zero_div] | |
| lemma mul_dBasis (n : Node) : | |
| (fun s : β => (s - n.val) * dBasis n s) = P := by | |
| funext s | |
| simpa only [smul_eq_mul, P_node, sub_zero, dBasis] using | |
| sub_smul_dslope P (n.val : β) s | |
| lemma mul_cBasis (n : Node) : | |
| (fun s : β => (s - n.val) * cBasis n s) = dBasis n := by | |
| funext s | |
| simpa only [smul_eq_mul, dBasis_node, sub_zero, cBasis] using | |
| sub_smul_dslope (dBasis n) (n.val : β) s | |
| lemma deriv_dBasis_other {m n : Node} (hmn : m β n) : | |
| deriv (dBasis n) (m.val : β) = 0 := by | |
| have hd := (((hasDerivAt_id (m.val : β)).sub_const (n.val : β)).mul | |
| ((differentiable_dBasis n (m.val : β)).hasDerivAt)).deriv | |
| simp only [Pi.mul_def, id_eq] at hd | |
| rw [mul_dBasis] at hd | |
| simp only [deriv_P_node, dBasis_other hmn, mul_zero, zero_add] at hd | |
| exact (mul_eq_zero.mp hd.symm).resolve_left (sub_ne_zero.mpr (node_cast_ne hmn)) | |
| lemma deriv_cBasis_other {m n : Node} (hmn : m β n) : | |
| deriv (cBasis n) (m.val : β) = 0 := by | |
| have hd := (((hasDerivAt_id (m.val : β)).sub_const (n.val : β)).mul | |
| ((differentiable_cBasis n (m.val : β)).hasDerivAt)).deriv | |
| simp only [Pi.mul_def, id_eq] at hd | |
| rw [mul_cBasis] at hd | |
| simp only [deriv_dBasis_other hmn, cBasis_other hmn, mul_zero, zero_add] at hd | |
| exact (mul_eq_zero.mp hd.symm).resolve_left (sub_ne_zero.mpr (node_cast_ne hmn)) | |
| lemma cBasis_node (n : Node) : cBasis n (n.val : β) = deriv (dBasis n) (n.val : β) := by | |
| exact dslope_same (dBasis n) (n.val : β) | |
| lemma P_conj (s : β) : conj (P s) = P (conj s) := by | |
| simp only [P, sineFactor, map_prod, map_pow, map_mul, β Complex.sin_conj, | |
| map_sub, Complex.conj_ofReal, map_ofNat, map_intCast] | |
| lemma dslope_conj_real {f : β β β} (hf : β s, conj (f s) = f (conj s)) | |
| (r : β) (s : β) : conj (dslope f (r : β) s) = dslope f (r : β) (conj s) := by | |
| have he : conj β f β conj = f := by | |
| ext z | |
| simp only [Function.comp_apply, hf, RCLike.conj_conj] | |
| have hd := congrFun (deriv_conj_conj (f := f)) (r : β) | |
| rw [he] at hd | |
| simp only [Function.comp_apply, Complex.conj_ofReal] at hd | |
| by_cases hs : s = (r : β) | |
| Β· subst s | |
| simpa only [Complex.conj_ofReal, dslope_same] using hd.symm | |
| Β· have hc : conj s β (r : β) := by | |
| intro h | |
| apply hs | |
| have hh := congrArg conj h | |
| simpa using hh | |
| rw [dslope_of_ne _ hs, dslope_of_ne _ hc] | |
| simp only [slope_def_field, map_divβ, map_sub, hf, Complex.conj_ofReal] | |
| lemma dBasis_conj (n : Node) (s : β) : | |
| conj (dBasis n s) = dBasis n (conj s) := | |
| dslope_conj_real P_conj n.val s | |
| lemma cBasis_conj (n : Node) (s : β) : | |
| conj (cBasis n s) = cBasis n (conj s) := | |
| dslope_conj_real (dBasis_conj n) n.val s | |
| lemma norm_two_sin_le (z : β) : β2 * Complex.sin zβ β€ 2 * Real.exp |z.im| := by | |
| rw [Complex.two_sin, norm_mul, Complex.norm_I, mul_one] | |
| calc | |
| βComplex.exp (-z * Complex.I) - Complex.exp (z * Complex.I)β β€ | |
| βComplex.exp (-z * Complex.I)β + βComplex.exp (z * Complex.I)β := norm_sub_le _ _ | |
| _ = Real.exp z.im + Real.exp (-z.im) := by simp [Complex.norm_exp] | |
| _ β€ Real.exp |z.im| + Real.exp |z.im| := | |
| add_le_add (Real.exp_le_exp.mpr (le_abs_self _)) | |
| (Real.exp_le_exp.mpr (neg_le_abs _)) | |
| _ = 2 * Real.exp |z.im| := by ring | |
| def stripBound (R : β) : β := (2 * Real.exp (Real.pi * R / 12)) ^ 12 | |
| lemma stripBound_nonneg (R : β) : 0 β€ stripBound R := by | |
| unfold stripBound | |
| positivity | |
| lemma P_strip_bound (R : β) (s : β) (hs : |s.im| β€ R) : βP sβ β€ stripBound R := by | |
| unfold P sineFactor | |
| rw [norm_prod] | |
| calc | |
| β a β L, β(2 * Complex.sin (((Real.pi / 12 : β) : β) * (s - a))) ^ 2β β€ | |
| β _a β L, (2 * Real.exp (Real.pi * R / 12)) ^ 2 := by | |
| apply Finset.prod_le_prodβ (by intros; positivity) | |
| intro a _ | |
| rw [norm_pow] | |
| apply pow_le_pow_leftβ (norm_nonneg _) | |
| refine (norm_two_sin_le _).trans ?_ | |
| apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : β) β€ 2) | |
| apply Real.exp_le_exp.mpr | |
| have he : ((((Real.pi / 12 : β) : β) * (s - a))).im = | |
| Real.pi * s.im / 12 := by simp [div_eq_mul_inv]; ring | |
| rw [he, abs_div, abs_mul, abs_of_pos Real.pi_pos] | |
| norm_num only [abs_of_pos (by norm_num : (0 : β) < 12)] | |
| exact div_le_div_of_nonneg_right | |
| (mul_le_mul_of_nonneg_left hs Real.pi_pos.le) (by norm_num) | |
| _ = stripBound R := by simp [stripBound, β pow_mul, L] | |
| lemma im_le_dist_real (w : β) (n : β) : |w.im| β€ dist w (n : β) := by | |
| simpa [dist_eq_norm] using Complex.abs_im_le_norm (w - (n : β)) | |
| lemma uniform_basis_bound (R : β) : β M : β, 0 β€ M β§ | |
| β (n : Node) (s : β), |s.im| β€ R β βcBasis n sβ β€ M β§ βdBasis n sβ β€ M := by | |
| let A := max R 2 | |
| let M := stripBound A | |
| have hM : 0 β€ M := stripBound_nonneg A | |
| refine β¨M, hM, ?_β© | |
| intro n s hs | |
| have hmapP : Set.MapsTo P (Metric.ball (n.val : β) 2) | |
| (Metric.closedBall (P (n.val : β)) M) := by | |
| intro w hw | |
| simp only [Metric.mem_closedBall, P_node, dist_zero_right] | |
| exact P_strip_bound A w ((im_le_dist_real w n.val).trans | |
| ((Metric.mem_ball.mp hw).le.trans (le_max_right _ _))) | |
| have hd : β w β Metric.ball (n.val : β) 2, βdBasis n wβ β€ M / 2 := by | |
| intro w hw | |
| exact Complex.norm_dslope_le_div_of_mapsTo_ball | |
| differentiable_P.differentiableOn hmapP hw | |
| have hmapD : Set.MapsTo (dBasis n) (Metric.ball (n.val : β) 1) | |
| (Metric.closedBall (dBasis n (n.val : β)) (M / 2)) := by | |
| intro w hw | |
| simp only [Metric.mem_closedBall, dBasis_node, dist_zero_right] | |
| apply hd w | |
| exact (Metric.ball_subset_ball (by norm_num : (1 : β) β€ 2)) hw | |
| have hc : β w β Metric.ball (n.val : β) 1, βcBasis n wβ β€ M / 2 := by | |
| intro w hw | |
| simpa [cBasis] using Complex.norm_dslope_le_div_of_mapsTo_ball | |
| (differentiable_dBasis n).differentiableOn hmapD hw | |
| have hPs : βP sβ β€ M := P_strip_bound A s (hs.trans (le_max_left _ _)) | |
| have hhalf : M / 2 β€ M := by linarith | |
| by_cases hnear : dist s (n.val : β) < 1 | |
| Β· exact β¨(hc s hnear).trans hhalf, | |
| (hd s (lt_trans hnear (by norm_num : (1 : β) < 2))).trans hhalfβ© | |
| Β· have hfar : 1 β€ βs - (n.val : β)β := by | |
| simpa [dist_eq_norm] using le_of_not_gt hnear | |
| have hne : s β (n.val : β) := by intro he; norm_num [he] at hfar | |
| rw [cBasis_eq n hne, dBasis_eq n hne, norm_div, norm_div, norm_pow] | |
| constructor | |
| Β· exact (div_le_self (norm_nonneg _) (one_le_powβ hfar)).trans hPs | |
| Β· exact (div_le_self (norm_nonneg _) hfar).trans hPs | |
| structure Coefficients where | |
| C : β | |
| c : Node β β | |
| d : Node β β | |
| summable : Summable (fun n => |c n| + |d n|) | |
| def profile (a : Coefficients) (s : β) : β := | |
| (a.C : β) * P s + | |
| β' n : Node, ((a.c n : β) * cBasis n s + (a.d n : β) * dBasis n s) | |
| lemma summand_norm_bound (a : Coefficients) {R M : β} | |
| (hM : β (n : Node) (s : β), |s.im| β€ R β βcBasis n sβ β€ M β§ βdBasis n sβ β€ M) | |
| (n : Node) (s : β) (hs : |s.im| β€ R) : | |
| β(a.c n : β) * cBasis n s + (a.d n : β) * dBasis n sβ β€ | |
| (|a.c n| + |a.d n|) * M := by | |
| refine (norm_add_le _ _).trans ?_ | |
| simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs] | |
| calc | |
| _ β€ |a.c n| * M + |a.d n| * M := | |
| add_le_add (mul_le_mul_of_nonneg_left (hM n s hs).1 (abs_nonneg _)) | |
| (mul_le_mul_of_nonneg_left (hM n s hs).2 (abs_nonneg _)) | |
| _ = _ := by ring | |
| lemma differentiable_profile (a : Coefficients) : Differentiable β (profile a) := by | |
| intro s | |
| obtain β¨M, hM, hBβ© := uniform_basis_bound (|s.im| + 1) | |
| let U : Set β := {w | |w.im| < |s.im| + 1} | |
| have hU : IsOpen U := isOpen_lt Complex.continuous_im.abs continuous_const | |
| have hs : s β U := by dsimp [U]; linarith | |
| have hd : DifferentiableOn β | |
| (fun w => β' n : Node, ((a.c n : β) * cBasis n w + (a.d n : β) * dBasis n w)) U := by | |
| apply Complex.differentiableOn_tsum_of_summable_norm (a.summable.mul_right M) | |
| Β· intro n | |
| exact ((differentiable_cBasis n).const_mul _ |>.add | |
| ((differentiable_dBasis n).const_mul _)).differentiableOn | |
| Β· exact hU | |
| Β· intro n w hw | |
| exact summand_norm_bound a hB n w (le_of_lt hw) | |
| exact ((differentiable_P s).const_mul _).add (hd.differentiableAt (hU.mem_nhds hs)) | |
| lemma profile_strip (a : Coefficients) (R : β) : | |
| β M : β, β s : β, |s.im| β€ R β βprofile a sβ β€ M := by | |
| obtain β¨M, hM, hBβ© := uniform_basis_bound R | |
| refine β¨|a.C| * stripBound R + β' n : Node, (|a.c n| + |a.d n|) * M, ?_β© | |
| intro s hs | |
| have hsum := (a.summable.mul_right M).of_norm_bounded | |
| (fun n => summand_norm_bound a hB n s hs) | |
| unfold profile | |
| refine (norm_add_le _ _).trans (add_le_add ?_ ?_) | |
| Β· simpa only [norm_mul, Complex.norm_real, Real.norm_eq_abs] using | |
| mul_le_mul_of_nonneg_left (P_strip_bound R s hs) (abs_nonneg a.C) | |
| Β· exact (norm_tsum_le_tsum_norm hsum.norm).trans | |
| (hsum.norm.tsum_le_tsum (fun n => summand_norm_bound a hB n s hs) | |
| (a.summable.mul_right M)) | |
| lemma profile_conj (a : Coefficients) (s : β) : | |
| conj (profile a s) = profile a (conj s) := by | |
| simp only [profile, map_add, map_mul, Complex.conj_ofReal, P_conj, | |
| Complex.conj_tsum, cBasis_conj, dBasis_conj] | |
| lemma profile_real (a : Coefficients) (s : β) : (profile a (s : β)).im = 0 := by | |
| have hh : conj (profile a (s : β)) = profile a (s : β) := by | |
| simpa only [Complex.conj_ofReal] using profile_conj a (s : β) | |
| exact Complex.conj_eq_iff_im.mp hh | |
| lemma profile_eq (a : Coefficients) (s : β) (hs : β n : Node, s β (n.val : β)) : | |
| profile a s = P s * ((a.C : β) + | |
| β' n : Node, ((a.c n : β) / (s - n.val) ^ 2 + (a.d n : β) / (s - n.val))) := by | |
| simp_rw [profile, cBasis_eq _ (hs _), dBasis_eq _ (hs _)] | |
| rw [mul_add, β tsum_mul_left] | |
| congr 1 | |
| Β· ring | |
| Β· apply tsum_congr | |
| intro n | |
| ring | |
| lemma deriv_profile (a : Coefficients) (s : β) : | |
| deriv (profile a) s = (a.C : β) * deriv P s + | |
| β' n : Node, ((a.c n : β) * deriv (cBasis n) s + | |
| (a.d n : β) * deriv (dBasis n) s) := by | |
| obtain β¨M, hM, hBβ© := uniform_basis_bound (|s.im| + 1) | |
| let U : Set β := {w | |w.im| < |s.im| + 1} | |
| let F : Node β β β β := fun n w => (a.c n : β) * cBasis n w + (a.d n : β) * dBasis n w | |
| have hU : IsOpen U := isOpen_lt Complex.continuous_im.abs continuous_const | |
| have hs : s β U := by dsimp [U]; linarith | |
| have hd (n : Node) : Differentiable β (F n) := | |
| ((differentiable_cBasis n).const_mul _).add ((differentiable_dBasis n).const_mul _) | |
| have hF (n : Node) (w : β) (hw : w β U) : βF n wβ β€ (|a.c n| + |a.d n|) * M := | |
| summand_norm_bound a hB n w (le_of_lt hw) | |
| have hsum := Complex.hasSum_deriv_of_summable_norm (a.summable.mul_right M) | |
| (fun n => (hd n).differentiableOn) hU hF hs | |
| have hdiff := (Complex.differentiableOn_tsum_of_summable_norm (a.summable.mul_right M) | |
| (fun n => (hd n).differentiableOn) hU hF).differentiableAt (hU.mem_nhds hs) | |
| change deriv (fun z => (a.C : β) * P z + β' n : Node, F n z) s = _ | |
| rw [deriv_fun_add ((differentiable_P s).const_mul _) hdiff, | |
| deriv_const_mul _ (differentiable_P s), β hsum.tsum_eq] | |
| congr 1 | |
| apply tsum_congr | |
| intro n | |
| exact ((((differentiable_cBasis n s).hasDerivAt.const_mul (a.c n : β)).add | |
| ((differentiable_dBasis n s).hasDerivAt.const_mul (a.d n : β))).deriv) | |
| lemma profile_node (a : Coefficients) (n : Node) : | |
| profile a (n.val : β) = (a.c n : β) * cBasis n (n.val : β) := by | |
| classical | |
| simp only [profile, P_node, mul_zero, zero_add] | |
| rw [tsum_eq_single n] | |
| Β· simp only [dBasis_node, mul_zero, add_zero] | |
| Β· intro m hmn | |
| simp only [cBasis_other hmn.symm, dBasis_other hmn.symm, mul_zero, add_zero] | |
| lemma deriv_profile_node (a : Coefficients) (n : Node) : | |
| deriv (profile a) (n.val : β) = | |
| (a.c n : β) * deriv (cBasis n) (n.val : β) + | |
| (a.d n : β) * cBasis n (n.val : β) := by | |
| classical | |
| rw [deriv_profile, deriv_P_node, mul_zero, zero_add, tsum_eq_single n] | |
| Β· rw [cBasis_node] | |
| Β· intro m hmn | |
| simp only [deriv_cBasis_other hmn.symm, deriv_dBasis_other hmn.symm, | |
| mul_zero, add_zero] | |
| end Cardinal | |
| namespace Analysis | |
| lemma polynomial_gaussian_bound {c : β} (hc : 0 < c) (m : β) : | |
| β C : β, 0 β€ C β§ β r : β, 0 β€ r β (1+r)^m * Real.exp (-c*r^2) β€ C := by | |
| let B : β := 2+cβ»ΒΉ | |
| refine β¨B^m*(m.factorial:β)*Real.exp 1, by positivity, ?_β© | |
| intro r hr | |
| have hc' : 0 < cβ»ΒΉ := inv_pos.mpr hc | |
| have hB : 0 β€ B := by dsimp [B]; positivity | |
| have h : 1+r β€ B*(1+c*r^2) := by | |
| dsimp [B] | |
| have hsq := sq_nonneg (r-1) | |
| have hmul : cβ»ΒΉ*c=1 := inv_mul_cancelβ hc.ne' | |
| nlinarith [sq_nonneg r, mul_nonneg hc.le (sq_nonneg r)] | |
| have hp : (1+c*r^2)^m β€ (m.factorial:β)*Real.exp (1+c*r^2) := by | |
| have hh := Real.pow_div_factorial_le_exp (1+c*r^2) (by positivity : 0 β€ 1+c*r^2) m | |
| exact (div_le_iffβ (by positivity : (0 : β) < (m.factorial : β))).mp hh |>.trans_eq (mul_comm _ _) | |
| calc | |
| (1+r)^m * Real.exp (-c*r^2) β€ (B*(1+c*r^2))^m * Real.exp (-c*r^2) := by gcongr | |
| _ = B^m * ((1+c*r^2)^m * Real.exp (-c*r^2)) := by rw [mul_pow]; ring | |
| _ β€ B^m * (((m.factorial:β)*Real.exp (1+c*r^2))*Real.exp (-c*r^2)) := by gcongr | |
| _ = B^m*(m.factorial:β)*Real.exp 1 := by | |
| rw [mul_assoc (m.factorial:β), β Real.exp_add] | |
| rw [show 1+c*r^2 + -c*r^2 = 1 by ring] | |
| ring | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] | |
| lemma gaussian_schwartz_decay {c : β} (hc : 0 < c) (k n : β) : | |
| β C : β, β x : E, βxβ^k * βiteratedFDeriv β n (fun y : E => Real.exp (-c*βyβ^2)) xβ β€ C := by | |
| have ht : (fun x : E => -c*βxβ^2).HasTemperateGrowth := by fun_prop | |
| obtain β¨l,B,hB,hderβ© := ht.norm_iteratedFDeriv_le_uniform n | |
| obtain β¨C,hC,hCboundβ© := polynomial_gaussian_bound hc (k+l*n) | |
| refine β¨(n.factorial:β)*(B+1)^n*C, fun x => ?_β© | |
| have hw : 1 β€ (B+1)*(1+βxβ)^l := by | |
| have hh : 1 β€ (1+βxβ)^l := one_le_powβ (by linarith [norm_nonneg x]) | |
| nlinarith | |
| have hD (i : β) (hi : 1 β€ i) (hin : i β€ n) : | |
| βiteratedFDeriv β i (fun x : E => -c*βxβ^2) xβ β€ ((B+1)*(1+βxβ)^l)^i := by | |
| calc | |
| _ β€ B*(1+βxβ)^l := hder i hin x | |
| _ β€ (B+1)*(1+βxβ)^l := by gcongr; linarith | |
| _ β€ ((B+1)*(1+βxβ)^l)^i := le_self_powβ hw (by omega) | |
| have hexp (i : β) (_hi : i β€ n) : | |
| βiteratedFDeriv β i Real.exp (-c*βxβ^2)β β€ Real.exp (-c*βxβ^2) := by | |
| rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv,iteratedDeriv_eq_iterate,Real.iter_deriv_exp] | |
| exact le_of_eq (Real.norm_of_nonneg (Real.exp_pos _).le) | |
| have hd := norm_iteratedFDeriv_comp_le (π := β) Real.contDiff_exp ht.1 (by exact_mod_cast (show (n : ββ) β€ β€ from le_top)) x hexp hD | |
| calc | |
| _ β€ βxβ^k * ((n.factorial:β)*Real.exp (-c*βxβ^2)*((B+1)*(1+βxβ)^l)^n) := | |
| mul_le_mul_of_nonneg_left hd (by positivity) | |
| _ β€ (1+βxβ)^k * ((n.factorial:β)*Real.exp (-c*βxβ^2)*((B+1)*(1+βxβ)^l)^n) := by gcongr; linarith | |
| _ = (n.factorial:β)*(B+1)^n*((1+βxβ)^(k+l*n)*Real.exp (-c*βxβ^2)) := by | |
| rw [mul_pow,pow_add,pow_mul] | |
| ring | |
| _ β€ (n.factorial:β)*(B+1)^n*C := by gcongr; exact hCbound βxβ (norm_nonneg _) | |
| def gaussianSchwartz (c : β) (hc : 0 < c) : π’(E,β) where | |
| toFun x := Real.exp (-c*βxβ^2) | |
| smooth' := Real.contDiff_exp.comp (contDiff_const.mul (contDiff_norm_sq β)) | |
| decay' := gaussian_schwartz_decay hc | |
| @[simp] lemma gaussianSchwartz_apply (c : β) (hc : 0 < c) (x : E) : | |
| gaussianSchwartz c hc x = Real.exp (-c*βxβ^2) := rfl | |
| lemma iteratedDeriv_real_of_complex {f : β β β} (hf : Differentiable β f) (n : β) : | |
| iteratedDeriv n (fun x : β => (f x).re) = fun x : β => (iteratedDeriv n f x).re := by | |
| induction n with | |
| | zero => simp only [iteratedDeriv_zero] | |
| | succ n ih => | |
| rw [iteratedDeriv_succ, ih, iteratedDeriv_succ] | |
| funext x | |
| exact ((hf.contDiff (n := β€)).differentiable_iteratedDeriv n (by simp) (x : β)).hasDerivAt.real_of_complex.deriv | |
| lemma entire_real_temperate {f : β β β} (hf : Differentiable β f) | |
| (hstrip : β M : β, β z : β, |z.im| β€ 1 β βf zβ β€ M) : | |
| Function.HasTemperateGrowth (fun x : β => (f x).re) := by | |
| obtain β¨M,hMβ© := hstrip | |
| refine β¨hf.contDiff.real_of_complex, fun n => β¨0,(n.factorial:β)*M,?_β©β© | |
| intro x | |
| rw [pow_zero,mul_one,norm_iteratedFDeriv_eq_norm_iteratedDeriv,iteratedDeriv_real_of_complex hf] | |
| apply (Complex.abs_re_le_norm _).trans | |
| have hh := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le (f := f) n | |
| (by norm_num : (0:β)<1) hf.diffContOnCl (c := (x:β)) (C := M) (fun z hz => hM z (by | |
| have hi := Complex.abs_im_le_norm (z-(x:β)) | |
| have he := Metric.mem_sphere.mp hz | |
| simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero,β dist_eq_norm,he] using hi)) | |
| simpa using hh | |
| def dampedEntireSchwartz (c : β) (hc : 0 < c) (b : β) (f : β β β) | |
| (_hf : Differentiable β f) (_hstrip : β M : β, β z : β, |z.im| β€ 1 β βf zβ β€ M) : π’(E,β) := | |
| SchwartzMap.smulLeftCLM β (fun x : E => (f (b*βxβ^2)).re) (gaussianSchwartz c hc) | |
| lemma dampedEntireSchwartz_apply (c : β) (hc : 0 < c) (b : β) (f : β β β) | |
| (hf : Differentiable β f) (hstrip : β M : β, β z : β, |z.im| β€ 1 β βf zβ β€ M) (x : E) : | |
| dampedEntireSchwartz c hc b f hf hstrip x = Real.exp (-c*βxβ^2)*(f (b*βxβ^2)).re := by | |
| have ht := entire_real_temperate hf hstrip | |
| have hg : Function.HasTemperateGrowth (fun x : E => (f (b*βxβ^2)).re) := by | |
| convert ht.comp (by fun_prop : Function.HasTemperateGrowth (fun x : E => b*βxβ^2)) using 1 | |
| funext x | |
| simp | |
| rw [dampedEntireSchwartz,SchwartzMap.smulLeftCLM_apply_apply hg,gaussianSchwartz_apply] | |
| simp [mul_comm] | |
| end Analysis | |
| namespace Cardinal | |
| def dampedProfile (a : Coefficients) : SchwartzMap Plane β := | |
| Analysis.dampedEntireSchwartz (Real.pi * h * b) | |
| (mul_pos (mul_pos Real.pi_pos h_pos) b_pos) b (profile a) | |
| (differentiable_profile a) (profile_strip a 1) | |
| lemma dampedProfile_apply (a : Coefficients) (x : Plane) : | |
| dampedProfile a x = Real.exp (-Real.pi * h * b * βxβ ^ 2) * | |
| (profile a ((b * βxβ ^ 2 : β) : β)).re := by | |
| rw [dampedProfile, Analysis.dampedEntireSchwartz_apply] | |
| push_cast | |
| congr 3; ring | |
| lemma dampedProfile_complex (a : Coefficients) (x : Plane) : | |
| (dampedProfile a x : β) = (Real.exp (-Real.pi * h * b * βxβ ^ 2) : β) * | |
| profile a ((b * βxβ ^ 2 : β) : β) := by | |
| rw [dampedProfile_apply, Complex.ofReal_mul] | |
| have hh : ((profile a ((b * βxβ ^ 2 : β) : β)).re : β) = | |
| profile a ((b * βxβ ^ 2 : β) : β) := | |
| Complex.conj_eq_iff_re.mp (by | |
| simpa only [Complex.conj_ofReal] using profile_conj a ((b * βxβ ^ 2 : β) : β)) | |
| rw [hh] | |
| lemma dampedProfile_radial (a : Coefficients) : IsRadial (dampedProfile a) := by | |
| intro x y hxy | |
| simp only [dampedProfile_apply, hxy] | |
| theorem cardinal_realization (a : Coefficients) : | |
| Differentiable β (profile a) β§ | |
| (β s : β, (profile a (s : β)).im = 0) β§ | |
| β f : SchwartzMap Plane β, IsRadial f β§ | |
| β x : Plane, (f x : β) = | |
| (Real.exp (-Real.pi * h * b * βxβ ^ 2) : β) * | |
| profile a ((b * βxβ ^ 2 : β) : β) := by | |
| exact β¨differentiable_profile a, profile_real a, dampedProfile a, | |
| dampedProfile_radial a, dampedProfile_complex aβ© | |
| end Cardinal | |
| end Triangular | |
| end | |
| end OAI | |