l3lab/ntp-mathlib huggingface dataset:
/-- Baire theorem: the intersection of two dense Gδ sets is dense. -/
theorem Dense.inter_of_Gδ {s t : Set α} (hs : IsGδ s) (ht : IsGδ t) (hsc : Dense s)
    (htc : Dense t) : Dense (s ∩ t) := by
  rw [inter_eq_iInter]
  apply dense_iInter_of_Gδ <;> 

Proof state:
case ho
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
s t : Set α
hs : IsGδ s
ht : IsGδ t
hsc : Dense s
htc : Dense t
⊢ ∀ (s_1 : Bool), IsGδ (bif s_1 then s else t)

Next tactic:
simp [Bool.forall_bool, *]
/-- Baire theorem: the intersection of two dense Gδ sets is dense. -/
theorem Dense.inter_of_Gδ {s t : Set α} (hs : IsGδ s) (ht : IsGδ t) (hsc : Dense s)
    (htc : Dense t) : Dense (s ∩ t) := by
  rw [inter_eq_iInter]
  apply dense_iInter_of_Gδ <;> 

Proof state:
case hd
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
s t : Set α
hs : IsGδ s
ht : IsGδ t
hsc : Dense s
htc : Dense t
⊢ ∀ (s_1 : Bool), Dense (bif s_1 then s else t)

Next tactic:
simp [Bool.forall_bool, *]
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
⊢ Dense (⋃ i, interior (f i))

Next tactic:
let g i := (frontier (f i))ᶜ
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
⊢ Dense (⋃ i, interior (f i))

Next tactic:
have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
⊢ Dense (⋃ i, interior (f i))

Next tactic:
have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
⊢ Dense (⋂ i, g i)

Next tactic:
refine' dense_iInter_of_isOpen hgo fun i x => _
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
i : ι
x : α
⊢ x ∈ closure (g i)

Next tactic:
rw [closure_compl, interior_frontier (hc _)]
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
i : ι
x : α
⊢ x ∈ ∅ᶜ

Next tactic:
exact id
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
hgd : Dense (⋂ i, g i)
⊢ Dense (⋃ i, interior (f i))

Next tactic:
refine' (hd.inter_of_Gδ hs (isGδ_iInter_of_isOpen fun i => (hgo i)) hgd).mono _
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
  refine' (hd.inter_of_Gδ hs (isGδ_iInter_of_isOpen fun i => (hgo i)) hgd).mono _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
hgd : Dense (⋂ i, g i)
⊢ s ∩ ⋂ i, g i ⊆ ⋃ i, interior (f i)

Next tactic:
rintro x ⟨hxs, hxg⟩
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
  refine' (hd.inter_of_Gδ hs (isGδ_iInter_of_isOpen fun i => (hgo i)) hgd).mono _
  rintro x ⟨hxs, hxg⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
hgd : Dense (⋂ i, g i)
x : α
hxs : x ∈ s
hxg : x ∈ ⋂ i, g i
⊢ x ∈ ⋃ i, interior (f i)

Next tactic:
rw [mem_iInter] at hxg
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
  refine' (hd.inter_of_Gδ hs (isGδ_iInter_of_isOpen fun i => (hgo i)) hgd).mono _
  rintro x ⟨hxs, hxg⟩
  rw [mem_iInter] at hxg
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
hgd : Dense (⋂ i, g i)
x : α
hxs : x ∈ s
hxg : ∀ (i : ι), x ∈ g i
⊢ x ∈ ⋃ i, interior (f i)

Next tactic:
rcases mem_iUnion.1 (hU hxs) with ⟨i, hi⟩
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃`. -/
theorem IsGδ.dense_iUnion_interior_of_closed [Encodable ι] {s : Set α} (hs : IsGδ s) (hd : Dense s)
    {f : ι → Set α} (hc : ∀ i, IsClosed (f i)) (hU : s ⊆ ⋃ i, f i) :
    Dense (⋃ i, interior (f i)) := by
  let g i := (frontier (f i))ᶜ
  have hgo : ∀ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl
  have hgd : Dense (⋂ i, g i) := by
    refine' dense_iInter_of_isOpen hgo fun i x => _
    rw [closure_compl, interior_frontier (hc _)]
    exact id
  refine' (hd.inter_of_Gδ hs (isGδ_iInter_of_isOpen fun i => (hgo i)) hgd).mono _
  rintro x ⟨hxs, hxg⟩
  rw [mem_iInter] at hxg
  rcases mem_iUnion.1 (hU hxs) with ⟨i, hi⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : BaireSpace α
inst✝ : Encodable ι
s : Set α
hs : IsGδ s
hd : Dense s
f : ι → Set α
hc : ∀ (i : ι), IsClosed (f i)
hU : s ⊆ ⋃ i, f i
g : ι → Set α := fun i => (frontier (f i))ᶜ
hgo : ∀ (i : ι), IsOpen (g i)
hgd : Dense (⋂ i, g i)
x : α
hxs : x ∈ s
hxg : ∀ (i : ι), x ∈ g i
i : ι
hi : x ∈ f i
⊢ x ∈ ⋃ i, interior (f i)

Next tactic:
exact mem_iUnion.2 ⟨i, self_diff_frontier (f i) ▸ ⟨hi, hxg _⟩⟩
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with a union over a countable set in any type. -/
theorem IsGδ.dense_biUnion_interior_of_closed {t : Set ι} {s : Set α} (hs : IsGδ s) (hd : Dense s)
    (ht : t.Countable) {f : ι → Set α} (hc : ∀ i ∈ t, IsClosed (f i)) (hU : s ⊆ ⋃ i ∈ t, f i) :
    Dense (⋃ i ∈ t, interior (f i)) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
t : Set ι
s : Set α
hs : IsGδ s
hd : Dense s
ht : Set.Countable t
f : ι → Set α
hc : ∀ i ∈ t, IsClosed (f i)
hU : s ⊆ ⋃ i ∈ t, f i
⊢ Dense (⋃ i ∈ t, interior (f i))

Next tactic:
haveI := ht.toEncodable
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with a union over a countable set in any type. -/
theorem IsGδ.dense_biUnion_interior_of_closed {t : Set ι} {s : Set α} (hs : IsGδ s) (hd : Dense s)
    (ht : t.Countable) {f : ι → Set α} (hc : ∀ i ∈ t, IsClosed (f i)) (hU : s ⊆ ⋃ i ∈ t, f i) :
    Dense (⋃ i ∈ t, interior (f i)) := by
  haveI := ht.toEncodable
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
t : Set ι
s : Set α
hs : IsGδ s
hd : Dense s
ht : Set.Countable t
f : ι → Set α
hc : ∀ i ∈ t, IsClosed (f i)
hU : s ⊆ ⋃ i ∈ t, f i
this : Encodable ↑t
⊢ Dense (⋃ i ∈ t, interior (f i))

Next tactic:
simp only [biUnion_eq_iUnion, SetCoe.forall'] at *
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with a union over a countable set in any type. -/
theorem IsGδ.dense_biUnion_interior_of_closed {t : Set ι} {s : Set α} (hs : IsGδ s) (hd : Dense s)
    (ht : t.Countable) {f : ι → Set α} (hc : ∀ i ∈ t, IsClosed (f i)) (hU : s ⊆ ⋃ i ∈ t, f i) :
    Dense (⋃ i ∈ t, interior (f i)) := by
  haveI := ht.toEncodable
  simp only [biUnion_eq_iUnion, SetCoe.forall'] at *
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
t : Set ι
s : Set α
hs : IsGδ s
hd : Dense s
ht : Set.Countable t
f : ι → Set α
this : Encodable ↑t
hc : ∀ (x : ↑t), IsClosed (f ↑x)
hU : s ⊆ ⋃ x, f ↑x
⊢ Dense (⋃ x, interior (f ↑x))

Next tactic:
exact hs.dense_iUnion_interior_of_closed hd hc hU
/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with `⋃₀`. -/
theorem IsGδ.dense_sUnion_interior_of_closed {T : Set (Set α)} {s : Set α} (hs : IsGδ s)
    (hd : Dense s) (hc : T.Countable) (hc' : ∀ t ∈ T, IsClosed t) (hU : s ⊆ ⋃₀ T) :
    Dense (⋃ t ∈ T, interior t) :=
  hs.dense_biUnion_interior_of_closed hd hc hc' <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : BaireSpace α
T : Set (Set α)
s : Set α
hs : IsGδ s
hd : Dense s
hc : Set.Countable T
hc' : ∀ t ∈ T, IsClosed t
hU : s ⊆ ⋃₀ T
⊢ s ⊆ ⋃ i ∈ T, i

Next tactic:
rwa [← sUnion_eq_biUnion]
/-- One of the most useful consequences of Baire theorem: if a countable union of closed sets
covers the space, then one of the sets has nonempty interior. -/
theorem nonempty_interior_of_iUnion_of_closed [Nonempty α] [Encodable β] {f : β → Set α}
    (hc : ∀ s, IsClosed (f s)) (hU : ⋃ s, f s = univ) : ∃ s, (interior <| f s).Nonempty := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : BaireSpace α
inst✝¹ : Nonempty α
inst✝ : Encodable β
f : β → Set α
hc : ∀ (s : β), IsClosed (f s)
hU : ⋃ s, f s = univ
⊢ ∃ s, Set.Nonempty (interior (f s))

Next tactic:
simpa using (dense_iUnion_interior_of_closed hc hU).nonempty
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
⊢ ∃ i, ∀ j ≥ i, abs' (f j - f i) < ε

Next tactic:
let ⟨k, hk⟩ := Archimedean.arch a ε0
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
⊢ ∃ i, ∀ j ≥ i, abs' (f j - f i) < ε

Next tactic:
have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))))
        (neg_le.2 <| abs_neg (f n) ▸ le_abs_self _)⟩
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm✝ : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
n : ℕ
hnm : n ≥ m
⊢ a < -(a - (k + (k + 1)) • ε)

Next tactic:
rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm✝ : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
n : ℕ
hnm : n ≥ m
⊢ a + a < k • ε + (k • ε + ε)

Next tactic:
exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))))
        (neg_le.2 <| abs_neg (f n) ▸ le_abs_self _)⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
h : ∃ l, ∀ n ≥ m, a - l • ε < f n
⊢ ∃ i, ∀ j ≥ i, abs' (f j - f i) < ε

Next tactic:
let l := Nat.find h
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))))
        (neg_le.2 <| abs_neg (f n) ▸ le_abs_self _)⟩
  let l := Nat.find h
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
h : ∃ l, ∀ n ≥ m, a - l • ε < f n
l : ℕ := Nat.find h
⊢ ∃ i, ∀ j ≥ i, abs' (f j - f i) < ε

Next tactic:
have hl : ∀ n : ℕ, n ≥ m → f n > a - l • ε := Nat.find_spec h
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))))
        (neg_le.2 <| abs_neg (f n) ▸ le_abs_self _)⟩
  let l := Nat.find h
  have hl : ∀ n : ℕ, n ≥ m → f n > a - l • ε := Nat.find_spec h
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
h : ∃ l, ∀ n ≥ m, a - l • ε < f n
l : ℕ := Nat.find h
hl : ∀ n ≥ m, f n > a - l • ε
⊢ ∃ i, ∀ j ≥ i, abs' (f j - f i) < ε

Next tactic:
have hl0 : l ≠ 0 := fun hl0 =>
    not_lt_of_ge (ham m le_rfl)
      (lt_of_lt_of_le (by have := hl m (le_refl m); simpa [hl0] using this) (le_abs_self (f m)))
theorem isCauSeq_of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f := fun ε ε0 => by
  let ⟨k, hk⟩ := Archimedean.arch a ε0
  have h : ∃ l, ∀ n ≥ m, a - l • ε < f n :=
    ⟨k + k + 1, fun n hnm =>
      lt_of_lt_of_le
        (show a - (k + (k + 1)) • ε < -|f n| from
          lt_neg.1 <|
            lt_of_le_of_lt (ham n hnm)
              (by
                rw [neg_sub, lt_sub_iff_add_lt, add_nsmul, add_nsmul, one_nsmul]
                exact add_lt_add_of_le_of_lt hk (lt_of_le_of_lt hk (lt_add_of_pos_right _ ε0))))
        (neg_le.2 <| abs_neg (f n) ▸ le_abs_self _)⟩
  let l := Nat.find h
  have hl : ∀ n : ℕ, n ≥ m → f n > a - l • ε := Nat.find_spec h
  have hl0 : l ≠ 0 := fun hl0 =>
    not_lt_of_ge (ham m le_rfl)
      (lt_of_lt_of_le (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Ring β
inst✝² : LinearOrderedField α
inst✝¹ : Archimedean α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → α
a : α
m : ℕ
ham : ∀ n ≥ m, abs' (f n) ≤ a
hnm : ∀ n ≥ m, f (Nat.succ n) ≤ f n
ε : α
ε0 : ε > 0
k : ℕ
hk : a ≤ k • ε
h : ∃ l, ∀ n ≥ m, a - l • ε < f n
l : ℕ := Nat.find h
hl : ∀ n ≥ m, f n > a - l • ε
hl0 : l = 0
⊢ a < f m

Next tactic:
have := hl m (le_refl m)