Theorem: GeneralizedContinuedFraction.fib_le_of_continuantsAux_b
File: Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean

tactic: intro n IH hyp
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
⊢ ∀ (n : ℕ),
    (∀ m < n, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b) →
      n ≤ 1 ∨ ¬(of v).TerminatedAt (n - 2) → ↑(fib n) ≤ ((of v).continuantsAux n).b
state_after: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n ≤ 1 ∨ ¬(of v).TerminatedAt (n - 2)
⊢ ↑(fib n) ≤ ((of v).continuantsAux n).b

tactic: rcases n with (_ | _ | n)
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n ≤ 1 ∨ ¬(of v).TerminatedAt (n - 2)
⊢ ↑(fib n) ≤ ((of v).continuantsAux n).b
state_after: case zero
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
IH : ∀ m < 0, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : 0 ≤ 1 ∨ ¬(of v).TerminatedAt (0 - 2)
⊢ ↑(fib 0) ≤ ((of v).continuantsAux 0).b

case succ.zero
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
IH : ∀ m < 0 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : 0 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (0 + 1 - 2)
⊢ ↑(fib (0 + 1)) ≤ ((of v).continuantsAux (0 + 1)).b

case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: simp [fib_add_two, continuantsAux]
state_before: case zero
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
IH : ∀ m < 0, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : 0 ≤ 1 ∨ ¬(of v).TerminatedAt (0 - 2)
⊢ ↑(fib 0) ≤ ((of v).continuantsAux 0).b
state_after: no goals

tactic: simp [fib_add_two, continuantsAux]
state_before: case succ.zero
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
IH : ∀ m < 0 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : 0 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (0 + 1 - 2)
⊢ ↑(fib (0 + 1)) ≤ ((of v).continuantsAux (0 + 1)).b
state_after: no goals

tactic: let g := of v
state_before: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: have : ¬n + 2 ≤ 1 := by omega
state_before: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: have not_terminated_at_n : ¬g.TerminatedAt n := Or.resolve_left hyp this
state_before: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: obtain ⟨gp, s_ppred_nth_eq⟩ : ∃ gp, g.s.get? n = some gp :=
  Option.ne_none_iff_exists'.mp not_terminated_at_n
state_before: case succ.succ
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: set pconts := g.continuantsAux (n + 1) with pconts_eq
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: set ppconts := g.continuantsAux n with ppconts_eq
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b

tactic: simp only [Nat.succ_eq_add_one, Nat.add_assoc, Nat.reduceAdd]
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib (n + 1 + 1)) ≤ ((of v).continuantsAux (n + 1 + 1)).b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib (n + 2)) ≤ ((of v).continuantsAux (n + 2)).b

tactic: suffices (fib n : K) + fib (n + 1) ≤ gp.a * ppconts.b + gp.b * pconts.b by
  simpa [fib_add_two, add_comm,
    continuantsAux_recurrence s_ppred_nth_eq ppconts_eq pconts_eq]
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib (n + 2)) ≤ ((of v).continuantsAux (n + 2)).b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ gp.a * ppconts.b + gp.b * pconts.b

tactic: suffices (fib n : K) + fib (n + 1) ≤ ppconts.b + gp.b * pconts.b by
  simpa [of_part_num_eq_one <| part_num_eq_s_a s_ppred_nth_eq]
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ gp.a * ppconts.b + gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b

tactic: have not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1) :=
  mt (terminated_stable <| Nat.sub_le n 1) not_terminated_at_n
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b

tactic: have not_terminated_at_ppred_n : ¬TerminatedAt g (n - 2) :=
  mt (terminated_stable (n - 1).pred_le) not_terminated_at_pred_n
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b

tactic: have ppred_nth_fib_le_ppconts_B : (fib n : K) ≤ ppconts.b :=
  IH n (lt_trans (Nat.lt.base n) <| Nat.lt.base <| n + 1) (Or.inr not_terminated_at_ppred_n)
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b

tactic: suffices (fib (n + 1) : K) ≤ gp.b * pconts.b by
  solve_by_elim [_root_.add_le_add ppred_nth_fib_le_ppconts_B]
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ ↑(fib (n + 1)) ≤ gp.b * pconts.b

tactic: suffices 1 * (fib (n + 1) : K) ≤ gp.b * pconts.b by rwa [one_mul] at this
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b

tactic: have one_le_gp_b : (1 : K) ≤ gp.b :=
  of_one_le_get?_part_denom (part_denom_eq_s_b s_ppred_nth_eq)
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b

tactic: have : (0 : K) ≤ fib (n + 1) := mod_cast (fib (n + 1)).zero_le
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this : 0 ≤ ↑(fib (n + 1))
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b

tactic: have : (0 : K) ≤ gp.b := le_trans zero_le_one one_le_gp_b
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this : 0 ≤ ↑(fib (n + 1))
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b

tactic: mono
state_before: case succ.succ.intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: case succ.succ.intro.h₂.a
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ n + 1 < n + 1 + 1

case succ.succ.intro.h₂.a
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ n + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 - 2)

tactic: omega
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
⊢ ¬n + 2 ≤ 1
state_after: no goals

tactic: simpa [fib_add_two, add_comm,
  continuantsAux_recurrence s_ppred_nth_eq ppconts_eq pconts_eq]
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
this : ↑(fib n) + ↑(fib (n + 1)) ≤ gp.a * ppconts.b + gp.b * pconts.b
⊢ ↑(fib (n + 2)) ≤ ((of v).continuantsAux (n + 2)).b
state_after: no goals

tactic: simpa [of_part_num_eq_one <| part_num_eq_s_a s_ppred_nth_eq]
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
this : ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ gp.a * ppconts.b + gp.b * pconts.b
state_after: no goals

tactic: solve_by_elim [_root_.add_le_add ppred_nth_fib_le_ppconts_B]
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
this : ↑(fib (n + 1)) ≤ gp.b * pconts.b
⊢ ↑(fib n) + ↑(fib (n + 1)) ≤ ppconts.b + gp.b * pconts.b
state_after: no goals

tactic: rwa [one_mul] at this
state_before: K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
this : 1 * ↑(fib (n + 1)) ≤ gp.b * pconts.b
⊢ ↑(fib (n + 1)) ≤ gp.b * pconts.b
state_after: no goals

tactic: norm_num
state_before: case succ.succ.intro.h₂.a
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ n + 1 < n + 1 + 1
state_after: no goals

tactic: tauto
state_before: case succ.succ.intro.h₂.a
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
IH : ∀ m < n + 1 + 1, m ≤ 1 ∨ ¬(of v).TerminatedAt (m - 2) → ↑(fib m) ≤ ((of v).continuantsAux m).b
hyp : n + 1 + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 + 1 - 2)
g : GeneralizedContinuedFraction K := of v
this✝¹ : ¬n + 2 ≤ 1
not_terminated_at_n : ¬g.TerminatedAt n
gp : Pair K
s_ppred_nth_eq : g.s.get? n = some gp
pconts : Pair K := g.continuantsAux (n + 1)
pconts_eq : pconts = g.continuantsAux (n + 1)
ppconts : Pair K := g.continuantsAux n
ppconts_eq : ppconts = g.continuantsAux n
not_terminated_at_pred_n : ¬g.TerminatedAt (n - 1)
not_terminated_at_ppred_n : ¬g.TerminatedAt (n - 2)
ppred_nth_fib_le_ppconts_B : ↑(fib n) ≤ ppconts.b
one_le_gp_b : 1 ≤ gp.b
this✝ : 0 ≤ ↑(fib (n + 1))
this : 0 ≤ gp.b
⊢ n + 1 ≤ 1 ∨ ¬(of v).TerminatedAt (n + 1 - 2)
state_after: no goals