math / data /lean /OAI /Analysis /Conductivity /Variational /CompactDepthReductionTwo.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
11.6 kB
import Mathlib
import OAI.Analysis.Conductivity.Branching.JoinHull
import OAI.Analysis.Conductivity.Variational.ConjugateDiagonal
import OAI.Analysis.Conductivity.Variational.CompactCompatibleReplacement
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
open Set Filter
open scoped Topology
open Set Filter MeasureTheory
open scoped Topology Manifold ENNReal
open Set
namespace ScalarConductivity
open Matrix Set MeasureTheory Filter Topology
open scoped Matrix.Norms.Elementwise
theorem exists_compact_depth_reduction_two
(ΞΌ : Measure Coord3) [ΞΌ.IsAddHaarMeasure]
(u : Coord3 β†’ Fin 2 β†’ ℝ) (A : Coord3 β†’ Symmetric3)
{U : Set Coord3} (hU : IsOpen U) (hUb : Bornology.IsBounded U)
(hu : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) u U)
(hA : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) (fun x => (A x).val) U)
(hdiv : βˆ€ j (ψ : Coord3 β†’ ℝ), ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’ HasCompactSupport ψ β†’
tsupport ψ βŠ† U β†’ (∫ x, fderiv ℝ ψ x ((conductivityFlux u A x).col j) βˆ‚ΞΌ) = 0)
{a b : ℝ} (ha : 0 < a) {T : Set DiagonalTriple}
(hT : IsOpen T) (hsub : βˆ€ d ∈ T, IsFiniteLaminate a b d)
(hperm : βˆ€ d ∈ T, βˆ€ e : Equiv.Perm (Fin 3), d ∘ e ∈ T)
{p : Coord3} (hpU : p ∈ U)
(hD : Function.Surjective (fderiv ℝ u p)) {n : β„•}
(hp : A p ∈ spectralExtension (depthClass T (n+1)))
(hn : A p βˆ‰ spectralExtension (depthClass T n)) :
βˆƒ W : Set Coord3, IsOpen W ∧ p ∈ W ∧ closure W βŠ† U ∧ IsCompact (closure W) ∧
βˆ€ O : Set Coord3, IsOpen O β†’ O βŠ† W β†’ βˆ€ Ξ΅ : ℝ, 0 < Ξ΅ β†’
βˆƒ R : CompactTwoFieldReplacement ΞΌ O u A,
(βˆ€ x ∈ O, R.tensor x ∈ matrixFiniteLaminate a b) ∧
ΞΌ {x | x ∈ O ∧ R.tensor x βˆ‰ spectralExtension (depthClass T n)} ≀ ENNReal.ofReal Ξ΅ := by
obtain ⟨Q, hQ, d, hd, hrep⟩ := hp
have hdn : d βˆ‰ depthClass T n := fun h => hn ⟨Q, hQ, d, h, hrep⟩
obtain ⟨i, θ, α, β, hθ, hθ1, hα, hβ, he, _⟩ := depthClass_plan hsub hd hdn
have hre : conjugateDiagonal Q (coordinateJoin i ΞΈ Ξ± Ξ²) = A p := by
apply Subtype.ext
simpa only [conjugateDiagonal, he] using hrep.symm
obtain ⟨v, L, B, η, c, m, C, hLv, hB, hBn, hη, hη1, hm, hpath, hC, hCs,
hdet, hconst, hCG, hCa, hCb⟩ := spectral_join_plan ha
(depthClass_subset_laminate hsub n) i hΞ± hΞ² hΞΈ hΞΈ1 hQ
rw [hre] at hconst
have hTo : IsOpen (spectralExtension (depthClass T n)) :=
isOpen_spectralExtension (isOpen_depthClass ha hT hsub n) (depthClass_permute hperm n)
let G := endpointGraph (-Ξ·) (1-Ξ·) (matrixFiniteLaminate a b)
(spectralExtension (depthClass T n)) (spectralExtension (depthClass T n))
have hGo : IsOpen G := isOpen_endpointGraph _ _ (isOpen_matrixFiniteLaminate ha) hTo hTo
have hGC : βˆ€ z ∈ Icc (-Ξ·) (1-Ξ·), (z, C z) ∈ G :=
path_mem_endpointGraph _ _ C hCG hCa hCb
obtain ⟨W, hW, hpW, hWU, hWc, hop⟩ := exists_locally_smooth_compact_split μ u A
hU hUb hpU hu hA hdiv hD v L hLv B hB hBn hΞ· hΞ·1 hm hpath C hC hCs hdet hconst hGo hGC
refine ⟨W, hW, hpW, hWU, hWc, ?_⟩
intro O hO hOW Ξ΅ hΞ΅
obtain ⟨R, q, _, _, hqG, hqm⟩ := hop O hO hOW Ρ hΡ
refine ⟨R, fun x hx => (hqG x hx).1, le_trans (measure_mono ?_) hqm⟩
intro x hx
refine ⟨hx.1, ?_, ?_⟩
Β· exact (hqG x hx.1).2.1.resolve_right hx.2
Β· exact (hqG x hx.1).2.2.resolve_right hx.2
end ScalarConductivity
namespace ScalarConductivity
open Matrix Set MeasureTheory Filter Topology
open scoped Matrix.Norms.Elementwise
theorem exists_compact_depth_reduction_selected
(J : Set (Fin 2))
(ΞΌ : Measure Coord3) [ΞΌ.IsAddHaarMeasure]
(u : Coord3 β†’ Fin 2 β†’ ℝ) (A : Coord3 β†’ Symmetric3)
{U : Set Coord3} (hU : IsOpen U) (hUb : Bornology.IsBounded U)
(hu : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) u U)
(hA : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) (fun x => (A x).val) U)
(hdiv : βˆ€ j ∈ J, βˆ€ (ψ : Coord3 β†’ ℝ), ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’ HasCompactSupport ψ β†’
tsupport ψ βŠ† U β†’ (∫ x, fderiv ℝ ψ x ((conductivityFlux u A x).col j) βˆ‚ΞΌ) = 0)
{a b : ℝ} (ha : 0 < a) {T : Set DiagonalTriple}
(hT : IsOpen T) (hsub : βˆ€ d ∈ T, IsFiniteLaminate a b d)
(hperm : βˆ€ d ∈ T, βˆ€ e : Equiv.Perm (Fin 3), d ∘ e ∈ T)
{p : Coord3} (hpU : p ∈ U)
(hD : Function.Surjective (fderiv ℝ u p)) {n : β„•}
(hp : A p ∈ spectralExtension (depthClass T (n+1)))
(hn : A p βˆ‰ spectralExtension (depthClass T n)) :
βˆƒ W : Set Coord3, IsOpen W ∧ p ∈ W ∧ closure W βŠ† U ∧ IsCompact (closure W) ∧
βˆ€ O : Set Coord3, IsOpen O β†’ O βŠ† W β†’ βˆ€ Ξ΅ : ℝ, 0 < Ξ΅ β†’
βˆƒ R : CompactSelectedReplacement J ΞΌ O u A,
(βˆ€ x ∈ O, R.tensor x ∈ matrixFiniteLaminate a b) ∧
ΞΌ {x | x ∈ O ∧ R.tensor x βˆ‰ spectralExtension (depthClass T n)} ≀ ENNReal.ofReal Ξ΅ := by
obtain ⟨Q, hQ, d, hd, hrep⟩ := hp
have hdn : d βˆ‰ depthClass T n := fun h => hn ⟨Q, hQ, d, h, hrep⟩
obtain ⟨i, θ, α, β, hθ, hθ1, hα, hβ, he, _⟩ := depthClass_plan hsub hd hdn
have hre : conjugateDiagonal Q (coordinateJoin i ΞΈ Ξ± Ξ²) = A p := by
apply Subtype.ext
simpa only [conjugateDiagonal, he] using hrep.symm
obtain ⟨v, L, B, η, c, m, C, hLv, hB, hBn, hη, hη1, hm, hpath, hC, hCs,
hdet, hconst, hCG, hCa, hCb⟩ := spectral_join_plan ha
(depthClass_subset_laminate hsub n) i hΞ± hΞ² hΞΈ hΞΈ1 hQ
rw [hre] at hconst
have hTo : IsOpen (spectralExtension (depthClass T n)) :=
isOpen_spectralExtension (isOpen_depthClass ha hT hsub n) (depthClass_permute hperm n)
let G := endpointGraph (-Ξ·) (1-Ξ·) (matrixFiniteLaminate a b)
(spectralExtension (depthClass T n)) (spectralExtension (depthClass T n))
have hGo : IsOpen G := isOpen_endpointGraph _ _ (isOpen_matrixFiniteLaminate ha) hTo hTo
have hGC : βˆ€ z ∈ Icc (-Ξ·) (1-Ξ·), (z, C z) ∈ G :=
path_mem_endpointGraph _ _ C hCG hCa hCb
obtain ⟨W, hW, hpW, hWU, hWc, hop⟩ := exists_locally_smooth_selected_split J μ u A
hU hUb hpU hu hA hdiv hD v L hLv B hB hBn hΞ· hΞ·1 hm hpath C hC hCs hdet hconst hGo hGC
refine ⟨W, hW, hpW, hWU, hWc, ?_⟩
intro O hO hOW Ξ΅ hΞ΅
obtain ⟨R, q, _, _, hqG, hqm⟩ := hop O hO hOW Ρ hΡ
refine ⟨R, fun x hx => (hqG x hx).1, le_trans (measure_mono ?_) hqm⟩
intro x hx
refine ⟨hx.1, ?_, ?_⟩
Β· exact (hqG x hx.1).2.1.resolve_right hx.2
Β· exact (hqG x hx.1).2.2.resolve_right hx.2
end ScalarConductivity
namespace ScalarConductivity
open Matrix Set MeasureTheory Filter Topology
open scoped Matrix.Norms.Elementwise
lemma gradientColumns_surjective {m : Type*} [Fintype m] [DecidableEq m]
(D : Coord3 β†’L[ℝ] (m β†’ ℝ))
(hD : LinearIndependent ℝ (gradientColumns D).col) : Function.Surjective D := by
let E := gradientColumns D
have hh : Eα΅€ * (((Eα΅€ * E)⁻¹ * Eα΅€)α΅€) = 1 := by
rw [← Matrix.transpose_mul, gram_leftInverse E hD, Matrix.transpose_one]
have hs := Matrix.mulVec_surjective_iff_exists_right_inverse.mpr ⟨_, hh⟩
intro y
obtain ⟨x, hx⟩ := hs y
exact ⟨x, (gradientColumns_apply D x).symm.trans hx⟩
lemma exists_independent_pairedPotential_at {u : Coord3 β†’ ℝ} {p : Coord3}
(hu : DifferentiableAt ℝ u p) (hp : fderiv ℝ u p β‰  0) :
βˆƒ j : Fin 3, Function.Surjective (fderiv ℝ (pairedPotential u j) p) := by
obtain ⟨i, hi⟩ := exists_coordinate_nonzero hp
obtain ⟨j, hji⟩ := exists_ne i
refine ⟨j, ?_⟩
rw [(pairedPotential_hasFDerivAt hu.hasFDerivAt j).fderiv]
exact pairedFunctional_surjective hi hji.symm
lemma pairedPotential_contDiffOn {u : Coord3 β†’ ℝ} {O : Set Coord3}
(hu : ContDiffOn ℝ (↑(⊀ : β„•βˆž)) u O) (j : Fin 3) :
ContDiffOn ℝ (↑(⊀ : β„•βˆž)) (pairedPotential u j) O := by
apply contDiffOn_pi.mpr
intro i
fin_cases i
Β· exact hu
Β· exact (contDiff_apply ℝ ℝ j).contDiffOn
lemma column_derivative_ne_zero_of_independent {O : Set Coord3} (hO : IsOpen O)
{v : Coord3 β†’ Fin 2 β†’ ℝ} (hv : DifferentiableOn ℝ v O)
{x : Coord3} (hx : x ∈ O)
(hr : LinearIndependent ℝ (gradientColumns (fderiv ℝ v x)).col) (j : Fin 2) :
fderiv ℝ (fun y => v y j) x β‰  0 := by
intro hz
have hh := ((ContinuousLinearMap.proj j).hasFDerivAt.comp x
((hv x hx).differentiableAt (hO.mem_nhds hx)).hasFDerivAt).fderiv
have hzero : (gradientColumns (fderiv ℝ v x)).col j = 0 := by
ext i
have h := congrArg (fun L : Coord3 β†’L[ℝ] ℝ => L (Pi.single i 1)) (hh.symm.trans hz)
exact h
exact (hr.ne_zero j) hzero
lemma conductivityFlux_affine_column {O : Set Coord3} (hO : IsOpen O)
{u v : Coord3 β†’ Fin 2 β†’ ℝ} {l ΞΊ : Fin 2 β†’ ℝ} (A : Coord3 β†’ Symmetric3)
(he : βˆ€ x ∈ O, βˆ€ j, u x j = l j * v x 0 + ΞΊ j)
(hv : DifferentiableOn ℝ v O) {x : Coord3} (hx : x ∈ O) (j : Fin 2) :
(conductivityFlux u A x).col j = l j β€’ (conductivityFlux v A x).col 0 := by
ext i
change (βˆ‘ k, (A x).val i k * gradientColumns (fderiv ℝ u x) k j) =
l j * βˆ‘ k, (A x).val i k * gradientColumns (fderiv ℝ v x) k 0
simp_rw [gradientColumns_affine_column hO he hv hx]
rw [Finset.mul_sum]
apply Finset.sum_congr rfl
intro k _
ring
lemma active_flux_harmonic_of_affine
(ΞΌ : Measure Coord3) {O : Set Coord3} (hO : IsOpen O)
{u v : Coord3 β†’ Fin 2 β†’ ℝ} {l ΞΊ : Fin 2 β†’ ℝ} (A : Coord3 β†’ Symmetric3)
(he : βˆ€ x ∈ O, βˆ€ j, u x j = l j * v x 0 + ΞΊ j)
(hv : DifferentiableOn ℝ v O) {j : Fin 2} (hj : l j β‰  0)
(hdiv : βˆ€ (ψ : Coord3 β†’ ℝ), ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’ HasCompactSupport ψ β†’
tsupport ψ βŠ† O β†’ (∫ x, fderiv ℝ ψ x ((conductivityFlux u A x).col j) βˆ‚ΞΌ) = 0) :
βˆ€ (ψ : Coord3 β†’ ℝ), ContDiff ℝ (↑(⊀ : β„•βˆž)) ψ β†’ HasCompactSupport ψ β†’
tsupport ψ βŠ† O β†’ (∫ x, fderiv ℝ ψ x ((conductivityFlux v A x).col 0) βˆ‚ΞΌ) = 0 := by
intro ψ hψ hc hs
have heq : (∫ x, fderiv ℝ ψ x ((conductivityFlux u A x).col j) βˆ‚ΞΌ) =
l j * ∫ x, fderiv ℝ ψ x ((conductivityFlux v A x).col 0) βˆ‚ΞΌ := by
rw [derivative_test_integral_congr μ ψ _
(fun x => l j β€’ (conductivityFlux v A x).col 0)
(fun x hx => conductivityFlux_affine_column hO A he hv (hs hx) j)]
simp_rw [map_smul, smul_eq_mul]
exact integral_const_mul _ _
exact (mul_eq_zero.mp (heq.symm.trans (hdiv ψ hψ hc hs))).resolve_left hj
def TwoFieldRankRegular (u : Coord3 β†’ Fin 2 β†’ ℝ) (O : Set Coord3) : Prop :=
(βˆ€ x ∈ O, LinearIndependent ℝ (gradientColumns (fderiv ℝ u x)).col) ∨
(βˆƒ (v : Coord3 β†’ ℝ) (l ΞΊ : Fin 2 β†’ ℝ),
ContDiffOn ℝ (↑(⊀ : β„•βˆž)) v O ∧ (βˆƒ j, l j β‰  0) ∧
(βˆ€ x ∈ O, fderiv ℝ v x β‰  0) ∧
(βˆ€ x ∈ O, βˆ€ j, u x j = l j * v x + ΞΊ j)) ∨
βˆƒ ΞΊ : Fin 2 β†’ ℝ, βˆ€ x ∈ O, u x = ΞΊ
lemma TwoFieldRankRegular.mono {u : Coord3 β†’ Fin 2 β†’ ℝ} {O W : Set Coord3}
(h : TwoFieldRankRegular u O) (hW : W βŠ† O) : TwoFieldRankRegular u W := by
rcases h with h | h | ⟨κ, hκ⟩
Β· exact Or.inl (fun x hx => h x (hW hx))
· obtain ⟨v, l, κ, hv, hl, hd, he⟩ := h
exact Or.inr (Or.inl ⟨v, l, κ, hv.mono hW, hl, fun x hx => hd x (hW hx),
fun x hx => he x (hW hx)⟩)
· exact Or.inr (Or.inr ⟨κ, fun x hx => hκ x (hW hx)⟩)
end ScalarConductivity
end
end OAI