Buckets:
| import OAI.Geometry.IsometricImmersion.Calculus.HessianCommutator | |
| import OAI.Geometry.IsometricImmersion.Energy.HeightEnergy | |
| import OAI.Geometry.IsometricImmersion.Calculus.QuotientCalculus | |
| import Mathlib.Analysis.Calculus.Deriv.Pow | |
| import Mathlib.Tactic.FinCases | |
| import Mathlib.Tactic.FieldSimp | |
| import Mathlib.Tactic.Ring | |
| namespace OAI | |
| noncomputable section | |
| open scoped ContDiff Topology BigOperators Matrix | |
| namespace SmoothLocal.Geometry | |
| def jetConnection (g : MetricField) (p : Coord) (a b : Fin 2) (u : Coord) : ℝ := | |
| ∑ r, christoffel g r a b p * u r | |
| def jetMixed (g : MetricField) (p : Coord) (b : ℝ) (u : Coord) : ℝ := | |
| b - jetConnection g p 0 1 u | |
| def jetYY (g : MetricField) (p : Coord) (c : ℝ) (u : Coord) : ℝ := | |
| c - jetConnection g p 1 1 u | |
| def jetEnergy (g : MetricField) (p : Coord) (u : Coord) : ℝ := | |
| (g p).det - (g p 1 1 * (u 0) ^ 2 - | |
| (g p 0 1 + g p 1 0) * u 0 * u 1 + g p 0 0 * (u 1) ^ 2) | |
| def jetNumerator (g : MetricField) (p : Coord) (b : ℝ) (u : Coord) : ℝ := | |
| (jetMixed g p b u) ^ 2 + gaussianCurvature g p * jetEnergy g p u | |
| def solvedDarboux (g : MetricField) (p : Coord) (b c : ℝ) (u : Coord) : ℝ := | |
| jetConnection g p 0 0 u + jetNumerator g p b u / jetYY g p c u | |
| def jetDriftVector (q : ℝ) : Coord := ![1, -q] | |
| def christoffelAlongD (g : MetricField) (p : Coord) (q : ℝ) (i : Fin 2) : ℝ := | |
| ∑ a, ∑ b, christoffel g i a b p * jetDriftVector q a * jetDriftVector q b | |
| namespace DarbouxJetCalculus | |
| theorem coordPartial_const (c : ℝ) (i : Fin 2) (u : Coord) : | |
| coordPartial i (fun _ : Coord => c) u = 0 := by | |
| simp [coordPartial] | |
| theorem coordPartial_eval (i j : Fin 2) (u : Coord) : | |
| coordPartial i (fun v : Coord => v j) u = if j = i then 1 else 0 := by | |
| simp [coordPartial, (hasFDerivAt_apply j u).fderiv, Pi.single_apply] | |
| theorem coordPartial_sq {f : Coord → ℝ} {u : Coord} | |
| (hf : DifferentiableAt ℝ f u) (i : Fin 2) : | |
| coordPartial i (fun v => (f v) ^ 2) u = 2 * f u * coordPartial i f u := by | |
| simp only [pow_two] | |
| rw [HessianCalculus.coordPartial_mul_at hf hf i] | |
| ring | |
| end DarbouxJetCalculus | |
| theorem jetConnection_differentiableAt (g : MetricField) (p u : Coord) (a b : Fin 2) : | |
| DifferentiableAt ℝ (jetConnection g p a b) u := by | |
| have h0 : DifferentiableAt ℝ (fun v : Coord => christoffel g 0 a b p * v 0) u := | |
| (differentiableAt_apply (𝕜 := ℝ) 0 u).const_mul (christoffel g 0 a b p) | |
| have h1 : DifferentiableAt ℝ (fun v : Coord => christoffel g 1 a b p * v 1) u := | |
| (differentiableAt_apply (𝕜 := ℝ) 1 u).const_mul (christoffel g 1 a b p) | |
| change DifferentiableAt ℝ (fun v => ∑ r, christoffel g r a b p * v r) u | |
| simpa only [Fin.sum_univ_two, Pi.add_def] using h0.add h1 | |
| theorem coordPartial_jetConnection (g : MetricField) (p u : Coord) (a b i : Fin 2) : | |
| coordPartial i (jetConnection g p a b) u = christoffel g i a b p := by | |
| have h0 : DifferentiableAt ℝ (fun v : Coord => christoffel g 0 a b p * v 0) u := | |
| (differentiableAt_apply (𝕜 := ℝ) 0 u).const_mul (christoffel g 0 a b p) | |
| have h1 : DifferentiableAt ℝ (fun v : Coord => christoffel g 1 a b p * v 1) u := | |
| (differentiableAt_apply (𝕜 := ℝ) 1 u).const_mul (christoffel g 1 a b p) | |
| change coordPartial i (fun v => ∑ r, christoffel g r a b p * v r) u = _ | |
| simp only [Fin.sum_univ_two] | |
| rw [HessianCalculus.coordPartial_add_at h0 h1 i, | |
| HessianCalculus.coordPartial_mul_at (differentiableAt_const (christoffel g 0 a b p)) | |
| (differentiableAt_apply (𝕜 := ℝ) 0 u) i, | |
| HessianCalculus.coordPartial_mul_at (differentiableAt_const (christoffel g 1 a b p)) | |
| (differentiableAt_apply (𝕜 := ℝ) 1 u) i] | |
| fin_cases i <;> | |
| simp [DarbouxJetCalculus.coordPartial_const, DarbouxJetCalculus.coordPartial_eval] | |
| theorem jetMixed_differentiableAt (g : MetricField) (p u : Coord) (b : ℝ) : | |
| DifferentiableAt ℝ (jetMixed g p b) u := by | |
| change DifferentiableAt ℝ (fun v => b - jetConnection g p 0 1 v) u | |
| simpa only [Pi.sub_def] using | |
| (differentiableAt_const (𝕜 := ℝ) b).sub (jetConnection_differentiableAt g p u 0 1) | |
| theorem jetYY_differentiableAt (g : MetricField) (p u : Coord) (c : ℝ) : | |
| DifferentiableAt ℝ (jetYY g p c) u := by | |
| change DifferentiableAt ℝ (fun v => c - jetConnection g p 1 1 v) u | |
| simpa only [Pi.sub_def] using | |
| (differentiableAt_const (𝕜 := ℝ) c).sub (jetConnection_differentiableAt g p u 1 1) | |
| theorem coordPartial_jetMixed (g : MetricField) (p u : Coord) (b : ℝ) (i : Fin 2) : | |
| coordPartial i (jetMixed g p b) u = -christoffel g i 0 1 p := by | |
| change coordPartial i (fun v => b - jetConnection g p 0 1 v) u = _ | |
| rw [HessianCalculus.coordPartial_sub_at (differentiableAt_const b) | |
| (jetConnection_differentiableAt g p u 0 1) i] | |
| simp [DarbouxJetCalculus.coordPartial_const, coordPartial_jetConnection] | |
| theorem coordPartial_jetYY (g : MetricField) (p u : Coord) (c : ℝ) (i : Fin 2) : | |
| coordPartial i (jetYY g p c) u = -christoffel g i 1 1 p := by | |
| change coordPartial i (fun v => c - jetConnection g p 1 1 v) u = _ | |
| rw [HessianCalculus.coordPartial_sub_at (differentiableAt_const c) | |
| (jetConnection_differentiableAt g p u 1 1) i] | |
| simp [DarbouxJetCalculus.coordPartial_const, coordPartial_jetConnection] | |
| theorem jetEnergy_differentiableAt (g : MetricField) (p u : Coord) : | |
| DifferentiableAt ℝ (jetEnergy g p) u := by | |
| have h0 := differentiableAt_apply (𝕜 := ℝ) 0 u | |
| have h1 := differentiableAt_apply (𝕜 := ℝ) 1 u | |
| change DifferentiableAt ℝ (fun v : Coord => (g p).det - | |
| (g p 1 1 * (v 0) ^ 2 - (g p 0 1 + g p 1 0) * v 0 * v 1 + | |
| g p 0 0 * (v 1) ^ 2)) u | |
| simpa only [Pi.pow_apply, Pi.add_def, Pi.sub_def, Pi.mul_apply] using | |
| (differentiableAt_const (𝕜 := ℝ) (g p).det).sub | |
| ((((h0.pow 2).const_mul (g p 1 1)).sub | |
| ((h0.const_mul (g p 0 1 + g p 1 0)).mul h1)).add | |
| ((h1.pow 2).const_mul (g p 0 0))) | |
| theorem coordPartial_jetEnergy (g : MetricField) (p u : Coord) (i : Fin 2) : | |
| coordPartial i (jetEnergy g p) u = | |
| if i = 0 then -2 * g p 1 1 * u 0 + (g p 0 1 + g p 1 0) * u 1 | |
| else (g p 0 1 + g p 1 0) * u 0 - 2 * g p 0 0 * u 1 := by | |
| have h0 := hasFDerivAt_apply (𝕜 := ℝ) 0 u | |
| have h1 := hasFDerivAt_apply (𝕜 := ℝ) 1 u | |
| have hQ := (((h0.fun_mul h0).const_mul (g p 1 1)).sub | |
| ((h0.const_mul (g p 0 1 + g p 1 0)).fun_mul h1)).add | |
| ((h1.fun_mul h1).const_mul (g p 0 0)) | |
| have hd := (hasFDerivAt_const (𝕜 := ℝ) (g p).det u).sub hQ | |
| simp only [Pi.add_def, Pi.sub_def] at hd | |
| change fderiv ℝ (fun v : Coord => (g p).det - | |
| (g p 1 1 * (v 0) ^ 2 - (g p 0 1 + g p 1 0) * v 0 * v 1 + | |
| g p 0 0 * (v 1) ^ 2)) u (Pi.single i 1) = _ | |
| simp only [pow_two] | |
| rw [hd.fderiv] | |
| fin_cases i <;> simp <;> ring | |
| theorem jetNumerator_differentiableAt (g : MetricField) (p u : Coord) (b : ℝ) : | |
| DifferentiableAt ℝ (jetNumerator g p b) u := by | |
| have hsq : DifferentiableAt ℝ (fun v => (jetMixed g p b v) ^ 2) u := by | |
| simpa only [pow_two] using | |
| ((jetMixed_differentiableAt g p u b).hasFDerivAt.fun_mul | |
| (jetMixed_differentiableAt g p u b).hasFDerivAt).differentiableAt | |
| have hKE : DifferentiableAt ℝ | |
| (fun v => gaussianCurvature g p * jetEnergy g p v) u := | |
| (jetEnergy_differentiableAt g p u).const_mul (gaussianCurvature g p) | |
| change DifferentiableAt ℝ (fun v => (jetMixed g p b v) ^ 2 + | |
| gaussianCurvature g p * jetEnergy g p v) u | |
| simpa only [Pi.add_def] using hsq.add hKE | |
| theorem coordPartial_jetNumerator (g : MetricField) (p u : Coord) (b : ℝ) (i : Fin 2) : | |
| coordPartial i (jetNumerator g p b) u = | |
| -2 * jetMixed g p b u * christoffel g i 0 1 p + | |
| gaussianCurvature g p * coordPartial i (jetEnergy g p) u := by | |
| have hsq : DifferentiableAt ℝ (fun v => (jetMixed g p b v) ^ 2) u := by | |
| simpa only [pow_two] using | |
| ((jetMixed_differentiableAt g p u b).hasFDerivAt.fun_mul | |
| (jetMixed_differentiableAt g p u b).hasFDerivAt).differentiableAt | |
| have hKE : DifferentiableAt ℝ | |
| (fun v => gaussianCurvature g p * jetEnergy g p v) u := | |
| (jetEnergy_differentiableAt g p u).const_mul (gaussianCurvature g p) | |
| change coordPartial i (fun v => (jetMixed g p b v) ^ 2 + | |
| gaussianCurvature g p * jetEnergy g p v) u = _ | |
| rw [HessianCalculus.coordPartial_add_at hsq hKE i, | |
| DarbouxJetCalculus.coordPartial_sq (jetMixed_differentiableAt g p u b) i, | |
| HessianCalculus.coordPartial_mul_at (differentiableAt_const (gaussianCurvature g p)) | |
| (jetEnergy_differentiableAt g p u) i, | |
| coordPartial_jetMixed] | |
| simp only [DarbouxJetCalculus.coordPartial_const, zero_mul, zero_add] | |
| ring | |
| theorem solvedDarboux_firstJet_expanded (g : MetricField) (p u : Coord) (b c : ℝ) | |
| (hne : jetYY g p c u ≠ 0) (i : Fin 2) : | |
| coordPartial i (solvedDarboux g p b c) u = | |
| christoffel g i 0 0 p - 2 * (jetMixed g p b u / jetYY g p c u) * christoffel g i 0 1 p + | |
| (jetMixed g p b u / jetYY g p c u) ^ 2 * christoffel g i 1 1 p + | |
| gaussianCurvature g p * | |
| (coordPartial i (jetEnergy g p) u / jetYY g p c u + | |
| jetEnergy g p u * christoffel g i 1 1 p / (jetYY g p c u) ^ 2) := by | |
| have hN := jetNumerator_differentiableAt g p u b | |
| have hH := jetYY_differentiableAt g p u c | |
| have hQ : DifferentiableAt ℝ | |
| (fun v => jetNumerator g p b v / jetYY g p c v) u := by | |
| simpa only [div_eq_mul_inv, Function.comp_def] using | |
| (hN.hasFDerivAt.fun_mul | |
| ((hasDerivAt_inv hne).comp_hasFDerivAt u hH.hasFDerivAt)).differentiableAt | |
| change coordPartial i (fun v => jetConnection g p 0 0 v + | |
| jetNumerator g p b v / jetYY g p c v) u = _ | |
| rw [HessianCalculus.coordPartial_add_at (jetConnection_differentiableAt g p u 0 0) hQ i, | |
| coordPartial_jetConnection, coordPartial_div hN hH hne i, | |
| coordPartial_jetNumerator, coordPartial_jetYY] | |
| simp only [jetNumerator] | |
| field_simp [hne] | |
| ring | |
| theorem christoffelAlongD_eq {g : MetricField} {U : Set Coord} | |
| (hg : SmoothPositiveOn g U) (hU : IsOpen U) {p : Coord} (hp : p ∈ U) | |
| (q : ℝ) (i : Fin 2) : | |
| christoffelAlongD g p q i = | |
| christoffel g i 0 0 p - 2 * q * christoffel g i 0 1 p + | |
| q ^ 2 * christoffel g i 1 1 p := by | |
| simp only [christoffelAlongD, Fin.sum_univ_two, jetDriftVector, | |
| Matrix.cons_val_zero, Matrix.cons_val_one] | |
| rw [christoffel_lower_symm hg hU hp i 1 0] | |
| ring | |
| theorem solvedDarboux_firstJet {g : MetricField} {U : Set Coord} | |
| (hg : SmoothPositiveOn g U) (hU : IsOpen U) {p : Coord} (hp : p ∈ U) | |
| (u : Coord) (b c : ℝ) (hne : jetYY g p c u ≠ 0) (i : Fin 2) : | |
| coordPartial i (solvedDarboux g p b c) u = | |
| christoffelAlongD g p (jetMixed g p b u / jetYY g p c u) i + | |
| gaussianCurvature g p * | |
| (coordPartial i (jetEnergy g p) u / jetYY g p c u + | |
| jetEnergy g p u * christoffel g i 1 1 p / (jetYY g p c u) ^ 2) := by | |
| rw [christoffelAlongD_eq hg hU hp] | |
| exact solvedDarboux_firstJet_expanded g p u b c hne i | |
| theorem solvedDarboux_deriv_b (g : MetricField) (p u : Coord) (b c : ℝ) | |
| (_hne : jetYY g p c u ≠ 0) : | |
| deriv (fun t => solvedDarboux g p t c u) b = | |
| 2 * (jetMixed g p b u / jetYY g p c u) := by | |
| have hd := (((((hasDerivAt_id b).sub_const (jetConnection g p 0 1 u)).pow 2).add_const | |
| (gaussianCurvature g p * jetEnergy g p u)).div_const (jetYY g p c u)).const_add | |
| (jetConnection g p 0 0 u) | |
| simp only [Pi.pow_apply, id_eq] at hd | |
| change deriv (fun t => jetConnection g p 0 0 u + | |
| ((t - jetConnection g p 0 1 u) ^ 2 + gaussianCurvature g p * jetEnergy g p u) / | |
| jetYY g p c u) b = _ | |
| rw [hd.deriv] | |
| simp only [jetMixed, mul_one] | |
| ring | |
| theorem solvedDarboux_deriv_c (g : MetricField) (p u : Coord) (b c : ℝ) | |
| (hne : jetYY g p c u ≠ 0) : | |
| deriv (fun t => solvedDarboux g p b t u) c = | |
| -((jetMixed g p b u / jetYY g p c u) ^ 2 + | |
| gaussianCurvature g p * jetEnergy g p u / (jetYY g p c u) ^ 2) := by | |
| have hdH := (hasDerivAt_id c).sub_const (jetConnection g p 1 1 u) | |
| have hd := ((hasDerivAt_const c (jetNumerator g p b u)).div hdH hne).const_add | |
| (jetConnection g p 0 0 u) | |
| simp only [Pi.div_apply, id_eq] at hd | |
| change deriv (fun t => jetConnection g p 0 0 u + | |
| jetNumerator g p b u / (t - jetConnection g p 1 1 u)) c = _ | |
| rw [hd.deriv] | |
| change (0 * jetYY g p c u - jetNumerator g p b u * 1) / (jetYY g p c u) ^ 2 = _ | |
| simp only [jetNumerator] | |
| field_simp [hne] | |
| ring | |
| theorem jetEnergy_at_height {g : MetricField} {U : Set Coord} | |
| (hg : SmoothPositiveOn g U) {p : Coord} (hp : p ∈ U) (z : Coord → ℝ) : | |
| jetEnergy g p (fun i => coordPartial i z p) = heightEnergy g z p := by | |
| symm | |
| exact heightEnergy_polynomial z hg hp | |
| theorem jetMixed_at_height (g : MetricField) (p : Coord) (z : Coord → ℝ) : | |
| jetMixed g p (coordPartial 0 (coordPartial 1 z) p) (fun i => coordPartial i z p) = | |
| covHessian g z p 0 1 := rfl | |
| theorem jetYY_at_height (g : MetricField) (p : Coord) (z : Coord → ℝ) : | |
| jetYY g p (coordPartial 1 (coordPartial 1 z) p) (fun i => coordPartial i z p) = | |
| covHessian g z p 1 1 := rfl | |
| end SmoothLocal.Geometry | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 13 kB
- Xet hash:
- 5636aa0137034967255cd538f006a2c9ee8b31be11e8fedfb79900dc3cf63486
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.