Theorem: GeneralizedContinuedFraction.squashSeq_nth_of_lt
File: Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean

tactic: cases s_succ_nth_eq : s.get? (n + 1)
state_before: K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: case none => rw [squashSeq_eq_self_of_terminated s_succ_nth_eq]
state_before: case none
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = none
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

case some
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: case some =>
  obtain ⟨gp_n, s_nth_eq⟩ : ∃ gp_n, s.get? n = some gp_n
  exact s.ge_stable n.le_succ s_succ_nth_eq
  obtain ⟨gp_m, s_mth_eq⟩ : ∃ gp_m, s.get? m = some gp_m
  exact s.ge_stable (le_of_lt m_lt_n) s_nth_eq
  simp [*, squashSeq, m_lt_n.ne]
state_before: case some
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: rw [squashSeq_eq_self_of_terminated s_succ_nth_eq]
state_before: K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = none
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: obtain ⟨gp_n, s_nth_eq⟩ : ∃ gp_n, s.get? n = some gp_n
state_before: K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: exact s.ge_stable n.le_succ s_succ_nth_eq
state_before: K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
⊢ ∃ gp_n, Stream'.Seq.get? s n = some gp_n

case intro
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
gp_n : Pair K
s_nth_eq : Stream'.Seq.get? s n = some gp_n
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: obtain ⟨gp_m, s_mth_eq⟩ : ∃ gp_m, s.get? m = some gp_m
state_before: case intro
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
gp_n : Pair K
s_nth_eq : Stream'.Seq.get? s n = some gp_n
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: exact s.ge_stable (le_of_lt m_lt_n) s_nth_eq
state_before: K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
gp_n : Pair K
s_nth_eq : Stream'.Seq.get? s n = some gp_n
⊢ ∃ gp_m, Stream'.Seq.get? s m = some gp_m

case intro.intro
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
gp_n : Pair K
s_nth_eq : Stream'.Seq.get? s n = some gp_n
gp_m : Pair K
s_mth_eq : Stream'.Seq.get? s m = some gp_m
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m

tactic: simp [*, squashSeq, m_lt_n.ne]
state_before: case intro.intro
K : Type u_1
n : ℕ
g : GeneralizedContinuedFraction K
s : Stream'.Seq (Pair K)
inst✝ : DivisionRing K
m : ℕ
m_lt_n : m < n
val✝ : Pair K
s_succ_nth_eq : Stream'.Seq.get? s (n + 1) = some val✝
gp_n : Pair K
s_nth_eq : Stream'.Seq.get? s n = some gp_n
gp_m : Pair K
s_mth_eq : Stream'.Seq.get? s m = some gp_m
⊢ Stream'.Seq.get? (squashSeq s n) m = Stream'.Seq.get? s m