File size: 6,147 Bytes
a458723 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | import Mathlib
import OAI.Analysis.Conductivity.Sources.LocalPhysicalCorrection
namespace OAI
noncomputable section
namespace ScalarConductivity
open Set MeasureTheory Filter Topology Matrix
open scoped Matrix.Norms.Elementwise
def potentialCompletion (D : Coord3 →L[ℝ] (Fin 2 → ℝ)) : Mat3 :=
![(gradientColumns D).col 0,(gradientColumns D).col 1,
crossProduct ((gradientColumns D).col 0) ((gradientColumns D).col 1)]
lemma potentialCompletion_det_ne_zero (D : Coord3 →L[ℝ] (Fin 2 → ℝ))
(hD : Function.Surjective D) : (potentialCompletion D).det≠0 := by
have hc : crossProduct ((gradientColumns D).col 0) ((gradientColumns D).col 1)≠0 := by
apply crossProduct_ne_zero_iff_linearIndependent.mpr
have he : ![(gradientColumns D).col 0,(gradientColumns D).col 1] =
(gradientColumns D).col := by
ext j i
fin_cases j <;> rfl
rw [he]
exact gradientColumns_rank D hD
rw [potentialCompletion,←triple_product_eq_det,
triple_product_permutation ((gradientColumns D).col 0),
triple_product_permutation ((gradientColumns D).col 1)]
exact mt dotProduct_self_eq_zero.mp hc
lemma potentialCompletion_pairing (D : Coord3 →L[ℝ] (Fin 2 → ℝ)) (x : Coord3) :
coordinatePair (potentialCompletion D*ᵥx)=D x := by
rw [←gradientColumns_apply D x]
ext j
fin_cases j <;> rfl
def potentialCompletionEquiv (D : Coord3 →L[ℝ] (Fin 2 → ℝ))
(hD : Function.Surjective D) : Coord3 ≃L[ℝ] Coord3 :=
(LinearMap.equivOfDetNeZero (Matrix.toLin' (potentialCompletion D))
(by rw [LinearMap.det_toLin']; exact potentialCompletion_det_ne_zero D hD)).toContinuousLinearEquiv
lemma potentialCompletionEquiv_pairing (D : Coord3 →L[ℝ] (Fin 2 → ℝ))
(hD : Function.Surjective D) (x : Coord3) :
coordinatePair (potentialCompletionEquiv D hD x)=D x :=
potentialCompletion_pairing D x
theorem exists_regular_potential_coordinates
{u : Coord3 → Fin 2 → ℝ} (hu : ContDiff ℝ (↑(⊤:ℕ∞)) u)
(a : Coord3) (hD : Function.Surjective (fderiv ℝ u a))
{U : Set Coord3} (hU : IsOpen U) (ha : a∈U) :
∃ X : OpenPartialHomeomorph Coord3 Coord3,
a∈X.target ∧ X.target⊆U ∧
ContDiffOn ℝ (↑(⊤:ℕ∞)) X X.source ∧
ContDiff ℝ (↑(⊤:ℕ∞)) X.symm ∧
u=coordinatePair∘X.symm := by
obtain ⟨Y,haY,hYU,hY,hYi,he,hder⟩ := exists_potential_chart hu a hD hU ha
let L : Coord3 ≃L[ℝ] Coord3 := potentialCompletionEquiv (fderiv ℝ u a) hD
let Z := Y.transHomeomorph L.toHomeomorph
refine ⟨Z.symm,haY,hYU,?_,?_,?_⟩
· change ContDiffOn ℝ (↑(⊤:ℕ∞)) (fun z => Y.symm (L.symm z)) {z | L.symm z∈Y.target}
exact hYi.comp L.symm.contDiff.contDiffOn (fun _ hx => hx)
· change ContDiff ℝ (↑(⊤:ℕ∞)) (fun z => L (Y z))
exact L.contDiff.comp hY
· funext x
exact (he x).symm.trans (potentialCompletionEquiv_pairing _ hD (Y x)).symm
end ScalarConductivity
end
noncomputable section
namespace ScalarConductivity
open Set MeasureTheory Filter Topology Matrix
open scoped Matrix.Norms.Elementwise
lemma mem_correctionBox {a b x : Coord3} : x∈correctionBox a b ↔ ∀ i,a i<x i ∧ x i<b i := by
constructor
· rintro ⟨⟨h0,h1⟩,h2⟩ i
fin_cases i
· exact h0
· exact h1
· exact h2
· intro h
exact ⟨⟨h 0,h 1⟩,h 2⟩
lemma correctionBox_isOpen (a b : Coord3) : IsOpen (correctionBox a b) :=
((isOpen_Ioo.prod isOpen_Ioo).prod isOpen_Ioo).preimage boxCoordinates.continuous
lemma exists_correctionBox_inside {U : Set Coord3} (hU : IsOpen U) {x : Coord3} (hx : x∈U) :
∃ a b : Coord3,(∀ i,a i<b i) ∧ x∈correctionBox a b ∧ correctionBox a b⊆U := by
obtain ⟨ε,hε,hball⟩ := Metric.isOpen_iff.mp hU x hx
refine ⟨fun i => x i-ε,fun i => x i+ε,fun i => by linarith,
mem_correctionBox.mpr (fun i => by constructor <;> linarith),?_⟩
intro y hy
apply hball
rw [Metric.mem_ball,dist_pi_lt_iff hε]
intro i
rw [Real.dist_eq,abs_lt]
have hi := mem_correctionBox.mp hy i
constructor <;> linarith
structure RegularCorrectionBox (u : Coord3 → Fin 2 → ℝ) (U : Set Coord3) where
chart : OpenPartialHomeomorph Coord3 Coord3
lower : Coord3
upper : Coord3
widths : ∀ i,lower i<upper i
subset_source : correctionBox lower upper⊆chart.source
smooth : ContDiffOn ℝ (↑(⊤:ℕ∞)) chart chart.source
inverse_smooth : ContDiffOn ℝ (↑(⊤:ℕ∞)) chart.symm chart.target
potentials : EqOn u (coordinatePair∘chart.symm) chart.target
target_subset : chart.target⊆U
namespace RegularCorrectionBox
variable {u : Coord3 → Fin 2 → ℝ} {U : Set Coord3}
def region (B : RegularCorrectionBox u U) : Set Coord3 :=
B.chart '' correctionBox B.lower B.upper
lemma region_open (B : RegularCorrectionBox u U) : IsOpen B.region :=
B.chart.isOpen_image_of_subset_source (correctionBox_isOpen _ _) B.subset_source
lemma region_target (B : RegularCorrectionBox u U) : B.region⊆B.chart.target := by
rintro y ⟨x,hx,rfl⟩
exact B.chart.map_source (B.subset_source hx)
lemma region_subset (B : RegularCorrectionBox u U) : B.region⊆U :=
B.region_target.trans B.target_subset
lemma region_nonempty (B : RegularCorrectionBox u U) : B.region.Nonempty := by
refine ⟨B.chart (fun i => (B.lower i+B.upper i)/2),
(fun i => (B.lower i+B.upper i)/2),?_,rfl⟩
exact mem_correctionBox.mpr (fun i => by have := B.widths i; constructor <;> linarith)
end RegularCorrectionBox
theorem exists_regular_correction_box
{u : Coord3 → Fin 2 → ℝ} (hu : ContDiff ℝ (↑(⊤:ℕ∞)) u)
{U : Set Coord3} (hU : IsOpen U) {p : Coord3} (hp : p∈U)
(hD : Function.Surjective (fderiv ℝ u p)) :
∃ B : RegularCorrectionBox u U,p∈B.region := by
obtain ⟨X,hpX,hXU,hX,hXi,he⟩ := exists_regular_potential_coordinates hu p hD hU hp
obtain ⟨a,b,hab,hx,hs⟩ := exists_correctionBox_inside X.open_source (X.map_target hpX)
let B : RegularCorrectionBox u U := ⟨X,a,b,hab,hs,hX,hXi.contDiffOn,fun _ _ => congrFun he _,hXU⟩
exact ⟨B,X.symm p,hx,X.right_inv hpX⟩
end ScalarConductivity
end
end OAI
|