Theorem: GeneralizedContinuedFraction.exists_gcf_pair_rat_eq_of_nth_conts_aux
File: Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean

tactic: clear n
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
n : ℕ
⊢ ∀ (n : ℕ),
    (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →
      ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts
state_after: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
⊢ ∀ (n : ℕ),
    (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →
      ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts

tactic: let g := of v
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
⊢ ∀ (n : ℕ),
    (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →
      ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts
state_after: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
⊢ ∀ (n : ℕ),
    (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →
      ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts

tactic: intro n IH
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
⊢ ∀ (n : ℕ),
    (∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts) →
      ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts
state_after: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts

tactic: rcases n with (_ | _ | n)
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux n = Pair.map Rat.cast conts
state_after: case zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux 0 = Pair.map Rat.cast conts

case succ.zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux (0 + 1) = Pair.map Rat.cast conts

case succ.succ
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

tactic: suffices ∃ gp : Pair ℚ, Pair.mk (1 : K) 0 = gp.map (↑) by simpa [continuantsAux]
state_before: case zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux 0 = Pair.map Rat.cast conts
state_after: case zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ gp, { a := 1, b := 0 } = Pair.map Rat.cast gp

tactic: use Pair.mk 1 0
state_before: case zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ gp, { a := 1, b := 0 } = Pair.map Rat.cast gp
state_after: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ { a := 1, b := 0 } = Pair.map Rat.cast { a := 1, b := 0 }

tactic: simp
state_before: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ { a := 1, b := 0 } = Pair.map Rat.cast { a := 1, b := 0 }
state_after: no goals

tactic: simpa [continuantsAux]
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
this : ∃ gp, { a := 1, b := 0 } = Pair.map Rat.cast gp
⊢ ∃ conts, (of v).continuantsAux 0 = Pair.map Rat.cast conts
state_after: no goals

tactic: suffices ∃ conts : Pair ℚ, Pair.mk g.h 1 = conts.map (↑) by simpa [continuantsAux]
state_before: case succ.zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux (0 + 1) = Pair.map Rat.cast conts
state_after: case succ.zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, { a := g.h, b := 1 } = Pair.map Rat.cast conts

tactic: use Pair.mk ⌊v⌋ 1
state_before: case succ.zero
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, { a := g.h, b := 1 } = Pair.map Rat.cast conts
state_after: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ { a := g.h, b := 1 } = Pair.map Rat.cast { a := ↑⌊v⌋, b := 1 }

tactic: simp [g]
state_before: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ { a := g.h, b := 1 } = Pair.map Rat.cast { a := ↑⌊v⌋, b := 1 }
state_after: no goals

tactic: simpa [continuantsAux]
state_before: K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
IH : ∀ m < 0 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
this : ∃ conts, { a := g.h, b := 1 } = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux (0 + 1) = Pair.map Rat.cast conts
state_after: no goals

tactic: cases' IH (n + 1) <| lt_add_one (n + 1) with pred_conts pred_conts_eq
state_before: case succ.succ
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case succ.succ.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

tactic: cases' s_ppred_nth_eq : g.s.get? n with gp_n
state_before: case succ.succ.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case succ.succ.intro.none
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

case succ.succ.intro.some
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

tactic: use pred_conts
state_before: case succ.succ.intro.none
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
⊢ (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast pred_conts

tactic: have : g.continuantsAux (n + 2) = g.continuantsAux (n + 1) :=
  continuantsAux_stable_of_terminated (n + 1).le_succ s_ppred_nth_eq
state_before: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
⊢ (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast pred_conts
state_after: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
this : g.continuantsAux (n + 2) = g.continuantsAux (n + 1)
⊢ (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast pred_conts

tactic: simp only [this, pred_conts_eq]
state_before: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
s_ppred_nth_eq : g.s.get? n = none
this : g.continuantsAux (n + 2) = g.continuantsAux (n + 1)
⊢ (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast pred_conts
state_after: no goals

tactic: cases' IH n <| lt_of_le_of_lt n.le_succ <| lt_add_one <| n + 1 with ppred_conts
  ppred_conts_eq
state_before: case succ.succ.intro.some
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case succ.succ.intro.some.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

tactic: obtain ⟨a_eq_one, z, b_eq_z⟩ : gp_n.a = 1 ∧ ∃ z : ℤ, gp_n.b = (z : K) :=
  of_part_num_eq_one_and_exists_int_part_denom_eq s_ppred_nth_eq
state_before: case succ.succ.intro.some.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case succ.succ.intro.some.intro.intro.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts

tactic: simp only [a_eq_one, b_eq_z,
  continuantsAux_recurrence s_ppred_nth_eq ppred_conts_eq pred_conts_eq]
state_before: case succ.succ.intro.some.intro.intro.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ ∃ conts, (of v).continuantsAux (n + 1 + 1) = Pair.map Rat.cast conts
state_after: case succ.succ.intro.some.intro.intro.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ ∃ conts,
    { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,
        b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =
      Pair.map Rat.cast conts

tactic: use nextContinuants 1 (z : ℚ) ppred_conts pred_conts
state_before: case succ.succ.intro.some.intro.intro.intro
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ ∃ conts,
    { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,
        b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =
      Pair.map Rat.cast conts
state_after: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,
      b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =
    Pair.map Rat.cast (nextContinuants 1 (↑z) ppred_conts pred_conts)

tactic: cases ppred_conts
state_before: case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
ppred_conts : Pair ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast ppred_conts
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,
      b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =
    Pair.map Rat.cast (nextContinuants 1 (↑z) ppred_conts pred_conts)
state_after: case h.mk
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
a✝ b✝ : ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast { a := a✝, b := b✝ }
⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).a,
      b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).b } =
    Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝, b := b✝ } pred_conts)

tactic: cases pred_conts
state_before: case h.mk
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
pred_conts : Pair ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast pred_conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
a✝ b✝ : ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast { a := a✝, b := b✝ }
⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).a,
      b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).b } =
    Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝, b := b✝ } pred_conts)
state_after: case h.mk.mk
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
a✝¹ b✝¹ : ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast { a := a✝¹, b := b✝¹ }
a✝ b✝ : ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast { a := a✝, b := b✝ }
⊢ { a := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).a + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).a,
      b := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).b + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).b } =
    Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝¹, b := b✝¹ } { a := a✝, b := b✝ })

tactic: simp [nextContinuants, nextNumerator, nextDenominator]
state_before: case h.mk.mk
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
g : GeneralizedContinuedFraction K := of v
n : ℕ
IH : ∀ m < n + 1 + 1, ∃ conts, (of v).continuantsAux m = Pair.map Rat.cast conts
gp_n : Pair K
s_ppred_nth_eq : g.s.get? n = some gp_n
a_eq_one : gp_n.a = 1
z : ℤ
b_eq_z : gp_n.b = ↑z
a✝¹ b✝¹ : ℚ
ppred_conts_eq : (of v).continuantsAux n = Pair.map Rat.cast { a := a✝¹, b := b✝¹ }
a✝ b✝ : ℚ
pred_conts_eq : (of v).continuantsAux (n + 1) = Pair.map Rat.cast { a := a✝, b := b✝ }
⊢ { a := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).a + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).a,
      b := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).b + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).b } =
    Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝¹, b := b✝¹ } { a := a✝, b := b✝ })
state_after: no goals