theorem determinant_aux (hyp : n = 0 ∨ ¬(of v).TerminatedAt (n - 1)) :
    ((of v).continuantsAux n).a * ((of v).continuantsAux (n + 1)).b -
      ((of v).continuantsAux n).b * ((of v).continuantsAux (n + 1)).a = (-1) ^ n := by
  induction' n with n IH
  case zero => simp [continuantsAux]
  case succ =>
    -- set up some shorthand notation
    let g := of v
    let conts := continuantsAux g (n + 2)
    set pred_conts := continuantsAux g (n + 1) with pred_conts_eq
    set ppred_conts := continuantsAux g n with ppred_conts_eq
    let pA := pred_conts.a
    let pB := pred_conts.b
    let ppA := ppred_conts.a
    let ppB := ppred_conts.b
    -- let's change the goal to something more readable
    change pA * conts.b - pB * conts.a = (-1) ^ (n + 1)
    have not_terminated_at_n : ¬TerminatedAt g n := Or.resolve_left hyp n.succ_ne_zero
    obtain ⟨gp, s_nth_eq⟩ : ∃ gp, g.s.get? n = some gp
    exact Option.ne_none_iff_exists'.1 not_terminated_at_n
    -- unfold the recurrence relation for `conts` once and simplify to derive the following
    suffices pA * (ppB + gp.b * pB) - pB * (ppA + gp.b * pA) = (-1) ^ (n + 1) by
      simp only [continuantsAux_recurrence s_nth_eq ppred_conts_eq pred_conts_eq]
      have gp_a_eq_one : gp.a = 1 := of_part_num_eq_one (part_num_eq_s_a s_nth_eq)
      rw [gp_a_eq_one, this.symm]
      ring
    suffices : pA * ppB - pB * ppA = (-1) ^ (n + 1);
    

Proof state:
case intro
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
hyp : Nat.succ n = 0 ∨ ¬TerminatedAt (of v) (Nat.succ n - 1)
g : GeneralizedContinuedFraction K := of v
conts : Pair K := continuantsAux g (n + 2)
pred_conts : Pair K := continuantsAux g (n + 1)
pred_conts_eq : pred_conts = continuantsAux g (n + 1)
ppred_conts : Pair K := continuantsAux g n
IH : n = 0 ∨ ¬TerminatedAt (of v) (n - 1) → ppred_conts.a * pred_conts.b - ppred_conts.b * pred_conts.a = (-1) ^ n
ppred_conts_eq : ppred_conts = continuantsAux g n
pA : K := pred_conts.a
pB : K := pred_conts.b
ppA : K := ppred_conts.a
ppB : K := ppred_conts.b
not_terminated_at_n : ¬TerminatedAt g n
gp : Pair K
s_nth_eq : Stream'.Seq.get? g.s n = some gp
this : pA * ppB - pB * ppA = (-1) ^ (n + 1)
⊢ pA * (ppB + gp.b * pB) - pB * (ppA + gp.b * pA) = (-1) ^ (n + 1)
case this
K : Type u_1
v : K
n✝ : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
n : ℕ
hyp : Nat.succ n = 0 ∨ ¬TerminatedAt (of v) (Nat.succ n - 1)
g : GeneralizedContinuedFraction K := of v
conts : Pair K := continuantsAux g (n + 2)
pred_conts : Pair K := continuantsAux g (n + 1)
pred_conts_eq : pred_conts = continuantsAux g (n + 1)
ppred_conts : Pair K := continuantsAux g n
IH : n = 0 ∨ ¬TerminatedAt (of v) (n - 1) → ppred_conts.a * pred_conts.b - ppred_conts.b * pred_conts.a = (-1) ^ n
ppred_conts_eq : ppred_conts = continuantsAux g n
pA : K := pred_conts.a
pB : K := pred_conts.b
ppA : K := ppred_conts.a
ppB : K := ppred_conts.b
not_terminated_at_n : ¬TerminatedAt g n
gp : Pair K
s_nth_eq : Stream'.Seq.get? g.s n = some gp
⊢ pA * ppB - pB * ppA = (-1) ^ (n + 1)

Next tactic:
calc
      pA * (ppB + gp.b * pB) - pB * (ppA + gp.b * pA) =
          pA * ppB + pA * gp.b * pB - pB * ppA - pB * gp.b * pA := by ring
      _ = pA * ppB - pB * ppA := by ring
      _ = (-1) ^ (n + 1) := by assumption