math / data /lean /OAI /Analysis /Calculus /Current /Fiber /Normal.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.27 kB
import OAI.Analysis.Calculus.Current.Fiber.Quaternion
namespace OAI.Analysis.Calculus.Current
noncomputable section
open scoped Matrix
def fiberGradient {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚) : Index d β†’ Quaternion ℝ :=
OAI.Analysis.Calculus.Quaternion.imaginaryGradient (fiberDefining w a) z
theorem fiberGradient_formula {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
(hY : z none β‰  0) (b : Index d) :
fiberGradient w a z b = (2 : ℝ) β€’
(((quaternionFiberJacobian w a z)α΄΄ *α΅₯ (fun i => complexK (fiberMap w a z i))) b * qi) := by
unfold fiberGradient fiberDefining
rw [OAI.Analysis.Calculus.Quaternion.imaginaryGradient_sub_const, OAI.Analysis.Calculus.Quaternion.imaginaryGradient_sum _ (fun i =>
((contDiffAt_fiberMap_complex w a z hY i).differentiableAt (by norm_num)).restrictScalars ℝ |>.norm_sq β„‚)]
simp_rw [OAI.Analysis.Calculus.Quaternion.imaginaryGradient_norm_sq
((contDiffAt_fiberMap_complex w a z hY _).differentiableAt (by norm_num)),
fderiv_fiberMap_single w a z hY]
simp only [Matrix.mulVec, dotProduct, Matrix.conjTranspose_apply, quaternionFiberJacobian,
complexK_star, ← map_mul, ← Finset.sum_mul, ← Finset.smul_sum]
private theorem gradient_pairing_algebra {ΞΉ : Type*} [Fintype ΞΉ]
(u v : ΞΉ β†’ Quaternion ℝ) :
(βˆ‘ b, star ((2 : ℝ) β€’ (u b * qi)) * v b) =
(2 : ℝ) β€’ (star qi * (star u ⬝α΅₯ v)) := by
simp only [Quaternion.star_smul, star_mul, smul_mul_assoc, Finset.smul_sum,
dotProduct, Pi.star_apply, Finset.mul_sum, mul_assoc]
/-- The full Hessian kernel is orthogonal to the actual defining-function gradient. -/
theorem fiberHessian_kernel_orthogonal_gradient {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
(hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ)
(hH : fiberHessian w a z *α΅₯ v = 0) : star (fiberGradient w a z) ⬝α΅₯ v = 0 := by
have hJ := (fiberHessian_kernel_iff w a z hY v).mp hH
have hp : star ((quaternionFiberJacobian w a z)α΄΄ *α΅₯
(fun i => complexK (fiberMap w a z i))) ⬝α΅₯ v = 0 := by
rw [Matrix.star_mulVec, Matrix.conjTranspose_conjTranspose, ← Matrix.dotProduct_mulVec,
hJ, dotProduct_zero]
simp only [dotProduct, Pi.star_apply, fiberGradient_formula w a z hY]
rw [gradient_pairing_algebra, hp, mul_zero, smul_zero]
theorem fiberHessian_kernel_tangent_phi {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
(v : Index d β†’ Quaternion ℝ) (ha : a β‰  0) (hY : z none β‰  0)
(hH : fiberHessian w a z *α΅₯ v = 0) :
(βˆ‘ b, complexK (phaseRow (ratio z) b) * v b) = 0 := by
have hJ := congrFun ((fiberHessian_kernel_iff w a z hY v).mp hH) none
have he : complexK (10 / (a : β„‚)) * (βˆ‘ b, complexK (phaseRow (ratio z) b) * v b) = 0 := by
simpa only [Matrix.mulVec, dotProduct, quaternionFiberJacobian, fiberJacobian,
map_mul, mul_assoc, ← Finset.mul_sum, Pi.zero_apply] using hJ
have hc : complexK (10 / (a : β„‚)) β‰  0 := by
intro hz
have heq := congrArg quaternionFirst hz
change (10 / (a : β„‚)) = 0 at heq
have haC : (a : β„‚) β‰  0 := by exact_mod_cast ha
exact (div_ne_zero (by norm_num) haC) heq
exact (mul_eq_zero.mp he).resolve_left hc
theorem fderiv_phi_single {d : β„•} (z : Index d β†’ β„‚) (hY : z none β‰  0) (b : Index d) :
fderiv β„‚ (phi : (Index d β†’ β„‚) β†’ β„‚) z (Pi.single b 1) = phaseRow (ratio z) b := by
have he : (fun q : Index d β†’ β„‚ => fiberMap 1 10 q none) = phi := by
funext q
simp [fiberMap]
have hh := fderiv_fiberMap_single 1 10 z hY none b
rw [he] at hh
simpa [fiberJacobian] using hh
def backgroundHessian {d : β„•} (z : Index d β†’ β„‚) :
Matrix (Index d) (Index d) (Quaternion ℝ) :=
OAI.Analysis.Calculus.Quaternion.imaginaryHessian (fun q => β€–phi qβ€– ^ 2) z
theorem backgroundHessian_formula {d : β„•} (z : Index d β†’ β„‚) (hY : z none β‰  0) :
backgroundHessian z = (4 : ℝ) β€’
OAI.Analysis.Calculus.Quaternion.outer (fun b => complexK (star (phaseRow (ratio z) b))) := by
have he : (fun q : Index d β†’ β„‚ => fiberMap 1 10 q none) = phi := by
funext q
simp [fiberMap]
have hf : ContDiffAt β„‚ 2 (phi : (Index d β†’ β„‚) β†’ β„‚) z := by
rw [← he]
exact contDiffAt_fiberMap_complex 1 10 z hY none
apply Matrix.ext
intro a b
simp only [backgroundHessian, OAI.Analysis.Calculus.Quaternion.imaginaryHessian_norm_sq hf, fderiv_phi_single z hY,
Matrix.smul_apply, OAI.Analysis.Calculus.Quaternion.outer, ← complexK_star, star_star, map_mul]
/-- The full fiber Hessian and the rank-one background have the required common kernel. -/
theorem fiberHessian_kernel_background {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
(v : Index d β†’ Quaternion ℝ) (ha : a β‰  0) (hY : z none β‰  0)
(hH : fiberHessian w a z *α΅₯ v = 0) : backgroundHessian z *α΅₯ v = 0 := by
have ht := fiberHessian_kernel_tangent_phi w a z v ha hY hH
rw [backgroundHessian_formula z hY, Matrix.smul_mulVec]
have hz : OAI.Analysis.Calculus.Quaternion.outer (fun b => complexK (star (phaseRow (ratio z) b))) *α΅₯ v = 0 := by
funext b
rw [OAI.Analysis.Calculus.Quaternion.outer_mulVec]
simp only [← complexK_star, star_star, ht, mul_zero, Pi.zero_apply]
rw [hz, smul_zero]
end
end OAI.Analysis.Calculus.Current