File: Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean

full_name: Matrix._aux_Mathlib_LinearAlgebra_Matrix_Determinant_Basic___macroRules_Matrix_termε__1
code: local notation "ε " σ:arg => ((sign σ : ℤ) : R)
goal: Lean.Macro

full_name: Matrix.detRowAlternating
code: /-- `det` is an `AlternatingMap` in the rows of the matrix. -/
def detRowAlternating : (n → R) [⋀^n]→ₗ[R] R 
goal: (n → R) [⋀^n]→ₗ[R] R

full_name: Matrix.det
code: /-- The determinant of a matrix given by the Leibniz formula. -/
abbrev det (M : Matrix n n R) : R 
goal: R

full_name: Matrix.det_apply
code: theorem det_apply (M : Matrix n n R) : M.det = ∑ σ : Perm n, Equiv.Perm.sign σ • ∏ i, M (σ i) i 
goal: M.det = ∑ σ : Equiv.Perm n, Equiv.Perm.sign σ • ∏ i : n, M (σ i) i

full_name: Matrix.det_apply'
code: theorem det_apply' (M : Matrix n n R) : M.det = ∑ σ : Perm n, ε σ * ∏ i, M (σ i) i 
goal: M.det = ∑ σ : Equiv.Perm n, ↑↑(Equiv.Perm.sign σ) * ∏ i : n, M (σ i) i

full_name: Matrix.det_diagonal
code: @[simp]
theorem det_diagonal {d : n → R} : det (diagonal d) = ∏ i, d i 
goal: (Matrix.diagonal d).det = ∏ i : n, d i

full_name: Matrix.det_zero
code: theorem det_zero (_ : Nonempty n) : det (0 : Matrix n n R) = 0 
goal: Nonempty n → Matrix.det 0 = 0

full_name: Matrix.det_one
code: @[simp]
theorem det_one : det (1 : Matrix n n R) = 1 
goal: Matrix.det 1 = 1

full_name: Matrix.det_isEmpty
code: theorem det_isEmpty [IsEmpty n] {A : Matrix n n R} : det A = 1 
goal: A.det = 1

full_name: Matrix.coe_det_isEmpty
code: @[simp]
theorem coe_det_isEmpty [IsEmpty n] : (det : Matrix n n R → R) = Function.const _ 1 
goal: Matrix.det = Function.const (Matrix n n R) 1

full_name: Matrix.det_eq_one_of_card_eq_zero
code: theorem det_eq_one_of_card_eq_zero {A : Matrix n n R} (h : Fintype.card n = 0) : det A = 1 
goal: A.det = 1

full_name: Matrix.det_unique
code: /-- If `n` has only one element, the determinant of an `n` by `n` matrix is just that element.
Although `Unique` implies `DecidableEq` and `Fintype`, the instances might
not be syntactically equal. Thus, we need to fill in the args explicitly. -/
@[simp]
theorem det_unique {n : Type*} [Unique n] [DecidableEq n] [Fintype n] (A : Matrix n n R) :
    det A = A default default 
goal: A.det = A default default

full_name: Matrix.det_eq_elem_of_subsingleton
code: theorem det_eq_elem_of_subsingleton [Subsingleton n] (A : Matrix n n R) (k : n) :
    det A = A k k 
goal: A.det = A k k

full_name: Matrix.det_eq_elem_of_card_eq_one
code: theorem det_eq_elem_of_card_eq_one {A : Matrix n n R} (h : Fintype.card n = 1) (k : n) :
    det A = A k k 
goal: A.det = A k k

full_name: Matrix.det_mul_aux
code: theorem det_mul_aux {M N : Matrix n n R} {p : n → n} (H : ¬Bijective p) :
    (∑ σ : Perm n, ε σ * ∏ x, M (σ x) (p x) * N (p x) x) = 0 
goal: ∑ σ : Equiv.Perm n, ↑↑(Equiv.Perm.sign σ) * ∏ x : n, M (σ x) (p x) * N (p x) x = 0

full_name: Matrix.det_mul
code: @[simp]
theorem det_mul (M N : Matrix n n R) : det (M * N) = det M * det N 
goal: (M * N).det = M.det * N.det

full_name: Matrix.detMonoidHom
code: /-- The determinant of a matrix, as a monoid homomorphism. -/
def detMonoidHom : Matrix n n R →* R 
goal: Matrix n n R →* R

full_name: Matrix.coe_detMonoidHom
code: @[simp]
theorem coe_detMonoidHom : (detMonoidHom : Matrix n n R → R) = det 
goal: ⇑Matrix.detMonoidHom = Matrix.det

full_name: Matrix.det_mul_comm
code: /-- On square matrices, `mul_comm` applies under `det`. -/
theorem det_mul_comm (M N : Matrix m m R) : det (M * N) = det (N * M) 
goal: (M * N).det = (N * M).det

full_name: Matrix.det_mul_left_comm
code: /-- On square matrices, `mul_left_comm` applies under `det`. -/
theorem det_mul_left_comm (M N P : Matrix m m R) : det (M * (N * P)) = det (N * (M * P)) 
goal: (M * (N * P)).det = (N * (M * P)).det

full_name: Matrix.det_mul_right_comm
code: /-- On square matrices, `mul_right_comm` applies under `det`. -/
theorem det_mul_right_comm (M N P : Matrix m m R) : det (M * N * P) = det (M * P * N) 
goal: (M * N * P).det = (M * P * N).det

full_name: Matrix.det_units_conj
code: theorem det_units_conj (M : (Matrix m m R)ˣ) (N : Matrix m m R) :
    det ((M : Matrix _ _ _) * N * (↑M⁻¹ : Matrix _ _ _)) = det N 
goal: (↑M * N * ↑M⁻¹).det = N.det

full_name: Matrix.det_units_conj'
code: theorem det_units_conj' (M : (Matrix m m R)ˣ) (N : Matrix m m R) :
    det ((↑M⁻¹ : Matrix _ _ _) * N * (↑M : Matrix _ _ _)) = det N 
goal: (↑M⁻¹ * N * ↑M).det = N.det

full_name: Matrix.det_transpose
code: /-- Transposing a matrix preserves the determinant. -/
@[simp]
theorem det_transpose (M : Matrix n n R) : Mᵀ.det = M.det 
goal: M.transpose.det = M.det

full_name: Matrix.det_permute
code: /-- Permuting the columns changes the sign of the determinant. -/
theorem det_permute (σ : Perm n) (M : Matrix n n R) :
    (M.submatrix σ id).det = Perm.sign σ * M.det 
goal: (M.submatrix (⇑σ) id).det = ↑↑(Equiv.Perm.sign σ) * M.det

full_name: Matrix.det_permute'
code: /-- Permuting the rows changes the sign of the determinant. -/
theorem det_permute' (σ : Perm n) (M : Matrix n n R) :
    (M.submatrix id σ).det = Perm.sign σ * M.det 
goal: (M.submatrix id ⇑σ).det = ↑↑(Equiv.Perm.sign σ) * M.det

full_name: Matrix.det_submatrix_equiv_self
code: /-- Permuting rows and columns with the same equivalence has no effect. -/
@[simp]
theorem det_submatrix_equiv_self (e : n ≃ m) (A : Matrix m m R) :
    det (A.submatrix e e) = det A 
goal: (A.submatrix ⇑e ⇑e).det = A.det

full_name: Matrix.det_reindex_self
code: /-- Reindexing both indices along the same equivalence preserves the determinant.

For the `simp` version of this lemma, see `det_submatrix_equiv_self`; this one is unsuitable because
`Matrix.reindex_apply` unfolds `reindex` first.
-/
theorem det_reindex_self (e : m ≃ n) (A : Matrix m m R) : det (reindex e e A) = det A 
goal: ((Matrix.reindex e e) A).det = A.det

full_name: Matrix.det_smul
code: theorem det_smul (A : Matrix n n R) (c : R) : det (c • A) = c ^ Fintype.card n * det A 
goal: (c • A).det = c ^ Fintype.card n * A.det

full_name: Matrix.det_smul_of_tower
code: @[simp]
theorem det_smul_of_tower {α} [Monoid α] [DistribMulAction α R] [IsScalarTower α R R]
    [SMulCommClass α R R] (c : α) (A : Matrix n n R) :
    det (c • A) = c ^ Fintype.card n • det A 
goal: (c • A).det = c ^ Fintype.card n • A.det

full_name: Matrix.det_neg
code: theorem det_neg (A : Matrix n n R) : det (-A) = (-1) ^ Fintype.card n * det A 
goal: (-A).det = (-1) ^ Fintype.card n * A.det

full_name: Matrix.det_neg_eq_smul
code: /-- A variant of `Matrix.det_neg` with scalar multiplication by `Units ℤ` instead of multiplication
by `R`. -/
theorem det_neg_eq_smul (A : Matrix n n R) :
    det (-A) = (-1 : Units ℤ) ^ Fintype.card n • det A 
goal: (-A).det = (-1) ^ Fintype.card n • A.det

full_name: Matrix.det_mul_row
code: /-- Multiplying each row by a fixed `v i` multiplies the determinant by
the product of the `v`s. -/
theorem det_mul_row (v : n → R) (A : Matrix n n R) :
    det (of fun i j => v j * A i j) = (∏ i, v i) * det A 
goal: (Matrix.of fun i j => v j * A i j).det = (∏ i : n, v i) * A.det

full_name: Matrix.det_mul_column
code: /-- Multiplying each column by a fixed `v j` multiplies the determinant by
the product of the `v`s. -/
theorem det_mul_column (v : n → R) (A : Matrix n n R) :
    det (of fun i j => v i * A i j) = (∏ i, v i) * det A 
goal: (Matrix.of fun i j => v i * A i j).det = (∏ i : n, v i) * A.det

full_name: Matrix.det_pow
code: @[simp]
theorem det_pow (M : Matrix m m R) (n : ℕ) : det (M ^ n) = det M ^ n 
goal: (M ^ n).det = M.det ^ n

full_name: RingHom.map_det
code: theorem _root_.RingHom.map_det (f : R →+* S) (M : Matrix n n R) :
    f M.det = Matrix.det (f.mapMatrix M) 
goal: f M.det = (f.mapMatrix M).det

full_name: RingEquiv.map_det
code: theorem _root_.RingEquiv.map_det (f : R ≃+* S) (M : Matrix n n R) :
    f M.det = Matrix.det (f.mapMatrix M) 
goal: f M.det = (f.mapMatrix M).det

full_name: AlgHom.map_det
code: theorem _root_.AlgHom.map_det [Algebra R S] {T : Type z} [CommRing T] [Algebra R T] (f : S →ₐ[R] T)
    (M : Matrix n n S) : f M.det = Matrix.det (f.mapMatrix M) 
goal: f M.det = (f.mapMatrix M).det

full_name: AlgEquiv.map_det
code: theorem _root_.AlgEquiv.map_det [Algebra R S] {T : Type z} [CommRing T] [Algebra R T]
    (f : S ≃ₐ[R] T) (M : Matrix n n S) : f M.det = Matrix.det (f.mapMatrix M) 
goal: f M.det = (f.mapMatrix M).det

full_name: Matrix.det_conjTranspose
code: @[simp]
theorem det_conjTranspose [StarRing R] (M : Matrix m m R) : det Mᴴ = star (det M) 
goal: M.conjTranspose.det = star M.det

full_name: Matrix.det_eq_zero_of_row_eq_zero
code: theorem det_eq_zero_of_row_eq_zero {A : Matrix n n R} (i : n) (h : ∀ j, A i j = 0) : det A = 0 
goal: A.det = 0

full_name: Matrix.det_eq_zero_of_column_eq_zero
code: theorem det_eq_zero_of_column_eq_zero {A : Matrix n n R} (j : n) (h : ∀ i, A i j = 0) :
    det A = 0 
goal: A.det = 0

full_name: Matrix.det_zero_of_row_eq
code: /-- If a matrix has a repeated row, the determinant will be zero. -/
theorem det_zero_of_row_eq (i_ne_j : i ≠ j) (hij : M i = M j) : M.det = 0 
goal: M.det = 0

full_name: Matrix.det_zero_of_column_eq
code: /-- If a matrix has a repeated column, the determinant will be zero. -/
theorem det_zero_of_column_eq (i_ne_j : i ≠ j) (hij : ∀ k, M k i = M k j) : M.det = 0 
goal: M.det = 0

full_name: Matrix.det_updateRow_eq_zero
code: /-- If we repeat a row of a matrix, we get a matrix of determinant zero. -/
theorem det_updateRow_eq_zero (h : i ≠ j) :
    (M.updateRow j (M i)).det = 0 
goal: (M.updateRow j (M i)).det = 0

full_name: Matrix.det_updateColumn_eq_zero
code: /-- If we repeat a column of a matrix, we get a matrix of determinant zero. -/
theorem det_updateColumn_eq_zero (h : i ≠ j) :
    (M.updateColumn j (fun k ↦ M k i)).det = 0 
goal: (M.updateColumn j fun k => M k i).det = 0

full_name: Matrix.det_updateRow_add
code: theorem det_updateRow_add (M : Matrix n n R) (j : n) (u v : n → R) :
    det (updateRow M j <| u + v) = det (updateRow M j u) + det (updateRow M j v) 
goal: (M.updateRow j (u + v)).det = (M.updateRow j u).det + (M.updateRow j v).det

full_name: Matrix.det_updateColumn_add
code: theorem det_updateColumn_add (M : Matrix n n R) (j : n) (u v : n → R) :
    det (updateColumn M j <| u + v) = det (updateColumn M j u) + det (updateColumn M j v) 
goal: (M.updateColumn j (u + v)).det = (M.updateColumn j u).det + (M.updateColumn j v).det

full_name: Matrix.det_updateRow_smul
code: theorem det_updateRow_smul (M : Matrix n n R) (j : n) (s : R) (u : n → R) :
    det (updateRow M j <| s • u) = s * det (updateRow M j u) 
goal: (M.updateRow j (s • u)).det = s * (M.updateRow j u).det

full_name: Matrix.det_updateColumn_smul
code: theorem det_updateColumn_smul (M : Matrix n n R) (j : n) (s : R) (u : n → R) :
    det (updateColumn M j <| s • u) = s * det (updateColumn M j u) 
goal: (M.updateColumn j (s • u)).det = s * (M.updateColumn j u).det

full_name: Matrix.det_updateRow_smul'
code: theorem det_updateRow_smul' (M : Matrix n n R) (j : n) (s : R) (u : n → R) :
    det (updateRow (s • M) j u) = s ^ (Fintype.card n - 1) * det (updateRow M j u) 
goal: ((s • M).updateRow j u).det = s ^ (Fintype.card n - 1) * (M.updateRow j u).det

full_name: Matrix.det_updateColumn_smul'
code: theorem det_updateColumn_smul' (M : Matrix n n R) (j : n) (s : R) (u : n → R) :
    det (updateColumn (s • M) j u) = s ^ (Fintype.card n - 1) * det (updateColumn M j u) 
goal: ((s • M).updateColumn j u).det = s ^ (Fintype.card n - 1) * (M.updateColumn j u).det

full_name: Matrix.det_updateRow_sum_aux
code: theorem det_updateRow_sum_aux (M : Matrix n n R) {j : n} (s : Finset n) (hj : j ∉ s) (c : n → R)
    (a : R) :
    (M.updateRow j (a • M j + ∑ k ∈ s, (c k) • M k)).det = a • M.det 
goal: (M.updateRow j (a • M j + ∑ k ∈ s, c k • M k)).det = a • M.det

full_name: Matrix.det_updateRow_sum
code: /-- If we replace a row of a matrix by a linear combination of its rows, then the determinant is
multiplied by the coefficient of that row. -/
theorem det_updateRow_sum (A : Matrix n n R) (j : n) (c : n → R) :
    (A.updateRow j (∑ k, (c k) • A k)).det = (c j) • A.det 
goal: (A.updateRow j (∑ k : n, c k • A k)).det = c j • A.det

full_name: Matrix.det_updateColumn_sum
code: /-- If we replace a column of a matrix by a linear combination of its columns, then the determinant
is multiplied by the coefficient of that column. -/
theorem det_updateColumn_sum (A : Matrix n n R) (j : n) (c : n → R) :
    (A.updateColumn j (fun k ↦ ∑ i, (c i) • A k i)).det = (c j) • A.det 
goal: (A.updateColumn j fun k => ∑ i : n, c i • A k i).det = c j • A.det

full_name: Matrix.det_eq_of_eq_mul_det_one
code: theorem det_eq_of_eq_mul_det_one {A B : Matrix n n R} (C : Matrix n n R) (hC : det C = 1)
    (hA : A = B * C) : det A = det B 
goal: A.det = B.det

full_name: Matrix.det_eq_of_eq_det_one_mul
code: theorem det_eq_of_eq_det_one_mul {A B : Matrix n n R} (C : Matrix n n R) (hC : det C = 1)
    (hA : A = C * B) : det A = det B 
goal: A.det = B.det

full_name: Matrix.det_updateRow_add_self
code: theorem det_updateRow_add_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) :
    det (updateRow A i (A i + A j)) = det A 
goal: (A.updateRow i (A i + A j)).det = A.det

full_name: Matrix.det_updateColumn_add_self
code: theorem det_updateColumn_add_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) :
    det (updateColumn A i fun k => A k i + A k j) = det A 
goal: (A.updateColumn i fun k => A k i + A k j).det = A.det

full_name: Matrix.det_updateRow_add_smul_self
code: theorem det_updateRow_add_smul_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) (c : R) :
    det (updateRow A i (A i + c • A j)) = det A 
goal: (A.updateRow i (A i + c • A j)).det = A.det

full_name: Matrix.det_updateColumn_add_smul_self
code: theorem det_updateColumn_add_smul_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) (c : R) :
    det (updateColumn A i fun k => A k i + c • A k j) = det A 
goal: (A.updateColumn i fun k => A k i + c • A k j).det = A.det

full_name: Matrix.det_eq_of_forall_row_eq_smul_add_const_aux
code: theorem det_eq_of_forall_row_eq_smul_add_const_aux {A B : Matrix n n R} {s : Finset n} :
    ∀ (c : n → R) (_ : ∀ i, i ∉ s → c i = 0) (k : n) (_ : k ∉ s)
      (_ : ∀ i j, A i j = B i j + c i * B k j), det A = det B 
goal: (∀ i ∉ s, c i = 0) → ∀ k ∉ s, (∀ (i j : n), A i j = B i j + c i * B k j) → A.det = B.det

full_name: Matrix.det_eq_of_forall_row_eq_smul_add_const
code: /-- If you add multiples of row `B k` to other rows, the determinant doesn't change. -/
theorem det_eq_of_forall_row_eq_smul_add_const {A B : Matrix n n R} (c : n → R) (k : n)
    (hk : c k = 0) (A_eq : ∀ i j, A i j = B i j + c i * B k j) : det A = det B 
goal: A.det = B.det

full_name: Matrix.det_eq_of_forall_row_eq_smul_add_pred_aux
code: theorem det_eq_of_forall_row_eq_smul_add_pred_aux {n : ℕ} (k : Fin (n + 1)) :
    ∀ (c : Fin n → R) (_hc : ∀ i : Fin n, k < i.succ → c i = 0)
      {M N : Matrix (Fin n.succ) (Fin n.succ) R} (_h0 : ∀ j, M 0 j = N 0 j)
      (_hsucc : ∀ (i : Fin n) (j), M i.succ j = N i.succ j + c i * M (Fin.castSucc i) j),
      det M = det N 
goal: M.det = N.det

full_name: Matrix.det_eq_of_forall_row_eq_smul_add_pred
code: /-- If you add multiples of previous rows to the next row, the determinant doesn't change. -/
theorem det_eq_of_forall_row_eq_smul_add_pred {n : ℕ} {A B : Matrix (Fin (n + 1)) (Fin (n + 1)) R}
    (c : Fin n → R) (A_zero : ∀ j, A 0 j = B 0 j)
    (A_succ : ∀ (i : Fin n) (j), A i.succ j = B i.succ j + c i * A (Fin.castSucc i) j) :
    det A = det B 
goal: A.det = B.det

full_name: Matrix.det_eq_of_forall_col_eq_smul_add_pred
code: /-- If you add multiples of previous columns to the next columns, the determinant doesn't change. -/
theorem det_eq_of_forall_col_eq_smul_add_pred {n : ℕ} {A B : Matrix (Fin (n + 1)) (Fin (n + 1)) R}
    (c : Fin n → R) (A_zero : ∀ i, A i 0 = B i 0)
    (A_succ : ∀ (i) (j : Fin n), A i j.succ = B i j.succ + c j * A i (Fin.castSucc j)) :
    det A = det B 
goal: A.det = B.det

full_name: Matrix.det_blockDiagonal
code: @[simp]
theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Matrix n n R) :
    (blockDiagonal M).det = ∏ k, (M k).det 
goal: (Matrix.blockDiagonal M).det = ∏ k : o, (M k).det

full_name: Matrix.det_fromBlocks_zero₂₁
code: /-- The determinant of a 2×2 block matrix with the lower-left block equal to zero is the product of
the determinants of the diagonal blocks. For the generalization to any number of blocks, see
`Matrix.det_of_upper_triangular`. -/
@[simp]
theorem det_fromBlocks_zero₂₁ (A : Matrix m m R) (B : Matrix m n R) (D : Matrix n n R) :
    (Matrix.fromBlocks A B 0 D).det = A.det * D.det 
goal: (Matrix.fromBlocks A B 0 D).det = A.det * D.det

full_name: Matrix.det_fromBlocks_zero₁₂
code: /-- The determinant of a 2×2 block matrix with the upper-right block equal to zero is the product of
the determinants of the diagonal blocks. For the generalization to any number of blocks, see
`Matrix.det_of_lower_triangular`. -/
@[simp]
theorem det_fromBlocks_zero₁₂ (A : Matrix m m R) (C : Matrix n m R) (D : Matrix n n R) :
    (Matrix.fromBlocks A 0 C D).det = A.det * D.det 
goal: (Matrix.fromBlocks A 0 C D).det = A.det * D.det

full_name: Matrix.det_succ_column_zero
code: /-- Laplacian expansion of the determinant of an `n+1 × n+1` matrix along column 0. -/
theorem det_succ_column_zero {n : ℕ} (A : Matrix (Fin n.succ) (Fin n.succ) R) :
    det A = ∑ i : Fin n.succ, (-1) ^ (i : ℕ) * A i 0 * det (A.submatrix i.succAbove Fin.succ) 
goal: A.det = ∑ i : Fin n.succ, (-1) ^ ↑i * A i 0 * (A.submatrix i.succAbove Fin.succ).det

full_name: Matrix.det_succ_row_zero
code: /-- Laplacian expansion of the determinant of an `n+1 × n+1` matrix along row 0. -/
theorem det_succ_row_zero {n : ℕ} (A : Matrix (Fin n.succ) (Fin n.succ) R) :
    det A = ∑ j : Fin n.succ, (-1) ^ (j : ℕ) * A 0 j * det (A.submatrix Fin.succ j.succAbove) 
goal: A.det = ∑ j : Fin n.succ, (-1) ^ ↑j * A 0 j * (A.submatrix Fin.succ j.succAbove).det

full_name: Matrix.det_succ_row
code: /-- Laplacian expansion of the determinant of an `n+1 × n+1` matrix along row `i`. -/
theorem det_succ_row {n : ℕ} (A : Matrix (Fin n.succ) (Fin n.succ) R) (i : Fin n.succ) :
    det A =
      ∑ j : Fin n.succ, (-1) ^ (i + j : ℕ) * A i j * det (A.submatrix i.succAbove j.succAbove) 
goal: A.det = ∑ j : Fin n.succ, (-1) ^ (↑i + ↑j) * A i j * (A.submatrix i.succAbove j.succAbove).det

full_name: Matrix.det_succ_column
code: /-- Laplacian expansion of the determinant of an `n+1 × n+1` matrix along column `j`. -/
theorem det_succ_column {n : ℕ} (A : Matrix (Fin n.succ) (Fin n.succ) R) (j : Fin n.succ) :
    det A =
      ∑ i : Fin n.succ, (-1) ^ (i + j : ℕ) * A i j * det (A.submatrix i.succAbove j.succAbove) 
goal: A.det = ∑ i : Fin n.succ, (-1) ^ (↑i + ↑j) * A i j * (A.submatrix i.succAbove j.succAbove).det

full_name: Matrix.det_fin_zero
code: /-- Determinant of 0x0 matrix -/
@[simp]
theorem det_fin_zero {A : Matrix (Fin 0) (Fin 0) R} : det A = 1 
goal: A.det = 1

full_name: Matrix.det_fin_one
code: /-- Determinant of 1x1 matrix -/
theorem det_fin_one (A : Matrix (Fin 1) (Fin 1) R) : det A = A 0 0 
goal: A.det = A 0 0

full_name: Matrix.det_fin_one_of
code: theorem det_fin_one_of (a : R) : det !![a] = a 
goal: !![a].det = a

full_name: Matrix.det_fin_two
code: /-- Determinant of 2x2 matrix -/
theorem det_fin_two (A : Matrix (Fin 2) (Fin 2) R) : det A = A 0 0 * A 1 1 - A 0 1 * A 1 0 
goal: A.det = A 0 0 * A 1 1 - A 0 1 * A 1 0

full_name: Matrix.det_fin_two_of
code: @[simp]
theorem det_fin_two_of (a b c d : R) : Matrix.det !![a, b; c, d] = a * d - b * c 
goal: !![a, b; c, d].det = a * d - b * c

full_name: Matrix.det_fin_three
code: /-- Determinant of 3x3 matrix -/
theorem det_fin_three (A : Matrix (Fin 3) (Fin 3) R) :
    det A =
      A 0 0 * A 1 1 * A 2 2 - A 0 0 * A 1 2 * A 2 1
      - A 0 1 * A 1 0 * A 2 2 + A 0 1 * A 1 2 * A 2 0
      + A 0 2 * A 1 0 * A 2 1 - A 0 2 * A 1 1 * A 2 0 
goal: A.det =
  A 0 0 * A 1 1 * A 2 2 - A 0 0 * A 1 2 * A 2 1 - A 0 1 * A 1 0 * A 2 2 + A 0 1 * A 1 2 * A 2 0 +
      A 0 2 * A 1 0 * A 2 1 -
    A 0 2 * A 1 1 * A 2 0