math / data /lean /OAI /Analysis /Conductivity /Variational /ContDiffClmDet.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.94 kB
import Mathlib
import OAI.Analysis.Conductivity.Sobolev.LocalPiolaFlux
namespace OAI
noncomputable section
open MeasureTheory
open scoped ENNReal
open Matrix Filter Topology
open Set MeasureTheory Filter Topology
open scoped BigOperators
open Set MeasureTheory Filter Topology
open scoped Manifold
namespace ScalarConductivity
lemma contDiff_clm_det {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E] (n : WithTop β„•βˆž) :
ContDiff ℝ n (fun L : E β†’L[ℝ] E => L.det) := by
classical
let b := Module.finBasis ℝ E
simp_rw [ContinuousLinearMap.det, ← LinearMap.det_toMatrix b, Matrix.det_apply',
LinearMap.toMatrix_apply]
apply ContDiff.sum
intro Οƒ _
apply contDiff_const.mul
apply contDiff_prod
intro i _
change ContDiff ℝ n (fun L : E β†’L[ℝ] E => (b.coord (Οƒ i)).toContinuousLinearMap (L (b i)))
exact (b.coord (Οƒ i)).toContinuousLinearMap.contDiff.comp ((ContinuousLinearMap.apply ℝ E (b i)).contDiff)
lemma contDiff_of_contDiffOn_tsupport {E V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup V] [NormedSpace ℝ V] {n : WithTop β„•βˆž} {f : E β†’ V} {s : Set E}
(hs : IsOpen s) (hf : ContDiffOn ℝ n f s) (hfS : tsupport f βŠ† s) : ContDiff ℝ n f := by
rw [contDiff_iff_contDiffAt]
intro x
by_cases hx : x ∈ tsupport f
Β· exact hf.contDiffAt (hs.mem_nhds (hfS hx))
Β· exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hx)
lemma localPiolaFlux_smooth {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E]
(X : OpenPartialHomeomorph E E) (hX : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) X X.source)
(hXi : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) X.symm X.target)
(F : E β†’ E) (hF : ContDiff ℝ (↑(⊀ : β„•βˆž)) F) (hc : HasCompactSupport F)
(hs : tsupport F βŠ† X.source) : ContDiff ℝ (↑(⊀ : β„•βˆž)) (localPiolaFlux X F) := by
apply contDiff_of_contDiffOn_tsupport X.open_target _ (localPiolaFlux_tsupport X F hc hs)
apply X.open_target.contDiffOn_iff.mpr
intro y hy
have hxi := hXi.contDiffAt (X.open_target.mem_nhds hy)
have hx := hX.contDiffAt (X.open_source.mem_nhds (X.map_target hy))
have hd : ContDiffAt ℝ (↑(⊀ : β„•βˆž)) (fun z => fderiv ℝ X (X.symm z)) y :=
(hx.fderiv_right (by simp)).comp y hxi
have hd0 : (fderiv ℝ X (X.symm y)).det β‰  0 :=
local_fderiv_det_ne_zero X (hX.differentiableOn (by simp))
(hXi.differentiableOn (by simp)) (X.map_target hy)
have hdet := ((contDiff_clm_det (E := E) (↑(⊀ : β„•βˆž))).contDiffAt.comp y hd).abs hd0
have hformula := (hdet.inv (abs_ne_zero.mpr hd0)).smul
(hd.clm_apply (hF.contDiffAt.comp y hxi))
apply hformula.congr_of_eventuallyEq
filter_upwards [X.open_target.mem_nhds hy] with z hz
simp [localPiolaFlux, hz]
lemma exists_smooth_extension_near_compact {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E] {U K : Set E} (hU : IsOpen U) (hK : IsCompact K) (hKU : K βŠ† U)
(Ο† : E β†’ ℝ) (hΟ† : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) Ο† U) :
βˆƒ g : E β†’ ℝ, ContDiff ℝ (↑(⊀ : β„•βˆž)) g ∧ βˆ€ x ∈ K, g =αΆ [𝓝 x] Ο† := by
obtain βŸ¨Ο‡, hΟ‡β‚€, hχ₁, _⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed
(π“˜(ℝ, E)) hU.isClosed_compl hK.isClosed
(disjoint_left.mpr (fun x hx hxK => hx (hKU hxK))) (n := ⊀)
have hΟ‡ : ContDiff ℝ (↑(⊀ : β„•βˆž)) (Ο‡ : E β†’ ℝ) := contMDiff_iff_contDiff.mp Ο‡.contMDiff
refine ⟨fun x => Ο‡ x * Ο† x, ?_, ?_⟩
Β· rw [contDiff_iff_contDiffAt]
intro x
by_cases hx : x ∈ U
· exact hχ.contDiffAt.mul (hφ.contDiffAt (hU.mem_nhds hx))
Β· have hzero : βˆ€αΆ  z in 𝓝 x, Ο‡ z = 0 := hΟ‡β‚€.filter_mono (nhds_le_nhdsSet hx)
apply (contDiffAt_const : ContDiffAt ℝ (↑(⊀ : β„•βˆž)) (fun _ : E => (0 : ℝ)) x).congr_of_eventuallyEq
filter_upwards [hzero] with z hz
simp [hz]
Β· intro x hx
have hone : βˆ€αΆ  z in 𝓝 x, Ο‡ z = 1 := hχ₁.filter_mono (nhds_le_nhdsSet hx)
filter_upwards [hone] with z hz
simp [hz]
lemma compactFlux_local_test
{E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E]
(ΞΌ : Measure E) {U : Set E} (hU : IsOpen U)
(F : E β†’ E) (hc : HasCompactSupport F) (hs : tsupport F βŠ† U)
(hF : βˆ€ ψ : E β†’ ℝ, ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’
(∫ x, fderiv ℝ ψ x (F x) βˆ‚ΞΌ) = 0)
(Ο† : E β†’ ℝ) (hΟ† : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) Ο† U) :
(∫ x, fderiv ℝ Ο† x (F x) βˆ‚ΞΌ) = 0 := by
obtain ⟨g, hg, hge⟩ := exists_smooth_extension_near_compact hU hc hs Ο† hΟ†
rw [← hF g hg]
apply integral_congr_ae
filter_upwards [] with x
by_cases hx : x ∈ tsupport F
Β· rw [(hge x hx).fderiv_eq]
Β· rw [image_eq_zero_of_notMem_tsupport hx, map_zero, map_zero]
lemma localPiolaFlux_zero_pairing
{E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
(ΞΌ : Measure E) [ΞΌ.IsAddHaarMeasure]
(X : OpenPartialHomeomorph E E) (hX : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) X X.source)
(hXi : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) X.symm X.target)
(F : E β†’ E) (hc : HasCompactSupport F) (hs : tsupport F βŠ† X.source)
(hF : βˆ€ ψ : E β†’ ℝ, ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’
(∫ x, fderiv ℝ ψ x (F x) βˆ‚ΞΌ) = 0)
(ψ : E β†’ ℝ) (hψ : ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ) :
(∫ y, fderiv ℝ ψ y (localPiolaFlux X F y) βˆ‚ΞΌ) = 0 := by
rw [localPiolaFlux_pairing ΞΌ X (hX.differentiableOn (by simp))
(fun _ hx => local_fderiv_det_ne_zero X (hX.differentiableOn (by simp))
(hXi.differentiableOn (by simp)) hx)
F (subset_closure.trans hs) ψ (hψ.differentiable (by simp))]
exact compactFlux_local_test μ X.open_source F hc hs hF _ (hψ.comp_contDiffOn hX)
end ScalarConductivity
end
end OAI