File size: 6,703 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Analysis.Calculus.Current.Fiber.Normal
import OAI.Analysis.Calculus.Quaternion.IndexedCofactor

/-! The genuine Moore-cofactor regularizer of the fiber defining function. -/

noncomputable section
namespace OAI.Analysis.Calculus.Current

open OAI.Analysis.Calculus.Quaternion OAI.LinearAlgebra.Moore
open scoped Matrix Matrix.Norms.Elementwise ComplexOrder ContDiff

def fiberCofactor {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚) :
    Matrix (Index d) (Index d) (Quaternion ℝ) := OAI.Analysis.Calculus.Quaternion.indexedCofactor (fiberHessian w a z)

theorem fiberHessian_isHermitian {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : (fiberHessian w a z).IsHermitian := by
  rw [fiberHessian_factorization w a z hY]
  apply Matrix.ext
  intro i j
  simp only [Matrix.conjTranspose_apply, Matrix.smul_apply, Quaternion.star_smul,
    Matrix.mul_apply, star_sum, star_mul, star_star]

theorem fiberHessian_posSemidef {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : (OAI.LinearAlgebra.Moore.complexify (fiberHessian w a z)).PosSemidef :=
  (OAI.Analysis.Calculus.Quaternion.indexed_complexify_posSemidef_iff _ (fiberHessian_isHermitian w a z hY)).mpr
    (fiberHessian_nonneg w a z hY)

theorem fiberHessian_mooreDet_zero {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : OAI.Analysis.Calculus.Quaternion.indexedMooreDet (fiberHessian w a z) = 0 := by
  apply OAI.Analysis.Calculus.Quaternion.indexedMooreDet_zero_of_kernel _ (fiberHessian_isHermitian w a z hY)
    (fun b => complexK (fiberKernelVector z b)) _ (fiberHessian_kernel w a z hY)
  intro hz
  have h := congrFun hz none
  simp [fiberKernelVector] at h

theorem fiberCofactor_isHermitian {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚) :
    (fiberCofactor w a z).IsHermitian := OAI.Analysis.Calculus.Quaternion.indexedCofactor_isHermitian _

theorem fiberCofactor_posSemidef {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : (OAI.LinearAlgebra.Moore.complexify (fiberCofactor w a z)).PosSemidef :=
  OAI.Analysis.Calculus.Quaternion.indexedCofactor_posSemidef _ (fiberHessian_posSemidef w a z hY)

theorem fiberCofactor_nonneg {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ) :
    0 ≀ (star v ⬝α΅₯ (fiberCofactor w a z *α΅₯ v)).re :=
  (OAI.Analysis.Calculus.Quaternion.indexed_complexify_posSemidef_iff _ (fiberCofactor_isHermitian w a z)).mp
    (fiberCofactor_posSemidef w a z hY) v

theorem fiberCofactor_image_in_kernel {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ) :
    fiberHessian w a z *α΅₯ (fiberCofactor w a z *α΅₯ v) = 0 :=
  OAI.Analysis.Calculus.Quaternion.indexedCofactor_image_in_kernel _ (fiberHessian_isHermitian w a z hY)
    (fiberHessian_mooreDet_zero w a z hY) v

theorem fiberCofactor_tangent_phi {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (ha : a β‰  0) (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ) :
    (βˆ‘ b, complexK (phaseRow (ratio z) b) * (fiberCofactor w a z *α΅₯ v) b) = 0 :=
  fiberHessian_kernel_tangent_phi w a z _ ha hY (fiberCofactor_image_in_kernel w a z hY v)

theorem fiberCofactor_orthogonal_gradient {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ) :
    star (fiberGradient w a z) ⬝α΅₯ (fiberCofactor w a z *α΅₯ v) = 0 :=
  fiberHessian_kernel_orthogonal_gradient w a z hY _ (fiberCofactor_image_in_kernel w a z hY v)

theorem fiberCofactor_background {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (ha : a β‰  0) (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ) :
    backgroundHessian z *α΅₯ (fiberCofactor w a z *α΅₯ v) = 0 :=
  fiberHessian_kernel_background w a z _ ha hY (fiberCofactor_image_in_kernel w a z hY v)

theorem fiberHessian_pos_on_Y_zero {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hw : w β‰  0) (ha : a β‰  0) (hY : z none β‰  0) (v : Index d β†’ Quaternion ℝ)
    (hv : v β‰  0) (hvY : v none = 0) :
    0 < (star v ⬝α΅₯ (fiberHessian w a z *α΅₯ v)).re := by
  have hJ : quaternionFiberJacobian w a z *α΅₯ v β‰  0 := by
    intro h
    apply hv
    have he := quaternionFiberJacobian_kernel_unique w a z v hw ha hY h
    funext b
    simp only [congrFun he b, hvY, mul_zero, Pi.zero_apply]
  rw [fiberHessian_factorization w a z hY, Matrix.smul_mulVec, dotProduct_smul]
  simpa only [Quaternion.re_smul, smul_eq_mul] using
    mul_pos (by norm_num : (0 : ℝ) < 4)
      (OAI.Analysis.Calculus.Quaternion.quaternionGram_pos (quaternionFiberJacobian w a z) v hJ)

theorem fiberCofactor_YY_pos {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hw : w β‰  0) (ha : a β‰  0) (hY : z none β‰  0) :
    0 < (fiberCofactor w a z none none).re :=
  OAI.Analysis.Calculus.Quaternion.indexedCofactor_diag_pos _ none (fiberHessian_posSemidef w a z hY)
    (fiberHessian_mooreDet_zero w a z hY) (fiberHessian_pos_on_Y_zero w a z hw ha hY)

theorem fiberCofactor_divergence_zero {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) (b : Index d) :
    OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots (fun p => fderiv ℝ (fiberCofactor w a) z
      (OAI.Analysis.Calculus.Quaternion.imaginaryDirection p.1 p.2)) b = 0 := by
  exact OAI.Analysis.Calculus.Quaternion.indexedCofactor_directionalHessian_divergence OAI.Analysis.Calculus.Quaternion.threeSlots
    (fun p => OAI.Analysis.Calculus.Quaternion.imaginaryDirection p.1 p.2)
    ((contDiffAt_fiberDefining w a z hY).of_le (by simp)) b

theorem contDiffAt_fiberHessian {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : ContDiffAt ℝ ⊀ (fiberHessian w a) z := by
  have hH : ContDiffAt ℝ ⊀ (fderiv ℝ (fderiv ℝ (fiberDefining w a))) z :=
    ((contDiffAt_fiberDefining w a z hY).fderiv_right (m := ⊀) (by simp)).fderiv_right
      (m := ⊀) (by simp)
  have he : ContDiffAt ℝ ⊀
      (OAI.Analysis.Calculus.Quaternion.directionalRealHessian (fun p => OAI.Analysis.Calculus.Quaternion.imaginaryDirection (ΞΉ := Index d) p.1 p.2)
        (fiberDefining w a)) z := by
    apply contDiffAt_pi.mpr
    intro p
    apply contDiffAt_pi.mpr
    intro q
    exact (hH.clm_apply contDiffAt_const).clm_apply contDiffAt_const
  simpa only using! (OAI.Analysis.Calculus.Quaternion.hessianCLM OAI.Analysis.Calculus.Quaternion.threeSlots).contDiff.contDiffAt.comp z he

theorem contDiffAt_fiberCofactor {d : β„•} (w a : ℝ) (z : Index d β†’ β„‚)
    (hY : z none β‰  0) : ContDiffAt ℝ ⊀ (fiberCofactor w a) z :=
  (OAI.Analysis.Calculus.Quaternion.contDiff_indexedCofactor ⊀).contDiffAt.comp z (contDiffAt_fiberHessian w a z hY)

end OAI.Analysis.Calculus.Current