# Algebraic structures on the set of positive numbers #

In this file we define various instances (AddSemigroup, OrderedCommMonoid 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.

instance Positive.instAddSubtypeLtOfNat_mathlib {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
Add { x : M // 0 < x }
Equations
• Positive.instAddSubtypeLtOfNat_mathlib = { add := fun (x y : { x : M // 0 < x }) => x + y, }
@[simp]
theorem Positive.coe_add {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] (x : { x : M // 0 < x }) (y : { x : M // 0 < x }) :
(x + y) = x + y
instance Positive.addSemigroup {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
AddSemigroup { x : M // 0 < x }
Equations
instance Positive.addCommSemigroup {M : Type u_4} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
AddCommSemigroup { x : M // 0 < x }
Equations
instance Positive.addLeftCancelSemigroup {M : Type u_4} [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
AddLeftCancelSemigroup { x : M // 0 < x }
Equations
instance Positive.addRightCancelSemigroup {M : Type u_4} [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
AddRightCancelSemigroup { x : M // 0 < x }
Equations
instance Positive.covariantClass_add_lt {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
CovariantClass { x : M // 0 < x } { x : M // 0 < x } (fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x < x_1
Equations
• =
instance Positive.covariantClass_swap_add_lt {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] [CovariantClass M M (Function.swap fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
CovariantClass { x : M // 0 < x } { x : M // 0 < x } (Function.swap fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x < x_1
Equations
• =
instance Positive.contravariantClass_add_lt {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] [ContravariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
ContravariantClass { x : M // 0 < x } { x : M // 0 < x } (fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x < x_1
Equations
• =
instance Positive.contravariantClass_swap_add_lt {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] [ContravariantClass M M (Function.swap fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
ContravariantClass { x : M // 0 < x } { x : M // 0 < x } (Function.swap fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x < x_1
Equations
• =
instance Positive.contravariantClass_add_le {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] [ContravariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x x_1] :
ContravariantClass { x : M // 0 < x } { x : M // 0 < x } (fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x x_1
Equations
• =
instance Positive.contravariantClass_swap_add_le {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] [ContravariantClass M M (Function.swap fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x x_1] :
ContravariantClass { x : M // 0 < x } { x : M // 0 < x } (Function.swap fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x x_1
Equations
• =
instance Positive.covariantClass_add_le {M : Type u_1} [] [] [CovariantClass M M (fun (x x_1 : M) => x + x_1) fun (x x_1 : M) => x < x_1] :
CovariantClass { x : M // 0 < x } { x : M // 0 < x } (fun (x x_1 : { x : M // 0 < x }) => x + x_1) fun (x x_1 : { x : M // 0 < x }) => x x_1
Equations
• =
instance Positive.instMulSubtypeLtOfNat_mathlib {R : Type u_2} :
Mul { x : R // 0 < x }
Equations
• Positive.instMulSubtypeLtOfNat_mathlib = { mul := fun (x y : { x : R // 0 < x }) => x * y, }
@[simp]
theorem Positive.val_mul {R : Type u_2} (x : { x : R // 0 < x }) (y : { x : R // 0 < x }) :
(x * y) = x * y
instance Positive.instPowSubtypeLtOfNatNat_mathlib {R : Type u_2} :
Pow { x : R // 0 < x }
Equations
• Positive.instPowSubtypeLtOfNatNat_mathlib = { pow := fun (x : { x : R // 0 < x }) (n : ) => x ^ n, }
@[simp]
theorem Positive.val_pow {R : Type u_2} (x : { x : R // 0 < x }) (n : ) :
(x ^ n) = x ^ n
instance Positive.instSemigroupSubtypeLtOfNat {R : Type u_2} :
Semigroup { x : R // 0 < x }
Equations
instance Positive.instDistribSubtypeLtOfNat {R : Type u_2} :
Distrib { x : R // 0 < x }
Equations
instance Positive.instOneSubtypeLtOfNatOfNontrivial {R : Type u_2} [] :
One { x : R // 0 < x }
Equations
• Positive.instOneSubtypeLtOfNatOfNontrivial = { one := 1, }
@[simp]
theorem Positive.val_one {R : Type u_2} [] :
1 = 1
instance Positive.instMonoidSubtypeLtOfNatOfNontrivial {R : Type u_2} [] :
Monoid { x : R // 0 < x }
Equations
instance Positive.orderedCommMonoid {R : Type u_2} [] :
OrderedCommMonoid { x : R // 0 < x }
Equations

If R is a nontrivial linear ordered commutative semiring, then {x : R // 0 < x} is a linear ordered cancellative commutative monoid.

Equations
• One or more equations did not get rendered due to their size.