Theorem: IsCauSeq.bounded
File: Mathlib/Algebra/Order/CauSeq/Basic.lean

tactic: obtain ⟨i, h⟩ := hf _ zero_lt_one
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
⊢ ∃ r, ∀ (i : ℕ), abv (f i) < r
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
⊢ ∃ r, ∀ (i : ℕ), abv (f i) < r

tactic: set R : ℕ → α := @Nat.rec (fun _ => α) (abv (f 0)) fun i c => max c (abv (f i.succ)) with hR
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
⊢ ∃ r, ∀ (i : ℕ), abv (f i) < r
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
⊢ ∃ r, ∀ (i : ℕ), abv (f i) < r

tactic: refine ⟨R i + 1, fun j ↦ ?_⟩
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
⊢ ∃ r, ∀ (i : ℕ), abv (f i) < r
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
j : ℕ
⊢ abv (f j) < R i + 1

tactic: obtain hji | hij := le_total j i
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
j : ℕ
⊢ abv (f j) < R i + 1
state_after: case intro.inl
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
j : ℕ
hji : j ≤ i
⊢ abv (f j) < R i + 1

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

tactic: refine Nat.rec (by simp [hR]) ?_
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
⊢ ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
state_after: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
⊢ ∀ (n : ℕ), (∀ j ≤ n, abv (f j) ≤ R n) → ∀ j ≤ n.succ, abv (f j) ≤ R n.succ

tactic: rintro i hi j (rfl | hj)
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
⊢ ∀ (n : ℕ), (∀ j ≤ n, abv (f j) ≤ R n) → ∀ j ≤ n.succ, abv (f j) ≤ R n.succ
state_after: case refl
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i✝ : ℕ
h : ∀ j ≥ i✝, abv (f j - f i✝) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
i : ℕ
hi : ∀ j ≤ i, abv (f j) ≤ R i
⊢ abv (f i.succ) ≤ R i.succ

case step
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i✝ : ℕ
h : ∀ j ≥ i✝, abv (f j - f i✝) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
i : ℕ
hi : ∀ j ≤ i, abv (f j) ≤ R i
j : ℕ
hj : j.le i
⊢ abv (f j) ≤ R i.succ

tactic: simp [hR]
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
⊢ ∀ j ≤ Nat.zero, abv (f j) ≤ R Nat.zero
state_after: no goals

tactic: simp [R]
state_before: case refl
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i✝ : ℕ
h : ∀ j ≥ i✝, abv (f j - f i✝) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
i : ℕ
hi : ∀ j ≤ i, abv (f j) ≤ R i
⊢ abv (f i.succ) ≤ R i.succ
state_after: no goals

tactic: exact (hi j hj).trans (le_max_left _ _)
state_before: case step
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i✝ : ℕ
h : ∀ j ≥ i✝, abv (f j - f i✝) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
i : ℕ
hi : ∀ j ≤ i, abv (f j) ≤ R i
j : ℕ
hj : j.le i
⊢ abv (f j) ≤ R i.succ
state_after: no goals

tactic: exact (this i _ hji).trans_lt (lt_add_one _)
state_before: case intro.inl
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
j : ℕ
hji : j ≤ i
⊢ abv (f j) < R i + 1
state_after: no goals

tactic: simpa using (abv_add abv _ _).trans_lt $ add_lt_add_of_le_of_lt (this i _ le_rfl) (h _ hij)
state_before: case intro.inr
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
hf : IsCauSeq abv f
i : ℕ
h : ∀ j ≥ i, abv (f j - f i) < 1
R : ℕ → α := Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
hR : R = Nat.rec (abv (f 0)) fun i c => max c (abv (f i.succ))
this : ∀ (i j : ℕ), j ≤ i → abv (f j) ≤ R i
j : ℕ
hij : i ≤ j
⊢ abv (f j) < R i + 1
state_after: no goals