l3lab/ntp-mathlib huggingface dataset:
theorem bounded (f : CauSeq β abv) : ∃ r, ∀ i, abv (f i) < r := by
  cases' f.cauchy zero_lt_one with i h
  set R : ℕ → α := @Nat.rec (fun _ => α) (abv (f 0)) fun i c => max c (abv (f i.succ)) with hR
  have : ∀ i, ∀ j ≤ i, abv (f j) ≤ R i := by
    refine' Nat.rec (by simp [hR]) _
    rintro i hi j (rfl | hj)
    · simp
    exact (hi j hj).trans (le_max_left _ _)
  refine' ⟨R i + 1, fun j => _⟩
  cases' lt_or_le j i with ij ij
  · 

Proof state:
case intro.inl
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
i : ℕ
h : ∀ j ≥ i, abv (↑f j - ↑f i) < 1
R : ℕ → α := Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
hR : R = Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
this : ∀ (i j : ℕ), j ≤ i → abv (↑f j) ≤ R i
j : ℕ
ij : j < i
⊢ abv (↑f j) < R i + 1

Next tactic:
exact lt_of_le_of_lt (this i _ (le_of_lt ij)) (lt_add_one _)
theorem bounded (f : CauSeq β abv) : ∃ r, ∀ i, abv (f i) < r := by
  cases' f.cauchy zero_lt_one with i h
  set R : ℕ → α := @Nat.rec (fun _ => α) (abv (f 0)) fun i c => max c (abv (f i.succ)) with hR
  have : ∀ i, ∀ j ≤ i, abv (f j) ≤ R i := by
    refine' Nat.rec (by simp [hR]) _
    rintro i hi j (rfl | hj)
    · simp
    exact (hi j hj).trans (le_max_left _ _)
  refine' ⟨R i + 1, fun j => _⟩
  cases' lt_or_le j i with ij ij
  · exact lt_of_le_of_lt (this i _ (le_of_lt ij)) (lt_add_one _)
  · 

Proof state:
case intro.inr
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
i : ℕ
h : ∀ j ≥ i, abv (↑f j - ↑f i) < 1
R : ℕ → α := Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
hR : R = Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
this : ∀ (i j : ℕ), j ≤ i → abv (↑f j) ≤ R i
j : ℕ
ij : i ≤ j
⊢ abv (↑f j) < R i + 1

Next tactic:
have := lt_of_le_of_lt (abv_add abv _ _) (add_lt_add_of_le_of_lt (this i _ le_rfl) (h _ ij))
theorem bounded (f : CauSeq β abv) : ∃ r, ∀ i, abv (f i) < r := by
  cases' f.cauchy zero_lt_one with i h
  set R : ℕ → α := @Nat.rec (fun _ => α) (abv (f 0)) fun i c => max c (abv (f i.succ)) with hR
  have : ∀ i, ∀ j ≤ i, abv (f j) ≤ R i := by
    refine' Nat.rec (by simp [hR]) _
    rintro i hi j (rfl | hj)
    · simp
    exact (hi j hj).trans (le_max_left _ _)
  refine' ⟨R i + 1, fun j => _⟩
  cases' lt_or_le j i with ij ij
  · exact lt_of_le_of_lt (this i _ (le_of_lt ij)) (lt_add_one _)
  · have := lt_of_le_of_lt (abv_add abv _ _) (add_lt_add_of_le_of_lt (this i _ le_rfl) (h _ ij))
    

Proof state:
case intro.inr
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
i : ℕ
h : ∀ j ≥ i, abv (↑f j - ↑f i) < 1
R : ℕ → α := Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
hR : R = Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
this✝ : ∀ (i j : ℕ), j ≤ i → abv (↑f j) ≤ R i
j : ℕ
ij : i ≤ j
this : abv (↑f i + (↑f j - ↑f i)) < R i + 1
⊢ abv (↑f j) < R i + 1

Next tactic:
rw [add_sub, add_comm] at this
theorem bounded (f : CauSeq β abv) : ∃ r, ∀ i, abv (f i) < r := by
  cases' f.cauchy zero_lt_one with i h
  set R : ℕ → α := @Nat.rec (fun _ => α) (abv (f 0)) fun i c => max c (abv (f i.succ)) with hR
  have : ∀ i, ∀ j ≤ i, abv (f j) ≤ R i := by
    refine' Nat.rec (by simp [hR]) _
    rintro i hi j (rfl | hj)
    · simp
    exact (hi j hj).trans (le_max_left _ _)
  refine' ⟨R i + 1, fun j => _⟩
  cases' lt_or_le j i with ij ij
  · exact lt_of_le_of_lt (this i _ (le_of_lt ij)) (lt_add_one _)
  · have := lt_of_le_of_lt (abv_add abv _ _) (add_lt_add_of_le_of_lt (this i _ le_rfl) (h _ ij))
    rw [add_sub, add_comm] at this
    

Proof state:
case intro.inr
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
i : ℕ
h : ∀ j ≥ i, abv (↑f j - ↑f i) < 1
R : ℕ → α := Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
hR : R = Nat.rec (abv (↑f 0)) fun i c => max c (abv (↑f (Nat.succ i)))
this✝ : ∀ (i j : ℕ), j ≤ i → abv (↑f j) ≤ R i
j : ℕ
ij : i ≤ j
this : abv (↑f j + ↑f i - ↑f i) < R i + 1
⊢ abv (↑f j) < R i + 1

Next tactic:
simpa using this
/-- The constant Cauchy sequence. -/
def const (x : β) : CauSeq β abv :=
  ⟨fun _ => x, fun ε ε0 => ⟨0, fun j _ => by 

Proof state:
α : Type ?u.63580
β : Type ?u.63583
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
x : β
ε : α
ε0 : ε > 0
j : ℕ
x✝ : j ≥ 0
⊢ abv ((fun x_1 => x) j - (fun x_1 => x) 0) < ε

Next tactic:
simpa [abv_zero] using ε0
instance : Neg (CauSeq β abv) :=
  ⟨fun f => ofEq (const (-1) * f) (fun x => -f x) fun i => by 

Proof state:
α : Type ?u.90076
β : Type ?u.90079
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
i : ℕ
⊢ ↑(const (-1) * f) i = (fun x => -↑f x) i

Next tactic:
simp
instance : Sub (CauSeq β abv) :=
  ⟨fun f g => ofEq (f + -g) (fun x => f x - g x) fun i => by 

Proof state:
α : Type ?u.93417
β : Type ?u.93420
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
i : ℕ
⊢ ↑(f + -g) i = (fun x => ↑f x - ↑g x) i

Next tactic:
simp [sub_eq_add_neg]
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
⊢ ∀ (x : CauSeq β abv) (n : ℕ), ↑(n • x) = n • ↑x

Next tactic:
intros
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
x✝ : CauSeq β abv
n✝ : ℕ
⊢ ↑(n✝ • x✝) = n✝ • ↑x✝

Next tactic:
rfl
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
⊢ ∀ (x : CauSeq β abv) (n : ℤ), ↑(n • x) = n • ↑x

Next tactic:
intros
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by intros; 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
x✝ : CauSeq β abv
n✝ : ℤ
⊢ ↑(n✝ • x✝) = n✝ • ↑x✝

Next tactic:
rfl
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by intros; rfl)
  (by 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
⊢ ∀ (n : ℕ), ↑↑n = ↑n

Next tactic:
intros
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by intros; rfl)
  (by intros; 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
n✝ : ℕ
⊢ ↑↑n✝ = ↑n✝

Next tactic:
rfl
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by intros; rfl)
  (by intros; rfl)
  (by 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
⊢ ∀ (n : ℤ), ↑↑n = ↑n

Next tactic:
intros
instance addGroupWithOne : AddGroupWithOne (CauSeq β abv) :=
  Function.Injective.addGroupWithOne Subtype.val Subtype.val_injective rfl rfl
  coe_add coe_neg coe_sub
  (by intros; rfl)
  (by intros; rfl)
  (by intros; rfl)
  (by intros; 

Proof state:
α : Type ?u.115848
β : Type ?u.115851
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
n✝ : ℤ
⊢ ↑↑n✝ = ↑n✝

Next tactic:
rfl
instance : Pow (CauSeq β abv) ℕ :=
  ⟨fun f n =>
    (ofEq (npowRec n f) fun i => f i ^ n) <| by 

Proof state:
α : Type ?u.117613
β : Type ?u.117616
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
n : ℕ
⊢ ∀ (i : ℕ), ↑(npowRec n f) i = ↑f i ^ n

Next tactic:
induction n
instance : Pow (CauSeq β abv) ℕ :=
  ⟨fun f n =>
    (ofEq (npowRec n f) fun i => f i ^ n) <| by induction n <;> 

Proof state:
case zero
α : Type ?u.117613
β : Type ?u.117616
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
⊢ ∀ (i : ℕ), ↑(npowRec Nat.zero f) i = ↑f i ^ Nat.zero

Next tactic:
simp [*, npowRec, pow_succ]
instance : Pow (CauSeq β abv) ℕ :=
  ⟨fun f n =>
    (ofEq (npowRec n f) fun i => f i ^ n) <| by induction n <;> 

Proof state:
case succ
α : Type ?u.117613
β : Type ?u.117616
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
n✝ : ℕ
n_ih✝ : ∀ (i : ℕ), ↑(npowRec n✝ f) i = ↑f i ^ n✝
⊢ ∀ (i : ℕ), ↑(npowRec (Nat.succ n✝) f) i = ↑f i ^ Nat.succ n✝

Next tactic:
simp [*, npowRec, pow_succ]
instance {β : Type*} [CommRing β] {abv : β → α} [IsAbsoluteValue abv] : CommRing (CauSeq β abv) :=
  { CauSeq.ring with
    mul_comm := fun a b => ext $ fun n => by 

Proof state:
α : Type ?u.125395
β✝ : Type ?u.125398
inst✝⁴ : LinearOrderedField α
inst✝³ : Ring β✝
abv✝ : β✝ → α
inst✝² : IsAbsoluteValue abv✝
β : Type u_1
inst✝¹ : CommRing β
abv : β → α
inst✝ : IsAbsoluteValue abv
src✝ : Ring (CauSeq β abv) := ring
a b : CauSeq β abv
n : ℕ
⊢ ↑(a * b) n = ↑(b * a) n

Next tactic:
simp [mul_left_comm, mul_comm]
theorem add_limZero {f g : CauSeq β abv} (hf : LimZero f) (hg : LimZero g) : LimZero (f + g)
  | ε, ε0 =>
    (exists_forall_ge_and (hf _ <| half_pos ε0) (hg _ <| half_pos ε0)).imp fun i H j ij => by
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hf : LimZero f
hg : LimZero g
ε : α
ε0 : ε > 0
i : ℕ
H : ∀ j ≥ i, abv (↑f j) < ε / 2 ∧ abv (↑g j) < ε / 2
j : ℕ
ij : j ≥ i
⊢ abv (↑(f + g) j) < ε

Next tactic:
let ⟨H₁, H₂⟩ := H _ ij
theorem add_limZero {f g : CauSeq β abv} (hf : LimZero f) (hg : LimZero g) : LimZero (f + g)
  | ε, ε0 =>
    (exists_forall_ge_and (hf _ <| half_pos ε0) (hg _ <| half_pos ε0)).imp fun i H j ij => by
      let ⟨H₁, H₂⟩ := H _ ij
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hf : LimZero f
hg : LimZero g
ε : α
ε0 : ε > 0
i : ℕ
H : ∀ j ≥ i, abv (↑f j) < ε / 2 ∧ abv (↑g j) < ε / 2
j : ℕ
ij : j ≥ i
H₁ : abv (↑f j) < ε / 2
H₂ : abv (↑g j) < ε / 2
⊢ abv (↑(f + g) j) < ε

Next tactic:
simpa [add_halves ε] using lt_of_le_of_lt (abv_add abv _ _) (add_lt_add H₁ H₂)
theorem mul_limZero_right (f : CauSeq β abv) {g} (hg : LimZero g) : LimZero (f * g)
  | ε, ε0 =>
    let ⟨F, F0, hF⟩ := f.bounded' 0
    (hg _ <| div_pos ε0 F0).imp fun i H j ij => by
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hg : LimZero g
ε : α
ε0 : ε > 0
F : α
F0 : F > 0
hF : ∀ (i : ℕ), abv (↑f i) < F
i : ℕ
H : ∀ j ≥ i, abv (↑g j) < ε / F
j : ℕ
ij : j ≥ i
⊢ abv (↑(f * g) j) < ε

Next tactic:
have := mul_lt_mul' (le_of_lt <| hF j) (H _ ij) (abv_nonneg abv _) F0
theorem mul_limZero_right (f : CauSeq β abv) {g} (hg : LimZero g) : LimZero (f * g)
  | ε, ε0 =>
    let ⟨F, F0, hF⟩ := f.bounded' 0
    (hg _ <| div_pos ε0 F0).imp fun i H j ij => by
      have := mul_lt_mul' (le_of_lt <| hF j) (H _ ij) (abv_nonneg abv _) F0
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hg : LimZero g
ε : α
ε0 : ε > 0
F : α
F0 : F > 0
hF : ∀ (i : ℕ), abv (↑f i) < F
i : ℕ
H : ∀ j ≥ i, abv (↑g j) < ε / F
j : ℕ
ij : j ≥ i
this : abv (↑f j) * abv (↑g j) < F * (ε / F)
⊢ abv (↑(f * g) j) < ε

Next tactic:
rwa [mul_comm F, div_mul_cancel _ (ne_of_gt F0), ← abv_mul] at this
theorem mul_limZero_left {f} (g : CauSeq β abv) (hg : LimZero f) : LimZero (f * g)
  | ε, ε0 =>
    let ⟨G, G0, hG⟩ := g.bounded' 0
    (hg _ <| div_pos ε0 G0).imp fun i H j ij => by
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hg : LimZero f
ε : α
ε0 : ε > 0
G : α
G0 : G > 0
hG : ∀ (i : ℕ), abv (↑g i) < G
i : ℕ
H : ∀ j ≥ i, abv (↑f j) < ε / G
j : ℕ
ij : j ≥ i
⊢ abv (↑(f * g) j) < ε

Next tactic:
have := mul_lt_mul'' (H _ ij) (hG j) (abv_nonneg abv _) (abv_nonneg abv _)
theorem mul_limZero_left {f} (g : CauSeq β abv) (hg : LimZero f) : LimZero (f * g)
  | ε, ε0 =>
    let ⟨G, G0, hG⟩ := g.bounded' 0
    (hg _ <| div_pos ε0 G0).imp fun i H j ij => by
      have := mul_lt_mul'' (H _ ij) (hG j) (abv_nonneg abv _) (abv_nonneg abv _)
      

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hg : LimZero f
ε : α
ε0 : ε > 0
G : α
G0 : G > 0
hG : ∀ (i : ℕ), abv (↑g i) < G
i : ℕ
H : ∀ j ≥ i, abv (↑f j) < ε / G
j : ℕ
ij : j ≥ i
this : abv (↑f j) * abv (↑g j) < ε / G * G
⊢ abv (↑(f * g) j) < ε

Next tactic:
rwa [div_mul_cancel _ (ne_of_gt G0), ← abv_mul] at this
theorem neg_limZero {f : CauSeq β abv} (hf : LimZero f) : LimZero (-f) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : LimZero f
⊢ LimZero (-f)

Next tactic:
rw [← neg_one_mul f]
theorem neg_limZero {f : CauSeq β abv} (hf : LimZero f) : LimZero (-f) := by
  rw [← neg_one_mul f]
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : LimZero f
⊢ LimZero (-1 * f)

Next tactic:
exact mul_limZero_right _ hf
theorem sub_limZero {f g : CauSeq β abv} (hf : LimZero f) (hg : LimZero g) : LimZero (f - g) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hf : LimZero f
hg : LimZero g
⊢ LimZero (f - g)

Next tactic:
simpa only [sub_eq_add_neg] using add_limZero hf (neg_limZero hg)
theorem limZero_sub_rev {f g : CauSeq β abv} (hfg : LimZero (f - g)) : LimZero (g - f) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hfg : LimZero (f - g)
⊢ LimZero (g - f)

Next tactic:
simpa using neg_limZero hfg
theorem zero_limZero : LimZero (0 : CauSeq β abv)
  | ε, ε0 => ⟨0, fun j _ => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
ε : α
ε0 : ε > 0
j : ℕ
x✝ : j ≥ 0
⊢ abv (↑0 j) < ε

Next tactic:
simpa [abv_zero abv] using ε0
instance equiv : Setoid (CauSeq β abv) :=
  ⟨fun f g => LimZero (f - g),
    ⟨fun f => by 

Proof state:
α : Type ?u.139461
β : Type ?u.139464
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
⊢ LimZero (f - f)

Next tactic:
simp [zero_limZero]
instance equiv : Setoid (CauSeq β abv) :=
  ⟨fun f g => LimZero (f - g),
    ⟨fun f => by simp [zero_limZero],
    fun f ε hε => by 

Proof state:
α : Type ?u.139461
β : Type ?u.139464
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
x✝ y✝ : CauSeq β abv
f : LimZero (x✝ - y✝)
ε : α
hε : ε > 0
⊢ ∃ i, ∀ j ≥ i, abv (↑(y✝ - x✝) j) < ε

Next tactic:
simpa using neg_limZero f ε hε
instance equiv : Setoid (CauSeq β abv) :=
  ⟨fun f g => LimZero (f - g),
    ⟨fun f => by simp [zero_limZero],
    fun f ε hε => by simpa using neg_limZero f ε hε,
    fun fg gh => by 

Proof state:
α : Type ?u.139461
β : Type ?u.139464
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
x✝ y✝ z✝ : CauSeq β abv
fg : LimZero (x✝ - y✝)
gh : LimZero (y✝ - z✝)
⊢ LimZero (x✝ - z✝)

Next tactic:
simpa using add_limZero fg gh
theorem add_equiv_add {f1 f2 g1 g2 : CauSeq β abv} (hf : f1 ≈ f2) (hg : g1 ≈ g2) :
    f1 + g1 ≈ f2 + g2 := by 

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f1 f2 g1 g2 : CauSeq β abv
hf : f1 ≈ f2
hg : g1 ≈ g2
⊢ f1 + g1 ≈ f2 + g2

Next tactic:
simpa only [← add_sub_add_comm] using add_limZero hf hg
theorem neg_equiv_neg {f g : CauSeq β abv} (hf : f ≈ g) : -f ≈ -g := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
hf : f ≈ g
⊢ -f ≈ -g

Next tactic:
simpa only [neg_sub'] using neg_limZero hf
theorem sub_equiv_sub {f1 f2 g1 g2 : CauSeq β abv} (hf : f1 ≈ f2) (hg : g1 ≈ g2) :
    f1 - g1 ≈ f2 - g2 := by 

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f1 f2 g1 g2 : CauSeq β abv
hf : f1 ≈ f2
hg : g1 ≈ g2
⊢ f1 - g1 ≈ f2 - g2

Next tactic:
simpa only [sub_eq_add_neg] using add_equiv_add hf (neg_equiv_neg hg)
theorem equiv_def₃ {f g : CauSeq β abv} (h : f ≈ g) {ε : α} (ε0 : 0 < ε) :
    ∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - g j) < ε :=
  (exists_forall_ge_and (h _ <| half_pos ε0) (f.cauchy₃ <| half_pos ε0)).imp fun i H j ij k jk => by
    

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
h : f ≈ g
ε : α
ε0 : 0 < ε
i : ℕ
H : ∀ j ≥ i, abv (↑(f - g) j) < ε / 2 ∧ ∀ k ≥ j, abv (↑f k - ↑f j) < ε / 2
j : ℕ
ij : j ≥ i
k : ℕ
jk : k ≥ j
⊢ abv (↑f k - ↑g j) < ε

Next tactic:
let ⟨h₁, h₂⟩ := H _ ij
theorem equiv_def₃ {f g : CauSeq β abv} (h : f ≈ g) {ε : α} (ε0 : 0 < ε) :
    ∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - g j) < ε :=
  (exists_forall_ge_and (h _ <| half_pos ε0) (f.cauchy₃ <| half_pos ε0)).imp fun i H j ij k jk => by
    let ⟨h₁, h₂⟩ := H _ ij
    

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
h : f ≈ g
ε : α
ε0 : 0 < ε
i : ℕ
H : ∀ j ≥ i, abv (↑(f - g) j) < ε / 2 ∧ ∀ k ≥ j, abv (↑f k - ↑f j) < ε / 2
j : ℕ
ij : j ≥ i
k : ℕ
jk : k ≥ j
h₁ : abv (↑(f - g) j) < ε / 2
h₂ : ∀ k ≥ j, abv (↑f k - ↑f j) < ε / 2
⊢ abv (↑f k - ↑g j) < ε

Next tactic:
have := lt_of_le_of_lt (abv_add abv (f j - g j) _) (add_lt_add h₁ (h₂ _ jk))
theorem equiv_def₃ {f g : CauSeq β abv} (h : f ≈ g) {ε : α} (ε0 : 0 < ε) :
    ∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - g j) < ε :=
  (exists_forall_ge_and (h _ <| half_pos ε0) (f.cauchy₃ <| half_pos ε0)).imp fun i H j ij k jk => by
    let ⟨h₁, h₂⟩ := H _ ij
    have := lt_of_le_of_lt (abv_add abv (f j - g j) _) (add_lt_add h₁ (h₂ _ jk))
    

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
h : f ≈ g
ε : α
ε0 : 0 < ε
i : ℕ
H : ∀ j ≥ i, abv (↑(f - g) j) < ε / 2 ∧ ∀ k ≥ j, abv (↑f k - ↑f j) < ε / 2
j : ℕ
ij : j ≥ i
k : ℕ
jk : k ≥ j
h₁ : abv (↑(f - g) j) < ε / 2
h₂ : ∀ k ≥ j, abv (↑f k - ↑f j) < ε / 2
this : abv (↑f j - ↑g j + (↑f k - ↑f j)) < ε / 2 + ε / 2
⊢ abv (↑f k - ↑g j) < ε

Next tactic:
rwa [sub_add_sub_cancel', add_halves] at this
theorem limZero_congr {f g : CauSeq β abv} (h : f ≈ g) : LimZero f ↔ LimZero g :=
  ⟨fun l => by 

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
h : f ≈ g
l : LimZero f
⊢ LimZero g

Next tactic:
simpa using add_limZero (Setoid.symm h) l
theorem limZero_congr {f g : CauSeq β abv} (h : f ≈ g) : LimZero f ↔ LimZero g :=
  ⟨fun l => by simpa using add_limZero (Setoid.symm h) l, fun l => by 

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : CauSeq β abv
h : f ≈ g
l : LimZero g
⊢ LimZero f

Next tactic:
simpa using add_limZero h l
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
⊢ ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (↑f j)

Next tactic:
haveI := Classical.propDecidable
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  haveI := Classical.propDecidable
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
this : (a : Prop) → Decidable a
⊢ ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (↑f j)

Next tactic:
by_contra nk
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  haveI := Classical.propDecidable
  by_contra nk
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
this : (a : Prop) → Decidable a
nk : ¬∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (↑f j)
⊢ False

Next tactic:
refine' hf fun ε ε0 => _
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  haveI := Classical.propDecidable
  by_contra nk
  refine' hf fun ε ε0 => _
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
this : (a : Prop) → Decidable a
nk : ¬∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (↑f j)
ε : α
ε0 : ε > 0
⊢ ∃ i, ∀ j ≥ i, abv (↑f j) < ε

Next tactic:
simp? [not_forall] at nk says
    simp only [gt_iff_lt, ge_iff_le, not_exists, not_and, not_forall, not_le, exists_prop] at nk
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  haveI := Classical.propDecidable
  by_contra nk
  refine' hf fun ε ε0 => _
  simp? [not_forall] at nk says
    

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
this : (a : Prop) → Decidable a
nk : ¬∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (↑f j)
ε : α
ε0 : ε > 0
⊢ ∃ i, ∀ j ≥ i, abv (↑f j) < ε

Next tactic:
simp only [gt_iff_lt, ge_iff_le, not_exists, not_and, not_forall, not_le, exists_prop] at nk
theorem abv_pos_of_not_limZero {f : CauSeq β abv} (hf : ¬LimZero f) :
    ∃ K > 0, ∃ i, ∀ j ≥ i, K ≤ abv (f j) := by
  haveI := Classical.propDecidable
  by_contra nk
  refine' hf fun ε ε0 => _
  simp? [not_forall] at nk says
    simp only [gt_iff_lt, ge_iff_le, not_exists, not_and, not_forall, not_le, exists_prop] at nk
  

Proof state:
α : Type u_2
β : Type u_1
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : CauSeq β abv
hf : ¬LimZero f
this : (a : Prop) → Decidable a
ε : α
ε0 : ε > 0
nk : ∀ (x : α), 0 < x → ∀ (x_1 : ℕ), ∃ x_2, x_1 ≤ x_2 ∧ abv (↑f x_2) < x
⊢ ∃ i, ∀ j ≥ i, abv (↑f j) < ε

Next tactic:
cases' f.cauchy₃ (half_pos ε0) with i hi