Imports
/- Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Mathlib.LinearAlgebra.Eigenspace.Basic public import Mathlib.Analysis.InnerProductSpace.PiL2

The group SO(3)

@[expose] public section

The group of 3×3 real matrices with determinant 1 and A * Aᵀ = 1.

def SO3 : Type := {A : Matrix (Fin 3) (Fin 3) ℝ // A.det = 1 ∧ A * Aᵀ = 1}

The instance of a group on SO3.

All goals completed! 🐙⟩ one_mul A := Subtype.ext (Matrix.one_mul A.1) mul_one A := Subtype.ext (Matrix.mul_one A.1) inv A := ⟨A.1ᵀ, A:SO3⊢ (↑A)ᵀ.det = 1 All goals completed! 🐙, A:SO3⊢ (↑A)ᵀ * (↑A)ᵀᵀ = 1 All goals completed! 🐙⟩ inv_mul_cancel A := Subtype.ext (mul_eq_one_comm.mpr A.2.2)

Notation for the group SO3.

scoped[GroupTheory] notation (name := SO3_notation) "SO(3)" => SO3

SO3 has the subtype topology.

instance : TopologicalSpace SO3 := instTopologicalSpaceSubtype
lemma coe_inv (A : SO3) : (A⁻¹).1 = A.1⁻¹:= (inv_eq_left_inv (mul_eq_one_comm.mpr A.2.2)).symm

The inclusion of SO(3) into GL (Fin 3) ℝ.

def toGL : SO(3) →* GL (Fin 3) ℝ where toFun A := ⟨A.1, (A⁻¹).1, A.2.2, mul_eq_one_comm.mpr A.2.2⟩ map_one' := (GeneralLinearGroup.ext_iff _ 1).mpr fun _=> congrFun rfl map_mul' _ _ := (GeneralLinearGroup.ext_iff _ _).mpr fun _ => congrFun rfl
lemma subtype_val_eq_toGL : (Subtype.val : SO3 → Matrix (Fin 3) (Fin 3) ℝ) = Units.val ∘ toGL.toFun := rfl

The inclusion of SO(3) into GL(3,ℝ) is an injection.

lemma toGL_injective : Function.Injective toGL := ⊢ Function.Injective ⇑toGL A:SO(3)B:SO(3)h:toGL A = toGL B⊢ ↑A = ↑B rwa [A:SO(3)B:SO(3)h:↑(toGL A) = ↑(toGL B)⊢ ↑A = ↑BA:SO(3)B:SO(3)h:↑(toGL A) = ↑(toGL B)⊢ ↑A = ↑B at h

The inclusion of SO(3) into the monoid of matrices times the opposite of the monoid of matrices.

@[simps!] def toProd : SO(3) →* (Matrix (Fin 3) (Fin 3) ℝ) × (Matrix (Fin 3) (Fin 3) ℝ)ᵐᵒᵖ := MonoidHom.comp (Units.embedProduct _) toGL
lemma toProd_eq_transpose : toProd A = (A.1, ⟨A.1ᵀ⟩) := rflA:SO(3)B:SO(3)h:↑A = ↑B ∧ { unop' := (↑A)ᵀ } = { unop' := (↑B)ᵀ }⊢ A = B All goals completed! 🐙lemma toProd_continuous : Continuous toProd := continuous_prodMk.mpr ⟨continuous_iff_le_induced.mpr fun _ a ↦ a, Continuous.comp' (MulOpposite.continuous_op) (Continuous.matrix_transpose (continuous_iff_le_induced.mpr fun _ a ↦ a))⟩

The embedding of SO(3) into the monoid of matrices times the opposite of the monoid of matrices.

lemma toProd_embedding : IsEmbedding toProd where injective := toProd_injective eq_induced := (isInducing_iff ⇑toProd).mp (IsInducing.of_comp toProd_continuous continuous_fst ((isInducing_iff (Prod.fst ∘ ⇑toProd)).mpr rfl))

The embedding of SO(3) into GL (Fin 3) ℝ.

set_option backward.isDefEq.respectTransparency false ins:Set { A // A.det = 1 ∧ A * Aᵀ = 1 }U:Set (GL (Fin 3) ℝ)hU1:∃ t, IsOpen t ∧ ⇑(Units.embedProduct (Matrix (Fin 3) (Fin 3) ℝ)) ⁻¹' t = UhU2:(↑toGL).toFun ⁻¹' U = s⊢ ∃ t, IsOpen t ∧ ⇑toProd ⁻¹' t = s All goals completed! 🐙 s:Set { A // A.det = 1 ∧ A * Aᵀ = 1 }U:Set (Matrix (Fin 3) (Fin 3) ℝ × (Matrix (Fin 3) (Fin 3) ℝ)ᵐᵒᵖ)hU1:IsOpen UhU2:⇑toProd ⁻¹' U = s⊢ ∃ t, IsOpen t ∧ (↑toGL).toFun ⁻¹' t = s All goals completed! 🐙

The instance of a topological group on SO(3), defined through the embedding of SO(3) into GL(n).

instance : IsTopologicalGroup SO(3) := IsInducing.topologicalGroup toGL toGL_embedding.toIsInducing

The determinant of an SO(3) matrix minus the identity is equal to zero.

A:SO(3)h1:(↑A - 1).det = -(↑A - 1).det⊢ (↑A - 1).det = 0 All goals completed! 🐙

The determinant of the identity minus an SO(3) matrix is zero.

A:SO(3)h1:(1 - ↑A).det = -(↑A - 1).det⊢ -0 = 0 All goals completed! 🐙

For every matrix in SO(3), the real number 1 is in its spectrum.

@[simp] lemma one_in_spectrum (A : SO(3)) : 1 ∈ spectrum ℝ (A.1) := A:SO(3)⊢ 1 ∈ spectrum ℝ ↑A All goals completed! 🐙

The endomorphism of EuclideanSpace ℝ (Fin 3) associated to a element of SO(3).

@[simps!] def toEnd (A : SO(3)) : End ℝ (EuclideanSpace ℝ (Fin 3)) := Matrix.toLin (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis A.1

Every SO(3) matrix has an eigenvalue equal to 1.

A:SO(3)⊢ 1 ∈ spectrum ℝ A.toEnd erw [A:SO(3)⊢ 1 ∈ spectrum ℝ ↑AA:SO(3)⊢ 1 ∈ spectrum ℝ ↑A All goals completed! 🐙

For every element of SO(3) there exists a vector which remains unchanged under the action of that SO(3) element.

A:SO(3)v:EuclideanSpace ℝ (Fin 3)hv:A.toEnd.HasEigenvector 1 vhvn:‖v‖ ≠ 0v1:↑{0}⊢ ‖v‖⁻¹ * ((starRingEnd ℝ) ‖v‖⁻¹ * ‖v‖ ^ 2) = if v1 = v1 then 1 else 0 A:SO(3)v:EuclideanSpace ℝ (Fin 3)hv:A.toEnd.HasEigenvector 1 vhvn:‖v‖ ≠ 0v1:↑{0}⊢ ‖v‖⁻¹ * (‖v‖⁻¹ * ‖v‖ ^ 2) = 1 All goals completed! 🐙 A:SO(3)v:EuclideanSpace ℝ (Fin 3)hv:A.toEnd.HasEigenvector 1 vhvn:‖v‖ ≠ 0⊢ A.toEnd ((1 / ‖v‖) • v) = (1 / ‖v‖) • v All goals completed! 🐙

For every element of SO(3) there exists a basis indexed by Fin 3 under which the first element remains invariant.

A:SO(3)v:EuclideanSpace ℝ (Fin 3)hv:Orthonormal ℝ ({0}.restrict fun x => v) ∧ A.toEnd v = vb:OrthonormalBasis (Fin 3) ℝ (EuclideanSpace ℝ (Fin 3))hb:∀ i ∈ {0}, b i = v⊢ ∃ b, A.toEnd (b 0) = b 0 All goals completed! 🐙