Theorem: LinearRecurrence.geom_sol_iff_root_charPoly
File: Mathlib/Algebra/LinearRecurrence.lean

tactic: rw [charPoly, Polynomial.IsRoot.def, Polynomial.eval]
state_before: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) ↔ E.charPoly.IsRoot q
state_after: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) ↔
    eval₂ (RingHom.id α) q ((monomial E.order) 1 - ∑ i : Fin E.order, (monomial ↑i) (E.coeffs i)) = 0

tactic: simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial,
  Polynomial.eval₂_sub]
state_before: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) ↔
    eval₂ (RingHom.id α) q ((monomial E.order) 1 - ∑ i : Fin E.order, (monomial ↑i) (E.coeffs i)) = 0
state_after: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) ↔ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0

tactic: constructor
state_before: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) ↔ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
state_after: case mp
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) → q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0

case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0 → E.IsSolution fun n => q ^ n

tactic: intro h
state_before: case mp
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ (E.IsSolution fun n => q ^ n) → q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
state_after: case mp
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : E.IsSolution fun n => q ^ n
⊢ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0

tactic: simpa [sub_eq_zero] using h 0
state_before: case mp
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : E.IsSolution fun n => q ^ n
⊢ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
state_after: no goals

tactic: intro h n
state_before: case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
⊢ q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0 → E.IsSolution fun n => q ^ n
state_after: case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
n : ℕ
⊢ (fun n => q ^ n) (n + E.order) = ∑ i : Fin E.order, E.coeffs i * (fun n => q ^ n) (n + ↑i)

tactic: simp only [pow_add, sub_eq_zero.mp h, mul_sum]
state_before: case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
n : ℕ
⊢ (fun n => q ^ n) (n + E.order) = ∑ i : Fin E.order, E.coeffs i * (fun n => q ^ n) (n + ↑i)
state_after: case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
n : ℕ
⊢ ∑ i : Fin E.order, q ^ n * (E.coeffs i * q ^ ↑i) = ∑ x : Fin E.order, E.coeffs x * (q ^ n * q ^ ↑x)

tactic: exact sum_congr rfl fun _ _ ↦ by ring
state_before: case mpr
α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
n : ℕ
⊢ ∑ i : Fin E.order, q ^ n * (E.coeffs i * q ^ ↑i) = ∑ x : Fin E.order, E.coeffs x * (q ^ n * q ^ ↑x)
state_after: no goals

tactic: ring
state_before: α : Type u_1
inst✝ : CommRing α
E : LinearRecurrence α
q : α
h : q ^ E.order - ∑ x : Fin E.order, E.coeffs x * q ^ ↑x = 0
n : ℕ
x✝¹ : Fin E.order
x✝ : x✝¹ ∈ univ
⊢ q ^ n * (E.coeffs x✝¹ * q ^ ↑x✝¹) = E.coeffs x✝¹ * (q ^ n * q ^ ↑x✝¹)
state_after: no goals