math / data /lean /OAI /Geometry /Perimeter /Regularity /EllipticCurl.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.65 kB
import OAI.Geometry.Perimeter.Regularity.SmoothFlatOrder
import OAI.Geometry.Perimeter.Regularity.EllipticTestSpace
namespace OAI
noncomputable section
open Set Filter MeasureTheory
open scoped Topology ENNReal ContDiff InnerProductSpace
namespace RPISingularHarnack
variable {n : β„•}
def scalarDirection (Ο† : Euc n β†’ ℝ) (a : Euc n) (x : Euc n) := fderiv ℝ Ο† x a
theorem scalarDirection_contDiff {Ο† : Euc n β†’ ℝ} (hΟ† : ContDiff ℝ ∞ Ο†) (a : Euc n) :
ContDiff ℝ ∞ (scalarDirection Ο† a) :=
(hφ.fderiv_right (by simp)).clm_apply contDiff_const
theorem scalarDirection_tsupport (Ο† : Euc n β†’ ℝ) (a : Euc n) :
tsupport (scalarDirection Ο† a) βŠ† tsupport Ο† := by
apply closure_minimal _ (isClosed_tsupport _)
intro x hx
by_contra hh
exact hx (by simp [scalarDirection,fderiv_of_notMem_tsupport ℝ hh])
theorem scalarDirection_fderiv {Ο† : Euc n β†’ ℝ} (hΟ† : ContDiff ℝ ∞ Ο†)
(a x b : Euc n) :
fderiv ℝ (scalarDirection Ο† a) x b=fderiv ℝ (fderiv ℝ Ο†) x b a := by
have hd : ContDiff ℝ ∞ (fderiv ℝ Ο†) := hΟ†.fderiv_right (by simp)
have h := ((ContinuousLinearMap.apply ℝ ℝ a).hasFDerivAt.comp x
((hd.differentiable (by simp)) x).hasFDerivAt).fderiv
exact congrArg (fun L : Euc n β†’L[ℝ] ℝ ↦ L b) h
def directionLocalTest {U : Set (Euc n)} (Ο† : SmoothLocalTest U) (a : Euc n) : SmoothLocalTest U :=
⟨scalarDirection Ο†.val a,scalarDirection_contDiff Ο†.property.1 a,
Ο†.property.2.1.of_isClosed_subset (isClosed_tsupport _) (scalarDirection_tsupport _ _),
(scalarDirection_tsupport _ _).trans Ο†.property.2.2⟩
def curlTest (Ο† : Euc n β†’ ℝ) (a b : Euc n) (x : Euc n) : Euc n :=
scalarDirection Ο† a x β€’ b - scalarDirection Ο† b x β€’ a
theorem curlTest_contDiff {Ο† : Euc n β†’ ℝ} (hΟ† : ContDiff ℝ ∞ Ο†) (a b : Euc n) :
ContDiff ℝ ∞ (curlTest Ο† a b) :=
((scalarDirection_contDiff hφ a).smul contDiff_const).sub
((scalarDirection_contDiff hφ b).smul contDiff_const)
theorem curlTest_tsupport (Ο† : Euc n β†’ ℝ) (a b : Euc n) :
tsupport (curlTest Ο† a b) βŠ† tsupport Ο† := by
apply closure_minimal _ (isClosed_tsupport _)
intro x hx
by_contra hh
exact hx (by simp [curlTest,scalarDirection,fderiv_of_notMem_tsupport ℝ hh])
theorem curlTest_divergence {Ο† : Euc n β†’ ℝ} (hΟ† : ContDiff ℝ ∞ Ο†) (a b : Euc n) :
divergence (curlTest Ο† a b)=0 := by
have ha := (scalarDirection_contDiff hφ a).differentiable (by simp)
have hb := (scalarDirection_contDiff hφ b).differentiable (by simp)
rw [show curlTest Ο† a b=(fun x ↦ scalarDirection Ο† a x β€’ b)-(fun x ↦ scalarDirection Ο† b x β€’ a) from rfl,
divergence_sub (ha.smul_const b) (hb.smul_const a),divergence_scalar_direction ha,
divergence_scalar_direction hb]
funext x
simp only [Pi.sub_apply,Pi.zero_apply,scalarDirection_fderiv hφ]
exact sub_eq_zero.mpr ((hφ.contDiffAt.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; exact WithTop.coe_le_coe.mpr le_top)) b a)
def curlTestLp {U : Set (Euc n)} (Ο† : SmoothLocalTest U) (a b : Euc n) : VectorL2 n :=
((curlTest_contDiff Ο†.property.1 a b).continuous.memLp_of_hasCompactSupport
(Ο†.property.2.1.of_isClosed_subset (isClosed_tsupport _) (curlTest_tsupport _ _ _))).toLp
(curlTest Ο†.val a b)
theorem curlTestLp_ae {U : Set (Euc n)} (Ο† : SmoothLocalTest U) (a b : Euc n) :
(curlTestLp Ο† a b : Euc n β†’ Euc n)=ᡐ[volume] curlTest Ο†.val a b := MemLp.coeFn_toLp _
def CurlFreeLpOn (u : VectorL2 n) (U : Set (Euc n)) : Prop :=
βˆ€ (Ο† : SmoothLocalTest U) (a b : Euc n), inner ℝ u (curlTestLp Ο† a b)=0
theorem testGradient_curlTest_inner {U V : Set (Euc n)} (ψ : SmoothLocalTest V)
(Ο† : SmoothLocalTest U) (a b : Euc n) :
inner ℝ (testGradientLp ψ) (curlTestLp Ο† a b)=0 := by
rw [MeasureTheory.L2.inner_def]
have he : (∫ x, inner ℝ (testGradientLp ψ x) (curlTestLp Ο† a b x))=
∫ x, inner ℝ (gradient ψ.val x) (curlTest Ο†.val a b x) := by
apply integral_congr_ae
filter_upwards [testGradientLp_ae ψ,curlTestLp_ae Ο† a b] with x hx hy
rw [hx,hy]
rw [he]
have hi := integral_mul_divergence_eq_neg_inner_gradient_local ψ.property.1
(curlTest_contDiff Ο†.property.1 a b)
(Ο†.property.2.1.of_isClosed_subset (isClosed_tsupport _) (curlTest_tsupport _ _ _))
rw [curlTest_divergence Ο†.property.1] at hi
simpa only [Pi.zero_apply,mul_zero,integral_zero,eq_neg_iff_add_eq_zero,zero_add] using hi
theorem testGradientSpace_curlFree {U V : Set (Euc n)} {u : VectorL2 n}
(hu : u∈testGradientSpace V) : CurlFreeLpOn u U := by
intro Ο† a b
have hz := inner_zero_on_closed_span (Set.range (testGradientLp (U := V)))
(u := curlTestLp Ο† a b) (by
rintro _ ⟨ψ,rfl⟩
rw [real_inner_comm]
exact testGradient_curlTest_inner ψ Ο† a b) u hu
rwa [real_inner_comm] at hz
theorem CurlFreeLpOn.sub {U : Set (Euc n)} {u v : VectorL2 n}
(hu : CurlFreeLpOn u U) (hv : CurlFreeLpOn v U) : CurlFreeLpOn (u-v) U := by
intro Ο† a b
rw [inner_sub_left,hu Ο† a b,hv Ο† a b,sub_self]
theorem weak_curl_harmonic_comparison {U : Set (Euc n)} {u e : VectorL2 n}
(hu : CurlFreeLpOn u U)
(h : βˆ€ Ο† : SmoothLocalTest U, (∫ x, inner ℝ (u x) (gradient Ο†.val x))=
∫ x, inner ℝ (e x) (gradient Ο†.val x)) :
βˆƒ g : VectorL2 n, DivFreeLpOn g U ∧ CurlFreeLpOn g U ∧ β€–u-g‖≀‖eβ€– := by
obtain ⟨g,hg,hug,he⟩ := weak_harmonic_gradient_comparison h
have hcf := hu.sub (testGradientSpace_curlFree hug)
rw [sub_sub_cancel] at hcf
exact ⟨g,hg,hcf,he⟩
end RPISingularHarnack
end
end OAI