Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2020 Anne Baanen. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Anne Baanen | |
-/ | |
import linear_algebra.matrix.adjugate | |
import linear_algebra.matrix.to_lin | |
/-! | |
# The Special Linear group $SL(n, R)$ | |
This file defines the elements of the Special Linear group `special_linear_group n R`, consisting | |
of all square `R`-matrices with determinant `1` on the fintype `n` by `n`. In addition, we define | |
the group structure on `special_linear_group n R` and the embedding into the general linear group | |
`general_linear_group R (n β R)`. | |
## Main definitions | |
* `matrix.special_linear_group` is the type of matrices with determinant 1 | |
* `matrix.special_linear_group.group` gives the group structure (under multiplication) | |
* `matrix.special_linear_group.to_GL` is the embedding `SLβ(R) β GLβ(R)` | |
## Notation | |
For `m : β`, we introduce the notation `SL(m,R)` for the special linear group on the fintype | |
`n = fin m`, in the locale `matrix_groups`. | |
## Implementation notes | |
The inverse operation in the `special_linear_group` is defined to be the adjugate | |
matrix, so that `special_linear_group n R` has a group structure for all `comm_ring R`. | |
We define the elements of `special_linear_group` to be matrices, since we need to | |
compute their determinant. This is in contrast with `general_linear_group R M`, | |
which consists of invertible `R`-linear maps on `M`. | |
We provide `matrix.special_linear_group.has_coe_to_fun` for convenience, but do not state any | |
lemmas about it, and use `matrix.special_linear_group.coe_fn_eq_coe` to eliminate it `β` in favor | |
of a regular `β` coercion. | |
## References | |
* https://en.wikipedia.org/wiki/Special_linear_group | |
## Tags | |
matrix group, group, matrix inverse | |
-/ | |
namespace matrix | |
universes u v | |
open_locale matrix | |
open linear_map | |
section | |
variables (n : Type u) [decidable_eq n] [fintype n] (R : Type v) [comm_ring R] | |
/-- `special_linear_group n R` is the group of `n` by `n` `R`-matrices with determinant equal to 1. | |
-/ | |
def special_linear_group := { A : matrix n n R // A.det = 1 } | |
end | |
localized "notation `SL(` n `,` R `)`:= matrix.special_linear_group (fin n) R" in matrix_groups | |
namespace special_linear_group | |
variables {n : Type u} [decidable_eq n] [fintype n] {R : Type v} [comm_ring R] | |
instance has_coe_to_matrix : has_coe (special_linear_group n R) (matrix n n R) := | |
β¨Ξ» A, A.valβ© | |
/- In this file, Lean often has a hard time working out the values of `n` and `R` for an expression | |
like `det βA`. Rather than writing `(A : matrix n n R)` everywhere in this file which is annoyingly | |
verbose, or `A.val` which is not the simp-normal form for subtypes, we create a local notation | |
`ββA`. This notation references the local `n` and `R` variables, so is not valid as a global | |
notation. -/ | |
local prefix `ββ`:1024 := @coe _ (matrix n n R) _ | |
lemma ext_iff (A B : special_linear_group n R) : A = B β (β i j, ββA i j = ββB i j) := | |
subtype.ext_iff.trans matrix.ext_iff.symm | |
@[ext] lemma ext (A B : special_linear_group n R) : (β i j, ββA i j = ββB i j) β A = B := | |
(special_linear_group.ext_iff A B).mpr | |
instance has_inv : has_inv (special_linear_group n R) := | |
β¨Ξ» A, β¨adjugate A, by rw [det_adjugate, A.prop, one_pow]β©β© | |
instance has_mul : has_mul (special_linear_group n R) := | |
β¨Ξ» A B, β¨A.1 β¬ B.1, by erw [det_mul, A.2, B.2, one_mul]β©β© | |
instance has_one : has_one (special_linear_group n R) := | |
β¨β¨1, det_oneβ©β© | |
instance : has_pow (special_linear_group n R) β := | |
{ pow := Ξ» x n, β¨x ^ n, (det_pow _ _).trans $ x.prop.symm βΈ one_pow _β©} | |
instance : inhabited (special_linear_group n R) := β¨1β© | |
section coe_lemmas | |
variables (A B : special_linear_group n R) | |
@[simp] lemma coe_mk (A : matrix n n R) (h : det A = 1) : | |
β(β¨A, hβ© : special_linear_group n R) = A := | |
rfl | |
@[simp] lemma coe_inv : ββ(Aβ»ΒΉ) = adjugate A := rfl | |
@[simp] lemma coe_mul : ββ(A * B) = ββA β¬ ββB := rfl | |
@[simp] lemma coe_one : ββ(1 : special_linear_group n R) = (1 : matrix n n R) := rfl | |
@[simp] lemma det_coe : det ββA = 1 := A.2 | |
@[simp] lemma coe_pow (m : β) : ββ(A ^ m) = ββA ^ m := rfl | |
lemma det_ne_zero [nontrivial R] (g : special_linear_group n R) : | |
det ββg β 0 := | |
by { rw g.det_coe, norm_num } | |
lemma row_ne_zero [nontrivial R] (g : special_linear_group n R) (i : n): | |
ββg i β 0 := | |
Ξ» h, g.det_ne_zero $ det_eq_zero_of_row_eq_zero i $ by simp [h] | |
end coe_lemmas | |
instance : monoid (special_linear_group n R) := | |
function.injective.monoid coe subtype.coe_injective coe_one coe_mul coe_pow | |
instance : group (special_linear_group n R) := | |
{ mul_left_inv := Ξ» A, by { ext1, simp [adjugate_mul] }, | |
..special_linear_group.monoid, | |
..special_linear_group.has_inv } | |
/-- A version of `matrix.to_lin' A` that produces linear equivalences. -/ | |
def to_lin' : special_linear_group n R β* (n β R) ββ[R] (n β R) := | |
{ to_fun := Ξ» A, linear_equiv.of_linear (matrix.to_lin' ββA) (matrix.to_lin' ββ(Aβ»ΒΉ)) | |
(by rw [βto_lin'_mul, βcoe_mul, mul_right_inv, coe_one, to_lin'_one]) | |
(by rw [βto_lin'_mul, βcoe_mul, mul_left_inv, coe_one, to_lin'_one]), | |
map_one' := linear_equiv.to_linear_map_injective matrix.to_lin'_one, | |
map_mul' := Ξ» A B, linear_equiv.to_linear_map_injective $ matrix.to_lin'_mul A B } | |
lemma to_lin'_apply (A : special_linear_group n R) (v : n β R) : | |
special_linear_group.to_lin' A v = matrix.to_lin' ββA v := rfl | |
lemma to_lin'_to_linear_map (A : special_linear_group n R) : | |
β(special_linear_group.to_lin' A) = matrix.to_lin' ββA := rfl | |
lemma to_lin'_symm_apply (A : special_linear_group n R) (v : n β R) : | |
A.to_lin'.symm v = matrix.to_lin' ββ(Aβ»ΒΉ) v := rfl | |
lemma to_lin'_symm_to_linear_map (A : special_linear_group n R) : | |
β(A.to_lin'.symm) = matrix.to_lin' ββ(Aβ»ΒΉ) := rfl | |
lemma to_lin'_injective : | |
function.injective β(to_lin' : special_linear_group n R β* (n β R) ββ[R] (n β R)) := | |
Ξ» A B h, subtype.coe_injective $ matrix.to_lin'.injective $ | |
linear_equiv.to_linear_map_injective.eq_iff.mpr h | |
/-- `to_GL` is the map from the special linear group to the general linear group -/ | |
def to_GL : special_linear_group n R β* general_linear_group R (n β R) := | |
(general_linear_group.general_linear_equiv _ _).symm.to_monoid_hom.comp to_lin' | |
lemma coe_to_GL (A : special_linear_group n R) : βA.to_GL = A.to_lin'.to_linear_map := rfl | |
variables {S : Type*} [comm_ring S] | |
/-- A ring homomorphism from `R` to `S` induces a group homomorphism from | |
`special_linear_group n R` to `special_linear_group n S`. -/ | |
@[simps] def map (f : R β+* S) : special_linear_group n R β* special_linear_group n S := | |
{ to_fun := Ξ» g, β¨f.map_matrix βg, by { rw β f.map_det, simp [g.2] }β©, | |
map_one' := subtype.ext $ f.map_matrix.map_one, | |
map_mul' := Ξ» x y, subtype.ext $ f.map_matrix.map_mul x y } | |
section cast | |
/-- Coercion of SL `n` `β€` to SL `n` `R` for a commutative ring `R`. -/ | |
instance : has_coe (special_linear_group n β€) (special_linear_group n R) := | |
β¨Ξ» x, map (int.cast_ring_hom R) xβ© | |
@[simp] lemma coe_matrix_coe (g : special_linear_group n β€) : | |
β(g : special_linear_group n R) | |
= (βg : matrix n n β€).map (int.cast_ring_hom R) := | |
map_apply_coe (int.cast_ring_hom R) g | |
end cast | |
section has_neg | |
variables [fact (even (fintype.card n))] | |
/-- Formal operation of negation on special linear group on even cardinality `n` given by negating | |
each element. -/ | |
instance : has_neg (special_linear_group n R) := | |
β¨Ξ» g, | |
β¨- g, by simpa [(fact.out $ even $ fintype.card n).neg_one_pow, g.det_coe] using | |
det_smul ββg (-1)β©β© | |
@[simp] lemma coe_neg (g : special_linear_group n R) : β(- g) = - (g : matrix n n R) := rfl | |
instance : has_distrib_neg (special_linear_group n R) := | |
function.injective.has_distrib_neg _ subtype.coe_injective coe_neg coe_mul | |
@[simp] lemma coe_int_neg (g : special_linear_group n β€) : | |
β(-g) = (-βg : special_linear_group n R) := | |
subtype.ext $ (@ring_hom.map_matrix n _ _ _ _ _ _ (int.cast_ring_hom R)).map_neg βg | |
end has_neg | |
-- this section should be last to ensure we do not use it in lemmas | |
section coe_fn_instance | |
/-- This instance is here for convenience, but is not the simp-normal form. -/ | |
instance : has_coe_to_fun (special_linear_group n R) (Ξ» _, n β n β R) := | |
{ coe := Ξ» A, A.val } | |
@[simp] | |
lemma coe_fn_eq_coe (s : special_linear_group n R) : βs = ββs := rfl | |
end coe_fn_instance | |
end special_linear_group | |
end matrix | |