Linearly ordered commutative additive groups and monoids with a top element adjoined #
This file sets up a special class of linearly ordered commutative additive monoids that show up as the target of so-called “valuations” in algebraic number theory.
Usually, in the informal literature, these objects are constructed by taking a linearly ordered commutative additive group Γ and formally adjoining a top element: Γ ∪ {⊤}.
The disadvantage is that a type such as ENNReal
is not of that form,
whereas it is a very common target for valuations.
The solutions is to use a typeclass, and that is exactly what we do in this file.
A linearly ordered commutative monoid with an additively absorbing ⊤
element.
Instances should include number systems with an infinite element adjoined.
- add : α → α → α
- zero : α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
- compare_eq_compareOfLessAndEq : ∀ (a b : α), compare a b = compareOfLessAndEq a b
- top : α
In a
LinearOrderedAddCommMonoidWithTop
, the⊤
element is invariant under addition.
Instances
A linearly ordered commutative group with an additively absorbing ⊤
element.
Instances should include number systems with an infinite element adjoined.
- add : α → α → α
- zero : α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
- compare_eq_compareOfLessAndEq : ∀ (a b : α), compare a b = compareOfLessAndEq a b
- top : α
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : ∀ (a b : α), a - b = a + -b
- zsmul_zero' : ∀ (a : α), LinearOrderedAddCommGroupWithTop.zsmul 0 a = 0
- zsmul_succ' : ∀ (n : ℕ) (a : α), LinearOrderedAddCommGroupWithTop.zsmul (↑n.succ) a = LinearOrderedAddCommGroupWithTop.zsmul (↑n) a + a
- zsmul_neg' : ∀ (n : ℕ) (a : α), LinearOrderedAddCommGroupWithTop.zsmul (Int.negSucc n) a = -LinearOrderedAddCommGroupWithTop.zsmul (↑n.succ) a
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
Instances
Equations
- WithTop.linearOrderedAddCommMonoidWithTop = LinearOrderedAddCommMonoidWithTop.mk ⋯
Equations
- WithTop.LinearOrderedAddCommGroup.instNeg = { neg := Option.map fun (a : α) => -a }
If α
has subtraction, we can extend the subtraction to WithTop α
, by
setting x - ⊤ = ⊤
and ⊤ - x = ⊤
. This definition is only registered as an instance on linearly
ordered additive commutative groups, to avoid conflicting with the instance WithTop.instSub
on
types with a bottom element.
Equations
- WithTop.LinearOrderedAddCommGroup.sub x none = ⊤
- WithTop.LinearOrderedAddCommGroup.sub none (some x_2) = ⊤
- WithTop.LinearOrderedAddCommGroup.sub (some x_2) (some y) = ↑(x_2 - y)
Instances For
Equations
- WithTop.LinearOrderedAddCommGroup.instSub = { sub := WithTop.LinearOrderedAddCommGroup.sub }
Equations
- WithTop.LinearOrderedAddCommGroup.instLinearOrderedAddCommGroupWithTop = LinearOrderedAddCommGroupWithTop.mk ⋯ zsmulRec ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- LinearOrderedAddCommGroupWithTop.toSubtractionMonoid = SubtractionMonoid.mk ⋯ ⋯ ⋯