Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
Zhangir Azerbayev
squashed?
4365a98
raw
history blame
1.52 kB
/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import analysis.normed_space.basic
/-!
# The integers as normed ring
This file contains basic facts about the integers as normed ring.
Recall that `βˆ₯nβˆ₯` denotes the norm of `n` as real number.
This norm is always nonnegative, so we can bundle the norm together with this fact,
to obtain a term of type `nnreal` (the nonnegative real numbers).
The resulting nonnegative real number is denoted by `βˆ₯nβˆ₯β‚Š`.
-/
open_locale big_operators
namespace int
lemma nnnorm_coe_units (e : β„€Λ£) : βˆ₯(e : β„€)βˆ₯β‚Š = 1 :=
begin
obtain (rfl|rfl) := int.units_eq_one_or e;
simp only [units.coe_neg_one, units.coe_one, nnnorm_neg, nnnorm_one],
end
lemma norm_coe_units (e : β„€Λ£) : βˆ₯(e : β„€)βˆ₯ = 1 :=
by rw [← coe_nnnorm, int.nnnorm_coe_units, nnreal.coe_one]
@[simp] lemma nnnorm_coe_nat (n : β„•) : βˆ₯(n : β„€)βˆ₯β‚Š = n := real.nnnorm_coe_nat _
@[simp] lemma norm_coe_nat (n : β„•) : βˆ₯(n : β„€)βˆ₯ = n := real.norm_coe_nat _
@[simp] lemma to_nat_add_to_nat_neg_eq_nnnorm (n : β„€) : ↑(n.to_nat) + ↑((-n).to_nat) = βˆ₯nβˆ₯β‚Š :=
by rw [← nat.cast_add, to_nat_add_to_nat_neg_eq_nat_abs, nnreal.coe_nat_abs]
@[simp] lemma to_nat_add_to_nat_neg_eq_norm (n : β„€) : ↑(n.to_nat) + ↑((-n).to_nat) = βˆ₯nβˆ₯ :=
by simpa only [nnreal.coe_nat_cast, nnreal.coe_add]
using congr_arg (coe : _ β†’ ℝ) (to_nat_add_to_nat_neg_eq_nnnorm n)
end int