math / data /lean /OAI /Analysis /Conductivity /Sources /PhysicalC1Pullback.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.33 kB
import Mathlib
import OAI.Analysis.Conductivity.Variational.UniformC1Bounds
import OAI.Analysis.Conductivity.Sources.LocalPhysicalCorrection
namespace OAI
noncomputable section
namespace ScalarConductivity
open Set MeasureTheory Filter Topology Matrix
open scoped Matrix.Norms.Elementwise
def inverseSourceWeight (X : OpenPartialHomeomorph Coord3 Coord3) (x : Coord3) : ℝ :=
|(fderiv ℝ X.symm (X x)).det|⁻¹
lemma inverseSourceWeight_smooth
(X : OpenPartialHomeomorph Coord3 Coord3)
(hX : ContDiffOn ℝ (↑(⊀:β„•βˆž)) X X.source)
(hXi : ContDiffOn ℝ (↑(⊀:β„•βˆž)) X.symm X.target) :
ContDiffOn ℝ (↑(⊀:β„•βˆž)) (inverseSourceWeight X) X.source := by
apply X.open_source.contDiffOn_iff.mpr
intro x hx
have hxs := hX.contDiffAt (X.open_source.mem_nhds hx)
have hxis := hXi.contDiffAt (X.open_target.mem_nhds (X.map_source hx))
have hd : ContDiffAt ℝ (↑(⊀:β„•βˆž)) (fun y => fderiv ℝ X.symm (X y)) x :=
(hxis.fderiv_right (by trivial)).comp x hxs
have hd0 := local_fderiv_det_ne_zero X.symm (hXi.differentiableOn (by simp))
(hX.differentiableOn (by simp)) (X.map_source hx)
exact ((((contDiff_clm_det (E := Coord3) (↑(⊀:β„•βˆž))).contDiffAt.comp x hd).abs hd0).inv
(abs_ne_zero.mpr hd0))
lemma compact_smooth_C1_bound {f : Coord3 β†’ ℝ} {U K : Set Coord3}
(hU : IsOpen U) (hf : ContDiffOn ℝ (↑(⊀:β„•βˆž)) f U)
(hK : IsCompact K) (hKU : KβŠ†U) :
βˆƒ M : ℝ,0<M ∧ βˆ€ x∈K,|f x|≀M ∧ β€–fderiv ℝ f x‖≀M := by
have hd : ContinuousOn (fderiv ℝ f) U := by
intro x hx
exact ((hf.contDiffAt (hU.mem_nhds hx)).fderiv_right (m := 0) (by simp)).continuousAt.continuousWithinAt
obtain ⟨A,hA⟩ := (hK.image_of_continuousOn (hf.continuousOn.mono hKU)).isBounded.exists_norm_le
obtain ⟨B,hB⟩ := (hK.image_of_continuousOn (hd.mono hKU)).isBounded.exists_norm_le
refine ⟨|A|+|B|+1,by positivity,fun x hx => ⟨?_,?_⟩⟩
Β· exact (hA _ (mem_image_of_mem _ hx)).trans (by linarith [le_abs_self A,abs_nonneg B])
Β· exact (hB _ (mem_image_of_mem _ hx)).trans (by linarith [le_abs_self B,abs_nonneg A])
theorem localPiolaSource_inverse_C1
(X : OpenPartialHomeomorph Coord3 Coord3)
(hX : ContDiffOn ℝ (↑(⊀:β„•βˆž)) X X.source)
(hXi : ContDiffOn ℝ (↑(⊀:β„•βˆž)) X.symm X.target)
{K : Set Coord3} (hK : IsCompact K) (hKs : KβŠ†X.source) :
βˆƒ L : ℝ,0<L ∧ βˆ€ (r : Coord3 β†’ ℝ),ContDiff ℝ (↑(⊀:β„•βˆž)) r β†’
HasCompactSupport r β†’ tsupport rβŠ†X '' K β†’ βˆ€ M : ℝ,0≀M β†’
UniformC1Bound r M β†’ UniformC1Bound (localPiolaSource X.symm r) (L*M) := by
let w := inverseSourceWeight X
have hw := inverseSourceWeight_smooth X hX hXi
obtain ⟨B,hB,hwb⟩ := compact_smooth_C1_bound X.open_source hw hK hKs
have hdX : ContinuousOn (fderiv ℝ X) X.source := by
intro x hx
exact ((hX.contDiffAt (X.open_source.mem_nhds hx)).fderiv_right (m := 0) (by simp)).continuousAt.continuousWithinAt
obtain ⟨D,hD⟩ := (hK.image_of_continuousOn (hdX.mono hKs)).isBounded.exists_norm_le
have hDX (x) (hx : x∈K) : β€–fderiv ℝ X x‖≀|D|+1 :=
(hD _ (mem_image_of_mem _ hx)).trans (by linarith [le_abs_self D])
refine ⟨B*(|D|+2),by positivity,fun r hr hc hs M hM hb => ?_⟩
let p := localPiolaSource X.symm r
have hps : tsupport pβŠ†K := localPiolaSource_inverse_support X r hc hKs hs
intro x
change |p x| ≀ B*(|D|+2)*M ∧ β€–fderiv ℝ p xβ€– ≀ B*(|D|+2)*M
by_cases hx : x∈K
Β· have hxs := hX.contDiffAt (X.open_source.mem_nhds (hKs hx))
have hws := hw.contDiffAt (X.open_source.mem_nhds (hKs hx))
have he : p=αΆ [𝓝 x] (fun y => w y*r (X y)) := by
filter_upwards [X.open_source.mem_nhds (hKs hx)] with y hy
simp [p,localPiolaSource,hy,w,inverseSourceWeight]
have hrc : DifferentiableAt ℝ (fun y => r (X y)) x :=
(hr.differentiable (by simp) (X x)).comp x (hxs.differentiableAt (by simp))
refine ⟨?_,?_⟩
Β· rw [he.eq_of_nhds,abs_mul]
exact (mul_le_mul (hwb x hx).1 (hb (X x)).1 (abs_nonneg _) hB.le).trans
(by nlinarith [mul_nonneg hB.le hM,abs_nonneg D])
Β· rw [he.fderiv_eq,fderiv_fun_mul (hws.differentiableAt (by simp)) hrc]
have hchain := ((hr.differentiable (by simp) (X x)).hasFDerivAt.comp x
(hxs.differentiableAt (by simp)).hasFDerivAt).fderiv
have hcomp : β€–fderiv ℝ (fun y => r (X y)) x‖≀M*(|D|+1) := by
change β€–fderiv ℝ (r ∘ X) xβ€– ≀ _
rw [hchain]
exact (ContinuousLinearMap.opNorm_comp_le _ _).trans
(mul_le_mul (hb (X x)).2 (hDX x hx) (norm_nonneg _) hM)
calc
_ ≀ β€–w x β€’ fderiv ℝ (fun y => r (X y)) xβ€–+β€–r (X x) β€’ fderiv ℝ w xβ€– := norm_add_le _ _
_ = |w x| *β€–fderiv ℝ (fun y => r (X y)) xβ€–+|r (X x)| *β€–fderiv ℝ w xβ€– := by
simp only [norm_smul,Real.norm_eq_abs]
_ ≀ B*(M*(|D|+1))+M*B := add_le_add
(mul_le_mul (hwb x hx).1 hcomp (norm_nonneg _) hB.le)
(mul_le_mul (hb (X x)).1 (hwb x hx).2 (norm_nonneg _) hM)
_ = _ := by ring
Β· have hn : xβˆ‰tsupport p := fun h => hx (hps h)
rw [image_eq_zero_of_notMem_tsupport hn,fderiv_of_notMem_tsupport ℝ hn,abs_zero,norm_zero]
exact ⟨by positivity,by positivity⟩
end ScalarConductivity
end
end OAI