math / data /lean /OAI /LinearAlgebra /Moore /Smooth.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.71 kB
import OAI.LinearAlgebra.Moore.Cofactor
/-! Smoothness of the signed determinant, its differential, and its cofactor,
including at singular matrices. -/
noncomputable section
namespace OAI.LinearAlgebra.Moore
open Matrix
open scoped ContDiff Matrix.Norms.Elementwise
theorem contDiff_skewComplexify_entry {n : β„•} (k : β„•βˆžΟ‰) (i j : Fin n Γ— Fin 2) :
ContDiff ℝ k (fun A : Matrix (Fin n) (Fin n) (Quaternion ℝ) ↦ skewComplexify A i j) := by
exact (skewQuaternionEntryCLM i.2 j.2).contDiff.comp
(contDiff_apply_apply ℝ (Quaternion ℝ) i.1 j.1)
theorem contDiff_mooreDet (n : β„•) (k : β„•βˆžΟ‰) : ContDiff ℝ k (mooreDet n) := by
change ContDiff ℝ k (Complex.reCLM ∘ fun A : Matrix (Fin n) (Fin n) (Quaternion ℝ) ↦
pfaffian n (skewComplexify A))
apply (Complex.reCLM.contDiff : ContDiff ℝ k Complex.reCLM).comp
unfold pfaffian
apply contDiff_const.mul
apply ContDiff.sum
intro Οƒ _
apply contDiff_const.mul
apply contDiff_prod
intro i _
exact contDiff_skewComplexify_entry k (Οƒ (i, 0)) (Οƒ (i, 1))
theorem contDiff_mooreDifferential_left (n : β„•) (k : β„•βˆžΟ‰)
(D : Matrix (Fin n) (Fin n) (Quaternion ℝ)) :
ContDiff ℝ k (fun A ↦ mooreDifferential n A D) := by
change ContDiff ℝ k (Complex.reCLM ∘ fun A : Matrix (Fin n) (Fin n) (Quaternion ℝ) ↦
pfaffianDifferential n (skewComplexify A) (skewComplexify D))
apply (Complex.reCLM.contDiff : ContDiff ℝ k Complex.reCLM).comp
unfold pfaffianDifferential
apply contDiff_const.mul
apply ContDiff.sum
intro Οƒ _
apply contDiff_const.mul
apply ContDiff.sum
intro i _
apply ContDiff.mul _ contDiff_const
apply contDiff_prod
intro j _
exact contDiff_skewComplexify_entry k (Οƒ (j, 0)) (Οƒ (j, 1))
theorem quaternionDualVector_eq (L : Quaternion ℝ β†’β‚—[ℝ] ℝ) :
quaternionDualVector L = L 1 β€’ (1 : Quaternion ℝ) +
L ⟨0, 1, 0, 0⟩ β€’ (⟨0, 1, 0, 0⟩ : Quaternion ℝ) +
L ⟨0, 0, 1, 0⟩ β€’ (⟨0, 0, 1, 0⟩ : Quaternion ℝ) +
L ⟨0, 0, 0, 1⟩ β€’ (⟨0, 0, 0, 1⟩ : Quaternion ℝ) := by
ext <;> simp [quaternionDualVector]
theorem contDiff_rawCofactor (n : β„•) (k : β„•βˆžΟ‰) : ContDiff ℝ k (rawCofactor n) := by
apply contDiff_pi.mpr
intro i
apply contDiff_pi.mpr
intro j
simp only [rawCofactor, quaternionDualVector_eq]
apply quaternionStarCLM.contDiff.comp
change ContDiff ℝ k (fun A ↦
mooreDifferential n A (single j i 1) β€’ (1 : Quaternion ℝ) +
mooreDifferential n A (single j i ⟨0, 1, 0, 0⟩) β€’ (⟨0, 1, 0, 0⟩ : Quaternion ℝ) +
mooreDifferential n A (single j i ⟨0, 0, 1, 0⟩) β€’ (⟨0, 0, 1, 0⟩ : Quaternion ℝ) +
mooreDifferential n A (single j i ⟨0, 0, 0, 1⟩) β€’ (⟨0, 0, 0, 1⟩ : Quaternion ℝ))
exact (((contDiff_mooreDifferential_left n k _).smul contDiff_const).add
((contDiff_mooreDifferential_left n k _).smul contDiff_const) |>.add
((contDiff_mooreDifferential_left n k _).smul contDiff_const)).add
((contDiff_mooreDifferential_left n k _).smul contDiff_const)
theorem contDiff_mooreCofactor (n : β„•) (k : β„•βˆžΟ‰) : ContDiff ℝ k (mooreCofactor n) := by
apply contDiff_pi.mpr
intro i
apply contDiff_pi.mpr
intro j
change ContDiff ℝ k (fun A ↦ (1 / 2 : ℝ) β€’
(rawCofactor n A i j + star (rawCofactor n A j i)))
have h₁ := (contDiff_pi.mp (contDiff_pi.mp (contDiff_rawCofactor n k) i)) j
have hβ‚‚ := quaternionStarCLM.contDiff.comp
((contDiff_pi.mp (contDiff_pi.mp (contDiff_rawCofactor n k) j)) i)
exact (contDiff_const : ContDiff ℝ k (fun _ : Matrix (Fin n) (Fin n) (Quaternion ℝ) ↦
(1 / 2 : ℝ))).smul (h₁.add hβ‚‚)
end OAI.LinearAlgebra.Moore