HepLean Documentation

Mathlib.Algebra.Order.Ring.Canonical

Canonically ordered rings and semirings. #

TODO #

We're still missing some typeclasses, like

A canonically ordered commutative semiring is an ordered, commutative semiring in which a ≤ b iff there exists c with b = a + c. This is satisfied by the natural numbers, for example, but not the integers or other ordered groups.

Instances
    theorem Odd.pos {α : Type u} [CanonicallyOrderedCommSemiring α] {a : α} [Nontrivial α] :
    Odd a0 < a
    @[instance 100]
    Equations
    @[instance 100]
    Equations
    @[simp]
    theorem CanonicallyOrderedCommSemiring.mul_pos {α : Type u} [CanonicallyOrderedCommSemiring α] {a b : α} :
    0 < a * b 0 < a 0 < b
    theorem CanonicallyOrderedCommSemiring.pow_pos {α : Type u} [CanonicallyOrderedCommSemiring α] {a : α} (ha : 0 < a) (n : ) :
    0 < a ^ n
    theorem CanonicallyOrderedCommSemiring.mul_lt_mul_of_lt_of_lt {α : Type u} [CanonicallyOrderedCommSemiring α] {a b c d : α} [PosMulStrictMono α] (hab : a < b) (hcd : c < d) :
    a * c < b * d
    theorem AddLECancellable.mul_tsub {α : Type u} [CanonicallyOrderedCommSemiring α] {a b c : α} [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] (h : AddLECancellable (a * c)) :
    a * (b - c) = a * b - a * c
    theorem AddLECancellable.tsub_mul {α : Type u} [CanonicallyOrderedCommSemiring α] {a b c : α} [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] (h : AddLECancellable (b * c)) :
    (a - b) * c = a * c - b * c
    theorem mul_tsub {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b c : α) :
    a * (b - c) = a * b - a * c
    theorem tsub_mul {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b c : α) :
    (a - b) * c = a * c - b * c
    theorem mul_tsub_one {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b : α) :
    a * (b - 1) = a * b - a
    theorem tsub_one_mul {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b : α) :
    (a - 1) * b = a * b - b
    theorem mul_self_tsub_mul_self {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b : α) :
    a * a - b * b = (a + b) * (a - b)

    The tsub version of mul_self_sub_mul_self. Notably, this holds for Nat and NNReal.

    theorem sq_tsub_sq {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a b : α) :
    a ^ 2 - b ^ 2 = (a + b) * (a - b)

    The tsub version of sq_sub_sq. Notably, this holds for Nat and NNReal.

    theorem mul_self_tsub_one {α : Type u} [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α] [IsTotal α fun (x1 x2 : α) => x1 x2] [AddLeftReflectLE α] (a : α) :
    a * a - 1 = (a + 1) * (a - 1)