Algebraic structures on the set of positive numbers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In this file we define various instances (add_semigroup
, ordered_comm_monoid
etc) on the
type {x : R // 0 < x}
. In each case we try to require the weakest possible typeclass
assumptions on R
but possibly, there is a room for improvements.
@[protected, instance]
def
positive.subtype.has_add
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
@[simp, norm_cast]
theorem
positive.coe_add
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
(x y : {x // 0 < x}) :
@[protected, instance]
def
positive.subtype.add_semigroup
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
add_semigroup {x // 0 < x}
Equations
- positive.subtype.add_semigroup = function.injective.add_semigroup coe positive.subtype.add_semigroup._proof_1 positive.coe_add
@[protected, instance]
def
positive.subtype.add_comm_semigroup
{M : Type u_1}
[add_comm_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
add_comm_semigroup {x // 0 < x}
Equations
- positive.subtype.add_comm_semigroup = function.injective.add_comm_semigroup coe positive.subtype.add_comm_semigroup._proof_1 positive.subtype.add_comm_semigroup._proof_2
@[protected, instance]
def
positive.subtype.add_left_cancel_semigroup
{M : Type u_1}
[add_left_cancel_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
add_left_cancel_semigroup {x // 0 < x}
Equations
- positive.subtype.add_left_cancel_semigroup = function.injective.add_left_cancel_semigroup coe positive.subtype.add_left_cancel_semigroup._proof_1 positive.subtype.add_left_cancel_semigroup._proof_2
@[protected, instance]
def
positive.subtype.add_right_cancel_semigroup
{M : Type u_1}
[add_right_cancel_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
add_right_cancel_semigroup {x // 0 < x}
Equations
- positive.subtype.add_right_cancel_semigroup = function.injective.add_right_cancel_semigroup coe positive.subtype.add_right_cancel_semigroup._proof_1 positive.subtype.add_right_cancel_semigroup._proof_2
@[protected, instance]
def
positive.covariant_class_add_lt
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt] :
covariant_class {x // 0 < x} {x // 0 < x} has_add.add has_lt.lt
@[protected, instance]
def
positive.covariant_class_swap_add_lt
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
[covariant_class M M (function.swap has_add.add) has_lt.lt] :
covariant_class {x // 0 < x} {x // 0 < x} (function.swap has_add.add) has_lt.lt
@[protected, instance]
def
positive.contravariant_class_add_lt
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
[contravariant_class M M has_add.add has_lt.lt] :
contravariant_class {x // 0 < x} {x // 0 < x} has_add.add has_lt.lt
@[protected, instance]
def
positive.contravariant_class_swap_add_lt
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
[contravariant_class M M (function.swap has_add.add) has_lt.lt] :
contravariant_class {x // 0 < x} {x // 0 < x} (function.swap has_add.add) has_lt.lt
@[protected, instance]
def
positive.contravariant_class_add_le
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
[contravariant_class M M has_add.add has_le.le] :
contravariant_class {x // 0 < x} {x // 0 < x} has_add.add has_le.le
@[protected, instance]
def
positive.contravariant_class_swap_add_le
{M : Type u_1}
[add_monoid M]
[preorder M]
[covariant_class M M has_add.add has_lt.lt]
[contravariant_class M M (function.swap has_add.add) has_le.le] :
contravariant_class {x // 0 < x} {x // 0 < x} (function.swap has_add.add) has_le.le
@[protected, instance]
def
positive.covariant_class_add_le
{M : Type u_1}
[add_monoid M]
[partial_order M]
[covariant_class M M has_add.add has_lt.lt] :
covariant_class {x // 0 < x} {x // 0 < x} has_add.add has_le.le
@[protected, instance]
@[protected, instance]
Equations
- positive.subtype.semigroup = function.injective.semigroup coe positive.subtype.semigroup._proof_1 positive.coe_mul
@[protected, instance]
Equations
- positive.subtype.distrib = function.injective.distrib coe positive.subtype.distrib._proof_2 positive.subtype.distrib._proof_3 positive.coe_mul
@[protected, instance]
Equations
- positive.subtype.has_one = {one := ⟨1, _⟩}
@[simp]
@[protected, instance]
Equations
- positive.subtype.monoid = function.injective.monoid coe positive.subtype.monoid._proof_1 positive.coe_one positive.coe_mul positive.coe_pow
@[protected, instance]
def
positive.subtype.ordered_comm_monoid
{R : Type u_2}
[strict_ordered_comm_semiring R]
[nontrivial R] :
ordered_comm_monoid {x // 0 < x}
Equations
- positive.subtype.ordered_comm_monoid = {mul := comm_monoid.mul (function.injective.comm_monoid coe positive.subtype.ordered_comm_monoid._proof_1 positive.subtype.ordered_comm_monoid._proof_2 positive.subtype.ordered_comm_monoid._proof_3 positive.subtype.ordered_comm_monoid._proof_4), mul_assoc := _, one := comm_monoid.one (function.injective.comm_monoid coe positive.subtype.ordered_comm_monoid._proof_1 positive.subtype.ordered_comm_monoid._proof_2 positive.subtype.ordered_comm_monoid._proof_3 positive.subtype.ordered_comm_monoid._proof_4), one_mul := _, mul_one := _, npow := comm_monoid.npow (function.injective.comm_monoid coe positive.subtype.ordered_comm_monoid._proof_1 positive.subtype.ordered_comm_monoid._proof_2 positive.subtype.ordered_comm_monoid._proof_3 positive.subtype.ordered_comm_monoid._proof_4), npow_zero' := _, npow_succ' := _, mul_comm := _, le := partial_order.le (subtype.partial_order (λ (x : R), 0 < x)), lt := partial_order.lt (subtype.partial_order (λ (x : R), 0 < x)), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, mul_le_mul_left := _}
@[protected, instance]
def
positive.subtype.linear_ordered_cancel_comm_monoid
{R : Type u_2}
[linear_ordered_comm_semiring R] :
linear_ordered_cancel_comm_monoid {x // 0 < x}
If R
is a nontrivial linear ordered commutative semiring, then {x : R // 0 < x}
is a linear
ordered cancellative commutative monoid.
Equations
- positive.subtype.linear_ordered_cancel_comm_monoid = {mul := ordered_comm_monoid.mul positive.subtype.ordered_comm_monoid, mul_assoc := _, one := ordered_comm_monoid.one positive.subtype.ordered_comm_monoid, one_mul := _, mul_one := _, npow := ordered_comm_monoid.npow positive.subtype.ordered_comm_monoid, npow_zero' := _, npow_succ' := _, mul_comm := _, le := linear_order.le (subtype.linear_order (λ (x : R), 0 < x)), lt := linear_order.lt (subtype.linear_order (λ (x : R), 0 < x)), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, mul_le_mul_left := _, le_of_mul_le_mul_left := _, le_total := _, decidable_le := linear_order.decidable_le (subtype.linear_order (λ (x : R), 0 < x)), decidable_eq := linear_order.decidable_eq (subtype.linear_order (λ (x : R), 0 < x)), decidable_lt := linear_order.decidable_lt (subtype.linear_order (λ (x : R), 0 < x)), max := linear_order.max (subtype.linear_order (λ (x : R), 0 < x)), max_def := _, min := linear_order.min (subtype.linear_order (λ (x : R), 0 < x)), min_def := _}