math / data /lean /OAI /Analysis /Calculus /Current /Physical /Jacobian.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.63 kB
import OAI.Analysis.Calculus.Current.Physical.Inverse
/-! The real Jacobian of the inverse physical fiber coordinates. -/
noncomputable section
namespace OAI.Analysis.Calculus.Current
open scoped Topology
theorem contDiffAt_physicalFiberCoordinates {d : β„•} (a : ℝ) (Ο„ : β„‚)
(q : Option (Fin d) β†’ β„‚) (hY : physicalEmbedding Ο„ q none β‰  0) :
ContDiffAt β„‚ 2 (physicalFiberCoordinates a Ο„) q := by
apply contDiffAt_pi.mpr
intro b
cases b with
| none =>
have he : (fun p : Option (Fin d) β†’ β„‚ => fiberMap 1 10 (physicalEmbedding Ο„ p) none) =
(fun p => phi (physicalEmbedding Ο„ p)) := by funext p; simp [fiberMap]
have hh := (contDiffAt_fiberMap_complex 1 10 (physicalEmbedding Ο„ q) hY none).comp q
(contDiff_physicalEmbedding_complex Ο„).contDiffAt
dsimp only [Function.comp_def] at hh
rw [he] at hh
exact hh.div_const a
| some i =>
have he : (fun p : Option (Fin d) β†’ β„‚ => fiberMap 1 10 (physicalEmbedding Ο„ p) (some i)) =
(fun p => ratio (physicalEmbedding Ο„ p) i) := by funext p; simp [fiberMap]
have hh := (contDiffAt_fiberMap_complex 1 10 (physicalEmbedding Ο„ q) hY (some i)).comp q
(contDiff_physicalEmbedding_complex Ο„).contDiffAt
dsimp only [Function.comp_def] at hh
rw [he] at hh
exact hh
def physicalInverseJacobian {d : β„•} (a : ℝ) (Ο„ : β„‚) (u : Option (Fin d) β†’ β„‚) : ℝ :=
(fderiv ℝ (physicalFiberInverse a Ο„) u).det
theorem physicalInverseJacobian_ne_zero {d : β„•} (a : ℝ) (Ο„ : β„‚)
(u : Option (Fin d) β†’ β„‚) (ha : a β‰  0)
(hN : Real.sqrt 2 β€’ Ο„ + a β€’ u none β‰  0)
(hD : fiberDenominator (fun i => u (some i)) β‰  0) :
physicalInverseJacobian a Ο„ u β‰  0 := by
have hY : physicalEmbedding Ο„ (physicalFiberInverse a Ο„ u) none β‰  0 := by
rw [physicalEmbedding_inverse]
exact fiberInverse_Y_ne_zero _ _ _ hN hD
have hf := ((contDiffAt_physicalFiberCoordinates a Ο„ _ hY).restrict_scalars ℝ).differentiableAt (by norm_num)
have hg := ((contDiffAt_physicalFiberInverse a Ο„ u hD).restrict_scalars ℝ).differentiableAt (by norm_num)
have hNcont : ContinuousAt (fun v : Option (Fin d) β†’ β„‚ => Real.sqrt 2 β€’ Ο„ + a β€’ v none) u :=
continuousAt_const.add ((continuous_apply none).continuousAt.const_smul a)
have hDcont : ContinuousAt (fun v : Option (Fin d) β†’ β„‚ => fiberDenominator (fun i => v (some i))) u := by
unfold fiberDenominator fiberQuadratic
fun_prop
have heq : (physicalFiberCoordinates a Ο„ ∘ physicalFiberInverse a Ο„) =αΆ [𝓝 u] id := by
filter_upwards [hNcont.eventually_ne hN, hDcont.eventually_ne hD] with v hvN hvD
exact physicalCoordinates_right_inverse a Ο„ v ha hvN hvD
have hchain := hf.hasFDerivAt.comp u hg.hasFDerivAt
have hd := heq.fderiv_eq (π•œ := ℝ)
rw [hchain.fderiv, fderiv_id] at hd
have hdet := congrArg (fun L : (Option (Fin d) β†’ β„‚) β†’L[ℝ] (Option (Fin d) β†’ β„‚) => L.det) hd
change (LinearMap.comp
(fderiv ℝ (physicalFiberCoordinates a Ο„) (physicalFiberInverse a Ο„ u)).toLinearMap
(fderiv ℝ (physicalFiberInverse a Ο„) u).toLinearMap).det = (LinearMap.id).det at hdet
rw [LinearMap.det_comp, LinearMap.det_id] at hdet
intro hz
change (fderiv ℝ (physicalFiberInverse a Ο„) u).toLinearMap.det = 0 at hz
rw [hz, mul_zero] at hdet
exact zero_ne_one hdet
theorem physicalFiberInverse_fderiv_scale {d : β„•} (a : ℝ) (Ο„ : β„‚)
(u : Option (Fin d) β†’ β„‚) (hD : fiberDenominator (fun i => u (some i)) β‰  0) :
fderiv ℝ (physicalFiberInverse a (a β€’ Ο„)) u = a β€’ fderiv ℝ (physicalFiberInverse 1 Ο„) u := by
have hg := ((contDiffAt_physicalFiberInverse 1 Ο„ u hD).restrict_scalars ℝ).differentiableAt (by norm_num)
have hh : HasFDerivAt (physicalFiberInverse a (a β€’ Ο„))
(a β€’ fderiv ℝ (physicalFiberInverse 1 Ο„) u) u := by
have he : physicalFiberInverse (d := d) a (a β€’ Ο„) = a β€’ physicalFiberInverse 1 Ο„ :=
funext (physicalFiberInverse_scale a Ο„)
rw [he]
exact hg.hasFDerivAt.const_smul a
exact hh.fderiv
theorem physicalInverseJacobian_scale {d : β„•} (a : ℝ) (Ο„ : β„‚)
(u : Option (Fin d) β†’ β„‚) (hD : fiberDenominator (fun i => u (some i)) β‰  0) :
physicalInverseJacobian a (a β€’ Ο„) u = a ^ (2 * (d + 1)) * physicalInverseJacobian 1 Ο„ u := by
unfold physicalInverseJacobian
rw [physicalFiberInverse_fderiv_scale a Ο„ u hD]
change LinearMap.det (a β€’ (fderiv ℝ (physicalFiberInverse 1 Ο„) u).toLinearMap) = _
rw [LinearMap.det_smul]
congr 2
simp [Module.finrank_pi_fintype, Nat.mul_comm]
end OAI.Analysis.Calculus.Current