Documentation

Mathlib.Data.Nat.Cast.Order.Ring

Cast of natural numbers: lemmas about bundled ordered semirings #

@[simp]
theorem Nat.cast_nonneg {α : Type u_3} [Semiring α] [PartialOrder α] [IsOrderedRing α] (n : ℕ) :
0 ≤ ↑n

Specialisation of Nat.cast_nonneg', which seems to be easier for Lean to use.

@[simp]
theorem Nat.ofNat_nonneg {α : Type u_3} [Semiring α] [PartialOrder α] [IsOrderedRing α] (n : ℕ) [n.AtLeastTwo] :

Specialisation of Nat.ofNat_nonneg', which seems to be easier for Lean to use.

@[simp]
theorem Nat.cast_min {α : Type u_3} [Semiring α] [LinearOrder α] [IsStrictOrderedRing α] (m n : ℕ) :
↑(min m n) = min ↑m ↑n
@[simp]
theorem Nat.cast_max {α : Type u_3} [Semiring α] [LinearOrder α] [IsStrictOrderedRing α] (m n : ℕ) :
↑(max m n) = max ↑m ↑n
@[simp]
theorem Nat.cast_pos {α : Type u_3} [Semiring α] [PartialOrder α] [IsOrderedRing α] [Nontrivial α] {n : ℕ} :
0 < ↑n ↔ 0 < n

Specialisation of Nat.cast_pos', which seems to be easier for Lean to use.

@[simp]
theorem Nat.ofNat_pos' {α : Type u_2} [AddMonoidWithOne α] [PartialOrder α] [AddLeftMono α] [ZeroLEOneClass α] [NeZero 1] {n : ℕ} [n.AtLeastTwo] :

See also Nat.ofNat_pos, specialised for an OrderedSemiring.

@[simp]
theorem Nat.ofNat_pos {α : Type u_3} [Semiring α] [PartialOrder α] [IsOrderedRing α] [Nontrivial α] {n : ℕ} [n.AtLeastTwo] :

Specialisation of Nat.ofNat_pos', which seems to be easier for Lean to use.

@[simp]
theorem Nat.cast_tsub {α : Type u_2} [CommSemiring α] [PartialOrder α] [IsOrderedRing α] [CanonicallyOrderedAdd α] [Sub α] [OrderedSub α] [AddLeftReflectLE α] (m n : ℕ) :
↑(m - n) = ↑m - ↑n

A version of Nat.cast_sub that works for ℝ≥0 and ℚ≥0. Note that this proof doesn't work for ℕ∞ and ℝ≥0∞, so we use type-specific lemmas for these types.

@[simp]
theorem Nat.abs_cast {R : Type u_1} [Ring R] [Lattice R] [IsOrderedRing R] (n : ℕ) :
|↑n| = ↑n
@[simp]
theorem Nat.abs_ofNat {R : Type u_1} [Ring R] [Lattice R] [IsOrderedRing R] (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Nat.neg_cast_eq_cast {R : Type u_1} [Ring R] [PartialOrder R] [IsStrictOrderedRing R] {m n : ℕ} :
-↑m = ↑n ↔ m = 0 ∧ n = 0
@[simp]
theorem Nat.cast_eq_neg_cast {R : Type u_1} [Ring R] [PartialOrder R] [IsStrictOrderedRing R] {m n : ℕ} :
↑m = -↑n ↔ m = 0 ∧ n = 0