algebra.linear_recurrenceMathlib.Algebra.LinearRecurrence

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(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)

(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)

(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)

(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)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -245,7 +245,7 @@ def charPoly : α[X] :=
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q :=
   by
-  rw [char_poly, Polynomial.IsRoot.definition, Polynomial.eval]
+  rw [char_poly, Polynomial.IsRoot.def, Polynomial.eval]
   simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial,
     Polynomial.eval₂_sub]
   constructor
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 -/
-import Data.Polynomial.Eval
+import Algebra.Polynomial.Eval
 import LinearAlgebra.Dimension.Basic
 
 #align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 -/
 import Data.Polynomial.Eval
-import LinearAlgebra.Dimension
+import LinearAlgebra.Dimension.Basic
 
 #align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
 
@@ -245,7 +245,7 @@ def charPoly : α[X] :=
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q :=
   by
-  rw [char_poly, Polynomial.IsRoot.def, Polynomial.eval]
+  rw [char_poly, Polynomial.IsRoot.definition, Polynomial.eval]
   simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial,
     Polynomial.eval₂_sub]
   constructor
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 -/
-import Mathbin.Data.Polynomial.Eval
-import Mathbin.LinearAlgebra.Dimension
+import Data.Polynomial.Eval
+import LinearAlgebra.Dimension
 
 #align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
-
-! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 814d76e2247d5ba8bc024843552da1278bfe9e5c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Polynomial.Eval
 import Mathbin.LinearAlgebra.Dimension
 
+#align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"814d76e2247d5ba8bc024843552da1278bfe9e5c"
+
 /-!
 # Linear recurrence
 
Diff
@@ -221,11 +221,13 @@ section StrongRankCondition
 -- `comm_ring_strong_rank_condition`, is in a much later file.
 variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
+#print LinearRecurrence.solSpace_rank /-
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
   letI := nontrivial_of_invariantBasisNumber α
   @rank_fin_fun α _ _ E.order ▸ E.to_init.rank_eq
 #align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rank
+-/
 
 end StrongRankCondition
 
@@ -241,6 +243,7 @@ def charPoly : α[X] :=
 #align linear_recurrence.char_poly LinearRecurrence.charPoly
 -/
 
+#print LinearRecurrence.geom_sol_iff_root_charPoly /-
 /-- The geometric sequence `q^n` is a solution of `E` iff
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q :=
@@ -255,6 +258,7 @@ theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔
     simp only [pow_add, sub_eq_zero.mp h, mul_sum]
     exact sum_congr rfl fun _ _ => by ring
 #align linear_recurrence.geom_sol_iff_root_char_poly LinearRecurrence.geom_sol_iff_root_charPoly
+-/
 
 end CommRing
 
Diff
@@ -146,7 +146,7 @@ theorem eq_mk_of_is_sol_of_eq_init' {u : ℕ → α} {init : Fin E.order → α}
 /-- The space of solutions of `E`, as a `submodule` over `α` of the module `ℕ → α`. -/
 def solSpace : Submodule α (ℕ → α)
     where
-  carrier := { u | E.IsSolution u }
+  carrier := {u | E.IsSolution u}
   zero_mem' n := by simp
   add_mem' u v hu hv n := by simp [mul_add, sum_add_distrib, hu n, hv n]
   smul_mem' a u hu n := by simp [hu n, mul_sum] <;> congr <;> ext <;> ac_rfl
Diff
@@ -48,7 +48,7 @@ noncomputable section
 
 open Finset
 
-open BigOperators Polynomial
+open scoped BigOperators Polynomial
 
 #print LinearRecurrence /-
 /-- A "linear recurrence relation" over a commutative semiring is given by its
Diff
@@ -221,9 +221,6 @@ section StrongRankCondition
 -- `comm_ring_strong_rank_condition`, is in a much later file.
 variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
-/- warning: linear_recurrence.sol_space_rank -> LinearRecurrence.solSpace_rank is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rankₓ'. -/
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
   letI := nontrivial_of_invariantBasisNumber α
@@ -244,12 +241,6 @@ def charPoly : α[X] :=
 #align linear_recurrence.char_poly LinearRecurrence.charPoly
 -/
 
-/- warning: linear_recurrence.geom_sol_iff_root_char_poly -> LinearRecurrence.geom_sol_iff_root_charPoly is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α _inst_1)))) q n)) (Polynomial.IsRoot.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) q n)) (Polynomial.IsRoot.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
-Case conversion may be inaccurate. Consider using '#align linear_recurrence.geom_sol_iff_root_char_poly LinearRecurrence.geom_sol_iff_root_charPolyₓ'. -/
 /-- The geometric sequence `q^n` is a solution of `E` iff
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q :=
Diff
@@ -104,9 +104,7 @@ theorem is_sol_mkSol (init : Fin E.order → α) : E.IsSolution (E.mkSol init) :
 #print LinearRecurrence.mkSol_eq_init /-
 /-- `E.mk_sol init`'s first `E.order` terms are `init`. -/
 theorem mkSol_eq_init (init : Fin E.order → α) : ∀ n : Fin E.order, E.mkSol init n = init n :=
-  fun n => by
-  rw [mk_sol]
-  simp only [n.is_lt, dif_pos, Fin.mk_val, Fin.eta]
+  fun n => by rw [mk_sol]; simp only [n.is_lt, dif_pos, Fin.mk_val, Fin.eta]
 #align linear_recurrence.mk_sol_eq_init LinearRecurrence.mkSol_eq_init
 -/
 
@@ -169,12 +167,8 @@ theorem is_sol_iff_mem_solSpace (u : ℕ → α) : E.IsSolution u ↔ u ∈ E.so
 def toInit : E.solSpace ≃ₗ[α] Fin E.order → α
     where
   toFun u x := (u : ℕ → α) x
-  map_add' u v := by
-    ext
-    simp
-  map_smul' a u := by
-    ext
-    simp
+  map_add' u v := by ext; simp
+  map_smul' a u := by ext; simp
   invFun u := ⟨E.mkSol u, E.is_sol_mkSol u⟩
   left_inv u := by ext n <;> symm <;> apply E.eq_mk_of_is_sol_of_eq_init u.2 <;> intro k <;> rfl
   right_inv u := Function.funext_iff.mpr fun n => E.mkSol_eq_init u n
Diff
@@ -228,10 +228,7 @@ section StrongRankCondition
 variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
 /- warning: linear_recurrence.sol_space_rank -> LinearRecurrence.solSpace_rank is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (coeSort.{succ u1, succ (succ u1)} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (Subtype.{succ u1} (Nat -> α) (fun (x : Nat -> α) => Membership.mem.{u1, u1} (Nat -> α) (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (SetLike.instMembership.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) x (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
+<too large>
 Case conversion may be inaccurate. Consider using '#align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rankₓ'. -/
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
Diff
@@ -231,7 +231,7 @@ variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurre
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (coeSort.{succ u1, succ (succ u1)} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (Subtype.{succ u1} (Nat -> α) (fun (x : Nat -> α) => Membership.mem.{u1, u1} (Nat -> α) (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (SetLike.instMembership.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) x (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (Subtype.{succ u1} (Nat -> α) (fun (x : Nat -> α) => Membership.mem.{u1, u1} (Nat -> α) (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (SetLike.instMembership.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) x (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
 Case conversion may be inaccurate. Consider using '#align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rankₓ'. -/
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
@@ -257,7 +257,7 @@ def charPoly : α[X] :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α _inst_1)))) q n)) (Polynomial.IsRoot.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)))))) q n)) (Polynomial.IsRoot.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) q n)) (Polynomial.IsRoot.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
 Case conversion may be inaccurate. Consider using '#align linear_recurrence.geom_sol_iff_root_char_poly LinearRecurrence.geom_sol_iff_root_charPolyₓ'. -/
 /-- The geometric sequence `q^n` is a solution of `E` iff
   `q` is a root of `E`'s characteristic polynomial. -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 
 ! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
+! leanprover-community/mathlib commit 814d76e2247d5ba8bc024843552da1278bfe9e5c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.LinearAlgebra.Dimension
 /-!
 # Linear recurrence
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Informally, a "linear recurrence" is an assertion of the form
 `∀ n : ℕ, u (n + d) = a 0 * u n + a 1 * u (n+1) + ... + a (d-1) * u (n+d-1)`,
 where `u` is a sequence, `d` is the *order* of the recurrence and the `a i`
Diff
@@ -47,12 +47,14 @@ open Finset
 
 open BigOperators Polynomial
 
+#print LinearRecurrence /-
 /-- A "linear recurrence relation" over a commutative semiring is given by its
   order `n` and `n` coefficients. -/
 structure LinearRecurrence (α : Type _) [CommSemiring α] where
   order : ℕ
   coeffs : Fin order → α
 #align linear_recurrence LinearRecurrence
+-/
 
 instance (α : Type _) [CommSemiring α] : Inhabited (LinearRecurrence α) :=
   ⟨⟨0, default⟩⟩
@@ -63,12 +65,15 @@ section CommSemiring
 
 variable {α : Type _} [CommSemiring α] (E : LinearRecurrence α)
 
+#print LinearRecurrence.IsSolution /-
 /-- We say that a sequence `u` is solution of `linear_recurrence order coeffs` when we have
   `u (n + order) = ∑ i : fin order, coeffs i * u (n + i)` for any `n`. -/
 def IsSolution (u : ℕ → α) :=
   ∀ n, u (n + E.order) = ∑ i, E.coeffs i * u (n + i)
 #align linear_recurrence.is_solution LinearRecurrence.IsSolution
+-/
 
+#print LinearRecurrence.mkSol /-
 /-- A solution of a `linear_recurrence` which satisfies certain initial conditions.
   We will prove this is the only such solution. -/
 def mkSol (init : Fin E.order → α) : ℕ → α
@@ -84,19 +89,25 @@ def mkSol (init : Fin E.order → α) : ℕ → α
             simp only [zero_add]
         E.coeffs k * mk_sol (n - E.order + k)
 #align linear_recurrence.mk_sol LinearRecurrence.mkSol
+-/
 
+#print LinearRecurrence.is_sol_mkSol /-
 /-- `E.mk_sol` indeed gives solutions to `E`. -/
 theorem is_sol_mkSol (init : Fin E.order → α) : E.IsSolution (E.mkSol init) := fun n => by
   rw [mk_sol] <;> simp
 #align linear_recurrence.is_sol_mk_sol LinearRecurrence.is_sol_mkSol
+-/
 
+#print LinearRecurrence.mkSol_eq_init /-
 /-- `E.mk_sol init`'s first `E.order` terms are `init`. -/
 theorem mkSol_eq_init (init : Fin E.order → α) : ∀ n : Fin E.order, E.mkSol init n = init n :=
   fun n => by
   rw [mk_sol]
   simp only [n.is_lt, dif_pos, Fin.mk_val, Fin.eta]
 #align linear_recurrence.mk_sol_eq_init LinearRecurrence.mkSol_eq_init
+-/
 
+#print LinearRecurrence.eq_mk_of_is_sol_of_eq_init /-
 /-- If `u` is a solution to `E` and `init` designates its first `E.order` values,
   then `∀ n, u n = E.mk_sol init n`. -/
 theorem eq_mk_of_is_sol_of_eq_init {u : ℕ → α} {init : Fin E.order → α} (h : E.IsSolution u)
@@ -118,7 +129,9 @@ theorem eq_mk_of_is_sol_of_eq_init {u : ℕ → α} {init : Fin E.order → α}
             simp only [zero_add]
         rw [eq_mk_of_is_sol_of_eq_init]
 #align linear_recurrence.eq_mk_of_is_sol_of_eq_init LinearRecurrence.eq_mk_of_is_sol_of_eq_init
+-/
 
+#print LinearRecurrence.eq_mk_of_is_sol_of_eq_init' /-
 /-- If `u` is a solution to `E` and `init` designates its first `E.order` values,
   then `u = E.mk_sol init`. This proves that `E.mk_sol init` is the only solution
   of `E` whose first `E.order` values are given by `init`. -/
@@ -126,7 +139,9 @@ theorem eq_mk_of_is_sol_of_eq_init' {u : ℕ → α} {init : Fin E.order → α}
     (heq : ∀ n : Fin E.order, u n = init n) : u = E.mkSol init :=
   funext (E.eq_mk_of_is_sol_of_eq_init h HEq)
 #align linear_recurrence.eq_mk_of_is_sol_of_eq_init' LinearRecurrence.eq_mk_of_is_sol_of_eq_init'
+-/
 
+#print LinearRecurrence.solSpace /-
 /-- The space of solutions of `E`, as a `submodule` over `α` of the module `ℕ → α`. -/
 def solSpace : Submodule α (ℕ → α)
     where
@@ -135,13 +150,17 @@ def solSpace : Submodule α (ℕ → α)
   add_mem' u v hu hv n := by simp [mul_add, sum_add_distrib, hu n, hv n]
   smul_mem' a u hu n := by simp [hu n, mul_sum] <;> congr <;> ext <;> ac_rfl
 #align linear_recurrence.sol_space LinearRecurrence.solSpace
+-/
 
+#print LinearRecurrence.is_sol_iff_mem_solSpace /-
 /-- Defining property of the solution space : `u` is a solution
   iff it belongs to the solution space. -/
 theorem is_sol_iff_mem_solSpace (u : ℕ → α) : E.IsSolution u ↔ u ∈ E.solSpace :=
   Iff.rfl
 #align linear_recurrence.is_sol_iff_mem_sol_space LinearRecurrence.is_sol_iff_mem_solSpace
+-/
 
+#print LinearRecurrence.toInit /-
 /-- The function that maps a solution `u` of `E` to its first
   `E.order` terms as a `linear_equiv`. -/
 def toInit : E.solSpace ≃ₗ[α] Fin E.order → α
@@ -157,7 +176,9 @@ def toInit : E.solSpace ≃ₗ[α] Fin E.order → α
   left_inv u := by ext n <;> symm <;> apply E.eq_mk_of_is_sol_of_eq_init u.2 <;> intro k <;> rfl
   right_inv u := Function.funext_iff.mpr fun n => E.mkSol_eq_init u n
 #align linear_recurrence.to_init LinearRecurrence.toInit
+-/
 
+#print LinearRecurrence.sol_eq_of_eq_init /-
 /-- Two solutions are equal iff they are equal on `range E.order`. -/
 theorem sol_eq_of_eq_init (u v : ℕ → α) (hu : E.IsSolution u) (hv : E.IsSolution v) :
     u = v ↔ Set.EqOn u v ↑(range E.order) :=
@@ -172,12 +193,14 @@ theorem sol_eq_of_eq_init (u v : ℕ → α) (hu : E.IsSolution u) (hv : E.IsSol
   ext x
   exact_mod_cast h (mem_range.mpr x.2)
 #align linear_recurrence.sol_eq_of_eq_init LinearRecurrence.sol_eq_of_eq_init
+-/
 
 /-! `E.tuple_succ` maps `![s₀, s₁, ..., sₙ]` to `![s₁, ..., sₙ, ∑ (E.coeffs i) * sᵢ]`,
   where `n := E.order`. This operation is quite useful for determining closed-form
   solutions of `E`. -/
 
 
+#print LinearRecurrence.tupleSucc /-
 /-- `E.tuple_succ` maps `![s₀, s₁, ..., sₙ]` to `![s₁, ..., sₙ, ∑ (E.coeffs i) * sᵢ]`,
   where `n := E.order`. -/
 def tupleSucc : (Fin E.order → α) →ₗ[α] Fin E.order → α
@@ -191,6 +214,7 @@ def tupleSucc : (Fin E.order → α) →ₗ[α] Fin E.order → α
     split_ifs <;> simp [h, mul_sum]
     exact sum_congr rfl fun x _ => by ac_rfl
 #align linear_recurrence.tuple_succ LinearRecurrence.tupleSucc
+-/
 
 end CommSemiring
 
@@ -200,6 +224,12 @@ section StrongRankCondition
 -- `comm_ring_strong_rank_condition`, is in a much later file.
 variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
+/- warning: linear_recurrence.sol_space_rank -> LinearRecurrence.solSpace_rank is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (coeSort.{succ u1, succ (succ u1)} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.Function.module.{0, u1, u1} Nat α α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] [_inst_2 : StrongRankCondition.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1))] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)), Eq.{succ (succ u1)} Cardinal.{u1} (Module.rank.{u1, u1} α (Subtype.{succ u1} (Nat -> α) (fun (x : Nat -> α) => Membership.mem.{u1, u1} (Nat -> α) (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (SetLike.instMembership.{u1, u1} (Submodule.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (Nat -> α) (Submodule.setLike.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) x (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (Submodule.addCommMonoid.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E)) (Submodule.module.{u1, u1} α (Nat -> α) (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (Pi.addCommMonoid.{0, u1} Nat (fun (ᾰ : Nat) => α) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))))) (Pi.module.{0, u1, u1} Nat (fun (a._@.Mathlib.Algebra.LinearRecurrence._hyg.1024 : Nat) => α) α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (fun (i : Nat) => NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1))))) (fun (i : Nat) => Semiring.toModule.{u1} α (CommSemiring.toSemiring.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)))) (LinearRecurrence.solSpace.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} (LinearRecurrence.order.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E))
+Case conversion may be inaccurate. Consider using '#align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rankₓ'. -/
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
   letI := nontrivial_of_invariantBasisNumber α
@@ -212,12 +242,20 @@ section CommRing
 
 variable {α : Type _} [CommRing α] (E : LinearRecurrence α)
 
+#print LinearRecurrence.charPoly /-
 /-- The characteristic polynomial of `E` is
 `X ^ E.order - ∑ i : fin E.order, (E.coeffs i) * X ^ i`. -/
 def charPoly : α[X] :=
   Polynomial.monomial E.order 1 - ∑ i : Fin E.order, Polynomial.monomial i (E.coeffs i)
 #align linear_recurrence.char_poly LinearRecurrence.charPoly
+-/
 
+/- warning: linear_recurrence.geom_sol_iff_root_char_poly -> LinearRecurrence.geom_sol_iff_root_charPoly is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (Ring.toMonoid.{u1} α (CommRing.toRing.{u1} α _inst_1)))) q n)) (Polynomial.IsRoot.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : CommRing.{u1} α] (E : LinearRecurrence.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1)) (q : α), Iff (LinearRecurrence.IsSolution.{u1} α (CommRing.toCommSemiring.{u1} α _inst_1) E (fun (n : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)))))) q n)) (Polynomial.IsRoot.{u1} α (Ring.toSemiring.{u1} α (CommRing.toRing.{u1} α _inst_1)) (LinearRecurrence.charPoly.{u1} α _inst_1 E) q)
+Case conversion may be inaccurate. Consider using '#align linear_recurrence.geom_sol_iff_root_char_poly LinearRecurrence.geom_sol_iff_root_charPolyₓ'. -/
 /-- The geometric sequence `q^n` is a solution of `E` iff
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) : (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 
 ! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 7aac545b979fe3ffab5c93b833129e5c8d826296
+! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -201,10 +201,10 @@ section StrongRankCondition
 variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
 /-- The dimension of `E.sol_space` is `E.order`. -/
-theorem solSpace_dim : Module.rank α E.solSpace = E.order :=
+theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
   letI := nontrivial_of_invariantBasisNumber α
-  @dim_fin_fun α _ _ E.order ▸ E.to_init.dim_eq
-#align linear_recurrence.sol_space_dim LinearRecurrence.solSpace_dim
+  @rank_fin_fun α _ _ E.order ▸ E.to_init.rank_eq
+#align linear_recurrence.sol_space_rank LinearRecurrence.solSpace_rank
 
 end StrongRankCondition
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 
 ! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 3cacc945118c8c637d89950af01da78307f59325
+! leanprover-community/mathlib commit 7aac545b979fe3ffab5c93b833129e5c8d826296
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -203,7 +203,7 @@ variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurre
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_dim : Module.rank α E.solSpace = E.order :=
   letI := nontrivial_of_invariantBasisNumber α
-  @dim_fin_fun α _ _ _ E.order ▸ E.to_init.dim_eq
+  @dim_fin_fun α _ _ E.order ▸ E.to_init.dim_eq
 #align linear_recurrence.sol_space_dim LinearRecurrence.solSpace_dim
 
 end StrongRankCondition
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 
 ! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 85d9f2189d9489f9983c0d01536575b0233bd305
+! leanprover-community/mathlib commit 3cacc945118c8c637d89950af01da78307f59325
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -194,16 +194,19 @@ def tupleSucc : (Fin E.order → α) →ₗ[α] Fin E.order → α
 
 end CommSemiring
 
-section Field
+section StrongRankCondition
 
-variable {α : Type _} [Field α] (E : LinearRecurrence α)
+-- note: `strong_rank_condition` is the same as `nontrivial` on `comm_ring`s, but that result,
+-- `comm_ring_strong_rank_condition`, is in a much later file.
+variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
 /-- The dimension of `E.sol_space` is `E.order`. -/
 theorem solSpace_dim : Module.rank α E.solSpace = E.order :=
-  @dim_fin_fun α _ E.order ▸ E.toInit.dim_eq
+  letI := nontrivial_of_invariantBasisNumber α
+  @dim_fin_fun α _ _ _ E.order ▸ E.to_init.dim_eq
 #align linear_recurrence.sol_space_dim LinearRecurrence.solSpace_dim
 
-end Field
+end StrongRankCondition
 
 section CommRing
 

Changes in mathlib4

mathlib3
mathlib4
chore: rename IsRoot.definition back to IsRoot.def (#11999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -216,7 +216,7 @@ def charPoly : α[X] :=
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) :
     (E.IsSolution fun n ↦ q ^ n) ↔ E.charPoly.IsRoot q := by
-  rw [charPoly, Polynomial.IsRoot.definition, Polynomial.eval]
+  rw [charPoly, Polynomial.IsRoot.def, Polynomial.eval]
   simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial,
     Polynomial.eval₂_sub]
   constructor
move(Polynomial): Move out of Data (#11751)

Polynomial and MvPolynomial are algebraic objects, hence should be under Algebra (or at least not under Data)

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 -/
-import Mathlib.Data.Polynomial.Eval
+import Mathlib.Algebra.Polynomial.Eval
 import Mathlib.LinearAlgebra.Dimension.Constructions
 
 #align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
chore: rename away from 'def' (#11548)

This will become an error in 2024-03-16 nightly, possibly not permanently.

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -216,7 +216,7 @@ def charPoly : α[X] :=
   `q` is a root of `E`'s characteristic polynomial. -/
 theorem geom_sol_iff_root_charPoly (q : α) :
     (E.IsSolution fun n ↦ q ^ n) ↔ E.charPoly.IsRoot q := by
-  rw [charPoly, Polynomial.IsRoot.def, Polynomial.eval]
+  rw [charPoly, Polynomial.IsRoot.definition, Polynomial.eval]
   simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial,
     Polynomial.eval₂_sub]
   constructor
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -160,7 +160,7 @@ theorem sol_eq_of_eq_init (u v : ℕ → α) (hu : E.IsSolution u) (hv : E.IsSol
   set u' : ↥E.solSpace := ⟨u, hu⟩
   set v' : ↥E.solSpace := ⟨v, hv⟩
   change u'.val = v'.val
-  suffices h' : u' = v'; exact h' ▸ rfl
+  suffices h' : u' = v' from h' ▸ rfl
   rw [← E.toInit.toEquiv.apply_eq_iff_eq, LinearEquiv.coe_toEquiv]
   ext x
   exact mod_cast h (mem_range.mpr x.2)
chore: Reorganize results about rank and finrank. (#9349)

The files Mathlib.LinearAlgebra.FreeModule.Rank, Mathlib.LinearAlgebra.FreeModule.Finite.Rank, Mathlib.LinearAlgebra.Dimension and Mathlib.LinearAlgebra.Finrank were reorganized into a folder Mathlib.LinearAlgebra.Dimension, containing the following files

  • Basic.lean: Contains the definition of Module.rank.
  • Finrank.lean: Contains the definition of FiniteDimensional.finrank.
  • StrongRankCondition.lean: Contains results about rank and finrank over rings satisfying strong rank condition
  • Free.lean: Contains results about rank and finrank of free modules
  • Finite.lean: Contains conditions or consequences for rank to be finite or zero
  • Constructions.lean: Contains the calculation of the rank of various constructions.
  • DivisionRing.lean: Contains results about rank and finrank of spaces over division rings.
  • LinearMap.lean: Contains results about LinearMap.rank

API changes: IsNoetherian.rank_lt_aleph0 and FiniteDimensional.rank_lt_aleph0 are replaced with rank_lt_aleph0. Module.Free.finite_basis was renamed to Module.Finite.finite_basis. FiniteDimensional.finrank_eq_rank was renamed to finrank_eq_rank. rank_eq_cardinal_basis and rank_eq_cardinal_basis' were removed in favour of Basis.mk_eq_mk and Basis.mk_eq_mk''.

Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
 -/
 import Mathlib.Data.Polynomial.Eval
-import Mathlib.LinearAlgebra.Dimension
+import Mathlib.LinearAlgebra.Dimension.Constructions
 
 #align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
 
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -102,7 +102,7 @@ theorem eq_mk_of_is_sol_of_eq_init {u : ℕ → α} {init : Fin E.order → α}
   intro n
   rw [mkSol]
   split_ifs with h'
-  · exact_mod_cast heq ⟨n, h'⟩
+  · exact mod_cast heq ⟨n, h'⟩
   simp only
   rw [← tsub_add_cancel_of_le (le_of_not_lt h'), h (n - E.order)]
   congr with k
@@ -163,7 +163,7 @@ theorem sol_eq_of_eq_init (u v : ℕ → α) (hu : E.IsSolution u) (hv : E.IsSol
   suffices h' : u' = v'; exact h' ▸ rfl
   rw [← E.toInit.toEquiv.apply_eq_iff_eq, LinearEquiv.coe_toEquiv]
   ext x
-  exact_mod_cast h (mem_range.mpr x.2)
+  exact mod_cast h (mem_range.mpr x.2)
 #align linear_recurrence.sol_eq_of_eq_init LinearRecurrence.sol_eq_of_eq_init
 
 /-! `E.tupleSucc` maps `![s₀, s₁, ..., sₙ]` to `![s₁, ..., sₙ, ∑ (E.coeffs i) * sᵢ]`,
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -46,19 +46,19 @@ open BigOperators Polynomial
 
 /-- A "linear recurrence relation" over a commutative semiring is given by its
   order `n` and `n` coefficients. -/
-structure LinearRecurrence (α : Type _) [CommSemiring α] where
+structure LinearRecurrence (α : Type*) [CommSemiring α] where
   order : ℕ
   coeffs : Fin order → α
 #align linear_recurrence LinearRecurrence
 
-instance (α : Type _) [CommSemiring α] : Inhabited (LinearRecurrence α) :=
+instance (α : Type*) [CommSemiring α] : Inhabited (LinearRecurrence α) :=
   ⟨⟨0, default⟩⟩
 
 namespace LinearRecurrence
 
 section CommSemiring
 
-variable {α : Type _} [CommSemiring α] (E : LinearRecurrence α)
+variable {α : Type*} [CommSemiring α] (E : LinearRecurrence α)
 
 /-- We say that a sequence `u` is solution of `LinearRecurrence order coeffs` when we have
   `u (n + order) = ∑ i : Fin order, coeffs i * u (n + i)` for any `n`. -/
@@ -192,7 +192,7 @@ section StrongRankCondition
 
 -- note: `StrongRankCondition` is the same as `Nontrivial` on `CommRing`s, but that result,
 -- `commRing_strongRankCondition`, is in a much later file.
-variable {α : Type _} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
+variable {α : Type*} [CommRing α] [StrongRankCondition α] (E : LinearRecurrence α)
 
 /-- The dimension of `E.solSpace` is `E.order`. -/
 theorem solSpace_rank : Module.rank α E.solSpace = E.order :=
@@ -204,7 +204,7 @@ end StrongRankCondition
 
 section CommRing
 
-variable {α : Type _} [CommRing α] (E : LinearRecurrence α)
+variable {α : Type*} [CommRing α] (E : LinearRecurrence α)
 
 /-- The characteristic polynomial of `E` is
 `X ^ E.order - ∑ i : Fin E.order, (E.coeffs i) * X ^ i`. -/
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Anatole Dedecker. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anatole Dedecker
-
-! This file was ported from Lean 3 source module algebra.linear_recurrence
-! leanprover-community/mathlib commit 039a089d2a4b93c761b234f3e5f5aeb752bac60f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Polynomial.Eval
 import Mathlib.LinearAlgebra.Dimension
 
+#align_import algebra.linear_recurrence from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f"
+
 /-!
 # Linear recurrence
 
feat: port Algebra.LinearRecurrence (#3380)

Dependencies 8 + 517

518 files ported (98.5%)
217630 lines ported (98.6%)
Show graph

The unported dependencies are