l3lab/ntp-mathlib huggingface dataset:
instance (priority := 100) NormedDivisionRing.to_hasContinuousInv₀ : HasContinuousInv₀ α := by
  refine' ⟨fun r r0 => tendsto_iff_norm_sub_tendsto_zero.2 _⟩
  have r0' : 0 < ‖r‖ := norm_pos_iff.2 r0
  rcases exists_between r0' with ⟨ε, ε0, εr⟩
  have : ∀ᶠ e in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε := by
    filter_upwards [(isOpen_lt continuous_const continuous_norm).eventually_mem εr] with e he
    have e0 : e ≠ 0 := norm_pos_iff.1 (ε0.trans he)
    calc
      ‖e⁻¹ - r⁻¹‖ = ‖r‖⁻¹ * ‖r - e‖ * ‖e‖⁻¹ := by
        rw [← norm_inv, ← norm_inv, ← norm_mul, ← norm_mul, _root_.mul_sub, _root_.sub_mul,
          mul_assoc _ e, inv_mul_cancel r0, mul_inv_cancel e0, one_mul, mul_one]
      -- porting note: `ENNReal.{mul_sub, sub_mul}` should be `protected`
      _ = ‖r - e‖ / ‖r‖ / ‖e‖ := by field_simp [mul_comm]
      _ ≤ ‖r - e‖ / ‖r‖ / ε := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NormedDivisionRing α
r : α
r0 : r ≠ 0
r0' : 0 < ‖r‖
ε : ℝ
ε0 : 0 < ε
εr : ε < ‖r‖
e : α
he : ε < ‖e‖
e0 : e ≠ 0
⊢ ‖r - e‖ / ‖r‖ / ‖e‖ ≤ ‖r - e‖ / ‖r‖ / ε

Next tactic:
gcongr
instance (priority := 100) NormedDivisionRing.to_hasContinuousInv₀ : HasContinuousInv₀ α := by
  refine' ⟨fun r r0 => tendsto_iff_norm_sub_tendsto_zero.2 _⟩
  have r0' : 0 < ‖r‖ := norm_pos_iff.2 r0
  rcases exists_between r0' with ⟨ε, ε0, εr⟩
  have : ∀ᶠ e in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε := by
    filter_upwards [(isOpen_lt continuous_const continuous_norm).eventually_mem εr] with e he
    have e0 : e ≠ 0 := norm_pos_iff.1 (ε0.trans he)
    calc
      ‖e⁻¹ - r⁻¹‖ = ‖r‖⁻¹ * ‖r - e‖ * ‖e‖⁻¹ := by
        rw [← norm_inv, ← norm_inv, ← norm_mul, ← norm_mul, _root_.mul_sub, _root_.sub_mul,
          mul_assoc _ e, inv_mul_cancel r0, mul_inv_cancel e0, one_mul, mul_one]
      -- porting note: `ENNReal.{mul_sub, sub_mul}` should be `protected`
      _ = ‖r - e‖ / ‖r‖ / ‖e‖ := by field_simp [mul_comm]
      _ ≤ ‖r - e‖ / ‖r‖ / ε := by gcongr
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NormedDivisionRing α
r : α
r0 : r ≠ 0
r0' : 0 < ‖r‖
ε : ℝ
ε0 : 0 < ε
εr : ε < ‖r‖
this : ∀ᶠ (e : α) in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε
⊢ Tendsto (fun e => ‖e⁻¹ - r⁻¹‖) (𝓝 r) (𝓝 0)

Next tactic:
refine' squeeze_zero' (eventually_of_forall fun _ => norm_nonneg _) this _
instance (priority := 100) NormedDivisionRing.to_hasContinuousInv₀ : HasContinuousInv₀ α := by
  refine' ⟨fun r r0 => tendsto_iff_norm_sub_tendsto_zero.2 _⟩
  have r0' : 0 < ‖r‖ := norm_pos_iff.2 r0
  rcases exists_between r0' with ⟨ε, ε0, εr⟩
  have : ∀ᶠ e in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε := by
    filter_upwards [(isOpen_lt continuous_const continuous_norm).eventually_mem εr] with e he
    have e0 : e ≠ 0 := norm_pos_iff.1 (ε0.trans he)
    calc
      ‖e⁻¹ - r⁻¹‖ = ‖r‖⁻¹ * ‖r - e‖ * ‖e‖⁻¹ := by
        rw [← norm_inv, ← norm_inv, ← norm_mul, ← norm_mul, _root_.mul_sub, _root_.sub_mul,
          mul_assoc _ e, inv_mul_cancel r0, mul_inv_cancel e0, one_mul, mul_one]
      -- porting note: `ENNReal.{mul_sub, sub_mul}` should be `protected`
      _ = ‖r - e‖ / ‖r‖ / ‖e‖ := by field_simp [mul_comm]
      _ ≤ ‖r - e‖ / ‖r‖ / ε := by gcongr
  refine' squeeze_zero' (eventually_of_forall fun _ => norm_nonneg _) this _
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NormedDivisionRing α
r : α
r0 : r ≠ 0
r0' : 0 < ‖r‖
ε : ℝ
ε0 : 0 < ε
εr : ε < ‖r‖
this : ∀ᶠ (e : α) in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε
⊢ Tendsto (fun t => ‖r - t‖ / ‖r‖ / ε) (𝓝 r) (𝓝 0)

Next tactic:
refine' (((continuous_const.sub continuous_id).norm.div_const _).div_const _).tendsto' _ _ _
instance (priority := 100) NormedDivisionRing.to_hasContinuousInv₀ : HasContinuousInv₀ α := by
  refine' ⟨fun r r0 => tendsto_iff_norm_sub_tendsto_zero.2 _⟩
  have r0' : 0 < ‖r‖ := norm_pos_iff.2 r0
  rcases exists_between r0' with ⟨ε, ε0, εr⟩
  have : ∀ᶠ e in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε := by
    filter_upwards [(isOpen_lt continuous_const continuous_norm).eventually_mem εr] with e he
    have e0 : e ≠ 0 := norm_pos_iff.1 (ε0.trans he)
    calc
      ‖e⁻¹ - r⁻¹‖ = ‖r‖⁻¹ * ‖r - e‖ * ‖e‖⁻¹ := by
        rw [← norm_inv, ← norm_inv, ← norm_mul, ← norm_mul, _root_.mul_sub, _root_.sub_mul,
          mul_assoc _ e, inv_mul_cancel r0, mul_inv_cancel e0, one_mul, mul_one]
      -- porting note: `ENNReal.{mul_sub, sub_mul}` should be `protected`
      _ = ‖r - e‖ / ‖r‖ / ‖e‖ := by field_simp [mul_comm]
      _ ≤ ‖r - e‖ / ‖r‖ / ε := by gcongr
  refine' squeeze_zero' (eventually_of_forall fun _ => norm_nonneg _) this _
  refine' (((continuous_const.sub continuous_id).norm.div_const _).div_const _).tendsto' _ _ _
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NormedDivisionRing α
r : α
r0 : r ≠ 0
r0' : 0 < ‖r‖
ε : ℝ
ε0 : 0 < ε
εr : ε < ‖r‖
this : ∀ᶠ (e : α) in 𝓝 r, ‖e⁻¹ - r⁻¹‖ ≤ ‖r - e‖ / ‖r‖ / ε
⊢ ‖r - id r‖ / ‖r‖ / ε = 0

Next tactic:
simp
theorem norm_map_one_of_pow_eq_one [Monoid β] (φ : β →* α) {x : β} {k : ℕ+} (h : x ^ (k : ℕ) = 1) :
    ‖φ x‖ = 1 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : NormedDivisionRing α
inst✝ : Monoid β
φ : β →* α
x : β
k : ℕ+
h : x ^ ↑k = 1
⊢ ‖φ x‖ = 1

Next tactic:
rw [← pow_left_inj, ← norm_pow, ← map_pow, h, map_one, norm_one, one_pow]
theorem norm_map_one_of_pow_eq_one [Monoid β] (φ : β →* α) {x : β} {k : ℕ+} (h : x ^ (k : ℕ) = 1) :
    ‖φ x‖ = 1 := by
  rw [← pow_left_inj, ← norm_pow, ← map_pow, h, map_one, norm_one, one_pow]
  

Proof state:
case ha
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : NormedDivisionRing α
inst✝ : Monoid β
φ : β →* α
x : β
k : ℕ+
h : x ^ ↑k = 1
⊢ 0 ≤ ‖φ x‖
case hb
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : NormedDivisionRing α
inst✝ : Monoid β
φ : β →* α
x : β
k : ℕ+
h : x ^ ↑k = 1
⊢ 0 ≤ 1
case hn
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝¹ : NormedDivisionRing α
inst✝ : Monoid β
φ : β →* α
x : β
k : ℕ+
h : x ^ ↑k = 1
⊢ ↑k ≠ 0

Next tactic:
exacts [norm_nonneg _, zero_le_one, k.ne_zero]
theorem exists_lt_norm (r : ℝ) : ∃ x : α, r < ‖x‖ :=
  let ⟨w, hw⟩ := exists_one_lt_norm α
  let ⟨n, hn⟩ := pow_unbounded_of_one_lt r hw
  ⟨w ^ n, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
r : ℝ
w : α
hw : 1 < ‖w‖
n : ℕ
hn : r < ‖w‖ ^ n
⊢ r < ‖w ^ n‖

Next tactic:
rwa [norm_pow]
theorem exists_norm_lt {r : ℝ} (hr : 0 < r) : ∃ x : α, 0 < ‖x‖ ∧ ‖x‖ < r :=
  let ⟨w, hw⟩ := exists_lt_norm α r⁻¹
  ⟨w⁻¹, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
r : ℝ
hr : 0 < r
w : α
hw : r⁻¹ < ‖w‖
⊢ 0 < ‖w⁻¹‖ ∧ ‖w⁻¹‖ < r

Next tactic:
rwa [← Set.mem_Ioo, norm_inv, ← Set.mem_inv, Set.inv_Ioo_0_left hr]
@[instance]
theorem punctured_nhds_neBot (x : α) : NeBot (𝓝[≠] x) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
x : α
⊢ NeBot (𝓝[≠] x)

Next tactic:
rw [← mem_closure_iff_nhdsWithin_neBot, Metric.mem_closure_iff]
@[instance]
theorem punctured_nhds_neBot (x : α) : NeBot (𝓝[≠] x) := by
  rw [← mem_closure_iff_nhdsWithin_neBot, Metric.mem_closure_iff]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
x : α
⊢ ∀ ε > 0, ∃ b ∈ {x}ᶜ, dist x b < ε

Next tactic:
rintro ε ε0
@[instance]
theorem punctured_nhds_neBot (x : α) : NeBot (𝓝[≠] x) := by
  rw [← mem_closure_iff_nhdsWithin_neBot, Metric.mem_closure_iff]
  rintro ε ε0
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
x : α
ε : ℝ
ε0 : ε > 0
⊢ ∃ b ∈ {x}ᶜ, dist x b < ε

Next tactic:
rcases exists_norm_lt α ε0 with ⟨b, hb0, hbε⟩
@[instance]
theorem punctured_nhds_neBot (x : α) : NeBot (𝓝[≠] x) := by
  rw [← mem_closure_iff_nhdsWithin_neBot, Metric.mem_closure_iff]
  rintro ε ε0
  rcases exists_norm_lt α ε0 with ⟨b, hb0, hbε⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
x : α
ε : ℝ
ε0 : ε > 0
b : α
hb0 : 0 < ‖b‖
hbε : ‖b‖ < ε
⊢ ∃ b ∈ {x}ᶜ, dist x b < ε

Next tactic:
refine' ⟨x + b, mt (Set.mem_singleton_iff.trans add_right_eq_self).1 <| norm_pos_iff.1 hb0, _⟩
@[instance]
theorem punctured_nhds_neBot (x : α) : NeBot (𝓝[≠] x) := by
  rw [← mem_closure_iff_nhdsWithin_neBot, Metric.mem_closure_iff]
  rintro ε ε0
  rcases exists_norm_lt α ε0 with ⟨b, hb0, hbε⟩
  refine' ⟨x + b, mt (Set.mem_singleton_iff.trans add_right_eq_self).1 <| norm_pos_iff.1 hb0, _⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
x : α
ε : ℝ
ε0 : ε > 0
b : α
hb0 : 0 < ‖b‖
hbε : ‖b‖ < ε
⊢ dist x (x + b) < ε

Next tactic:
rwa [dist_comm, dist_eq_norm, add_sub_cancel']
@[instance]
theorem nhdsWithin_isUnit_neBot : NeBot (𝓝[{ x : α | IsUnit x }] 0) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : NontriviallyNormedField α
⊢ NeBot (𝓝[{x | IsUnit x}] 0)

Next tactic:
simpa only [isUnit_iff_ne_zero] using punctured_nhds_neBot (0 : α)
instance denselyOrdered_range_norm : DenselyOrdered (Set.range (norm : α → ℝ)) where
  dense := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
⊢ ∀ (a₁ a₂ : ↑(Set.range norm)), a₁ < a₂ → ∃ a, a₁ < a ∧ a < a₂

Next tactic:
rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
instance denselyOrdered_range_norm : DenselyOrdered (Set.range (norm : α → ℝ)) where
  dense := by
    rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
    

Proof state:
case mk.intro.mk.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
x y : α
hxy : { val := ‖x‖, property := (_ : ∃ y, ‖y‖ = ‖x‖) } < { val := ‖y‖, property := (_ : ∃ y_1, ‖y_1‖ = ‖y‖) }
⊢ ∃ a, { val := ‖x‖, property := (_ : ∃ y, ‖y‖ = ‖x‖) } < a ∧ a < { val := ‖y‖, property := (_ : ∃ y_1, ‖y_1‖ = ‖y‖) }

Next tactic:
let ⟨z, h⟩ := exists_lt_norm_lt α (norm_nonneg _) hxy
instance denselyOrdered_range_norm : DenselyOrdered (Set.range (norm : α → ℝ)) where
  dense := by
    rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
    let ⟨z, h⟩ := exists_lt_norm_lt α (norm_nonneg _) hxy
    

Proof state:
case mk.intro.mk.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
x y : α
hxy : { val := ‖x‖, property := (_ : ∃ y, ‖y‖ = ‖x‖) } < { val := ‖y‖, property := (_ : ∃ y_1, ‖y_1‖ = ‖y‖) }
z : α
h : ‖x‖ < ‖z‖ ∧ ‖z‖ < ↑{ val := ‖y‖, property := (_ : ∃ y_1, ‖y_1‖ = ‖y‖) }
⊢ ∃ a, { val := ‖x‖, property := (_ : ∃ y, ‖y‖ = ‖x‖) } < a ∧ a < { val := ‖y‖, property := (_ : ∃ y_1, ‖y_1‖ = ‖y‖) }

Next tactic:
exact ⟨⟨‖z‖, z, rfl⟩, h⟩
instance denselyOrdered_range_nnnorm : DenselyOrdered (Set.range (nnnorm : α → ℝ≥0)) where
  dense := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
⊢ ∀ (a₁ a₂ : ↑(Set.range nnnorm)), a₁ < a₂ → ∃ a, a₁ < a ∧ a < a₂

Next tactic:
rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
instance denselyOrdered_range_nnnorm : DenselyOrdered (Set.range (nnnorm : α → ℝ≥0)) where
  dense := by
    rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
    

Proof state:
case mk.intro.mk.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
x y : α
hxy : { val := ‖x‖₊, property := (_ : ∃ y, ‖y‖₊ = ‖x‖₊) } < { val := ‖y‖₊, property := (_ : ∃ y_1, ‖y_1‖₊ = ‖y‖₊) }
⊢ ∃ a,
    { val := ‖x‖₊, property := (_ : ∃ y, ‖y‖₊ = ‖x‖₊) } < a ∧
      a < { val := ‖y‖₊, property := (_ : ∃ y_1, ‖y_1‖₊ = ‖y‖₊) }

Next tactic:
let ⟨z, h⟩ := exists_lt_nnnorm_lt α hxy
instance denselyOrdered_range_nnnorm : DenselyOrdered (Set.range (nnnorm : α → ℝ≥0)) where
  dense := by
    rintro ⟨-, x, rfl⟩ ⟨-, y, rfl⟩ hxy
    let ⟨z, h⟩ := exists_lt_nnnorm_lt α hxy
    

Proof state:
case mk.intro.mk.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : DenselyNormedField α
x y : α
hxy : { val := ‖x‖₊, property := (_ : ∃ y, ‖y‖₊ = ‖x‖₊) } < { val := ‖y‖₊, property := (_ : ∃ y_1, ‖y_1‖₊ = ‖y‖₊) }
z : α
h :
  ↑{ val := ‖x‖₊, property := (_ : ∃ y, ‖y‖₊ = ‖x‖₊) } < ‖z‖₊ ∧
    ‖z‖₊ < ↑{ val := ‖y‖₊, property := (_ : ∃ y_1, ‖y_1‖₊ = ‖y‖₊) }
⊢ ∃ a,
    { val := ‖x‖₊, property := (_ : ∃ y, ‖y‖₊ = ‖x‖₊) } < a ∧
      a < { val := ‖y‖₊, property := (_ : ∃ y_1, ‖y_1‖₊ = ‖y‖₊) }

Next tactic:
exact ⟨⟨‖z‖₊, z, rfl⟩, h⟩
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
h : ∃ x, x ≠ 0 ∧ ‖x‖ ≠ 1
⊢ ∃ x, 1 < ‖x‖

Next tactic:
rcases h with ⟨x, hx, hx1⟩
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    rcases h with ⟨x, hx, hx1⟩
    

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
x : 𝕜
hx : x ≠ 0
hx1 : ‖x‖ ≠ 1
⊢ ∃ x, 1 < ‖x‖

Next tactic:
rcases hx1.lt_or_lt with hlt | hlt
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    rcases h with ⟨x, hx, hx1⟩
    rcases hx1.lt_or_lt with hlt | hlt
    · 

Proof state:
case intro.intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
x : 𝕜
hx : x ≠ 0
hx1 : ‖x‖ ≠ 1
hlt : ‖x‖ < 1
⊢ ∃ x, 1 < ‖x‖

Next tactic:
use x⁻¹
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    rcases h with ⟨x, hx, hx1⟩
    rcases hx1.lt_or_lt with hlt | hlt
    · use x⁻¹
      

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
x : 𝕜
hx : x ≠ 0
hx1 : ‖x‖ ≠ 1
hlt : ‖x‖ < 1
⊢ 1 < ‖x⁻¹‖

Next tactic:
rw [norm_inv]
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    rcases h with ⟨x, hx, hx1⟩
    rcases hx1.lt_or_lt with hlt | hlt
    · use x⁻¹
      rw [norm_inv]
      

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
x : 𝕜
hx : x ≠ 0
hx1 : ‖x‖ ≠ 1
hlt : ‖x‖ < 1
⊢ 1 < ‖x‖⁻¹

Next tactic:
exact one_lt_inv (norm_pos_iff.2 hx) hlt
/-- A normed field is nontrivially normed
provided that the norm of some nonzero element is not one. -/
def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜]
    (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where
  toNormedField := h'
  non_trivial := by
    rcases h with ⟨x, hx, hx1⟩
    rcases hx1.lt_or_lt with hlt | hlt
    · use x⁻¹
      rw [norm_inv]
      exact one_lt_inv (norm_pos_iff.2 hx) hlt
    · 

Proof state:
case intro.intro.inr
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
𝕜 : Type u_5
h' : NormedField 𝕜
x : 𝕜
hx : x ≠ 0
hx1 : ‖x‖ ≠ 1
hlt : 1 < ‖x‖
⊢ ∃ x, 1 < ‖x‖

Next tactic:
exact ⟨x, hlt⟩
noncomputable instance Real.denselyNormedField : DenselyNormedField ℝ where
  lt_norm_lt _ _ h₀ hr :=
    let ⟨x, h⟩ := exists_between hr
    ⟨x, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
x✝¹ x✝ : ℝ
h₀ : 0 ≤ x✝¹
hr : x✝¹ < x✝
x : ℝ
h : x✝¹ < x ∧ x < x✝
⊢ x✝¹ < ‖x‖ ∧ ‖x‖ < x✝

Next tactic:
rwa [Real.norm_eq_abs, abs_of_nonneg (h₀.trans h.1.le)]
theorem toNNReal_mul_nnnorm {x : ℝ} (y : ℝ) (hx : 0 ≤ x) : x.toNNReal * ‖y‖₊ = ‖x * y‖₊ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
x y : ℝ
hx : 0 ≤ x
⊢ toNNReal x * ‖y‖₊ = ‖x * y‖₊

Next tactic:
ext
theorem toNNReal_mul_nnnorm {x : ℝ} (y : ℝ) (hx : 0 ≤ x) : x.toNNReal * ‖y‖₊ = ‖x * y‖₊ := by
  ext
  

Proof state:
case a
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
x y : ℝ
hx : 0 ≤ x
⊢ ↑(toNNReal x * ‖y‖₊) = ↑‖x * y‖₊

Next tactic:
simp only [NNReal.coe_mul, nnnorm_mul, coe_nnnorm, Real.toNNReal_of_nonneg, norm_of_nonneg, hx,
    NNReal.coe_mk]
theorem nnnorm_mul_toNNReal (x : ℝ) {y : ℝ} (hy : 0 ≤ y) : ‖x‖₊ * y.toNNReal = ‖x * y‖₊ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
x y : ℝ
hy : 0 ≤ y
⊢ ‖x‖₊ * toNNReal y = ‖x * y‖₊

Next tactic:
rw [mul_comm, mul_comm x, toNNReal_mul_nnnorm x hy]
theorem norm_eq (x : ℝ≥0) : ‖(x : ℝ)‖ = x := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
x : ℝ≥0
⊢ ‖↑x‖ = ↑x

Next tactic:
rw [Real.norm_eq_abs, x.abs_eq]
@[simp]
theorem nnnorm_norm [SeminormedAddCommGroup α] (a : α) : ‖‖a‖‖₊ = ‖a‖₊ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : SeminormedAddCommGroup α
a : α
⊢ ‖‖a‖‖₊ = ‖a‖₊

Next tactic:
rw [Real.nnnorm_of_nonneg (norm_nonneg a)]
@[simp]
theorem nnnorm_norm [SeminormedAddCommGroup α] (a : α) : ‖‖a‖‖₊ = ‖a‖₊ := by
  rw [Real.nnnorm_of_nonneg (norm_nonneg a)]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
inst✝ : SeminormedAddCommGroup α
a : α
⊢ { val := ‖a‖, property := (_ : 0 ≤ ‖a‖) } = ‖a‖₊

Next tactic:
rfl
/-- A restatement of `MetricSpace.tendsto_atTop` in terms of the norm. -/
theorem NormedAddCommGroup.tendsto_atTop [Nonempty α] [SemilatticeSup α] {β : Type*}
    [SeminormedAddCommGroup β] {f : α → β} {b : β} :
    Tendsto f atTop (𝓝 b) ↔ ∀ ε, 0 < ε → ∃ N, ∀ n, N ≤ n → ‖f n - b‖ < ε :=
  (atTop_basis.tendsto_iff Metric.nhds_basis_ball).trans (by 

Proof state:
α : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝² : Nonempty α
inst✝¹ : SemilatticeSup α
β : Type u_5
inst✝ : SeminormedAddCommGroup β
f : α → β
b : β
⊢ (∀ (ib : ℝ), 0 < ib → ∃ ia, True ∧ ∀ x ∈ Set.Ici ia, f x ∈ ball b ib) ↔
    ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : α), N ≤ n → ‖f n - b‖ < ε

Next tactic:
simp [dist_eq_norm]
/-- A variant of `NormedAddCommGroup.tendsto_atTop` that
uses `∃ N, ∀ n > N, ...` rather than `∃ N, ∀ n ≥ N, ...`
-/
theorem NormedAddCommGroup.tendsto_atTop' [Nonempty α] [SemilatticeSup α] [NoMaxOrder α]
    {β : Type*} [SeminormedAddCommGroup β] {f : α → β} {b : β} :
    Tendsto f atTop (𝓝 b) ↔ ∀ ε, 0 < ε → ∃ N, ∀ n, N < n → ‖f n - b‖ < ε :=
  (atTop_basis_Ioi.tendsto_iff Metric.nhds_basis_ball).trans (by 

Proof state:
α : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Type u_4
inst✝³ : Nonempty α
inst✝² : SemilatticeSup α
inst✝¹ : NoMaxOrder α
β : Type u_5
inst✝ : SeminormedAddCommGroup β
f : α → β
b : β
⊢ (∀ (ib : ℝ), 0 < ib → ∃ ia, True ∧ ∀ x ∈ Set.Ioi ia, f x ∈ ball b ib) ↔
    ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : α), N < n → ‖f n - b‖ < ε

Next tactic:
simp [dist_eq_norm]
instance Int.normedCommRing : NormedCommRing ℤ :=
  { Int.normedAddCommGroup, Int.instRingInt with
    norm_mul := fun m n => le_of_eq <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
src✝¹ : NormedAddCommGroup ℤ := normedAddCommGroup
src✝ : Ring ℤ := instRingInt
m n : ℤ
⊢ ‖m * n‖ = ‖m‖ * ‖n‖

Next tactic:
simp only [norm, Int.cast_mul, abs_mul]
instance Int.normOneClass : NormOneClass ℤ :=
  ⟨by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
⊢ ‖1‖ = 1

Next tactic:
simp [← Int.norm_cast_real]
instance Rat.normedField : NormedField ℚ :=
  { Rat.normedAddCommGroup, Rat.field with
    norm_mul' := fun r₁ r₂ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
src✝¹ : NormedAddCommGroup ℚ := normedAddCommGroup
src✝ : Field ℚ := field
r₁ r₂ : ℚ
⊢ ‖r₁ * r₂‖ = ‖r₁‖ * ‖r₂‖

Next tactic:
simp only [norm, Rat.cast_mul, abs_mul]
instance Rat.denselyNormedField : DenselyNormedField ℚ where
  lt_norm_lt r₁ r₂ h₀ hr :=
    let ⟨q, h⟩ := exists_rat_btwn hr
    ⟨q, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
r₁ r₂ : ℝ
h₀ : 0 ≤ r₁
hr : r₁ < r₂
q : ℚ
h : r₁ < ↑q ∧ ↑q < r₂
⊢ r₁ < ‖q‖ ∧ ‖q‖ < r₂

Next tactic:
rwa [← Rat.norm_cast_real, Real.norm_eq_abs, abs_of_pos (h₀.trans_lt h.1)]
/-- A non-unital ring homomorphism from a `NonUnitalRing` to a `NonUnitalSeminormedRing`
induces a `NonUnitalSeminormedRing` structure on the domain.

See note [reducible non-instances] -/
@[reducible]
def NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRing S]
    [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R :=
  { SeminormedAddCommGroup.induced R S f, ‹NonUnitalRing R› with
    norm_mul := fun x y => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Type u_5
R : Type u_6
S : Type u_7
inst✝² : NonUnitalRing R
inst✝¹ : NonUnitalSeminormedRing S
inst✝ : NonUnitalRingHomClass F R S
f : F
src✝¹ : SeminormedAddCommGroup R := SeminormedAddCommGroup.induced R S f
src✝ : NonUnitalRing R := inst✝²
x y : R
⊢ ‖x * y‖ ≤ ‖x‖ * ‖y‖

Next tactic:
show ‖f (x * y)‖ ≤ ‖f x‖ * ‖f y‖
/-- A non-unital ring homomorphism from a `NonUnitalRing` to a `NonUnitalSeminormedRing`
induces a `NonUnitalSeminormedRing` structure on the domain.

See note [reducible non-instances] -/
@[reducible]
def NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRing S]
    [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R :=
  { SeminormedAddCommGroup.induced R S f, ‹NonUnitalRing R› with
    norm_mul := fun x y => by
      show ‖f (x * y)‖ ≤ ‖f x‖ * ‖f y‖
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Type u_5
R : Type u_6
S : Type u_7
inst✝² : NonUnitalRing R
inst✝¹ : NonUnitalSeminormedRing S
inst✝ : NonUnitalRingHomClass F R S
f : F
src✝¹ : SeminormedAddCommGroup R := SeminormedAddCommGroup.induced R S f
src✝ : NonUnitalRing R := inst✝²
x y : R
⊢ ‖f (x * y)‖ ≤ ‖f x‖ * ‖f y‖

Next tactic:
exact (map_mul f x y).symm ▸ norm_mul_le (f x) (f y)
/-- An injective non-unital ring homomorphism from a `DivisionRing` to a `NormedRing` induces a
`NormedDivisionRing` structure on the domain.

See note [reducible non-instances] -/
@[reducible]
def NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] [NonUnitalRingHomClass F R S]
    (f : F) (hf : Function.Injective f) : NormedDivisionRing R :=
  { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with
    norm_mul' := fun x y => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Type u_5
R : Type u_6
S : Type u_7
inst✝² : DivisionRing R
inst✝¹ : NormedDivisionRing S
inst✝ : NonUnitalRingHomClass F R S
f : F
hf : Function.Injective ⇑f
src✝¹ : NormedAddCommGroup R := NormedAddCommGroup.induced R S f hf
src✝ : DivisionRing R := inst✝²
x y : R
⊢ ‖x * y‖ = ‖x‖ * ‖y‖

Next tactic:
show ‖f (x * y)‖ = ‖f x‖ * ‖f y‖
/-- An injective non-unital ring homomorphism from a `DivisionRing` to a `NormedRing` induces a
`NormedDivisionRing` structure on the domain.

See note [reducible non-instances] -/
@[reducible]
def NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] [NonUnitalRingHomClass F R S]
    (f : F) (hf : Function.Injective f) : NormedDivisionRing R :=
  { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with
    norm_mul' := fun x y => by
      show ‖f (x * y)‖ = ‖f x‖ * ‖f y‖
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type u_4
F : Type u_5
R : Type u_6
S : Type u_7
inst✝² : DivisionRing R
inst✝¹ : NormedDivisionRing S
inst✝ : NonUnitalRingHomClass F R S
f : F
hf : Function.Injective ⇑f
src✝¹ : NormedAddCommGroup R := NormedAddCommGroup.induced R S f hf
src✝ : DivisionRing R := inst✝²
x y : R
⊢ ‖f (x * y)‖ = ‖f x‖ * ‖f y‖

Next tactic:
exact (map_mul f x y).symm ▸ norm_mul (f x) (f y)