l3lab/ntp-mathlib huggingface dataset:
/-- A continuous function on a compact space is automatically a continuous function vanishing at
infinity. This is not an instance to avoid type class loops. -/
def zeroAtInftyContinuousMapClass.ofCompact {G : Type*} [ContinuousMapClass G α β]
    [CompactSpace α] : ZeroAtInftyContinuousMapClass G α β where
  coe g := g
  coe_injective' f g h := FunLike.coe_fn_eq.mp h
  map_continuous := map_continuous
  zero_at_infty := by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : Zero β
inst✝² : ZeroAtInftyContinuousMapClass F α β
G : Type u_2
inst✝¹ : ContinuousMapClass G α β
inst✝ : CompactSpace α
⊢ ∀ (f : G), Tendsto (⇑f) (cocompact α) (𝓝 0)

Next tactic:
simp
instance instMul [MulZeroClass β] [ContinuousMul β] : Mul C₀(α, β) :=
  ⟨fun f g =>
    ⟨f * g, by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : MulZeroClass β
inst✝ : ContinuousMul β
f g : α →C₀ β
⊢ Tendsto (↑f * ↑g).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa only [mul_zero] using (zero_at_infty f).mul (zero_at_infty g)
instance instAdd [AddZeroClass β] [ContinuousAdd β] : Add C₀(α, β) :=
  ⟨fun f g => ⟨f + g, by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddZeroClass β
inst✝ : ContinuousAdd β
f g : α →C₀ β
⊢ Tendsto (↑f + ↑g).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa only [add_zero] using (zero_at_infty f).add (zero_at_infty g)
@[simp]
theorem coe_nsmulRec : ∀ n, ⇑(nsmulRec n f) = n • ⇑f
  | 0 => by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddMonoid β
inst✝ : ContinuousAdd β
f g : α →C₀ β
⊢ ⇑(nsmulRec 0 f) = 0 • ⇑f

Next tactic:
rw [nsmulRec, zero_smul, coe_zero]
@[simp]
theorem coe_nsmulRec : ∀ n, ⇑(nsmulRec n f) = n • ⇑f
  | 0 => by rw [nsmulRec, zero_smul, coe_zero]
  | n + 1 => by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddMonoid β
inst✝ : ContinuousAdd β
f g : α →C₀ β
n : ℕ
⊢ ⇑(nsmulRec (n + 1) f) = (n + 1) • ⇑f

Next tactic:
rw [nsmulRec, succ_nsmul, coe_add, coe_nsmulRec n]
instance instNatSMul : SMul ℕ C₀(α, β) :=
  ⟨fun n f => ⟨n • (f : C(α, β)),
    by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddMonoid β
inst✝ : ContinuousAdd β
f✝ g : α →C₀ β
n : ℕ
f : α →C₀ β
⊢ Tendsto (n • ↑f).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa [coe_nsmulRec] using zero_at_infty (nsmulRec n f)
instance instNeg : Neg C₀(α, β) :=
  ⟨fun f => ⟨-f, by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f✝ g f : α →C₀ β
⊢ Tendsto (-↑f).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa only [neg_zero] using (zero_at_infty f).neg
instance instSub : Sub C₀(α, β) :=
  ⟨fun f g => ⟨f - g, by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f✝ g✝ f g : α →C₀ β
⊢ Tendsto (↑f - ↑g).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa only [sub_zero] using (zero_at_infty f).sub (zero_at_infty g)
@[simp]
theorem coe_zsmulRec : ∀ z, ⇑(zsmulRec z f) = z • ⇑f
  | Int.ofNat n => by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g : α →C₀ β
n : ℕ
⊢ ⇑(zsmulRec (Int.ofNat n) f) = Int.ofNat n • ⇑f

Next tactic:
rw [zsmulRec, Int.ofNat_eq_coe, coe_nsmulRec, coe_nat_zsmul]
@[simp]
theorem coe_zsmulRec : ∀ z, ⇑(zsmulRec z f) = z • ⇑f
  | Int.ofNat n => by rw [zsmulRec, Int.ofNat_eq_coe, coe_nsmulRec, coe_nat_zsmul]
  | Int.negSucc n => by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g : α →C₀ β
n : ℕ
⊢ ⇑(zsmulRec (Int.negSucc n) f) = Int.negSucc n • ⇑f

Next tactic:
rw [zsmulRec, negSucc_zsmul, coe_neg, coe_nsmulRec]
instance instIntSMul : SMul ℤ C₀(α, β) :=
  -- Porting note: Original version didn't have `Continuous.const_smul f.continuous n`
  ⟨fun n f => ⟨⟨n • ⇑f, Continuous.const_smul f.continuous n⟩,
    by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
x : α
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f✝ g : α →C₀ β
n : ℤ
f : α →C₀ β
⊢ Tendsto (ContinuousMap.mk (n • ⇑f)).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa using zero_at_infty (zsmulRec n f)
instance instSMul [Zero β] {R : Type*} [Zero R] [SMulWithZero R β] [ContinuousConstSMul R β] :
    SMul R C₀(α, β) :=
  -- Porting note: Original version didn't have `Continuous.const_smul f.continuous r`
  ⟨fun r f => ⟨⟨r • ⇑f, Continuous.const_smul f.continuous r⟩,
    by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
x : α
inst✝³ : Zero β
R : Type u_2
inst✝² : Zero R
inst✝¹ : SMulWithZero R β
inst✝ : ContinuousConstSMul R β
r : R
f : α →C₀ β
⊢ Tendsto (ContinuousMap.mk (r • ⇑f)).toFun (cocompact α) (𝓝 0)

Next tactic:
simpa [smul_zero] using (zero_at_infty f).const_smul r
instance instIsScalarTower {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [IsScalarTower R β β] :
    IsScalarTower R C₀(α, β) C₀(α, β) where
  smul_assoc r f g := by
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : IsScalarTower R β β
r : R
f g : α →C₀ β
⊢ (r • f) • g = r • f • g

Next tactic:
ext
instance instIsScalarTower {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [IsScalarTower R β β] :
    IsScalarTower R C₀(α, β) C₀(α, β) where
  smul_assoc r f g := by
    ext
    

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : IsScalarTower R β β
r : R
f g : α →C₀ β
x✝ : α
⊢ ((r • f) • g) x✝ = (r • f • g) x✝

Next tactic:
simp only [smul_eq_mul, coe_mul, coe_smul, Pi.mul_apply, Pi.smul_apply]
instance instIsScalarTower {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [IsScalarTower R β β] :
    IsScalarTower R C₀(α, β) C₀(α, β) where
  smul_assoc r f g := by
    ext
    simp only [smul_eq_mul, coe_mul, coe_smul, Pi.mul_apply, Pi.smul_apply]
    

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : IsScalarTower R β β
r : R
f g : α →C₀ β
x✝ : α
⊢ r • f x✝ * g x✝ = r • (f x✝ * g x✝)

Next tactic:
rw [← smul_eq_mul, ← smul_eq_mul, smul_assoc]
instance instSMulCommClass {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [SMulCommClass R β β] :
    SMulCommClass R C₀(α, β) C₀(α, β) where
  smul_comm r f g := by
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : SMulCommClass R β β
r : R
f g : α →C₀ β
⊢ r • f • g = f • r • g

Next tactic:
ext
instance instSMulCommClass {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [SMulCommClass R β β] :
    SMulCommClass R C₀(α, β) C₀(α, β) where
  smul_comm r f g := by
    ext
    

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : SMulCommClass R β β
r : R
f g : α →C₀ β
x✝ : α
⊢ (r • f • g) x✝ = (f • r • g) x✝

Next tactic:
simp only [smul_eq_mul, coe_smul, coe_mul, Pi.smul_apply, Pi.mul_apply]
instance instSMulCommClass {R : Type*} [Semiring R] [NonUnitalNonAssocSemiring β]
    [TopologicalSemiring β] [Module R β] [ContinuousConstSMul R β] [SMulCommClass R β β] :
    SMulCommClass R C₀(α, β) C₀(α, β) where
  smul_comm r f g := by
    ext
    simp only [smul_eq_mul, coe_smul, coe_mul, Pi.smul_apply, Pi.mul_apply]
    

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁷ : TopologicalSpace α
inst✝⁶ : TopologicalSpace β
x : α
R : Type u_2
inst✝⁵ : Semiring R
inst✝⁴ : NonUnitalNonAssocSemiring β
inst✝³ : TopologicalSemiring β
inst✝² : Module R β
inst✝¹ : ContinuousConstSMul R β
inst✝ : SMulCommClass R β β
r : R
f g : α →C₀ β
x✝ : α
⊢ r • (f x✝ * g x✝) = f x✝ * r • g x✝

Next tactic:
rw [← smul_eq_mul, ← smul_eq_mul, smul_comm]
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
⊢ ∃ C, ∀ (x y : α), dist (f x) (f y) ≤ C

Next tactic:
obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
⊢ ∃ C, ∀ (x y : α), dist (f x) (f y) ≤ C

Next tactic:
obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
⊢ ∃ C, ∀ (x y : α), dist (f x) (f y) ≤ C

Next tactic:
refine' ⟨max C 1 + max C 1, fun x y => _⟩
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x y : α
⊢ dist (f x) (f y) ≤ max C 1 + max C 1

Next tactic:
have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    intro x
    by_cases hx : x ∈ K
    · exact (mem_closedBall.mp <| hC ⟨x, hx, rfl⟩).trans (le_max_left _ _)
    · exact (mem_closedBall.mp <| mem_preimage.mp (hK₂ hx)).trans (le_max_right _ _)
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x y : α
⊢ ∀ (x : α), f x ∈ closedBall 0 (max C 1)

Next tactic:
intro x
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    intro x
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x✝ y x : α
⊢ f x ∈ closedBall 0 (max C 1)

Next tactic:
by_cases hx : x ∈ K
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    intro x
    by_cases hx : x ∈ K
    · 

Proof state:
case pos
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x✝ y x : α
hx : x ∈ K
⊢ f x ∈ closedBall 0 (max C 1)

Next tactic:
exact (mem_closedBall.mp <| hC ⟨x, hx, rfl⟩).trans (le_max_left _ _)
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    intro x
    by_cases hx : x ∈ K
    · exact (mem_closedBall.mp <| hC ⟨x, hx, rfl⟩).trans (le_max_left _ _)
    · 

Proof state:
case neg
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x✝ y x : α
hx : x ∉ K
⊢ f x ∈ closedBall 0 (max C 1)

Next tactic:
exact (mem_closedBall.mp <| mem_preimage.mp (hK₂ hx)).trans (le_max_right _ _)
protected theorem bounded (f : F) : ∃ C, ∀ x y : α, dist ((f : α → β) x) (f y) ≤ C := by
  obtain ⟨K : Set α, hK₁, hK₂⟩ := mem_cocompact.mp
    (tendsto_def.mp (zero_at_infty (f : F)) _ (closedBall_mem_nhds (0 : β) zero_lt_one))
  obtain ⟨C, hC⟩ := (hK₁.image (map_continuous f)).isBounded.subset_closedBall (0 : β)
  refine' ⟨max C 1 + max C 1, fun x y => _⟩
  have : ∀ x, f x ∈ closedBall (0 : β) (max C 1) := by
    intro x
    by_cases hx : x ∈ K
    · exact (mem_closedBall.mp <| hC ⟨x, hx, rfl⟩).trans (le_max_left _ _)
    · exact (mem_closedBall.mp <| mem_preimage.mp (hK₂ hx)).trans (le_max_right _ _)
  

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f : F
K : Set α
hK₁ : IsCompact K
hK₂ : Kᶜ ⊆ ⇑f ⁻¹' closedBall 0 1
C : ℝ
hC : ⇑f '' K ⊆ closedBall 0 C
x y : α
this : ∀ (x : α), f x ∈ closedBall 0 (max C 1)
⊢ dist (f x) (f y) ≤ max C 1 + max C 1

Next tactic:
exact (dist_triangle (f x) 0 (f y)).trans
    (add_le_add (mem_closedBall.mp <| this x) (mem_closedBall'.mp <| this y))
theorem toBcf_injective : Function.Injective (toBcf : C₀(α, β) → α →ᵇ β) := fun f g h => by
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f g : α →C₀ β
h : toBcf f = toBcf g
⊢ f = g

Next tactic:
ext x
theorem toBcf_injective : Function.Injective (toBcf : C₀(α, β) → α →ᵇ β) := fun f g h => by
  ext x
  

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
f g : α →C₀ β
h : toBcf f = toBcf g
x : α
⊢ f x = g x

Next tactic:
simpa only using FunLike.congr_fun h x
/-- Convergence in the metric on `C₀(α, β)` is uniform convergence. -/
theorem tendsto_iff_tendstoUniformly {ι : Type*} {F : ι → C₀(α, β)} {f : C₀(α, β)} {l : Filter ι} :
    Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => F i) f l := by
  

Proof state:
F✝ : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F✝ α β
C : ℝ
f✝ g : α →C₀ β
ι : Type u_2
F : ι → α →C₀ β
f : α →C₀ β
l : Filter ι
⊢ Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => ⇑(F i)) (⇑f) l

Next tactic:
simpa only [Metric.tendsto_nhds] using
    @BoundedContinuousFunction.tendsto_iff_tendstoUniformly _ _ _ _ _ (fun i => (F i).toBcf)
      f.toBcf l
theorem isometry_toBcf : Isometry (toBcf : C₀(α, β) → α →ᵇ β) := by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f g : α →C₀ β
⊢ Isometry toBcf

Next tactic:
tauto
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f g : α →C₀ β
⊢ IsClosed (range toBcf)

Next tactic:
refine' isClosed_iff_clusterPt.mpr fun f hf => _
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g : α →C₀ β
f : α →ᵇ β
hf : ClusterPt f (𝓟 (range toBcf))
⊢ f ∈ range toBcf

Next tactic:
rw [clusterPt_principal_iff] at hf
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  rw [clusterPt_principal_iff] at hf
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g : α →C₀ β
f : α →ᵇ β
hf : ∀ U ∈ 𝓝 f, Set.Nonempty (U ∩ range toBcf)
⊢ f ∈ range toBcf

Next tactic:
have : Tendsto f (cocompact α) (𝓝 0) := by
    refine' Metric.tendsto_nhds.mpr fun ε hε => _
    obtain ⟨_, hg, g, rfl⟩ := hf (ball f (ε / 2)) (ball_mem_nhds f <| half_pos hε)
    refine' (Metric.tendsto_nhds.mp (zero_at_infty g) (ε / 2) (half_pos hε)).mp
      (eventually_of_forall fun x hx => _)
    calc
      dist (f x) 0 ≤ dist (g.toBcf x) (f x) + dist (g x) 0 := dist_triangle_left _ _ _
      _ < dist g.toBcf f + ε / 2 := (add_lt_add_of_le_of_lt (dist_coe_le_dist x) hx)
      _ < ε := by simpa [add_halves ε] using add_lt_add_right (mem_ball.1 hg) (ε / 2)
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  rw [clusterPt_principal_iff] at hf
  have : Tendsto f (cocompact α) (𝓝 0) := by
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g : α →C₀ β
f : α →ᵇ β
hf : ∀ U ∈ 𝓝 f, Set.Nonempty (U ∩ range toBcf)
⊢ Tendsto (⇑f) (cocompact α) (𝓝 0)

Next tactic:
refine' Metric.tendsto_nhds.mpr fun ε hε => _
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  rw [clusterPt_principal_iff] at hf
  have : Tendsto f (cocompact α) (𝓝 0) := by
    refine' Metric.tendsto_nhds.mpr fun ε hε => _
    

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g : α →C₀ β
f : α →ᵇ β
hf : ∀ U ∈ 𝓝 f, Set.Nonempty (U ∩ range toBcf)
ε : ℝ
hε : ε > 0
⊢ ∀ᶠ (x : α) in cocompact α, dist (f x) 0 < ε

Next tactic:
obtain ⟨_, hg, g, rfl⟩ := hf (ball f (ε / 2)) (ball_mem_nhds f <| half_pos hε)
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  rw [clusterPt_principal_iff] at hf
  have : Tendsto f (cocompact α) (𝓝 0) := by
    refine' Metric.tendsto_nhds.mpr fun ε hε => _
    obtain ⟨_, hg, g, rfl⟩ := hf (ball f (ε / 2)) (ball_mem_nhds f <| half_pos hε)
    

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g✝ : α →C₀ β
f : α →ᵇ β
hf : ∀ U ∈ 𝓝 f, Set.Nonempty (U ∩ range toBcf)
ε : ℝ
hε : ε > 0
g : α →C₀ β
hg : toBcf g ∈ ball f (ε / 2)
⊢ ∀ᶠ (x : α) in cocompact α, dist (f x) 0 < ε

Next tactic:
refine' (Metric.tendsto_nhds.mp (zero_at_infty g) (ε / 2) (half_pos hε)).mp
      (eventually_of_forall fun x hx => _)
theorem closed_range_toBcf : IsClosed (range (toBcf : C₀(α, β) → α →ᵇ β)) := by
  refine' isClosed_iff_clusterPt.mpr fun f hf => _
  rw [clusterPt_principal_iff] at hf
  have : Tendsto f (cocompact α) (𝓝 0) := by
    refine' Metric.tendsto_nhds.mpr fun ε hε => _
    obtain ⟨_, hg, g, rfl⟩ := hf (ball f (ε / 2)) (ball_mem_nhds f <| half_pos hε)
    refine' (Metric.tendsto_nhds.mp (zero_at_infty g) (ε / 2) (half_pos hε)).mp
      (eventually_of_forall fun x hx => _)
    

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : MetricSpace β
inst✝¹ : Zero β
inst✝ : ZeroAtInftyContinuousMapClass F α β
C : ℝ
f✝ g✝ : α →C₀ β
f : α →ᵇ β
hf : ∀ U ∈ 𝓝 f, Set.Nonempty (U ∩ range toBcf)
ε : ℝ
hε : ε > 0
g : α →C₀ β
hg : toBcf g ∈ ball f (ε / 2)
x : α
hx : dist (g x) 0 < ε / 2
⊢ dist (f x) 0 < ε

Next tactic:
calc
      dist (f x) 0 ≤ dist (g.toBcf x) (f x) + dist (g x) 0 := dist_triangle_left _ _ _
      _ < dist g.toBcf f + ε / 2 := (add_lt_add_of_le_of_lt (dist_coe_le_dist x) hx)
      _ < ε := by simpa [add_halves ε] using add_lt_add_right (mem_ball.1 hg) (ε / 2)