Buckets:
import OAI.Analysis.HotSpots.Sobolev
import OAI.Analysis.HotSpots.DiskKernel
namespace OAI
section DouglasLipschitzBase
noncomputable section
section FullBoundaryCombinedLayer
section WeightedLayer
open Set MeasureTheory
open scoped ContDiff InnerProductSpace ENNReal NNReal
open Set Filter MeasureTheory InnerProductSpace NormedSpace
open scoped Topology ContDiff
open scoped Laplacian
open Set MeasureTheory Filter InnerProductSpace Bornology
open scoped Topology Laplacian ContDiff RealInnerProductSpace
namespace StrictHotSpots.GreenFundamental
def logRegularized (ε : ℝ) (z : ℂ) : ℝ := Real.log (‖z‖ ^ 2 + ε ^ 2)
def peak (z : ℂ) : ℝ := 1 / (Real.pi * (1 + ‖z‖ ^ 2) ^ 2)
lemma denominator_pos {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
0 < ‖z‖ ^ 2 + ε ^ 2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε)
lemma logRegularized_contDiff {ε : ℝ} (hε : ε ≠ 0) :
ContDiff ℝ ∞ (logRegularized ε) := by
exact ((contDiff_id.norm_sq (𝕜 := ℂ)).add contDiff_const).log
(fun z => (denominator_pos hε z).ne')
lemma logRegularized_fderiv {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
fderiv ℝ (logRegularized ε) z =
(‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) := by
exact (((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2)).log
(denominator_pos hε z).ne').fderiv
lemma logRegularized_second {ε : ℝ} (hε : ε ≠ 0) (z a b : ℂ) :
fderiv ℝ (fderiv ℝ (logRegularized ε)) z a b =
2 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ * ⟪a, b⟫_ℝ -
4 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ ^ 2 * ⟪z, a⟫_ℝ * ⟪z, b⟫_ℝ := by
have hf : fderiv ℝ (logRegularized ε) = fun z : ℂ =>
(‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) :=
funext (logRegularized_fderiv hε)
rw [hf]
have hd := (hasDerivAt_inv (denominator_pos hε z).ne').comp_hasFDerivAt z
((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2))
have hi : HasFDerivAt (fun z : ℂ => 2 • innerSL ℝ z) (2 • innerSL ℝ (E := ℂ)) z := by
exact (2 • innerSL ℝ (E := ℂ)).hasFDerivAt
calc
_ = _ := congrArg (fun L : ℂ →L[ℝ] (ℂ →L[ℝ] ℝ) => L a b) (hd.smul hi).fderiv
_ = _ := by
simp only [add_apply, smul_apply, two_smul, ContinuousLinearMap.smulRight_apply,
Function.comp_def, neg_mul, smul_eq_mul, innerSL_apply_apply]
erw [innerSL_apply_apply]
simp only [← inv_pow]
ring
lemma logRegularized_laplacian {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
Δ (logRegularized ε) z = 4 * ε ^ 2 / (‖z‖ ^ 2 + ε ^ 2) ^ 2 := by
rw [laplacian_eq_iteratedFDeriv_complexPlane]
simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero,
Matrix.cons_val_one, logRegularized_second hε]
have hz : z.re ^ 2 + z.im ^ 2 = ‖z‖ ^ 2 := by
simpa [Complex.normSq_apply, pow_two] using Complex.normSq_eq_norm_sq z
simp only [Complex.inner]
simp at *
field_simp
nlinarith
lemma radial_primitive_hasDerivAt (r : ℝ) :
HasDerivAt (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹)
(r / (Real.pi * (1 + r ^ 2)^2)) r := by
have hd := ((hasDerivAt_id r).pow 2).const_add 1
have h := (hasDerivAt_inv (show 1 + r ^ 2 ≠ 0 by positivity)).comp r hd
have hh := h.const_mul (-(2 * Real.pi)⁻¹)
simp only [Function.comp_def, id_eq, Pi.pow_apply, Nat.cast_ofNat,
Nat.reduceSub, pow_one, mul_one] at hh
convert! hh using 1
field_simp
lemma radial_primitive_tendsto :
Tendsto (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹) atTop (𝓝 0) := by
simpa using (tendsto_inv_atTop_zero.comp
(tendsto_atTop_add_const_left atTop (1 : ℝ) (tendsto_pow_atTop two_ne_zero))).const_mul
(-(2 * Real.pi)⁻¹)
lemma integral_radial :
∫ r in Ioi (0 : ℝ), r / (Real.pi * (1 + r ^ 2)^2) = (2 * Real.pi)⁻¹ := by
simpa using integral_Ioi_of_hasDerivAt_of_nonneg'
(a := (0 : ℝ)) (fun r _ => radial_primitive_hasDerivAt r)
(fun r hr => div_nonneg hr.le (by positivity)) radial_primitive_tendsto
lemma integral_peak : ∫ z : ℂ, peak z = 1 := by
rw [← Complex.integral_comp_polarCoord_symm]
have heq : (fun p : ℝ × ℝ => p.1 • peak (Complex.polarCoord.symm p)) =
(fun p : ℝ × ℝ => (p.1 / (Real.pi * (1 + p.1 ^ 2)^2)) * (1 : ℝ)) := by
funext p
simp [peak, sq_abs, div_eq_mul_inv]
rw [heq]
change (∫ p in (Ioi (0 : ℝ)) ×ˢ Ioo (-Real.pi) Real.pi,
(p.1 / (Real.pi * (1 + p.1 ^ 2)^2)) * (1 : ℝ)) = 1
rw [show (volume : Measure (ℝ × ℝ)) = volume.prod volume from rfl,
setIntegral_prod_mul (fun r : ℝ => r / (Real.pi * (1 + r ^ 2)^2))
(fun _ : ℝ => (1 : ℝ)), integral_radial]
simp [Real.pi_pos.le]
field_simp
ring
lemma peak_nonneg (z : ℂ) : 0 ≤ peak z := by
unfold peak
positivity
lemma peak_decay : Tendsto (fun z : ℂ => ‖z‖ ^ Module.finrank ℝ ℂ * peak z)
(cobounded ℂ) (𝓝 0) := by
have h : Tendsto (fun z : ℂ => (1 + ‖z‖ ^ 2)⁻¹) (cobounded ℂ) (𝓝 0) :=
tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_left _ (1 : ℝ)
((tendsto_pow_atTop two_ne_zero).comp tendsto_norm_cobounded_atTop))
have hh := (h.sub (h.pow 2)).const_mul Real.pi⁻¹
simp only [zero_pow two_ne_zero, sub_zero, mul_zero] at hh
convert! hh using 1
funext z
simp only [Complex.finrank_real_complex, peak]
field_simp
ring
lemma tendsto_peak_mul {φ : ℂ → ℝ} (hφ : Integrable φ) (hc : ContinuousAt φ 0) :
Tendsto (fun c : ℝ => ∫ z : ℂ, (c ^ 2 * peak (c • z)) * φ z)
atTop (𝓝 (φ 0)) := by
simpa only [Complex.finrank_real_complex, smul_eq_mul] using
tendsto_integral_comp_smul_smul_of_integrable peak_nonneg integral_peak peak_decay hφ hc
lemma logRegularized_laplacian_scale {c : ℝ} (hc : c ≠ 0) (z : ℂ) :
Δ (logRegularized c⁻¹) z = (4 * Real.pi) * (c ^ 2 * peak (c • z)) := by
rw [logRegularized_laplacian (inv_ne_zero hc)]
simp only [peak, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs]
have hd : ‖z‖ ^ 2 + c⁻¹ ^ 2 ≠ 0 := (denominator_pos (inv_ne_zero hc) z).ne'
have hd' : 1 + c ^ 2 * ‖z‖ ^ 2 ≠ 0 := by positivity
field_simp
ring
lemma tendsto_logRegularized_laplacian_mul {φ : ℂ → ℝ}
(hφ : Integrable φ) (hc : ContinuousAt φ 0) :
Tendsto (fun c : ℝ => ∫ z : ℂ, Δ (logRegularized c⁻¹) z * φ z)
atTop (𝓝 ((4 * Real.pi) * φ 0)) := by
apply ((tendsto_peak_mul hφ hc).const_mul (4 * Real.pi)).congr'
filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc
simp_rw [logRegularized_laplacian_scale hc.ne', mul_assoc]
simpa only [mul_assoc] using (integral_const_mul (μ := (volume : Measure ℂ)) (4 * Real.pi)
(fun z : ℂ => c ^ 2 * (peak (c • z) * φ z))).symm
def direction (f : ℂ → ℝ) (e : ℂ) (z : ℂ) : ℝ := fderiv ℝ f z e
lemma direction_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (e : ℂ) :
ContDiff ℝ ∞ (direction f e) :=
(hf.fderiv_right (by simp)).clm_apply contDiff_const
lemma direction_compact {φ : ℂ → ℝ} (hc : HasCompactSupport φ) (e : ℂ) :
HasCompactSupport (direction φ e) := hc.fderiv_apply ℝ e
lemma second_direction {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (e x : ℂ) :
direction (direction f e) e x = fderiv ℝ (fderiv ℝ f) x e e := by
unfold direction
rw [fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiable (by simp) x)
(differentiableAt_const _)]
simp
lemma laplacian_direction {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) :
Δ f = fun x => direction (direction f 1) 1 x +
direction (direction f Complex.I) Complex.I x := by
funext x
rw [laplacian_eq_iteratedFDeriv_complexPlane]
simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero,
Matrix.cons_val_one, second_direction hf]
lemma integral_direction_by_parts {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : ℂ) :
∫ x, f x * direction φ e x = -(∫ x, direction f e x * φ x) := by
apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable
· exact ((direction_smooth hf e).continuous.mul hφ.continuous).integrable_of_hasCompactSupport
hc.mul_left
· exact (hf.continuous.mul (direction_smooth hφ e).continuous).integrable_of_hasCompactSupport
(direction_compact hc e).mul_left
· exact (hf.continuous.mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left
· intro x _
exact hf.differentiable (by simp) x
· intro x _
exact hφ.differentiable (by simp) x
lemma integral_second_direction {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) (e : ℂ) :
∫ x, f x * direction (direction φ e) e x =
∫ x, direction (direction f e) e x * φ x := by
rw [integral_direction_by_parts hf (direction_smooth hφ e) (direction_compact hc e),
integral_direction_by_parts (direction_smooth hf e) hφ hc, neg_neg]
lemma integral_laplacian_by_parts {f φ : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) :
∫ x, f x * Δ φ x = ∫ x, Δ f x * φ x := by
have hi (e : ℂ) : Integrable (fun x => f x * direction (direction φ e) e x) :=
(hf.continuous.mul (direction_smooth (direction_smooth hφ e) e).continuous).integrable_of_hasCompactSupport (direction_compact (direction_compact hc e) e).mul_left
have hi' (e : ℂ) : Integrable (fun x => direction (direction f e) e x * φ x) :=
((direction_smooth (direction_smooth hf e) e).continuous.mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left
simp_rw [laplacian_direction hf, laplacian_direction hφ, mul_add, add_mul]
rw [integral_add (hi 1) (hi Complex.I), integral_add (hi' 1) (hi' Complex.I),
integral_second_direction hf hφ hc, integral_second_direction hf hφ hc]
lemma tendsto_logRegularized_test {φ : ℂ → ℝ}
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) :
Tendsto (fun c : ℝ => ∫ z : ℂ, logRegularized c⁻¹ z * Δ φ z)
atTop (𝓝 ((4 * Real.pi) * φ 0)) := by
apply (tendsto_logRegularized_laplacian_mul
(hφ.continuous.integrable_of_hasCompactSupport hc) hφ.continuous.continuousAt).congr'
filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc'
exact (integral_laplacian_by_parts (logRegularized_contDiff (inv_ne_zero hc'.ne')) hφ hc).symm
lemma abs_log_bound {t : ℝ} (ht : 0 < t) : |Real.log t| ≤ t + t⁻¹ := by
have hu := Real.log_le_sub_one_of_pos ht
have hl := Real.one_sub_inv_le_log_of_pos ht
exact abs_le.mpr ⟨by linarith, by have := inv_pos.mpr ht; linarith⟩
lemma log_norm_integrableOn_ball (R : ℝ) :
IntegrableOn (fun z : ℂ => Real.log ‖z‖) (Metric.ball 0 R) := by
apply integrableOn_ball_of_norm_le_rpow (C := R ^ 2 + 1) (α := 1)
(by norm_num : 1 ≤ Module.finrank ℝ ℂ) (by norm_num : (1 : ℝ) < Module.finrank ℝ ℂ)
· filter_upwards [self_mem_ae_restrict measurableSet_ball] with z hz
rw [Real.norm_eq_abs, Real.rpow_neg_one]
by_cases he : z = 0
· simp [he]
· have hp : 0 < ‖z‖ := norm_pos_iff.mpr he
have hr : ‖z‖ < R := by simpa using hz
calc
_ ≤ ‖z‖ + ‖z‖⁻¹ := abs_log_bound hp
_ ≤ (R ^ 2 + 1) * ‖z‖⁻¹ := by
rw [← div_eq_mul_inv]
apply (le_div_iff₀ hp).mpr
have he : (‖z‖ + ‖z‖⁻¹) * ‖z‖ = ‖z‖ ^ 2 + 1 := by field_simp
rw [he]
nlinarith
· exact (Real.measurable_log.comp continuous_norm.measurable).aestronglyMeasurable
lemma logRegularized_abs_le {ε : ℝ} (hε : 0 ≤ ε) (hε' : ε ≤ 1)
{z : ℂ} (hz : z ≠ 0) :
|logRegularized ε z| ≤ 2 * |Real.log ‖z‖| + ‖z‖ ^ 2 + 1 := by
have hp : 0 < ‖z‖ := norm_pos_iff.mpr hz
have hl := Real.log_le_log (sq_pos_of_pos hp) (le_add_of_nonneg_right (sq_nonneg ε))
have hu := Real.log_le_self (show 0 ≤ ‖z‖ ^ 2 + ε ^ 2 by positivity)
rw [Real.log_pow] at hl
norm_num at hl
have ha := neg_abs_le (Real.log ‖z‖)
have hb := abs_nonneg (Real.log ‖z‖)
unfold logRegularized
exact abs_le.mpr ⟨by nlinarith [sq_nonneg ‖z‖], by nlinarith⟩
lemma tendsto_logRegularized {z : ℂ} (hz : z ≠ 0) :
Tendsto (fun c : ℝ => logRegularized c⁻¹ z) atTop (𝓝 (2 * Real.log ‖z‖)) := by
have hp : ‖z‖ ^ 2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr hz)
have ht : Tendsto (fun c : ℝ => ‖z‖ ^ 2 + (c⁻¹) ^ 2) atTop (𝓝 (‖z‖ ^ 2)) := by
simpa using (tendsto_const_nhds (x := ‖z‖ ^ 2)).add (tendsto_inv_atTop_zero.pow 2)
simpa [logRegularized, Real.log_pow, Function.comp_def] using (Real.continuousAt_log hp).tendsto.comp ht
lemma tendsto_integral_logRegularized {ψ : ℂ → ℝ}
(hψ : Continuous ψ) (hc : HasCompactSupport ψ) :
Tendsto (fun c : ℝ => ∫ z : ℂ, logRegularized c⁻¹ z * ψ z)
atTop (𝓝 (∫ z : ℂ, (2 * Real.log ‖z‖) * ψ z)) := by
obtain ⟨R, hR, hsub⟩ := hc.isBounded.subset_ball_lt 0 (0 : ℂ)
obtain ⟨B, hB⟩ := hc.exists_bound_of_continuous hψ
have hB0 : 0 ≤ B := (norm_nonneg (ψ 0)).trans (hB 0)
let bound : ℂ → ℝ := (Metric.ball (0 : ℂ) R).indicator
(fun z => (2 * |Real.log ‖z‖| + R ^ 2 + 1) * B)
have hi : Integrable bound := by
apply (integrable_indicator_iff measurableSet_ball).mpr
exact ((((log_norm_integrableOn_ball R).abs.const_mul 2).add
(integrableOn_const (measure_ball_lt_top.ne))).add
(integrableOn_const (measure_ball_lt_top.ne))).mul_const B
refine tendsto_integral_filter_of_dominated_convergence bound ?_ ?_ hi ?_
· filter_upwards [Ioi_mem_atTop (0 : ℝ)] with c hc'
exact ((logRegularized_contDiff (inv_ne_zero hc'.ne')).continuous.mul hψ).aestronglyMeasurable
· filter_upwards [Ici_mem_atTop (1 : ℝ)] with c hc'
change 1 ≤ c at hc'
filter_upwards [volume.ae_ne (0 : ℂ)] with z hz
by_cases hzr : z ∈ Metric.ball (0 : ℂ) R
· rw [norm_mul, Real.norm_eq_abs, show bound z =
(2 * |Real.log ‖z‖| + R ^ 2 + 1) * B from Set.indicator_of_mem hzr _]
have hr : ‖z‖ < R := by simpa using hzr
have hli : |logRegularized c⁻¹ z| ≤ 2 * |Real.log ‖z‖| + R ^ 2 + 1 := by
apply (logRegularized_abs_le (inv_nonneg.mpr (by linarith))
(inv_le_one₀ (by linarith) |>.mpr hc') hz).trans
nlinarith [norm_nonneg z]
exact mul_le_mul hli (hB z) (norm_nonneg _) (by positivity)
· have hzψ : ψ z = 0 := image_eq_zero_of_notMem_tsupport
(fun hz' => hzr (hsub hz'))
simp [hzψ, bound, hzr]
· filter_upwards [volume.ae_ne (0 : ℂ)] with z hz
exact (tendsto_logRegularized hz).mul_const (ψ z)
lemma laplacian_smooth {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ) :
ContDiff ℝ ∞ (Δ φ) := by
rw [laplacian_direction hφ]
exact (direction_smooth (direction_smooth hφ 1) 1).add
(direction_smooth (direction_smooth hφ Complex.I) Complex.I)
lemma laplacian_compact {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ)
(hc : HasCompactSupport φ) : HasCompactSupport (Δ φ) := by
rw [laplacian_direction hφ]
exact (direction_compact (direction_compact hc 1) 1).add
(direction_compact (direction_compact hc Complex.I) Complex.I)
lemma integral_log_laplacian {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ)
(hc : HasCompactSupport φ) :
∫ z : ℂ, Real.log ‖z‖ * Δ φ z = (2 * Real.pi) * φ 0 := by
have he := tendsto_nhds_unique (tendsto_logRegularized_test hφ hc)
(tendsto_integral_logRegularized (laplacian_smooth hφ).continuous
(laplacian_compact hφ hc))
simp_rw [mul_assoc] at he
rw [integral_const_mul] at he
linarith
lemma log_norm_locallyIntegrable : LocallyIntegrable (fun z : ℂ => Real.log ‖z‖) := by
intro z
refine ⟨Metric.ball (0 : ℂ) (‖z‖ + 1), Metric.isOpen_ball.mem_nhds ?_,
log_norm_integrableOn_ball _⟩
simp
lemma laplacian_comp_add_right (φ : ℂ → ℝ) (a : ℂ) :
Δ (fun z => φ (z+a)) = fun z => Δ φ (z+a) := by
funext z
simp only [laplacian_eq_iteratedFDeriv_complexPlane, iteratedFDeriv_comp_add_right]
lemma integral_log_sub_laplacian {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ)
(hc : HasCompactSupport φ) (a : ℂ) :
∫ z : ℂ, Real.log ‖z-a‖ * Δ φ z = (2 * Real.pi) * φ a := by
have h := integral_log_laplacian (φ := fun z => φ (z+a))
(hφ.comp (contDiff_id.add contDiff_const))
(hc.comp_homeomorph (Homeomorph.addRight a))
rw [laplacian_comp_add_right] at h
rw [← integral_add_right_eq_self (fun z : ℂ => Real.log ‖z-a‖ * Δ φ z) a]
simpa using h
lemma integral_laplacian_zero {φ : ℂ → ℝ} (hφ : ContDiff ℝ ∞ φ)
(hc : HasCompactSupport φ) : ∫ z : ℂ, Δ φ z = 0 := by
simpa using integral_laplacian_by_parts (f := fun _ => (1 : ℝ)) contDiff_const hφ hc
lemma log_sub_mul_integrable {ψ : ℂ → ℝ} (hψ : Continuous ψ)
(hc : HasCompactSupport ψ) (a : ℂ) :
Integrable (fun z : ℂ => Real.log ‖z-a‖ * ψ z) := by
have hi := log_norm_locallyIntegrable.integrable_smul_right_of_hasCompactSupport
(hψ.comp (continuous_id.add continuous_const))
(hc.comp_homeomorph (Homeomorph.addRight a))
simpa [Function.comp_def, sub_eq_add_neg, smul_eq_mul] using
(measurePreserving_add_right volume (-a)).integrable_comp_of_integrable hi
end StrictHotSpots.GreenFundamental
namespace StrictHotSpots.DiskFormula
open StrictHotSpots.GreenFundamental
def green (x y : ℂ) : ℝ :=
Real.log (1 + (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) / ‖x-y‖ ^ 2) / (4 * Real.pi)
lemma disk_cross_identity (x y : ℂ) :
‖1 - x * star y‖ ^ 2 = (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) + ‖x-y‖ ^ 2 := by
simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im,
Complex.mul_re, Complex.mul_im, Complex.one_re, Complex.one_im,
Complex.star_def, Complex.conj_re, Complex.conj_im]
ring
lemma green_eq_log {x y : ℂ} (hxy : x ≠ y) (hnum : 1 - x * star y ≠ 0) :
green x y = (Real.log ‖1-x*star y‖ - Real.log ‖x-y‖) / (2 * Real.pi) := by
have hd := pow_ne_zero 2 (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hxy))
have hn := pow_ne_zero 2 (norm_ne_zero_iff.mpr hnum)
have he : 1 + (1 - ‖x‖ ^ 2) * (1 - ‖y‖ ^ 2) / ‖x-y‖ ^ 2 =
‖1-x*star y‖ ^ 2 / ‖x-y‖ ^ 2 := by
rw [disk_cross_identity, add_div, div_self hd]
ring
rw [green, he, Real.log_div hn hd, Real.log_pow, Real.log_pow]
ring
lemma correction_factor {y : ℂ} (hy : y ≠ 0) (z : ℂ) :
1-z*star y = -(star y) * (z-(star y)⁻¹) := by
have hn : star y ≠ 0 := star_ne_zero.mpr hy
field_simp
ring
lemma ae_correction_ne_zero (y : ℂ) : ∀ᵐ z : ℂ, 1-z*star y ≠ 0 := by
by_cases hy : y = 0
· simp [hy]
· filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz
rw [correction_factor hy]
exact mul_ne_zero (neg_ne_zero.mpr (star_ne_zero.mpr hy)) (sub_ne_zero.mpr hz)
lemma log_correction_eq {y : ℂ} (hy : y ≠ 0) {z : ℂ} (hz : z ≠ (star y)⁻¹) :
Real.log ‖1-z*star y‖ = Real.log ‖y‖ + Real.log ‖z-(star y)⁻¹‖ := by
rw [correction_factor hy, norm_mul, norm_neg, norm_star,
Real.log_mul (norm_ne_zero_iff.mpr hy) (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hz))]
lemma log_correction_mul_integrable (y : ℂ) {ψ : ℂ → ℝ}
(hψ : Continuous ψ) (hc : HasCompactSupport ψ) :
Integrable (fun z => Real.log ‖1-z*star y‖ * ψ z) := by
by_cases hy : y = 0
· simp [hy]
· have hi := ((hψ.integrable_of_hasCompactSupport hc).const_mul (Real.log ‖y‖)).add
(log_sub_mul_integrable hψ hc ((star y)⁻¹))
apply hi.congr
filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz
rw [log_correction_eq hy hz, add_mul]
rfl
lemma integral_log_correction_laplacian {φ : ℂ → ℝ}
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ)
(hs : tsupport φ ⊆ Metric.ball 0 1) {y : ℂ} (hy : ‖y‖ < 1) :
∫ z : ℂ, Real.log ‖1-z*star y‖ * Δ φ z = 0 := by
by_cases hy0 : y = 0
· simp [hy0]
· have he : (fun z : ℂ => Real.log ‖1-z*star y‖ * Δ φ z) =ᵐ[volume]
(fun z => Real.log ‖y‖ * Δ φ z + Real.log ‖z-(star y)⁻¹‖ * Δ φ z) := by
filter_upwards [volume.ae_ne ((star y)⁻¹)] with z hz
rw [log_correction_eq hy0 hz, add_mul]
rw [integral_congr_ae he, integral_add
(((laplacian_smooth hφ).continuous.integrable_of_hasCompactSupport
(laplacian_compact hφ hc)).const_mul _)
(log_sub_mul_integrable (laplacian_smooth hφ).continuous
(laplacian_compact hφ hc) _), integral_const_mul,
integral_laplacian_zero hφ hc, integral_log_sub_laplacian hφ hc, mul_zero, zero_add]
have hnot : (star y)⁻¹ ∉ tsupport φ := by
intro h
have hh : ‖y‖⁻¹ < 1 := by simpa using hs h
have hp := norm_pos_iff.mpr hy0
have hh' := (inv_lt_one₀ hp).mp hh
linarith
rw [image_eq_zero_of_notMem_tsupport hnot, mul_zero]
lemma integral_green_laplacian {φ : ℂ → ℝ}
(hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ)
(hs : tsupport φ ⊆ Metric.ball 0 1) {y : ℂ} (hy : ‖y‖ < 1) :
∫ z : ℂ, green z y * Δ φ z = -φ y := by
have he : (fun z : ℂ => green z y * Δ φ z) =ᵐ[volume]
(fun z => (2 * Real.pi)⁻¹ *
(Real.log ‖1-z*star y‖ * Δ φ z - Real.log ‖z-y‖ * Δ φ z)) := by
filter_upwards [volume.ae_ne y, ae_correction_ne_zero y] with z hz hn
rw [green_eq_log hz hn]
ring
rw [integral_congr_ae he, integral_const_mul, integral_sub
(log_correction_mul_integrable y (laplacian_smooth hφ).continuous (laplacian_compact hφ hc))
(log_sub_mul_integrable (laplacian_smooth hφ).continuous (laplacian_compact hφ hc) y),
integral_log_correction_laplacian hφ hc hs hy, integral_log_sub_laplacian hφ hc]
field_simp
ring
end StrictHotSpots.DiskFormula
open scoped Convolution
namespace StrictHotSpots.GreenPotential
open StrictHotSpots.GreenFundamental
lemma direction_convolution {f g : ℂ → ℝ}
(hf : LocallyIntegrable f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport g)
(e : ℂ) : direction (f ⋆ g) e = f ⋆ (direction g e) := by
funext x
rw [direction, (hc.hasFDerivAt_convolution_right (ContinuousLinearMap.lsmul ℝ ℝ)
hf (hg.of_le (by simp)) x).fderiv]
exact convolution_precompR_apply (ContinuousLinearMap.lsmul ℝ ℝ)
hf (hc.fderiv ℝ) (hg.continuous_fderiv (by simp)) x e
lemma laplacian_convolution {f g : ℂ → ℝ}
(hf : LocallyIntegrable f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport g) :
Δ (f ⋆ g) = f ⋆ (Δ g) := by
rw [laplacian_direction (hc.contDiff_convolution_right _ hf hg), laplacian_direction hg]
rw [direction_convolution hf hg hc, direction_convolution hf hg hc,
direction_convolution hf (direction_smooth hg _) (direction_compact hc _),
direction_convolution hf (direction_smooth hg _) (direction_compact hc _)]
funext x
symm
apply ConvolutionExistsAt.distrib_add
· exact (direction_compact (direction_compact hc _) _).convolutionExists_right _ hf
(direction_smooth (direction_smooth hg _) _).continuous x
· exact (direction_compact (direction_compact hc _) _).convolutionExists_right _ hf
(direction_smooth (direction_smooth hg _) _).continuous x
lemma log_potential_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) :
ContDiff ℝ ∞ ((fun z : ℂ => Real.log ‖z‖) ⋆ f) :=
hc.contDiff_convolution_right _ log_norm_locallyIntegrable hf
lemma laplacian_comp_neg {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (z : ℂ) :
Δ (fun x : ℂ => f (-x)) z = Δ f (-z) := by
have hh := iteratedFDeriv_comp_const_smul (𝕜 := ℝ) (i := 2) (-1 : ℝ)
(hf.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2))
have hh' : iteratedFDeriv ℝ 2 (fun x : ℂ => f (-x)) z =
iteratedFDeriv ℝ 2 f (-z) := by
simpa using congrFun hh z
simp only [laplacian_eq_iteratedFDeriv_complexPlane, hh']
lemma laplacian_comp_const_sub {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (a z : ℂ) :
Δ (fun x : ℂ => f (a-x)) z = Δ f (a-z) := by
have he : (fun x : ℂ => f (a-x)) = fun x => (fun y => f (y+a)) (-x) := by
funext x; congr 1; abel
have hshift : ContDiff ℝ ∞ (fun y : ℂ => f (y+a)) :=
hf.comp (contDiff_id.add contDiff_const)
calc
_ = Δ (fun y : ℂ => f (y+a)) (-z) := by
rw [he]
exact laplacian_comp_neg hshift z
_ = Δ f (-z+a) := congrFun (laplacian_comp_add_right f a) (-z)
_ = Δ f (a-z) := by rw [sub_eq_add_neg, add_comm a]
lemma log_potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) (z : ℂ) :
Δ ((fun x : ℂ => Real.log ‖x‖) ⋆ f) z = (2 * Real.pi) * f z := by
rw [laplacian_convolution log_norm_locallyIntegrable hf hc]
let φ : ℂ → ℝ := fun x => f (z-x)
have hφ : ContDiff ℝ ∞ φ := hf.comp (contDiff_const.sub contDiff_id)
have hφc : HasCompactSupport φ := by
simpa [φ, Function.comp_def, sub_eq_add_neg, add_comm] using
hc.comp_homeomorph ((Homeomorph.neg ℂ).trans (Homeomorph.addRight z))
have h := integral_log_laplacian hφ hφc
simp only [φ, laplacian_comp_const_sub hf, sub_zero] at h
simpa only [convolution_def, ContinuousLinearMap.lsmul_apply, smul_eq_mul] using h
def correctionIntegrand (f : ℂ → ℝ) (p : ℂ × ℂ) : ℝ :=
f p.2 * Real.log ‖1-p.1*star p.2‖
lemma correctionIntegrand_contDiffOn {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
{s : Set ℂ} (hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) :
ContDiffOn ℝ ∞ (correctionIntegrand f) (s ×ˢ univ) := by
intro p hp
by_cases hy : p.2 ∈ tsupport f
· have hg : ContDiff ℝ ∞ (fun p : ℂ × ℂ => 1-p.1*star p.2) := by
exact contDiff_const.sub (contDiff_fst.mul
(Complex.conjCLE.contDiff.comp contDiff_snd))
exact ((hf.comp contDiff_snd).contDiffAt.mul
((hg.contDiffAt.norm (𝕜 := ℂ) (hn p.1 hp.1 p.2 hy)).log
(norm_ne_zero_iff.mpr (hn p.1 hp.1 p.2 hy)))).contDiffWithinAt
· have he : (fun q : ℂ × ℂ => f q.2) =ᶠ[𝓝 p] (fun _ => (0 : ℝ)) :=
(notMem_tsupport_iff_eventuallyEq.mp hy).comp_tendsto continuousAt_snd
have hz : ContDiffAt ℝ ∞ (correctionIntegrand f) p := by
apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq
filter_upwards [he] with q hq
simp [correctionIntegrand, hq]
exact hz.contDiffWithinAt
lemma correction_potential_smooth {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s)
(hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) :
ContDiffOn ℝ ∞ (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) s := by
have hh := contDiffOn_convolution_left_with_param_comp
(ContinuousLinearMap.lsmul ℝ ℝ) (v := fun _ : ℂ => (0 : ℂ))
contDiffOn_const (f := fun _ : ℂ => (1 : ℝ))
(g := fun z y => correctionIntegrand f (z,y)) hs hc.isCompact
(fun z y _ hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy])
(locallyIntegrable_const (μ := (volume : Measure ℂ)) (1 : ℝ))
(correctionIntegrand_contDiffOn hf hn)
simpa only [convolution_def, correctionIntegrand, ContinuousLinearMap.lsmul_apply,
smul_eq_mul, mul_one] using hh
end StrictHotSpots.GreenPotential
open Set MeasureTheory Filter InnerProductSpace
open scoped Topology ContDiff Convolution Laplacian
namespace StrictHotSpots.CompactParameter
variable {s k : Set ℂ} {F : ℂ × ℂ → ℝ}
lemma fderiv_eq_zero_outside (hs : IsOpen s) (hk : IsClosed k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) {p : ℂ × ℂ}
(hp : p.1 ∈ s) (hy : p.2 ∉ k) : fderiv ℝ F p = 0 := by
have hd : HasFDerivAt F (0 : (ℂ × ℂ) →L[ℝ] ℝ) p := by
apply (hasFDerivAt_const (0 : ℝ) p).congr_of_eventuallyEq
filter_upwards [(hs.prod hk.isOpen_compl).mem_nhds (show p ∈ s ×ˢ kᶜ from ⟨hp,hy⟩)] with q hq
exact hz q.1 hq.1 q.2 hq.2
exact hd.fderiv
lemma fderiv_section_compact (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) {z : ℂ} (hzz : z ∈ s) :
HasCompactSupport (fun y : ℂ => fderiv ℝ F (z,y)) := by
apply HasCompactSupport.intro hk
intro y hy
exact fderiv_eq_zero_outside hs hk.isClosed hz hzz hy
lemma fderiv_section_continuous (hs : IsOpen s)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) :
Continuous (fun y : ℂ => fderiv ℝ F (z,y)) := by
exact (hf.continuousOn_fderiv_of_isOpen (hs.prod isOpen_univ) (by simp)).comp_continuous
(continuous_const.prodMk continuous_id) (fun y => ⟨hz, mem_univ y⟩)
lemma hasFDerivAt_integral (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) :
HasFDerivAt (fun z : ℂ => ∫ y : ℂ, F (z,y))
((∫ y : ℂ, fderiv ℝ F (z,y)).comp (ContinuousLinearMap.inl ℝ ℂ ℂ)) z := by
have h := hasFDerivAt_convolution_right_with_param
(ContinuousLinearMap.lsmul ℝ ℝ) (μ := (volume : Measure ℂ))
(f := fun _ : ℂ => (1 : ℝ)) (g := fun z y => F (z,y))
hs hk (fun z y hzz hy => hz z hzz y hy)
(locallyIntegrable_const (1 : ℝ)) (hf.of_le (by simp)) (z,0) hzz
have h' := h.comp z (ContinuousLinearMap.inl ℝ ℂ ℂ).hasFDerivAt
have hfun : (fun z : ℂ => (fun q : ℂ × ℂ =>
((fun _ : ℂ => (1 : ℝ)) ⋆ (fun y => F (q.1,y))) q.2)
((ContinuousLinearMap.inl ℝ ℂ ℂ) z)) =
(fun z : ℂ => ∫ y : ℂ, F (z,y)) := by
funext z
simp only [ContinuousLinearMap.inl_apply, convolution_def,
ContinuousLinearMap.lsmul_apply, smul_eq_mul, one_mul, zero_sub]
exact integral_neg_eq_self (fun y : ℂ => F (z,y)) volume
simp only [Function.comp_def] at h'
rw [hfun] at h'
convert! h' using 1
congr 1
change (∫ y : ℂ, fderiv ℝ F (z,y)) =
∫ y : ℂ, (ContinuousLinearMap.lsmul ℝ ℝ).precompR (ℂ × ℂ) 1
(fderiv ℝ F (z,0-y))
have hid : (ContinuousLinearMap.lsmul ℝ ℝ).precompR (ℂ × ℂ) 1 =
ContinuousLinearMap.id ℝ ((ℂ × ℂ) →L[ℝ] ℝ) := by
apply ContinuousLinearMap.ext
intro D
apply ContinuousLinearMap.ext
intro p
simp [ContinuousLinearMap.precompR_apply]
rw [hid]
simpa only [zero_sub, ContinuousLinearMap.id_apply] using
(integral_neg_eq_self (fun y : ℂ => fderiv ℝ F (z,y)) volume).symm
def paramDeriv (F : ℂ × ℂ → ℝ) (e : ℂ) (p : ℂ × ℂ) : ℝ :=
fderiv ℝ F p (e,0)
lemma partial_contDiffOn (hs : IsOpen s) (hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) (e : ℂ) :
ContDiffOn ℝ ∞ (paramDeriv F e) (s ×ˢ univ) :=
(hf.fderiv_of_isOpen (hs.prod isOpen_univ) (by simp)).clm_apply contDiffOn_const
lemma partial_zero_outside (hs : IsOpen s) (hk : IsClosed k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0) (e : ℂ) :
∀ z ∈ s, ∀ y ∉ k, paramDeriv F e (z,y) = 0 := by
intro z hzz y hy
simp [paramDeriv, fderiv_eq_zero_outside hs hk hz (p := (z,y)) hzz hy]
lemma integral_contDiffOn (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) :
ContDiffOn ℝ ∞ (fun z : ℂ => ∫ y : ℂ, F (z,y)) s := by
have hh := contDiffOn_convolution_left_with_param_comp
(ContinuousLinearMap.lsmul ℝ ℝ) (v := fun _ : ℂ => (0 : ℂ))
contDiffOn_const (f := fun _ : ℂ => (1 : ℝ))
(g := fun z y => F (z,y)) hs hk
(fun z y hzz hy => hz z hzz y hy)
(locallyIntegrable_const (μ := (volume : Measure ℂ)) (1 : ℝ)) hf
simpa only [convolution_def, ContinuousLinearMap.lsmul_apply,
smul_eq_mul, mul_one] using hh
lemma fderiv_integral_apply (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) (e : ℂ) :
fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e =
∫ y : ℂ, paramDeriv F e (z,y) := by
rw [(hasFDerivAt_integral hs hk hz hf hzz).fderiv]
change (∫ y : ℂ, fderiv ℝ F (z,y)) (e,0) = _
exact ContinuousLinearMap.integral_apply
((fderiv_section_continuous hs hf hzz).integrable_of_hasCompactSupport
(fderiv_section_compact hs hk hz hzz)) _
lemma fderiv_section_apply (hs : IsOpen s)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) (y e : ℂ) :
fderiv ℝ (fun z : ℂ => F (z,y)) z e = paramDeriv F e (z,y) := by
have hd := ((hf (z,y) ⟨hz, mem_univ y⟩).contDiffAt
((hs.prod isOpen_univ).mem_nhds ⟨hz, mem_univ y⟩)).differentiableAt (by simp)
have hpair : HasFDerivAt (fun x : ℂ => (x,y)) (ContinuousLinearMap.inl ℝ ℂ ℂ) z := by
exact (hasFDerivAt_id z).prodMk (hasFDerivAt_const y z)
have hc := hd.hasFDerivAt.comp z hpair
exact congrArg (fun L : ℂ →L[ℝ] ℝ => L e) hc.fderiv
lemma second_integral_apply (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) (e : ℂ) :
fderiv ℝ (fun z : ℂ => fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e) z e =
∫ y : ℂ, paramDeriv (paramDeriv F e) e (z,y) := by
have he : (fun z : ℂ => fderiv ℝ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z e) =ᶠ[𝓝 z]
(fun z : ℂ => ∫ y : ℂ, paramDeriv F e (z,y)) := by
filter_upwards [hs.mem_nhds hzz] with x hx
exact fderiv_integral_apply hs hk hz hf hx e
rw [he.fderiv_eq]
exact fderiv_integral_apply hs hk (partial_zero_outside hs hk.isClosed hz e)
(partial_contDiffOn hs hf e) hzz e
lemma second_section_apply (hs : IsOpen s)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hz : z ∈ s) (y e : ℂ) :
fderiv ℝ (fun z : ℂ => fderiv ℝ (fun z : ℂ => F (z,y)) z e) z e =
paramDeriv (paramDeriv F e) e (z,y) := by
have he : (fun z : ℂ => fderiv ℝ (fun z : ℂ => F (z,y)) z e) =ᶠ[𝓝 z]
(fun z : ℂ => paramDeriv F e (z,y)) := by
filter_upwards [hs.mem_nhds hz] with x hx
exact fderiv_section_apply hs hf hx y e
rw [he.fderiv_eq]
exact fderiv_section_apply hs (partial_contDiffOn hs hf e) hz y e
lemma integrable_section (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) :
Integrable (fun y : ℂ => F (z,y)) := by
have hc : HasCompactSupport (fun y : ℂ => F (z,y)) :=
HasCompactSupport.intro hk (hz z hzz)
exact (hf.continuousOn.comp_continuous (continuous_const.prodMk continuous_id)
(fun y => ⟨hzz, mem_univ y⟩)).integrable_of_hasCompactSupport hc
lemma laplacian_directions_at {f : ℂ → ℝ} {z : ℂ} (hf : ContDiffAt ℝ ∞ f z) :
Δ f z =
fderiv ℝ (fun x : ℂ => fderiv ℝ f x 1) z 1 +
fderiv ℝ (fun x : ℂ => fderiv ℝ f x Complex.I) z Complex.I := by
rw [laplacian_eq_iteratedFDeriv_complexPlane]
simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one]
rw [fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp))
(differentiableAt_const _),
fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp))
(differentiableAt_const _)]
simp
lemma laplacian_integral (hs : IsOpen s) (hk : IsCompact k)
(hz : ∀ z ∈ s, ∀ y ∉ k, F (z,y) = 0)
(hf : ContDiffOn ℝ ∞ F (s ×ˢ univ)) {z : ℂ} (hzz : z ∈ s) :
Δ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z =
∫ y : ℂ, Δ (fun z : ℂ => F (z,y)) z := by
have hfi : ContDiffAt ℝ ∞ (fun z : ℂ => ∫ y : ℂ, F (z,y)) z :=
((integral_contDiffOn hs hk hz hf) z hzz).contDiffAt (hs.mem_nhds hzz)
have hfs (y : ℂ) : ContDiffAt ℝ ∞ (fun z : ℂ => F (z,y)) z :=
((hf (z,y) ⟨hzz, mem_univ y⟩).contDiffAt
((hs.prod isOpen_univ).mem_nhds ⟨hzz, mem_univ y⟩)).comp z
(contDiffAt_id.prodMk contDiffAt_const)
have hi (e : ℂ) : Integrable (fun y : ℂ => paramDeriv (paramDeriv F e) e (z,y)) :=
integrable_section hk
(partial_zero_outside hs hk.isClosed (partial_zero_outside hs hk.isClosed hz e) e)
(partial_contDiffOn hs (partial_contDiffOn hs hf e) e) hzz
rw [laplacian_directions_at hfi, second_integral_apply hs hk hz hf hzz,
second_integral_apply hs hk hz hf hzz, ← integral_add (hi 1) (hi Complex.I)]
apply integral_congr_ae
filter_upwards [] with y
rw [laplacian_directions_at (hfs y), second_section_apply hs hf hzz,
second_section_apply hs hf hzz]
end StrictHotSpots.CompactParameter
namespace StrictHotSpots.GreenPotential
open StrictHotSpots.GreenFundamental StrictHotSpots.DiskFormula
lemma correction_potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s)
(hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) :
Δ (fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) z = 0 := by
change Δ (fun z : ℂ => ∫ y : ℂ, correctionIntegrand f (z,y)) z = 0
rw [CompactParameter.laplacian_integral hs hc.isCompact
(F := correctionIntegrand f)
(fun z _ y hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy])
(correctionIntegrand_contDiffOn hf hn) hz]
apply integral_eq_zero_of_ae
filter_upwards [] with y
by_cases hy : f y = 0
· simp [correctionIntegrand, hy]
· have hyt : y ∈ tsupport f := subset_tsupport _ hy
have ha : AnalyticAt ℂ (fun z : ℂ => 1-z*star y) z :=
analyticAt_const.sub (analyticAt_id.mul analyticAt_const)
have hh := (ha.harmonicAt_log_norm (hn z hz y hyt)).const_smul (c := f y)
exact hh.2.self_of_nhds
lemma log_potential_eq (f : ℂ → ℝ) (z : ℂ) :
((fun x : ℂ => Real.log ‖x‖) ⋆ f) z = ∫ y : ℂ, f y * Real.log ‖z-y‖ := by
rw [← convolution_flip]
simp only [convolution_def, ContinuousLinearMap.flip_apply,
ContinuousLinearMap.lsmul_apply, smul_eq_mul]
apply integral_congr_ae
filter_upwards [] with y
ring
def potential (f : ℂ → ℝ) (z : ℂ) : ℝ :=
(∫ y : ℂ, f y * Real.log ‖1-z*star y‖) / (2 * Real.pi) -
(((fun x : ℂ => Real.log ‖x‖) ⋆ f) z) / (2 * Real.pi)
lemma potential_contDiffOn {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s)
(hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) :
ContDiffOn ℝ ∞ (potential f) s :=
((correction_potential_smooth hf hc hs hn).div_const _).sub
((log_potential_smooth hf hc).contDiffOn.div_const _)
lemma potential_laplacian {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) {s : Set ℂ} (hs : IsOpen s)
(hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) :
Δ (potential f) z = -f z := by
have ha := ((correction_potential_smooth hf hc hs hn) z hz).contDiffAt (hs.mem_nhds hz)
have hb := (log_potential_smooth hf hc).contDiffAt (x := z)
have he : potential f = (2 * Real.pi)⁻¹ •
(fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖) -
(2 * Real.pi)⁻¹ • ((fun x : ℂ => Real.log ‖x‖) ⋆ f) := by
funext x
simp only [potential, Pi.sub_apply, Pi.smul_apply, smul_eq_mul, div_eq_mul_inv]
ring
have ha2 : ContDiffAt ℝ 2 ((2 * Real.pi)⁻¹ •
(fun z : ℂ => ∫ y : ℂ, f y * Real.log ‖1-z*star y‖)) z :=
(ha.const_smul ((2 * Real.pi)⁻¹)).of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)
have hb2 : ContDiffAt ℝ 2 ((2 * Real.pi)⁻¹ •
((fun x : ℂ => Real.log ‖x‖) ⋆ f)) z :=
(hb.const_smul ((2 * Real.pi)⁻¹)).of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)
rw [he, ha2.laplacian_sub hb2,
laplacian_smul _ (ha.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)),
laplacian_smul _ (hb.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)),
correction_potential_laplacian hf hc hs hn hz, log_potential_laplacian hf hc]
simp only [smul_eq_mul, mul_zero, zero_sub, neg_inj]
field_simp
lemma potential_eq_zero_on_circle (f : ℂ → ℝ) {z : ℂ} (hz : ‖z‖ = 1) :
potential f z = 0 := by
have he (y : ℂ) : ‖1-z*star y‖ = ‖z-y‖ := by
have hh := disk_cross_identity z y
rw [hz] at hh
nlinarith [norm_nonneg (1-z*star y), norm_nonneg (z-y)]
simp only [potential, he, log_potential_eq, sub_self]
lemma potential_eq_integral {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) {s : Set ℂ} (_hs : IsOpen s)
(hn : ∀ z ∈ s, ∀ y ∈ tsupport f, 1-z*star y ≠ 0) {z : ℂ} (hz : z ∈ s) :
potential f z = ∫ y : ℂ, green z y * f y := by
have hi : Integrable (fun y : ℂ => f y * Real.log ‖1-z*star y‖) :=
CompactParameter.integrable_section hc.isCompact
(F := correctionIntegrand f)
(fun z _ y hy => by simp [correctionIntegrand, image_eq_zero_of_notMem_tsupport hy])
(correctionIntegrand_contDiffOn hf hn) hz
have hj : Integrable (fun y : ℂ => f y * Real.log ‖z-y‖) := by
simpa only [norm_sub_rev z, mul_comm] using log_sub_mul_integrable hf.continuous hc z
rw [potential, log_potential_eq, ← integral_div, ← integral_div,
← integral_sub (hi.div_const _) (hj.div_const _)]
apply integral_congr_ae
filter_upwards [volume.ae_ne z] with y hy
by_cases hfy : f y = 0
· simp [hfy]
· rw [green_eq_log (Ne.symm hy) (hn z hz y (subset_tsupport _ hfy))]
ring
lemma exists_regular_neighborhood {f : ℂ → ℝ} (hc : HasCompactSupport f)
(hd : tsupport f ⊆ Metric.ball (0 : ℂ) 1) :
∃ R : ℝ, 1 < R ∧ ∀ z ∈ Metric.ball (0 : ℂ) R,
∀ y ∈ tsupport f, 1-z*star y ≠ 0 := by
obtain ⟨a, ha, hsub⟩ := exists_pos_lt_subset_ball (by norm_num : (0 : ℝ) < 1)
hc.isCompact.isClosed hd
refine ⟨a⁻¹, (one_lt_inv₀ ha.1).mpr ha.2, ?_⟩
intro z hz y hy
have hz' : ‖z‖ < a⁻¹ := by simpa using hz
have hy' : ‖y‖ < a := by simpa using hsub hy
have hp : ‖z*star y‖ < 1 := by
rw [norm_mul, norm_star]
calc
_ ≤ ‖z‖ * a := mul_le_mul_of_nonneg_left hy'.le (norm_nonneg _)
_ < a⁻¹ * a := mul_lt_mul_of_pos_right hz' ha.1
_ = 1 := inv_mul_cancel₀ ha.1.ne'
intro he
have hm : z*star y = 1 := (sub_eq_zero.mp he).symm
rw [hm, norm_one] at hp
exact lt_irrefl _ hp
lemma potential_smooth_near_closed_disk {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) (hd : tsupport f ⊆ Metric.ball (0 : ℂ) 1) :
∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧
(∀ z ∈ Metric.ball (0 : ℂ) R, Δ (potential f) z = -f z) := by
obtain ⟨R,hR,hn⟩ := exists_regular_neighborhood hc hd
exact ⟨R,hR,potential_contDiffOn hf hc Metric.isOpen_ball hn,
fun z hz => potential_laplacian hf hc Metric.isOpen_ball hn hz⟩
end StrictHotSpots.GreenPotential
open InnerProductSpace
open scoped Laplacian ContDiff
namespace StrictHotSpots
lemma laplacian_comp_linearIsometryEquiv
{E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[NormedAddCommGroup F] [InnerProductSpace ℝ F]
[FiniteDimensional ℝ E] [FiniteDimensional ℝ F]
(g : E ≃ₗᵢ[ℝ] F) (f : F → ℝ) (x : E) :
Δ (f ∘ g) x = Δ f (g x) := by
let b := stdOrthonormalBasis ℝ E
rw [laplacian_eq_iteratedFDeriv_orthonormalBasis _ b,
laplacian_eq_iteratedFDeriv_orthonormalBasis _ (b.map g)]
have he : iteratedFDeriv ℝ 2 (f ∘ g) x =
(iteratedFDeriv ℝ 2 f (g x)).compContinuousLinearMap (fun _ => g.toContinuousLinearEquiv.toContinuousLinearMap) := by
simpa [iteratedFDerivWithin_univ] using g.toContinuousLinearEquiv.iteratedFDerivWithin_comp_right f
uniqueDiffOn_univ (Set.mem_univ (g x)) 2
simp only [he, ContinuousMultilinearMap.compContinuousLinearMap_apply]
apply Finset.sum_congr rfl
intro i _
congr 1
funext j
fin_cases j <;> simp
end StrictHotSpots
namespace StrictHotSpots.PlaneGreen
open GreenPotential DiskH10
lemma diskOpen : IsOpen disk := Metric.isOpen_ball
noncomputable def complexIso : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr
def source (f : Plane → ℝ) (z : ℂ) : ℝ := f (complexIso z)
def potential (f : Plane → ℝ) (x : Plane) : ℝ :=
GreenPotential.potential (source f) (complexIso.symm x)
lemma source_contDiff {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f) :
ContDiff ℝ ∞ (source f) :=
hf.comp complexIso.toContinuousLinearEquiv.contDiff
lemma source_compact {f : Plane → ℝ} (hc : HasCompactSupport f) :
HasCompactSupport (source f) :=
hc.comp_homeomorph complexIso.toHomeomorph
lemma source_support {f : Plane → ℝ} (hs : tsupport f ⊆ disk) :
tsupport (source f) ⊆ Metric.ball (0 : ℂ) 1 := by
intro z hz
have he := Set.ext_iff.mp (tsupport_comp_eq_preimage f complexIso.toHomeomorph) z
have hm : complexIso z ∈ disk := hs (he.mp hz)
simpa [disk] using hm
lemma smooth_near_closed_disk {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) (hs : tsupport f ⊆ disk) :
∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧
(∀ x ∈ Metric.ball (0 : Plane) R, Δ (potential f) x = -f x) := by
obtain ⟨R,hR,hu,hp⟩ := GreenPotential.potential_smooth_near_closed_disk
(source_contDiff hf) (source_compact hc) (source_support hs)
refine ⟨R,hR,?_,?_⟩
· exact hu.comp complexIso.symm.toContinuousLinearEquiv.contDiff.contDiffOn
(fun x hx => by simpa using hx)
· intro x hx
change Δ (GreenPotential.potential (source f) ∘ complexIso.symm) x = -f x
rw [laplacian_comp_linearIsometryEquiv]
have hh := hp (complexIso.symm x) (by simpa using hx)
simpa [source] using hh
lemma zero_on_circle (f : Plane → ℝ) {x : Plane} (hx : ‖x‖ = 1) :
potential f x = 0 :=
GreenPotential.potential_eq_zero_on_circle (source f) (by simpa using hx)
lemma value_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) :
H10.value diskOpen ⟨w,hw⟩ = H1.value w := rfl
lemma grad_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) :
H10.grad diskOpen ⟨w,hw⟩ = H1.grad w := rfl
lemma energy_mk (w : H1 disk) (hw : w ∈ h10Submodule diskOpen) (v : H10 diskOpen) :
H10.energy diskOpen ⟨w,hw⟩ v = inner ℝ (H1.grad w) (H10.grad diskOpen v) := rfl
lemma exists_smooth_weak_solution {u f : Plane → ℝ} {R : ℝ}
(hR : 1 < R) (hu : ContDiffOn ℝ ∞ u (Metric.ball 0 R))
(hz : ∀ x : Plane, ‖x‖ = 1 → u x = 0)
(hf : MemLp f 2 (volume.restrict disk))
(hp : ∀ x ∈ disk, Δ u x = -f x) :
∃ w : H10 (Ω := disk) diskOpen,
(H10.value diskOpen w =ᵐ[volume.restrict disk] u) ∧
∀ v : H10 (Ω := disk) diskOpen,
H10.energy diskOpen w v = inner ℝ (hf.toLp f) (H10.value diskOpen v) := by
let h : HasH1Gradient disk u (gradient u) := smooth_memH1 hR hu
have hm : h.toH1 ∈ h10Submodule diskOpen := smooth_zero_boundary_memH10 hR hu hz
refine ⟨⟨h.toH1,hm⟩,?_,?_⟩
· rw [value_mk, H1.value_toH1]
exact h.1.coeFn_toLp
· intro v
rw [energy_mk]
exact smooth_weak_poisson diskOpen (hu.mono (Metric.ball_subset_ball hR.le)) h hf hp v
lemma exists_dirichlet_representative {f : Plane → ℝ} (hf : ContDiff ℝ ∞ f)
(hc : HasCompactSupport f) (hs : tsupport f ⊆ disk) :
∃ u : H10 (Ω := disk) diskOpen,
(H10.value diskOpen u =ᵐ[volume.restrict disk] potential f) ∧
∀ v : H10 (Ω := disk) diskOpen,
H10.energy diskOpen u v =
inner ℝ ((test_memLp (Ω := disk) hf hc).toLp f) (H10.value diskOpen v) := by
have hex : ∃ R : ℝ, 1 < R ∧ ContDiffOn ℝ ∞ (potential f) (Metric.ball 0 R) ∧
(∀ x ∈ Metric.ball (0 : Plane) R, Δ (potential f) x = -f x) :=
smooth_near_closed_disk (f := f) hf hc hs
rcases hex with ⟨R,hR,hu,hp⟩
refine exists_smooth_weak_solution (u := potential f) (f := f) (R := R) hR hu
?_ (test_memLp (Ω := disk) hf hc) ?_
· intro x hx
exact zero_on_circle f hx
· intro x hx
exact hp x (Metric.ball_subset_ball hR.le hx)
end StrictHotSpots.PlaneGreen
end WeightedLayer
end FullBoundaryCombinedLayer
end
end DouglasLipschitzBase
end OAI
import OAI.Analysis.HotSpots.Sobolev
import OAI.Analysis.HotSpots.DiskKernel
namespace OAI
section DouglasLipschitzBase
noncomputable section
section FullBoundaryCombinedLayer
section WeightedLayer
open Set MeasureTheory
open scoped ContDiff InnerProductSpace ENNReal NNReal
open Set Filter MeasureTheory InnerProductSpace NormedSpace
open scoped Topology ContDiff
open scoped Laplacian
open Set MeasureTheory Filter InnerProductSpace Bornology
open scoped Topology Laplacian ContDiff RealInnerProductSpace
namespace StrictHotSpots.GreenFundamental
def logRegularized (ε : ℝ) (z : ℂ) : ℝ := Real.log (‖z‖ ^ 2 + ε ^ 2)
def peak (z : ℂ) : ℝ := 1 / (Real.pi * (1 + ‖z‖ ^ 2) ^ 2)
lemma denominator_pos {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
0 < ‖z‖ ^ 2 + ε ^ 2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε)
lemma logRegularized_contDiff {ε : ℝ} (hε : ε ≠ 0) :
ContDiff ℝ ∞ (logRegularized ε) := by
exact ((contDiff_id.norm_sq (𝕜 := ℂ)).add contDiff_const).log
(fun z => (denominator_pos hε z).ne')
lemma logRegularized_fderiv {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
fderiv ℝ (logRegularized ε) z =
(‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) := by
exact (((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2)).log
(denominator_pos hε z).ne').fderiv
lemma logRegularized_second {ε : ℝ} (hε : ε ≠ 0) (z a b : ℂ) :
fderiv ℝ (fderiv ℝ (logRegularized ε)) z a b =
2 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ * ⟪a, b⟫_ℝ -
4 * (‖z‖ ^ 2 + ε ^ 2)⁻¹ ^ 2 * ⟪z, a⟫_ℝ * ⟪z, b⟫_ℝ := by
have hf : fderiv ℝ (logRegularized ε) = fun z : ℂ =>
(‖z‖ ^ 2 + ε ^ 2)⁻¹ • (2 • innerSL ℝ z) :=
funext (logRegularized_fderiv hε)
rw [hf]
have hd := (hasDerivAt_inv (denominator_pos hε z).ne').comp_hasFDerivAt z
((hasStrictFDerivAt_norm_sq z).hasFDerivAt.add_const (ε ^ 2))
have hi : HasFDerivAt (fun z : ℂ => 2 • innerSL ℝ z) (2 • innerSL ℝ (E := ℂ)) z := by
exact (2 • innerSL ℝ (E := ℂ)).hasFDerivAt
calc
_ = _ := congrArg (fun L : ℂ →L[ℝ] (ℂ →L[ℝ] ℝ) => L a b) (hd.smul hi).fderiv
_ = _ := by
simp only [add_apply, smul_apply, two_smul, ContinuousLinearMap.smulRight_apply,
Function.comp_def, neg_mul, smul_eq_mul, innerSL_apply_apply]
erw [innerSL_apply_apply]
simp only [← inv_pow]
ring
lemma logRegularized_laplacian {ε : ℝ} (hε : ε ≠ 0) (z : ℂ) :
Δ (logRegularized ε) z = 4 * ε ^ 2 / (‖z‖ ^ 2 + ε ^ 2) ^ 2 := by
rw [laplacian_eq_iteratedFDeriv_complexPlane]
simp only [iteratedFDeriv_two_apply, Fin.isValue, Matrix.cons_val_zero,
Matrix.cons_val_one, logRegularized_second hε]
have hz : z.re ^ 2 + z.im ^ 2 = ‖z‖ ^ 2 := by
simpa [Complex.normSq_apply, pow_two] using Complex.normSq_eq_norm_sq z
simp only [Complex.inner]
simp at *
field_simp
nlinarith
lemma radial_primitive_hasDerivAt (r : ℝ) :
HasDerivAt (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹)
(r / (Real.pi * (1 + r ^ 2)^2)) r := by
have hd := ((hasDerivAt_id r).pow 2).const_add 1
have h := (hasDerivAt_inv (show 1 + r ^ 2 ≠ 0 by positivity)).comp r hd
have hh := h.const_mul (-(2 * Real.pi)⁻¹)
simp only [Function.comp_def, id_eq, Pi.pow_apply, Nat.cast_ofNat,
Nat.reduceSub, pow_one, mul_one] at hh
convert! hh using 1
field_simp
lemma radial_primitive_tendsto :
Tendsto (fun r : ℝ => -(2 * Real.pi)⁻¹ * (1 + r ^ 2)⁻¹) atTop (𝓝 0) := by
simpa using (tendsto_inv_atTop_zero.comp
(tendsto_atTop_add_const_left atTop (1 : ℝ) (tendsto_pow_atTop two_ne_zero))).const_mul
(-(2 * Real.pi)⁻¹)
lemma integral_radial :
∫ r in Ioi (0 : ℝ), r / (Real.pi * (1 + r ^ 2)^2) = (2 * Real.pi)⁻¹ := by
simpa using integral_Ioi_of_hasDerivAt_of_nonneg'
(a := (0 : ℝ)) (fun r _ => radial_primitive_hasDerivAt r)
(fun r hr => div_nonneg hr.le (by positivity)) radial_primitive_tendsto
lemma integral_peak : ∫ z : ℂ, peak z = 1 := by
rw [← Complex.integral_comp_polarCoord_symm]
have heq : (fun p : ℝ × ℝ => p.1 • peak (Complex.polarCoord.symm p)) =
(fun p : ℝ × ℝ => (p.1 / (Real.pi * (1 + p.1 ^ 2)^2)) * (1 : ℝ)) := by
funext p
simp [peak, sq_abs, div_eq_mul_inv]
Xet Storage Details
- Size:
- 48.6 kB
- Xet hash:
- 5192274fa921f00eaa3aa49e916b7327244bbd8f7787cc0f2885b29bb2c33125
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.