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

tactic: obtain ⟨ifp, stream_succ_nth_eq, -⟩ : ∃ ifp, IntFractPair.stream v (n + 1) = some ifp ∧ _ :=
  IntFractPair.exists_succ_get?_stream_of_gcf_of_get?_eq_some nth_s_eq
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
⊢ gp.a = 1 ∧ ∃ z, gp.b = ↑z
state_after: case intro.intro
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
⊢ gp.a = 1 ∧ ∃ z, gp.b = ↑z

tactic: have : gp = ⟨1, ifp.b⟩ := by
  have : (of v).s.get? n = some ⟨1, ifp.b⟩ :=
    get?_of_eq_some_of_succ_get?_intFractPair_stream stream_succ_nth_eq
  have : some gp = some ⟨1, ifp.b⟩ := by rwa [nth_s_eq] at this
  injection this
state_before: case intro.intro
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
⊢ gp.a = 1 ∧ ∃ z, gp.b = ↑z
state_after: case intro.intro
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this : gp = { a := 1, b := ↑ifp.b }
⊢ gp.a = 1 ∧ ∃ z, gp.b = ↑z

tactic: simp [this]
state_before: case intro.intro
K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this : gp = { a := 1, b := ↑ifp.b }
⊢ gp.a = 1 ∧ ∃ z, gp.b = ↑z
state_after: no goals

tactic: have : (of v).s.get? n = some ⟨1, ifp.b⟩ :=
  get?_of_eq_some_of_succ_get?_intFractPair_stream stream_succ_nth_eq
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
⊢ gp = { a := 1, b := ↑ifp.b }
state_after: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this : (of v).s.get? n = some { a := 1, b := ↑ifp.b }
⊢ gp = { a := 1, b := ↑ifp.b }

tactic: have : some gp = some ⟨1, ifp.b⟩ := by rwa [nth_s_eq] at this
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this : (of v).s.get? n = some { a := 1, b := ↑ifp.b }
⊢ gp = { a := 1, b := ↑ifp.b }
state_after: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this✝ : (of v).s.get? n = some { a := 1, b := ↑ifp.b }
this : some gp = some { a := 1, b := ↑ifp.b }
⊢ gp = { a := 1, b := ↑ifp.b }

tactic: injection this
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this✝ : (of v).s.get? n = some { a := 1, b := ↑ifp.b }
this : some gp = some { a := 1, b := ↑ifp.b }
⊢ gp = { a := 1, b := ↑ifp.b }
state_after: no goals

tactic: rwa [nth_s_eq] at this
state_before: K : Type u_1
v : K
n : ℕ
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
gp : Pair K
nth_s_eq : (of v).s.get? n = some gp
ifp : IntFractPair K
stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp
this : (of v).s.get? n = some { a := 1, b := ↑ifp.b }
⊢ some gp = some { a := 1, b := ↑ifp.b }
state_after: no goals