WithAbs #
WithAbs v
is a type synonym for a semiring R
which depends on an absolute value. The point of
this is to allow the type class inference system to handle multiple sources of instances that
arise from absolute values. See NumberTheory.NumberField.Completion
for an example of this
being used to define Archimedean completions of a number field.
Main definitions #
WithAbs
: type synonym for a semiring which depends on an absolute value. This is a function that takes an absolute value on a semiring and returns the semiring. This can be used to assign and infer instances on a semiring that depend on absolute values.WithAbs.equiv v
: the canonical (type) equivalence betweenWithAbs v
andR
.WithAbs.ringEquiv v
: The canonical ring equivalence betweenWithAbs v
andR
.
def
WithAbs
{R : Type u_1}
{S : Type u_2}
[Semiring R]
[OrderedSemiring S]
:
AbsoluteValue R S → Type u_1
Type synonym for a semiring which depends on an absolute value. This is a function that takes an absolute value on a semiring and returns the semiring. We use this to assign and infer instances on a semiring that depend on absolute values.
Instances For
Canonical equivalence between WithAbs v
and R
.
Equations
- WithAbs.equiv v = Equiv.refl (WithAbs v)
Instances For
instance
WithAbs.instNonTrivial
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
[Nontrivial R]
:
Nontrivial (WithAbs v)
Equations
- ⋯ = ⋯
Equations
Equations
Equations
- WithAbs.instRing v = inferInstanceAs (Ring R)
Equations
- WithAbs.instInhabited v = { default := 0 }
Equations
- WithAbs.normedRing v = v.toNormedRing
instance
WithAbs.normedField
{K : Type u_3}
[Field K]
(v : AbsoluteValue K ℝ)
:
NormedField (WithAbs v)
Equations
- WithAbs.normedField v = v.toNormedField
WithAbs.equiv
preserves the ring structure.
@[simp]
theorem
WithAbs.equiv_zero
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
:
(WithAbs.equiv v) 0 = 0
@[simp]
theorem
WithAbs.equiv_symm_zero
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
:
(WithAbs.equiv v).symm 0 = 0
@[simp]
theorem
WithAbs.equiv_add
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(x : WithAbs v)
(y : WithAbs v)
:
(WithAbs.equiv v) (x + y) = (WithAbs.equiv v) x + (WithAbs.equiv v) y
@[simp]
theorem
WithAbs.equiv_symm_add
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(r : R)
(s : R)
:
(WithAbs.equiv v).symm (r + s) = (WithAbs.equiv v).symm r + (WithAbs.equiv v).symm s
@[simp]
theorem
WithAbs.equiv_sub
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(x : WithAbs v)
(y : WithAbs v)
[Ring R]
:
(WithAbs.equiv v) (x - y) = (WithAbs.equiv v) x - (WithAbs.equiv v) y
@[simp]
theorem
WithAbs.equiv_symm_sub
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(r : R)
(s : R)
[Ring R]
:
(WithAbs.equiv v).symm (r - s) = (WithAbs.equiv v).symm r - (WithAbs.equiv v).symm s
@[simp]
theorem
WithAbs.equiv_neg
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(x : WithAbs v)
[Ring R]
:
(WithAbs.equiv v) (-x) = -(WithAbs.equiv v) x
@[simp]
theorem
WithAbs.equiv_symm_neg
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(r : R)
[Ring R]
:
(WithAbs.equiv v).symm (-r) = -(WithAbs.equiv v).symm r
@[simp]
theorem
WithAbs.equiv_mul
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(x : WithAbs v)
(y : WithAbs v)
:
(WithAbs.equiv v) (x * y) = (WithAbs.equiv v) x * (WithAbs.equiv v) y
@[simp]
theorem
WithAbs.equiv_symm_mul
{R : Type u_1}
[Semiring R]
(v : AbsoluteValue R ℝ)
(x : WithAbs v)
(y : WithAbs v)
:
(WithAbs.equiv v).symm (x * y) = (WithAbs.equiv v).symm x * (WithAbs.equiv v).symm y