The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.Nat.Cast.Order.Ring

12 declarations. Mathlib docs · Source

theorem Nat.cast_nonneg E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : PartialOrder α] [IsOrderedRing α] (n : ℕ), 0 ≤ ↑n

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

theorem Nat.ofNat_nonneg E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : PartialOrder α] [IsOrderedRing α] (n : ℕ) [inst_3 : n.AtLeastTwo],
  0 ≤ OfNat.ofNat n

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

theorem Nat.cast_min E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (m n : ℕ), ↑(min m n) = min ↑m ↑n

theorem Nat.cast_max E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] (m n : ℕ), ↑(max m n) = max ↑m ↑n

theorem Nat.cast_pos E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : PartialOrder α] [IsOrderedRing α] [Nontrivial α] {n : ℕ}, 0 < ↑n ↔ 0 < n

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

theorem Nat.ofNat_pos' E0 #

∀ {α : Type u_2} [inst : AddMonoidWithOne α] [inst_1 : PartialOrder α] [AddLeftMono α] [ZeroLEOneClass α] [NeZero 1]
  {n : ℕ} [inst_5 : n.AtLeastTwo], 0 < OfNat.ofNat n

See also Nat.ofNat_pos, specialised to IsOrderedRing.

theorem Nat.ofNat_pos E0 #

∀ {α : Type u_3} [inst : Semiring α] [inst_1 : PartialOrder α] [IsOrderedRing α] [Nontrivial α] {n : ℕ}
  [inst_4 : n.AtLeastTwo], 0 < OfNat.ofNat n

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

theorem Nat.cast_tsub E0 #

∀ {α : Type u_2} [inst : CommSemiring α] [inst_1 : PartialOrder α] [CanonicallyOrderedAdd α] [inst_3 : 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.

theorem Nat.abs_cast E0 #

∀ {R : Type u_1} [inst : Ring R] [inst_1 : Lattice R] [IsOrderedRing R] (n : ℕ), |↑n| = ↑n

theorem Nat.abs_ofNat E0 #

∀ {R : Type u_1} [inst : Ring R] [inst_1 : Lattice R] [IsOrderedRing R] (n : ℕ) [inst_3 : n.AtLeastTwo],
  |OfNat.ofNat n| = OfNat.ofNat n

theorem Nat.neg_cast_eq_cast E0 #

∀ {R : Type u_1} [inst : Ring R] [inst_1 : PartialOrder R] [IsStrictOrderedRing R] {m n : ℕ}, -↑m = ↑n ↔ m = 0 ∧ n = 0

theorem Nat.cast_eq_neg_cast E0 #

∀ {R : Type u_1} [inst : Ring R] [inst_1 : PartialOrder R] [IsStrictOrderedRing R] {m n : ℕ}, ↑m = -↑n ↔ m = 0 ∧ n = 0