Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(linear_algebra/char_poly/coeff,*): prerequisites for friendship theorem #3953

Closed
wants to merge 140 commits into from
Closed
Show file tree
Hide file tree
Changes from 127 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
3b3c9ea
init
jalex-stark Jul 18, 2020
8ea8b3f
remove extra file
jalex-stark Jul 18, 2020
2ec56b8
variables in sym_matrix
jalex-stark Jul 18, 2020
44c2cd9
imports, friendship
jalex-stark Jul 18, 2020
ad8dca8
fixed broken proof
jalex-stark Jul 18, 2020
ee39e24
Hopefully updating char_poly.lean enough
awainverse Jul 18, 2020
5ccdfe3
golf
jalex-stark Jul 18, 2020
840648c
remove unnecessary line
jalex-stark Jul 18, 2020
a97aaef
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
jalex-stark Jul 18, 2020
5c7502f
import golf
jalex-stark Jul 18, 2020
f129ef8
renaming
jalex-stark Jul 18, 2020
4245a85
clean proofs
jalex-stark Jul 18, 2020
61e16b5
separate simple_graph
jalex-stark Jul 19, 2020
4db1f66
golf
jalex-stark Jul 19, 2020
7e4e3a2
rename
jalex-stark Jul 19, 2020
101bf55
..and remove the old file
jalex-stark Jul 19, 2020
11168ae
golf
jalex-stark Jul 19, 2020
c07106d
golf
jalex-stark Jul 19, 2020
1b3ba82
optimize main proof
jalex-stark Jul 19, 2020
d5e13ba
unified `pow`s
jalex-stark Jul 19, 2020
167a887
golf
jalex-stark Jul 19, 2020
0de44e6
Merge remote-tracking branch 'origin/master' into freek_83_friendship…
jalex-stark Jul 19, 2020
9e09caf
formatting
jalex-stark Jul 19, 2020
bfdad05
golf
jalex-stark Jul 19, 2020
3fd630f
golf
jalex-stark Jul 19, 2020
b28cf1c
copyright
jalex-stark Jul 19, 2020
f95f4e8
explicit arguments
jalex-stark Jul 19, 2020
13fb06a
formatting
jalex-stark Jul 19, 2020
aac328a
Kyle's graph nomenclature
awainverse Jul 19, 2020
d213dc6
Edge set
awainverse Jul 19, 2020
356bce5
rename
jalex-stark Jul 19, 2020
3fe6ef1
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
jalex-stark Jul 19, 2020
f5968f6
move into mathlib
jalex-stark Jul 19, 2020
bfb0fc3
Just accepting the docstrings?
awainverse Jul 19, 2020
42e2358
rename A and B to left_ and right_carrier
jalex-stark Jul 19, 2020
83e9816
implementation details
jalex-stark Jul 19, 2020
d30708c
Renaming
awainverse Jul 19, 2020
ca3ac2e
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
awainverse Jul 19, 2020
796d37e
Finish that renaming
awainverse Jul 19, 2020
6645cc8
renaming
jalex-stark Jul 19, 2020
8172d2e
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
jalex-stark Jul 19, 2020
54b5828
add comment
jalex-stark Jul 19, 2020
51cc97d
contract
jalex-stark Jul 19, 2020
eb6dd68
compress
jalex-stark Jul 19, 2020
a85cf26
left and right
awainverse Jul 19, 2020
1ea12ad
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
awainverse Jul 19, 2020
441c537
Merge branch 'freek_83_friendship_theorem' of https://github.com/lean…
jalex-stark Jul 19, 2020
54710a4
Merge branch 'freek_83_friendship_theorem' into graphs_and_bigraphs
jalex-stark Jul 19, 2020
e8cba46
remove archive stuff
jalex-stark Jul 19, 2020
2df1ebb
clarify naming choice
jalex-stark Jul 19, 2020
6078eb2
lint
jalex-stark Jul 19, 2020
bd602da
update docs
jalex-stark Jul 19, 2020
7540fc6
dedup paragraph
jalex-stark Jul 19, 2020
f1ffe41
Update src/combinatorics/simple_graph.lean
robertylewis Jul 20, 2020
bd2d218
Only simple graphs for now
awainverse Jul 21, 2020
21537d7
Merge branch 'graphs_and_bigraphs' of https://github.com/leanprover-c…
awainverse Jul 21, 2020
4306a52
Various modifications to simple_graphs PR
kmill Jul 22, 2020
70f80ab
Switched neighbors back to finset interface and renamed it to adj'
kmill Jul 22, 2020
c01d7a1
Renamed back to neighbors, modified the sections
awainverse Jul 22, 2020
d4703f9
Some docstrings and decidable instance manipulation
kmill Jul 22, 2020
676e01c
Forgot to commit a few more source beautifications
kmill Jul 22, 2020
6f52b7c
Integrating Kyle's contributions
awainverse Jul 22, 2020
c6a4f5d
naming
jalex-stark Jul 22, 2020
bd267e1
Merge remote-tracking branch 'origin/graphs_and_bigraphs_2' into grap…
jalex-stark Jul 22, 2020
4a29648
naming and golfing
jalex-stark Jul 22, 2020
a8bf2a7
just a little more golf
jalex-stark Jul 22, 2020
fa17ed0
has_mem nomenclature
awainverse Jul 22, 2020
081a4ce
docstring
awainverse Jul 22, 2020
a482f15
spacing, golfing
jalex-stark Jul 22, 2020
a69820e
Merge branch 'graphs_and_bigraphs' of https://github.com/leanprover-c…
jalex-stark Jul 22, 2020
9c71715
...and more spacing
jalex-stark Jul 22, 2020
32ead46
decidability golf
jalex-stark Jul 22, 2020
4e801bd
more golf
jalex-stark Jul 23, 2020
388f275
Merge remote-tracking branch 'origin/master' into graphs_and_bigraphs
jalex-stark Jul 23, 2020
829176a
Trying to abuse set less
awainverse Jul 24, 2020
f7a8c0c
new lemma
jalex-stark Jul 24, 2020
a2a202c
Merge branch 'graphs_and_bigraphs' of https://github.com/leanprover-c…
jalex-stark Jul 24, 2020
2611e7e
proved lemma
jalex-stark Jul 24, 2020
0657912
add attribute irreducible to G.E
jalex-stark Jul 24, 2020
907f163
Name change
awainverse Jul 24, 2020
3ab95fc
Simplify complete graph definition
awainverse Jul 24, 2020
de05071
E.other
jalex-stark Jul 25, 2020
1c38ff6
Merge branch 'graphs_and_bigraphs' of https://github.com/leanprover-c…
jalex-stark Jul 25, 2020
2982855
fix up decidable instance
jalex-stark Jul 25, 2020
42a1d6d
undo bad simp lemma
jalex-stark Jul 25, 2020
d524b19
add missing lemma
jalex-stark Jul 25, 2020
6168f03
remove extra comment
jalex-stark Jul 25, 2020
c3861f2
a smidge of term mode
awainverse Jul 28, 2020
ac664dc
Update src/data/sym2.lean
jalex-stark Jul 28, 2020
abf9b7a
Update src/data/sym2.lean
jalex-stark Jul 30, 2020
0e96132
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
7157dac
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
b0dbc5c
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
b3418be
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
151a7d4
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
c86981c
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
b4ee1a9
Update src/combinatorics/simple_graph.lean
jalex-stark Jul 30, 2020
b603cea
init
awainverse Aug 3, 2020
ad426e6
Sorry, meant to make a new branch
awainverse Aug 3, 2020
bc4a460
init
awainverse Aug 3, 2020
9783277
Docstring, removed unnecessary lemma
awainverse Aug 3, 2020
ad3aa87
Merge branch 'adjacency_matrix' of https://github.com/leanprover-comm…
awainverse Aug 3, 2020
62ac448
Reviewing
awainverse Aug 3, 2020
acfb589
Cleaning up by {}
awainverse Aug 3, 2020
851ff77
Removed computability/classical crutches
awainverse Aug 3, 2020
23bcc9f
Didn't need decidable_eq
awainverse Aug 5, 2020
eca55b7
Merge branch 'master' into adjacency_matrix
awainverse Aug 25, 2020
7301c58
matrix.mul_apply
awainverse Aug 25, 2020
3011613
Beginning to answer reviews
awainverse Aug 25, 2020
3970e04
Merge remote-tracking branch 'origin/master' into adjacency_matrix
awainverse Aug 25, 2020
b732e68
Reviewing
awainverse Aug 25, 2020
38284b2
``
awainverse Aug 25, 2020
9b94c75
linting simps
awainverse Aug 26, 2020
ab46f54
module doc
awainverse Aug 26, 2020
555381f
init
awainverse Aug 26, 2020
70ef81c
Revert "module doc"
awainverse Aug 26, 2020
e4f08b9
small fixes
awainverse Aug 26, 2020
336e6dd
I think it builds
awainverse Aug 27, 2020
0e8dfad
Typo in typo fix...
awainverse Aug 27, 2020
9658b0f
Just the prereqs
awainverse Aug 27, 2020
776b2d5
Linting
awainverse Aug 27, 2020
71973ff
One thing didn't commit
awainverse Aug 27, 2020
1f8963a
Reviews
awainverse Aug 27, 2020
d3258d5
reviews
awainverse Aug 27, 2020
18185f6
One more review
awainverse Aug 27, 2020
8c23220
Managing imports
awainverse Aug 27, 2020
1986c08
Typo
awainverse Aug 27, 2020
95dbb72
Reviews
awainverse Aug 27, 2020
1d50c44
A bit more review
awainverse Aug 27, 2020
76287f6
Generalizing to finite fields
awainverse Aug 27, 2020
a15eea9
More finite fields
awainverse Aug 28, 2020
96424a7
oof
awainverse Aug 28, 2020
3c85c6a
iterate frobenius
awainverse Aug 28, 2020
0ae797c
Hopefully good for all finite fields
awainverse Aug 28, 2020
30bf1a5
Moving fermat
awainverse Aug 28, 2020
9671f04
namespace 1
awainverse Aug 29, 2020
07a956a
namespace 2
awainverse Aug 29, 2020
111d46d
simp 1
awainverse Aug 29, 2020
e897ea7
simp 2
awainverse Aug 29, 2020
a6968b2
Indentation
awainverse Aug 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions src/algebra/char_p.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ classical.by_cases
theorem char_p.exists_unique (α : Type u) [semiring α] : ∃! p, char_p α p :=
let ⟨c, H⟩ := char_p.exists α in ⟨c, H, λ y H2, char_p.eq α H2 H⟩

/-- Noncomuptable function that outputs the unique characteristic of a semiring. -/
/-- Noncomputable function that outputs the unique characteristic of a semiring. -/
noncomputable def ring_char (α : Type u) [semiring α] : ℕ :=
classical.some (char_p.exists_unique α)

Expand All @@ -79,8 +79,8 @@ theorem ring_char.eq (α : Type u) [semiring α] {p : ℕ} (C : char_p α p) : p
(classical.some_spec (char_p.exists_unique α)).2 p C

theorem add_pow_char_of_commute (R : Type u) [ring R] {p : ℕ} [fact p.prime]
[char_p R p] (x y : R) (h : commute x y):
(x + y)^p = x^p + y^p :=
[char_p R p] (x y : R) (h : commute x y) :
(x + y)^p = x^p + y^p :=
begin
rw [commute.add_pow h, finset.sum_range_succ, nat.sub_self, pow_zero, nat.choose_self],
rw [nat.cast_one, mul_one, mul_one, add_right_inj],
Expand All @@ -93,14 +93,22 @@ begin
rwa ← finset.mem_range
end

theorem add_pow_char (α : Type u) [comm_ring α] {p : ℕ} (hp : nat.prime p)
[char_p α p] (x y : α) : (x + y)^p = x^p + y^p :=
theorem sub_pow_char_of_commute (R : Type u) [ring R] {p : ℕ} [fact p.prime]
[char_p R p] (x y : R) (h : commute x y) :
(x - y)^p = x^p - y^p :=
begin
haveI : fact p.prime := hp,
apply add_pow_char_of_commute,
apply commute.all,
have h' : commute (x - y) y, rw [commute, semiconj_by, sub_mul, mul_sub, h.eq],
awainverse marked this conversation as resolved.
Show resolved Hide resolved
rw [eq_sub_iff_add_eq, ← add_pow_char_of_commute _ _ _ h'], simp, repeat {apply_instance},
end

theorem add_pow_char (α : Type u) [comm_ring α] {p : ℕ} [fact p.prime]
[char_p α p] (x y : α) : (x + y)^p = x^p + y^p :=
add_pow_char_of_commute _ _ _ (commute.all _ _)

theorem sub_pow_char (α : Type u) [comm_ring α] {p : ℕ} [fact p.prime]
[char_p α p] (x y : α) : (x - y)^p = x^p - y^p :=
sub_pow_char_of_commute _ _ _ (commute.all _ _)

lemma eq_iff_modeq_int (R : Type*) [ring R] (p : ℕ) [char_p R p] (a b : ℤ) :
(a : R) = b ↔ a ≡ b [ZMOD p] :=
by rw [eq_comm, ←sub_eq_zero, ←int.cast_sub,
Expand Down Expand Up @@ -129,7 +137,7 @@ def frobenius : R →+* R :=
map_one' := one_pow p,
map_mul' := λ x y, mul_pow x y p,
map_zero' := zero_pow (lt_trans zero_lt_one ‹nat.prime p›.one_lt),
map_add' := add_pow_char R ‹nat.prime p› }
map_add' := add_pow_char R }

variable {R}

Expand Down
14 changes: 14 additions & 0 deletions src/data/matrix/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ lemma map_add [add_monoid α] {β : Type w} [add_monoid β] (f : α →+ β)
(M N : matrix m n α) : (M + N).map f = M.map f + N.map f :=
by { ext, simp, }

lemma map_sub [add_group α] {β : Type w} [add_group β] (f : α →+ β)
(M N : matrix m n α) : (M - N).map f = M.map f - N.map f :=
by { ext, simp }

lemma subsingleton_of_empty_left (hm : ¬ nonempty m) : subsingleton (matrix m n α) :=
⟨λ M N, by { ext, contrapose! hm, use i }⟩

lemma subsingleton_of_empty_right (hn : ¬ nonempty n) : subsingleton (matrix m n α) :=
⟨λ M N, by { ext, contrapose! hn, use j }⟩

end matrix

/-- The `add_monoid_hom` between spaces of matrices induced by an `add_monoid_hom` between their
Expand Down Expand Up @@ -446,6 +456,10 @@ lemma scalar_apply_ne (a : α) (i j : n) (h : i ≠ j) :
scalar n a i j = 0 :=
by simp only [h, coe_scalar, one_apply_ne, ne.def, not_false_iff, smul_apply, mul_zero]

lemma scalar_inj [nonempty n] {r s : α} : scalar n r = scalar n s ↔ r = s :=
⟨λ h, by { inhabit n, rw [← scalar_apply_eq r (arbitrary n), ← scalar_apply_eq s (arbitrary n), h] },
by rintro rfl; refl⟩
awainverse marked this conversation as resolved.
Show resolved Hide resolved

end scalar

end semiring
Expand Down
22 changes: 22 additions & 0 deletions src/data/matrix/char_p.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/-
Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-/
import data.matrix.basic
import algebra.char_p
/-!
# Matrices in prime characteristic
-/

open matrix
variables {n : Type*} [fintype n] {R : Type*} [ring R]

instance matrix.char_p [decidable_eq n] [nonempty n] (p : ℕ) [char_p R p] :
char_p (matrix n n R) p :=
{ cast_eq_zero_iff :=
begin
intro k, rw ← char_p.cast_eq_zero_iff R p k,
rw ← nat.cast_zero, rw ← (scalar n).map_nat_cast,
convert scalar_inj, simp, assumption,
end }
awainverse marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 3 additions & 4 deletions src/data/polynomial/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ def X : polynomial R := monomial 1 1

/-- `X` commutes with everything, even when the coefficients are noncommutative. -/
lemma X_mul : X * p = p * X :=
begin
ext,
simp [X, monomial, add_monoid_algebra.mul_apply, sum_single_index, add_comm],
end
by { ext, simp [X, monomial, add_monoid_algebra.mul_apply, sum_single_index, add_comm] }

lemma X_pow_mul {n : ℕ} : X^n * p = p * X^n :=
begin
Expand All @@ -80,6 +77,8 @@ end
lemma X_pow_mul_assoc {n : ℕ} : (p * X^n) * q = (p * q) * X^n :=
by rw [mul_assoc, X_pow_mul, ←mul_assoc]

lemma commute_X (p : polynomial R) : commute X p := by rw [commute, semiconj_by, X_mul]
awainverse marked this conversation as resolved.
Show resolved Hide resolved

/-- coeff p n is the coefficient of X^n in p -/
def coeff (p : polynomial R) := p.to_fun

Expand Down
26 changes: 24 additions & 2 deletions src/field_theory/finite.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import data.equiv.ring
import data.zmod.basic
import linear_algebra.basis
import ring_theory.integral_domain
import field_theory.separable

/-!
# Finite fields
Expand Down Expand Up @@ -110,12 +111,19 @@ begin
this, mul_one]
end

lemma pow_card_sub_one_eq_one (a : K) (ha : a ≠ 0) :
a ^ (fintype.card K - 1) = 1 :=
lemma pow_card_sub_one_eq_one (a : K) (ha : a ≠ 0) : a ^ (q - 1) = 1 :=
calc a ^ (fintype.card K - 1) = (units.mk0 a ha ^ (fintype.card K - 1) : units K) :
by rw [units.coe_pow, units.coe_mk0]
... = 1 : by { classical, rw [← card_units, pow_card_eq_one], refl }

lemma pow_card (a : K) : a ^ q = a :=
begin
have hp : fintype.card K > 0 := fintype.card_pos_iff.2 (by apply_instance),
by_cases a = 0, { rw h, apply zero_pow hp, },
awainverse marked this conversation as resolved.
Show resolved Hide resolved
rw [← nat.succ_pred_eq_of_pos hp, pow_succ, nat.pred_eq_sub_one,
pow_card_sub_one_eq_one a h, mul_one],
end

variable (K)

theorem card (p : ℕ) [char_p K p] : ∃ (n : ℕ+), nat.prime p ∧ q = p^(n : ℕ) :=
Expand Down Expand Up @@ -258,3 +266,17 @@ begin
simpa only [-zmod.pow_totient, nat.succ_eq_add_one, nat.cast_pow, units.coe_one,
nat.cast_one, cast_unit_of_coprime, units.coe_pow],
end

/-- A variation on Fermat's little theorem. See `zmod.fermat_little` -/
@[simp] lemma zmod.pow_card {p : ℕ} [fact p.prime] (x : zmod p) : x ^ p = x :=
awainverse marked this conversation as resolved.
Show resolved Hide resolved
awainverse marked this conversation as resolved.
Show resolved Hide resolved
by { have h := finite_field.pow_card x, rw zmod.card p at h, rw h }
awainverse marked this conversation as resolved.
Show resolved Hide resolved

open polynomial

lemma zmod.expand_p {p : ℕ} [fact p.prime] (f : polynomial (zmod p)) :
awainverse marked this conversation as resolved.
Show resolved Hide resolved
expand (zmod p) p f = f ^ p :=
begin
apply f.induction_on', intros a b ha hb, rw add_pow_char, simp [ha, hb],
intros n a, rw polynomial.expand_monomial, repeat {rw single_eq_C_mul_X},
rw [mul_pow, ← C.map_pow, zmod.pow_card a], ring_exp,
end
awainverse marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 34 additions & 0 deletions src/linear_algebra/char_poly/coeff.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Aaron Anderson, Jalex Stark.
-/

import data.matrix.basic
import linear_algebra.char_poly
import linear_algebra.matrix
import ring_theory.polynomial.basic
import algebra.polynomial.big_operators
import group_theory.perm.cycles
import field_theory.finite

/-!
# Characteristic polynomials
Expand Down Expand Up @@ -160,3 +162,35 @@ begin
rw [coeff_zero_eq_eval_zero, char_poly, eval_det, mat_poly_equiv_char_matrix, ← det_smul],
simp
end

variables {p : ℕ} [fact p.prime]

lemma zmod.char_poly_pow_card_of_nonempty [nonempty n] (M : matrix n n (zmod p)) :
awainverse marked this conversation as resolved.
Show resolved Hide resolved
awainverse marked this conversation as resolved.
Show resolved Hide resolved
char_poly (M ^ p) = char_poly M :=
begin
apply frobenius_inj (polynomial (zmod p)) p, repeat {rw frobenius_def},
rw ← zmod.expand_p,
unfold char_poly, rw [alg_hom.map_det, ← det_pow],
apply congr_arg det,
apply mat_poly_equiv.injective, swap, { apply_instance },
rw [← mat_poly_equiv.coe_alg_hom, alg_hom.map_pow, mat_poly_equiv.coe_alg_hom,
awainverse marked this conversation as resolved.
Show resolved Hide resolved
mat_poly_equiv_char_matrix, sub_pow_char_of_commute, ← C_pow],
swap, { apply polynomial.commute_X },
-- the following is a nasty case bash that should be abstracted as a lemma
-- (and maybe it can be proven more... algebraically?)
ext, rw [coeff_sub, coeff_C],
by_cases hij : i = j; simp [char_matrix, hij, coeff_X_pow]; simp only [coeff_C]; split_ifs; simp *,
end

lemma zmod.char_poly_pow_card (M : matrix n n (zmod p)) :
awainverse marked this conversation as resolved.
Show resolved Hide resolved
char_poly (M ^ p) = char_poly M :=
awainverse marked this conversation as resolved.
Show resolved Hide resolved
begin
classical,
by_cases hn : nonempty n, letI := hn, apply zmod.char_poly_pow_card_of_nonempty,
swap, { congr, apply @subsingleton.elim _ (subsingleton_of_empty_left hn) _ _, },
end
awainverse marked this conversation as resolved.
Show resolved Hide resolved

lemma zmod.trace_pow_p {p:ℕ} [fact p.prime] [nonempty n] (M : matrix n n (zmod p)) :
trace n (zmod p) (zmod p) (M ^ p) = (trace n (zmod p) (zmod p) M)^p :=
by rw [trace_eq_neg_char_poly_coeff, trace_eq_neg_char_poly_coeff,
zmod.char_poly_pow_card, zmod.pow_card]
awainverse marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions src/linear_algebra/determinant.lean
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ instance : is_monoid_hom (det : matrix n n R → R) :=
{ map_one := det_one,
map_mul := det_mul }

lemma det_pow (k : ℕ) (M : matrix n n R) : (M ^ k).det = (M.det) ^ k :=
awainverse marked this conversation as resolved.
Show resolved Hide resolved
by induction k; simp [pow_succ, *]
awainverse marked this conversation as resolved.
Show resolved Hide resolved

/-- Transposing a matrix preserves the determinant. -/
@[simp] lemma det_transpose (M : matrix n n R) : Mᵀ.det = M.det :=
begin
Expand Down