linear_algebra.eigenspace.minpoly
⟷
Mathlib.LinearAlgebra.Eigenspace.Minpoly
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
tauto
(#19183)
tauto
is not refl
.
@@ -101,16 +101,14 @@ theorem has_eigenvalue_iff_is_root :
/-- An endomorphism of a finite-dimensional vector space has finitely many eigenvalues. -/
noncomputable instance (f : End K V) : fintype f.eigenvalues :=
-set.finite.fintype
+set.finite.fintype $ show {μ | eigenspace f μ ≠ ⊥}.finite,
begin
have h : minpoly K f ≠ 0 := minpoly.ne_zero f.is_integral,
- convert (minpoly K f).root_set_finite K,
+ convert (minpoly K f).root_set_finite K using 1,
ext μ,
- have : (μ ∈ {μ : K | f.eigenspace μ = ⊥ → false}) ↔ ¬f.eigenspace μ = ⊥ := by tauto,
- convert rfl.mpr this,
classical,
simp [polynomial.root_set_def, polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
- has_eigenvalue]
+ has_eigenvalue],
end
end End
(no changes)
open_locale classical
(#19182)
This makes the lemmas strictly more general.
@@ -108,6 +108,7 @@ begin
ext μ,
have : (μ ∈ {μ : K | f.eigenspace μ = ⊥ → false}) ↔ ¬f.eigenspace μ = ⊥ := by tauto,
convert rfl.mpr this,
+ classical,
simp [polynomial.root_set_def, polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
has_eigenvalue]
end
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -64,7 +64,7 @@ theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
· intro a; simp [Module.algebraMap_end_apply]
· intro p q hp hq; simp [hp, hq, add_smul]
· intro n a hna
- rw [mul_comm, pow_succ, mul_assoc, AlgHom.map_mul, LinearMap.mul_apply, mul_comm, hna]
+ rw [mul_comm, pow_succ', mul_assoc, AlgHom.map_mul, LinearMap.mul_apply, mul_comm, hna]
simp only [mem_eigenspace_iff.1 h.1, smul_smul, aeval_X, eval_mul, eval_C, eval_pow, eval_X,
LinearMap.map_smulₛₗ, RingHom.id_apply, mul_comm]
#align module.End.aeval_apply_of_has_eigenvector Module.End.aeval_apply_of_hasEigenvector
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -38,8 +38,7 @@ theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degr
calc
eigenspace f (-q.coeff 0 / q.leadingCoeff) =
(q.leadingCoeff • f - algebraMap K (End K V) (-q.coeff 0)).ker :=
- by rw [eigenspace_div]; intro h; rw [leading_coeff_eq_zero_iff_deg_eq_bot.1 h] at hq ;
- cases hq
+ by rw [eigenspace_div]; intro h; rw [leading_coeff_eq_zero_iff_deg_eq_bot.1 h] at hq; cases hq
_ = (aeval f (C q.leadingCoeff * X + C (q.coeff 0))).ker := by rw [C_mul', aeval_def];
simp [algebraMap, Algebra.toRingHom]
_ = (aeval f q).ker := by rwa [← eq_X_add_C_of_degree_eq_one]
@@ -97,8 +96,8 @@ theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue
apply minpoly.ne_zero f.is_integral
rw [hp, Con, MulZeroClass.mul_zero]
have h_deg := minpoly.degree_le_of_ne_zero K f p_ne_0 _
- · rw [hp, degree_mul, degree_X_sub_C, Polynomial.degree_eq_natDegree p_ne_0] at h_deg
- norm_cast at h_deg
+ · rw [hp, degree_mul, degree_X_sub_C, Polynomial.degree_eq_natDegree p_ne_0] at h_deg
+ norm_cast at h_deg
linarith
· have h_aeval := minpoly.aeval K f
revert h_aeval
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -120,7 +120,8 @@ noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
have h : minpoly K f ≠ 0 := minpoly.ne_zero f.is_integral
convert (minpoly K f).rootSet_finite K using 1
ext μ
- classical
+ classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
+ has_eigenvalue]
end End
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -120,8 +120,7 @@ noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
have h : minpoly K f ≠ 0 := minpoly.ne_zero f.is_integral
convert (minpoly K f).rootSet_finite K using 1
ext μ
- classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
- has_eigenvalue]
+ classical
end End
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2020 Alexander Bentkamp. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
-/
-import Mathbin.LinearAlgebra.Eigenspace.Basic
-import Mathbin.FieldTheory.Minpoly.Field
+import LinearAlgebra.Eigenspace.Basic
+import FieldTheory.Minpoly.Field
#align_import linear_algebra.eigenspace.minpoly from "leanprover-community/mathlib"@"c3216069e5f9369e6be586ccbfcde2592b3cec92"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2020 Alexander Bentkamp. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
-
-! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit c3216069e5f9369e6be586ccbfcde2592b3cec92
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.LinearAlgebra.Eigenspace.Basic
import Mathbin.FieldTheory.Minpoly.Field
+#align_import linear_algebra.eigenspace.minpoly from "leanprover-community/mathlib"@"c3216069e5f9369e6be586ccbfcde2592b3cec92"
+
/-!
# Eigenvalues are the roots of the minimal polynomial.
mathlib commit https://github.com/leanprover-community/mathlib/commit/9f55d0d4363ae59948c33864cbc52e0b12e0e8ce
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit 8efcf8022aac8e01df8d302dcebdbc25d6a886c8
+! leanprover-community/mathlib commit c3216069e5f9369e6be586ccbfcde2592b3cec92
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -117,15 +117,14 @@ theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot
/-- An endomorphism of a finite-dimensional vector space has finitely many eigenvalues. -/
noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
- Set.Finite.fintype
- (by
+ Set.Finite.fintype <|
+ show {μ | eigenspace f μ ≠ ⊥}.Finite
+ by
have h : minpoly K f ≠ 0 := minpoly.ne_zero f.is_integral
- convert (minpoly K f).rootSet_finite K
+ convert (minpoly K f).rootSet_finite K using 1
ext μ
- have : μ ∈ {μ : K | f.eigenspace μ = ⊥ → False} ↔ ¬f.eigenspace μ = ⊥ := by tauto
- convert rfl.mpr this
classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
- has_eigenvalue])
+ has_eigenvalue]
end End
mathlib commit https://github.com/leanprover-community/mathlib/commit/8efcf8022aac8e01df8d302dcebdbc25d6a886c8
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit 6b0169218d01f2837d79ea2784882009a0da1aa1
+! leanprover-community/mathlib commit 8efcf8022aac8e01df8d302dcebdbc25d6a886c8
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.FieldTheory.Minpoly.Field
/-!
# Eigenvalues are the roots of the minimal polynomial.
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
## Tags
eigenvalue, minimal polynomial
@@ -121,7 +124,7 @@ noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
ext μ
have : μ ∈ {μ : K | f.eigenspace μ = ⊥ → False} ↔ ¬f.eigenspace μ = ⊥ := by tauto
convert rfl.mpr this
- simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
+ classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← has_eigenvalue_iff_is_root,
has_eigenvalue])
end End
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -32,6 +32,7 @@ open scoped Polynomial
variable {K : Type v} {V : Type w} [Field K] [AddCommGroup V] [Module K V]
+#print Module.End.eigenspace_aeval_polynomial_degree_1 /-
theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degree q = 1) :
eigenspace f (-q.coeff 0 / q.leadingCoeff) = (aeval f q).ker :=
calc
@@ -43,7 +44,9 @@ theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degr
simp [algebraMap, Algebra.toRingHom]
_ = (aeval f q).ker := by rwa [← eq_X_add_C_of_degree_eq_one]
#align module.End.eigenspace_aeval_polynomial_degree_1 Module.End.eigenspace_aeval_polynomial_degree_1
+-/
+#print Module.End.ker_aeval_ring_hom'_unit_polynomial /-
theorem ker_aeval_ring_hom'_unit_polynomial (f : End K V) (c : K[X]ˣ) :
(aeval f (c : K[X])).ker = ⊥ :=
by
@@ -52,7 +55,9 @@ theorem ker_aeval_ring_hom'_unit_polynomial (f : End K V) (c : K[X]ˣ) :
apply ker_algebra_map_End
apply coeff_coe_units_zero_ne_zero c
#align module.End.ker_aeval_ring_hom'_unit_polynomial Module.End.ker_aeval_ring_hom'_unit_polynomial
+-/
+#print Module.End.aeval_apply_of_hasEigenvector /-
theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
(h : f.HasEigenvector μ x) : aeval f p x = p.eval μ • x :=
by
@@ -64,7 +69,9 @@ theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
simp only [mem_eigenspace_iff.1 h.1, smul_smul, aeval_X, eval_mul, eval_C, eval_pow, eval_X,
LinearMap.map_smulₛₗ, RingHom.id_apply, mul_comm]
#align module.End.aeval_apply_of_has_eigenvector Module.End.aeval_apply_of_hasEigenvector
+-/
+#print Module.End.isRoot_of_hasEigenvalue /-
theorem isRoot_of_hasEigenvalue {f : End K V} {μ : K} (h : f.HasEigenvalue μ) :
(minpoly K f).IsRoot μ :=
by
@@ -72,11 +79,13 @@ theorem isRoot_of_hasEigenvalue {f : End K V} {μ : K} (h : f.HasEigenvalue μ)
refine' Or.resolve_right (smul_eq_zero.1 _) ne0
simp [← aeval_apply_of_has_eigenvector ⟨H, ne0⟩, minpoly.aeval K f]
#align module.End.is_root_of_has_eigenvalue Module.End.isRoot_of_hasEigenvalue
+-/
variable [FiniteDimensional K V] (f : End K V)
variable {f} {μ : K}
+#print Module.End.hasEigenvalue_of_isRoot /-
theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue μ :=
by
cases' dvd_iff_is_root.2 h with p hp
@@ -95,10 +104,13 @@ theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue
revert h_aeval
simp [hp, ← hu]
#align module.End.has_eigenvalue_of_is_root Module.End.hasEigenvalue_of_isRoot
+-/
+#print Module.End.hasEigenvalue_iff_isRoot /-
theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot μ :=
⟨isRoot_of_hasEigenvalue, hasEigenvalue_of_isRoot⟩
#align module.End.has_eigenvalue_iff_is_root Module.End.hasEigenvalue_iff_isRoot
+-/
/-- An endomorphism of a finite-dimensional vector space has finitely many eigenvalues. -/
noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -42,7 +42,6 @@ theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degr
_ = (aeval f (C q.leadingCoeff * X + C (q.coeff 0))).ker := by rw [C_mul', aeval_def];
simp [algebraMap, Algebra.toRingHom]
_ = (aeval f q).ker := by rwa [← eq_X_add_C_of_degree_eq_one]
-
#align module.End.eigenspace_aeval_polynomial_degree_1 Module.End.eigenspace_aeval_polynomial_degree_1
theorem ker_aeval_ring_hom'_unit_polynomial (f : End K V) (c : K[X]ˣ) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -57,7 +57,7 @@ theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
· intro a; simp [Module.algebraMap_end_apply]
· intro p q hp hq; simp [hp, hq, add_smul]
· intro n a hna
- rw [mul_comm, pow_succ, mul_assoc, AlgHom.map_mul, LinearMap.mul_apply, mul_comm, hna]
+ rw [mul_comm, pow_succ', mul_assoc, AlgHom.map_mul, LinearMap.mul_apply, mul_comm, hna]
simp only [mem_eigenspace_iff.1 h.1, smul_smul, aeval_X, eval_mul, eval_C, eval_pow, eval_X,
LinearMap.map_smulₛₗ, RingHom.id_apply, mul_comm]
#align module.End.aeval_apply_of_has_eigenvector Module.End.aeval_apply_of_hasEigenvector
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -70,7 +70,6 @@ theorem isRoot_of_hasEigenvalue {f : End K V} {μ : K} (h : f.HasEigenvalue μ)
#align module.End.is_root_of_has_eigenvalue Module.End.isRoot_of_hasEigenvalue
variable [FiniteDimensional K V] (f : End K V)
-
variable {f} {μ : K}
theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue μ := by
I ran tryAtEachStep on all files under Mathlib
to find all locations where omega
succeeds. For each that was a linarith
without an only
, I tried replacing it with omega
, and I verified that elaboration time got smaller. (In almost all cases, there was a noticeable speedup.) I also replaced some slow aesop
s along the way.
@@ -89,7 +89,7 @@ theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue
have h_deg := minpoly.degree_le_of_ne_zero K f p_ne_0 this
rw [hp, degree_mul, degree_X_sub_C, Polynomial.degree_eq_natDegree p_ne_0] at h_deg
norm_cast at h_deg
- linarith
+ omega
#align module.End.has_eigenvalue_of_is_root Module.End.hasEigenvalue_of_isRoot
theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot μ :=
The main change is to upgrade the existing Module.End.eigenspaces_independent
, which applied only to eigenspaces (and required a [Field K]
assumption) to Module.End.independent_generalizedEigenspace
, which applies to generalized eigenspaces (and requires only [NoZeroSMulDivisors R M]
)
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
@@ -96,19 +96,18 @@ theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot
⟨isRoot_of_hasEigenvalue, hasEigenvalue_of_isRoot⟩
#align module.End.has_eigenvalue_iff_is_root Module.End.hasEigenvalue_iff_isRoot
+variable (f)
+
+lemma finite_hasEigenvalue : Set.Finite f.HasEigenvalue := by
+ have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
+ convert (minpoly K f).rootSet_finite K
+ ext μ
+ change f.HasEigenvalue μ ↔ _
+ rw [hasEigenvalue_iff_isRoot, mem_rootSet_of_ne h, IsRoot, coe_aeval_eq_eval]
+
/-- An endomorphism of a finite-dimensional vector space has finitely many eigenvalues. -/
-noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
- Set.Finite.fintype <| show {μ | eigenspace f μ ≠ ⊥}.Finite by
- have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
- convert (minpoly K f).rootSet_finite K
- ext μ
- -- Porting note: was the below, but this applied unwanted simp lemmas
- -- ```
- -- classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← hasEigenvalue_iff_isRoot,
- -- HasEigenvalue]
- -- ```
- rw [Set.mem_setOf_eq, ← HasEigenvalue, hasEigenvalue_iff_isRoot, mem_rootSet_of_ne h, IsRoot,
- coe_aeval_eq_eval]
+noncomputable instance : Fintype f.Eigenvalues :=
+ Set.Finite.fintype f.finite_hasEigenvalue
end End
rcases
, convert
and congrm
(#7725)
Replace rcases(
with rcases (
. Same thing for convert(
and congrm(
. No other change.
@@ -64,7 +64,7 @@ theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
theorem isRoot_of_hasEigenvalue {f : End K V} {μ : K} (h : f.HasEigenvalue μ) :
(minpoly K f).IsRoot μ := by
- rcases(Submodule.ne_bot_iff _).1 h with ⟨w, ⟨H, ne0⟩⟩
+ rcases (Submodule.ne_bot_iff _).1 h with ⟨w, ⟨H, ne0⟩⟩
refine' Or.resolve_right (smul_eq_zero.1 _) ne0
simp [← aeval_apply_of_hasEigenvector ⟨H, ne0⟩, minpoly.aeval K f]
#align module.End.is_root_of_has_eigenvalue Module.End.isRoot_of_hasEigenvalue
MulZeroClass.
in mul_zero
/zero_mul
(#6682)
Search&replace MulZeroClass.mul_zero
-> mul_zero
, MulZeroClass.zero_mul
-> zero_mul
.
These were introduced by Mathport, as the full name of mul_zero
is actually MulZeroClass.mul_zero
(it's exported with the short name).
@@ -81,7 +81,7 @@ theorem hasEigenvalue_of_isRoot (h : (minpoly K f).IsRoot μ) : f.HasEigenvalue
have p_ne_0 : p ≠ 0 := by
intro con
apply minpoly.ne_zero f.isIntegral
- rw [hp, con, MulZeroClass.mul_zero]
+ rw [hp, con, mul_zero]
have : (aeval f) p = 0 := by
have h_aeval := minpoly.aeval K f
revert h_aeval
@@ -2,15 +2,12 @@
Copyright (c) 2020 Alexander Bentkamp. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
-
-! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit c3216069e5f9369e6be586ccbfcde2592b3cec92
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.Minpoly.Field
+#align_import linear_algebra.eigenspace.minpoly from "leanprover-community/mathlib"@"c3216069e5f9369e6be586ccbfcde2592b3cec92"
+
/-!
# Eigenvalues are the roots of the minimal polynomial.
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit 8efcf8022aac8e01df8d302dcebdbc25d6a886c8
+! leanprover-community/mathlib commit c3216069e5f9369e6be586ccbfcde2592b3cec92
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
This removes most of a scary porting note that is no longer true.
@@ -101,25 +101,17 @@ theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot
/-- An endomorphism of a finite-dimensional vector space has finitely many eigenvalues. -/
noncomputable instance (f : End K V) : Fintype f.Eigenvalues :=
- -- Porting note: added `show` to avoid unfolding `Set K` to `K → Prop`
- show Fintype { μ : K | f.HasEigenvalue μ } from
- Set.Finite.fintype
- (by
- have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
- convert (minpoly K f).rootSet_finite K
- ext μ
- -- Porting note: was
- -- have : μ ∈ {μ : K | f.eigenspace μ = ⊥ → False} ↔ ¬f.eigenspace μ = ⊥ := by tauto
- -- convert rfl.mpr this
- -- simp only [Polynomial.rootSet_def, Polynomial.mem_roots h, ← hasEigenvalue_iff_isRoot,
- -- HasEigenvalue]
- -- which didn't work, but worked with
- -- simp only [Polynomial.rootSet_def, Polynomial.mem_roots h, ← hasEigenvalue_iff_isRoot,
- -- HasEigenvalue, (Multiset.mem_toFinset), Algebra.id.map_eq_id, iff_self, Ne.def,
- -- Polynomial.map_id, Finset.mem_coe]
- -- but the code below is simpler.
- rw [Set.mem_setOf_eq, hasEigenvalue_iff_isRoot, mem_rootSet_of_ne h, IsRoot,
- coe_aeval_eq_eval])
+ Set.Finite.fintype <| show {μ | eigenspace f μ ≠ ⊥}.Finite by
+ have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
+ convert (minpoly K f).rootSet_finite K
+ ext μ
+ -- Porting note: was the below, but this applied unwanted simp lemmas
+ -- ```
+ -- classical simp [Polynomial.rootSet_def, Polynomial.mem_roots h, ← hasEigenvalue_iff_isRoot,
+ -- HasEigenvalue]
+ -- ```
+ rw [Set.mem_setOf_eq, ← HasEigenvalue, hasEigenvalue_iff_isRoot, mem_rootSet_of_ne h, IsRoot,
+ coe_aeval_eq_eval]
end End
The important thing to forward-port here is the addition of [DecidableEq _]
to a handful of lemmas.
linear_algebra.eigenspace.minpoly
did not need anything forward-porting, as the proof which broke in mathlib3 did not break in mathlib4.
The nthRootsFinset_def
lemma was forgotten in the mathlib3 PR.
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alexander Bentkamp
! This file was ported from Lean 3 source module linear_algebra.eigenspace.minpoly
-! leanprover-community/mathlib commit 6b0169218d01f2837d79ea2784882009a0da1aa1
+! leanprover-community/mathlib commit 8efcf8022aac8e01df8d302dcebdbc25d6a886c8
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
The unported dependencies are