@@ -125,22 +125,34 @@ lemma commute_cast [semiring α] (x : α) (n : ℕ) : commute x n :=
125
125
| 0 := le_refl _
126
126
| (n+1 ) := add_nonneg (cast_nonneg n) zero_le_one
127
127
128
- @[simp, norm_cast] theorem cast_le [linear_ordered_semiring α] : ∀ {m n : ℕ}, (m : α) ≤ n ↔ m ≤ n
129
- | 0 n := by simp [zero_le]
130
- | (m+ 1 ) 0 := by simpa [not_succ_le_zero] using
131
- lt_add_of_nonneg_of_lt (@cast_nonneg α _ m) zero_lt_one
132
- | (m+ 1 ) (n+ 1 ) := (add_le_add_iff_right 1 ).trans $
133
- (@cast_le m n).trans $ (add_le_add_iff_right 1 ).symm
128
+ theorem strict_mono_cast [linear_ordered_semiring α] : strict_mono (coe : ℕ → α) :=
129
+ λ m n h, nat.le_induction (lt_add_of_pos_right _ zero_lt_one)
130
+ (λ n _ h, lt_add_of_lt_of_pos h zero_lt_one) _ h
131
+
132
+ @[simp, norm_cast] theorem cast_le [linear_ordered_semiring α] {m n : ℕ} : (m : α) ≤ n ↔ m ≤ n :=
133
+ strict_mono_cast.le_iff_le
134
134
135
135
@[simp, norm_cast] theorem cast_lt [linear_ordered_semiring α] {m n : ℕ} : (m : α) < n ↔ m < n :=
136
- by simpa [-cast_le] using not_congr (@cast_le α _ n m)
136
+ strict_mono_cast.lt_iff_lt
137
137
138
138
@[simp] theorem cast_pos [linear_ordered_semiring α] {n : ℕ} : (0 : α) < n ↔ 0 < n :=
139
139
by rw [← cast_zero, cast_lt]
140
140
141
141
lemma cast_add_one_pos [linear_ordered_semiring α] (n : ℕ) : 0 < (n : α) + 1 :=
142
142
add_pos_of_nonneg_of_pos n.cast_nonneg zero_lt_one
143
143
144
+ @[simp, norm_cast] theorem one_lt_cast [linear_ordered_semiring α] {n : ℕ} : 1 < (n : α) ↔ 1 < n :=
145
+ by rw [← cast_one, cast_lt]
146
+
147
+ @[simp, norm_cast] theorem one_le_cast [linear_ordered_semiring α] {n : ℕ} : 1 ≤ (n : α) ↔ 1 ≤ n :=
148
+ by rw [← cast_one, cast_le]
149
+
150
+ @[simp, norm_cast] theorem cast_lt_one [linear_ordered_semiring α] {n : ℕ} : (n : α) < 1 ↔ n = 0 :=
151
+ by rw [← cast_one, cast_lt, lt_succ_iff, le_zero_iff]
152
+
153
+ @[simp, norm_cast] theorem cast_le_one [linear_ordered_semiring α] {n : ℕ} : (n : α) ≤ 1 ↔ n ≤ 1 :=
154
+ by rw [← cast_one, cast_le]
155
+
144
156
@[simp, norm_cast] theorem cast_min [decidable_linear_ordered_semiring α] {a b : ℕ} :
145
157
(↑(min a b) : α) = min a b :=
146
158
by by_cases a ≤ b; simp [h, min]
@@ -153,10 +165,12 @@ by by_cases a ≤ b; simp [h, max]
153
165
abs (a : α) = a :=
154
166
abs_of_nonneg (cast_nonneg a)
155
167
156
- lemma coe_nat_dvd [comm_semiring α] ( m n : ℕ) (h : m ∣ n) :
168
+ lemma coe_nat_dvd [comm_semiring α] { m n : ℕ} (h : m ∣ n) :
157
169
(m : α) ∣ (n : α) :=
158
170
ring_hom.map_dvd (nat.cast_ring_hom α) h
159
171
172
+ alias coe_nat_dvd ← has_dvd.dvd.nat_cast
173
+
160
174
section linear_ordered_field
161
175
variables [linear_ordered_field α]
162
176
0 commit comments