l3lab/ntp-mathlib huggingface dataset:
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  

Proof state:
case succ
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        have coe_of_fr := coe_of_rat_eq this
        simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        have coe_of_fr := coe_of_rat_eq this
        simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
rw [v_eq_q] at IH
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    

Proof state:
case none
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
stream_q_nth_eq : IntFractPair.stream q n = none
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)
case some
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
ifp_n : IntFractPair ℚ
stream_q_nth_eq : IntFractPair.stream q n = some ifp_n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
stream_q_nth_eq : IntFractPair.stream q n = none
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => 

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
stream_q_nth_eq : IntFractPair.stream q n = none
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    

Proof state:
case some
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
ifp_n : IntFractPair ℚ
stream_q_nth_eq : IntFractPair.stream q n = some ifp_n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        have coe_of_fr := coe_of_rat_eq this
        simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
ifp_n : IntFractPair ℚ
stream_q_nth_eq : IntFractPair.stream q n = some ifp_n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        have coe_of_fr := coe_of_rat_eq this
        simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
ifp_n : IntFractPair ℚ
stream_q_nth_eq : IntFractPair.stream q n = some ifp_n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
cases' ifp_n with b fr
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      

Proof state:
case mk
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · 

Proof state:
case mk.inl
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_zero : fr = 0
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · 

Proof state:
case mk.inr
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · 

Proof state:
case IH
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
IH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
⊢ some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n

Next tactic:
rwa [stream_q_nth_eq] at IH
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        

Proof state:
case mk.inr
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
IH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by 

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
IH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n
⊢ (↑fr)⁻¹ = ↑fr⁻¹

Next tactic:
norm_cast
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        

Proof state:
case mk.inr
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
IH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n
this : (↑fr)⁻¹ = ↑fr⁻¹
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
have coe_of_fr := coe_of_rat_eq this
theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n := by
  induction' n with n IH
  case zero =>
    -- Porting note: was
    -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]
    simp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]
  case succ =>
    rw [v_eq_q] at IH
    cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n
    case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]
    case some =>
      cases' ifp_n with b fr
      cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero
      · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]
      · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n;
        · rwa [stream_q_nth_eq] at IH
        have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast
        have coe_of_fr := coe_of_rat_eq this
        

Proof state:
case mk.inr
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
b : ℤ
fr : ℚ
stream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }
fr_ne_zero : ¬fr = 0
IH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n
this : (↑fr)⁻¹ = ↑fr⁻¹
coe_of_fr : mapFr Rat.cast (IntFractPair.of fr⁻¹) = IntFractPair.of (↑fr)⁻¹
⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)

Next tactic:
simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]
theorem coe_stream'_rat_eq :
    ((IntFractPair.stream q).map (Option.map (mapFr (↑))) : Stream' <| Option <| IntFractPair K) =
      IntFractPair.stream v :=
  by 

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n : ℕ
⊢ Stream'.map (Option.map (mapFr Rat.cast)) (IntFractPair.stream q) = IntFractPair.stream v

Next tactic:
funext n
theorem coe_stream'_rat_eq :
    ((IntFractPair.stream q).map (Option.map (mapFr (↑))) : Stream' <| Option <| IntFractPair K) =
      IntFractPair.stream v :=
  by funext n; 

Proof state:
case h
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n✝ n : ℕ
⊢ Stream'.map (Option.map (mapFr Rat.cast)) (IntFractPair.stream q) n = IntFractPair.stream v n

Next tactic:
exact IntFractPair.coe_stream_nth_rat_eq v_eq_q n
theorem coe_of_h_rat_eq : (↑((of q).h : ℚ) : K) = (of v).h := by
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n : ℕ
⊢ ↑(of q).h = (of v).h

Next tactic:
unfold of IntFractPair.seq1
theorem coe_of_h_rat_eq : (↑((of q).h : ℚ) : K) = (of v).h := by
  unfold of IntFractPair.seq1
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n : ℕ
⊢ ↑(match
          (IntFractPair.of q,
            Stream'.Seq.tail
              { val := IntFractPair.stream q, property := (_ : Stream'.IsSeq (IntFractPair.stream q)) }) with
        | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h =
    (match
        (IntFractPair.of v,
          Stream'.Seq.tail
            { val := IntFractPair.stream v, property := (_ : Stream'.IsSeq (IntFractPair.stream v)) }) with
      | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h

Next tactic:
rw [← IntFractPair.coe_of_rat_eq v_eq_q]
theorem coe_of_h_rat_eq : (↑((of q).h : ℚ) : K) = (of v).h := by
  unfold of IntFractPair.seq1
  rw [← IntFractPair.coe_of_rat_eq v_eq_q]
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n : ℕ
⊢ ↑(match
          (IntFractPair.of q,
            Stream'.Seq.tail
              { val := IntFractPair.stream q, property := (_ : Stream'.IsSeq (IntFractPair.stream q)) }) with
        | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h =
    (match
        (IntFractPair.mapFr Rat.cast (IntFractPair.of q),
          Stream'.Seq.tail
            { val := IntFractPair.stream v, property := (_ : Stream'.IsSeq (IntFractPair.stream v)) }) with
      | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h

Next tactic:
simp
theorem coe_of_s_get?_rat_eq :
    (((of q).s.get? n).map (Pair.map (↑)) : Option <| Pair K) = (of v).s.get? n := by
  

Proof state:
K : Type u_1
inst✝¹ : LinearOrderedField K
inst✝ : FloorRing K
v : K
q : ℚ
v_eq_q : v = ↑q
n : ℕ
⊢ Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = Stream'.Seq.get? (of v).s n

Next tactic:
simp only [of, IntFractPair.seq1, Stream'.Seq.map_get?, Stream'.Seq.get?_tail]