Theorem: Real.coe_fib_eq'
File: Mathlib/Data/Real/GoldenRatio.lean

tactic: rw [fibRec.sol_eq_of_eq_init]
state_before: ⊢ (fun n => ↑(Nat.fib n)) = fun n => (φ ^ n - ψ ^ n) / √5
state_after: ⊢ Set.EqOn (fun n => ↑(Nat.fib n)) (fun n => (φ ^ n - ψ ^ n) / √5) ↑(Finset.range fibRec.order)

case hu

⊢ fibRec.IsSolution fun n => ↑(Nat.fib n)

case hv

⊢ fibRec.IsSolution fun n => (φ ^ n - ψ ^ n) / √5

tactic: intro i hi
state_before: ⊢ Set.EqOn (fun n => ↑(Nat.fib n)) (fun n => (φ ^ n - ψ ^ n) / √5) ↑(Finset.range fibRec.order)
state_after: i : ℕ
hi : i ∈ ↑(Finset.range fibRec.order)
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / √5) i

tactic: norm_cast at hi
state_before: i : ℕ
hi : i ∈ ↑(Finset.range fibRec.order)
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / √5) i
state_after: i : ℕ
hi : i ∈ Finset.range fibRec.order
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / √5) i

tactic: fin_cases hi
state_before: i : ℕ
hi : i ∈ Finset.range fibRec.order
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / √5) i
state_after: case head

⊢ (fun n => ↑(Nat.fib n)) 0 = (fun n => (φ ^ n - ψ ^ n) / √5) 0

case tail.head

⊢ (fun n => ↑(Nat.fib n)) 1 = (fun n => (φ ^ n - ψ ^ n) / √5) 1

tactic: simp
state_before: case head

⊢ (fun n => ↑(Nat.fib n)) 0 = (fun n => (φ ^ n - ψ ^ n) / √5) 0
state_after: no goals

tactic: simp only [goldenRatio, goldenConj]
state_before: case tail.head

⊢ (fun n => ↑(Nat.fib n)) 1 = (fun n => (φ ^ n - ψ ^ n) / √5) 1
state_after: case tail.head

⊢ ↑(Nat.fib 1) = (((1 + √5) / 2) ^ 1 - ((1 - √5) / 2) ^ 1) / √5

tactic: ring_nf
state_before: case tail.head

⊢ ↑(Nat.fib 1) = (((1 + √5) / 2) ^ 1 - ((1 - √5) / 2) ^ 1) / √5
state_after: case tail.head

⊢ 1 = √5 * (√5)⁻¹

tactic: rw [mul_inv_cancel]
state_before: case tail.head

⊢ 1 = √5 * (√5)⁻¹
state_after: case tail.head

⊢ √5 ≠ 0

tactic: norm_num
state_before: case tail.head

⊢ √5 ≠ 0
state_after: no goals

tactic: exact fib_isSol_fibRec
state_before: case hu

⊢ fibRec.IsSolution fun n => ↑(Nat.fib n)
state_after: no goals

tactic: suffices LinearRecurrence.IsSolution fibRec
    ((fun n ↦ (√5)⁻¹ * φ ^ n) - (fun n ↦ (√5)⁻¹ * ψ ^ n)) by
  convert this
  rw [Pi.sub_apply]
  ring
state_before: case hv

⊢ fibRec.IsSolution fun n => (φ ^ n - ψ ^ n) / √5
state_after: case hv

⊢ fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)

tactic: apply (@fibRec ℝ _).solSpace.sub_mem
state_before: case hv

⊢ fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
state_after: case hv.a

⊢ (fun n => (√5)⁻¹ * φ ^ n) ∈ fibRec.solSpace

case hv.a

⊢ (fun n => (√5)⁻¹ * ψ ^ n) ∈ fibRec.solSpace

tactic: convert this
state_before: this : fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
⊢ fibRec.IsSolution fun n => (φ ^ n - ψ ^ n) / √5
state_after: case h.e'_4.h
this : fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / √5 = ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n) x✝

tactic: rw [Pi.sub_apply]
state_before: case h.e'_4.h
this : fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / √5 = ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n) x✝
state_after: case h.e'_4.h
this : fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / √5 = (√5)⁻¹ * φ ^ x✝ - (√5)⁻¹ * ψ ^ x✝

tactic: ring
state_before: case h.e'_4.h
this : fibRec.IsSolution ((fun n => (√5)⁻¹ * φ ^ n) - fun n => (√5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / √5 = (√5)⁻¹ * φ ^ x✝ - (√5)⁻¹ * ψ ^ x✝
state_after: no goals

tactic: exact Submodule.smul_mem fibRec.solSpace (√5)⁻¹ geom_gold_isSol_fibRec
state_before: case hv.a

⊢ (fun n => (√5)⁻¹ * φ ^ n) ∈ fibRec.solSpace
state_after: no goals

tactic: exact Submodule.smul_mem fibRec.solSpace (√5)⁻¹ geom_goldConj_isSol_fibRec
state_before: case hv.a

⊢ (fun n => (√5)⁻¹ * ψ ^ n) ∈ fibRec.solSpace
state_after: no goals