Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 60454dd

Browse files
committed
feat(algebra/order/monoid): zero_le_one' lemma with explicit type argument (#14594)
1 parent f40cd3c commit 60454dd

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

src/algebra/geom_sum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ lemma nat.geom_sum_Ico_le {b : ℕ} (hb : 2 ≤ b) (a n : ℕ) :
373373
∑ i in Ico 1 n, a/b^i ≤ a/(b - 1) :=
374374
begin
375375
cases n,
376-
{ rw [Ico_eq_empty_of_le (@zero_le_one ℕ _ _ _ _), sum_empty],
376+
{ rw [Ico_eq_empty_of_le (zero_le_one' ℕ), sum_empty],
377377
exact nat.zero_le _ },
378378
rw ←add_le_add_iff_left a,
379379
calc

src/algebra/order/monoid.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ class linear_ordered_comm_monoid (α : Type*)
114114
class zero_le_one_class (α : Type*) [has_zero α] [has_one α] [has_le α] :=
115115
(zero_le_one : (0 : α) ≤ 1)
116116

117-
@[simp] lemma zero_le_one [has_le α] [has_zero α] [has_one α] [zero_le_one_class α] : (0 : α) ≤ 1 :=
117+
@[simp] lemma zero_le_one [has_zero α] [has_one α] [has_le α] [zero_le_one_class α] : (0 : α) ≤ 1 :=
118118
zero_le_one_class.zero_le_one
119119

120+
/- `zero_le_one` with an explicit type argument. -/
121+
lemma zero_le_one' (α) [has_zero α] [has_one α] [has_le α] [zero_le_one_class α] : (0 : α) ≤ 1 :=
122+
zero_le_one
123+
120124
lemma zero_le_two [preorder α] [has_one α] [add_zero_class α] [zero_le_one_class α]
121125
[covariant_class α α (+) (≤)] : (0 : α) ≤ 2 :=
122126
add_nonneg zero_le_one zero_le_one

src/analysis/specific_limits/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ end
539539

540540
lemma tendsto_nat_floor_div_at_top :
541541
tendsto (λ x, (⌊x⌋₊ : R) / x) at_top (𝓝 1) :=
542-
by simpa using tendsto_nat_floor_mul_div_at_top (@zero_le_one R _ _ _ _)
542+
by simpa using tendsto_nat_floor_mul_div_at_top (zero_le_one' R)
543543

544544
lemma tendsto_nat_ceil_mul_div_at_top {a : R} (ha : 0 ≤ a) :
545545
tendsto (λ x, (⌈a * x⌉₊ : R) / x) at_top (𝓝 a) :=
@@ -558,6 +558,6 @@ end
558558

559559
lemma tendsto_nat_ceil_div_at_top :
560560
tendsto (λ x, (⌈x⌉₊ : R) / x) at_top (𝓝 1) :=
561-
by simpa using tendsto_nat_ceil_mul_div_at_top (@zero_le_one R _ _ _ _)
561+
by simpa using tendsto_nat_ceil_mul_div_at_top (zero_le_one' R)
562562

563563
end

src/data/int/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ le_sub_iff_add_le
221221
λ a0, (abs_eq_zero.mpr a0).le.trans_lt zero_lt_one⟩
222222

223223
lemma abs_le_one_iff {a : ℤ} : |a| ≤ 1 ↔ a = 0 ∨ a = 1 ∨ a = -1 :=
224-
by rw [le_iff_lt_or_eq, abs_lt_one_iff, abs_eq (@zero_le_one ℤ _ _ _ _)]
224+
by rw [le_iff_lt_or_eq, abs_lt_one_iff, abs_eq (zero_le_one' ℤ)]
225225

226226
lemma one_le_abs {z : ℤ} (h₀: z ≠ 0) : 1 ≤ |z| :=
227227
add_one_le_iff.mpr (abs_pos.mpr h₀)
@@ -1624,7 +1624,7 @@ begin
16241624
end
16251625

16261626
lemma sq_eq_one_of_sq_lt_four {x : ℤ} (h1 : x ^ 2 < 4) (h2 : x ≠ 0) : x ^ 2 = 1 :=
1627-
sq_eq_one_iff.mpr ((abs_eq (@zero_le_one ℤ _ _ _ _)).mp (le_antisymm (lt_add_one_iff.mp
1627+
sq_eq_one_iff.mpr ((abs_eq (zero_le_one' ℤ)).mp (le_antisymm (lt_add_one_iff.mp
16281628
(abs_lt_of_sq_lt_sq h1 zero_le_two)) (sub_one_lt_iff.mp (abs_pos.mpr h2))))
16291629

16301630
lemma sq_eq_one_of_sq_le_three {x : ℤ} (h1 : x ^ 23) (h2 : x ≠ 0) : x ^ 2 = 1 :=

src/topology/algebra/order/floor.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ begin
178178
have : (uncurry f) (s, 0) = (uncurry f) (s, (1 : α)),
179179
by simp [uncurry, hf],
180180
rw this,
181-
refine (h _ ⟨⟨⟩, by exact_mod_cast right_mem_Icc.2 (@zero_le_one α _ _ _ _)⟩).tendsto.comp _,
181+
refine (h _ ⟨⟨⟩, by exact_mod_cast right_mem_Icc.2 (zero_le_one' α)⟩).tendsto.comp _,
182182
rw [nhds_within_prod_eq, nhds_within_univ],
183183
rw nhds_within_Icc_eq_nhds_within_Iic (@zero_lt_one α _ _),
184184
exact tendsto_id.prod_map
185185
(tendsto_nhds_within_mono_right Iio_subset_Iic_self $ tendsto_fract_left _) },
186186
{ simp only [continuous_within_at, fract_coe, nhds_within_prod_eq,
187187
nhds_within_univ, id.def, comp_app, prod.map_mk],
188-
refine (h _ ⟨⟨⟩, by exact_mod_cast left_mem_Icc.2 (@zero_le_one α _ _ _ _)⟩).tendsto.comp _,
188+
refine (h _ ⟨⟨⟩, by exact_mod_cast left_mem_Icc.2 (zero_le_one' α)⟩).tendsto.comp _,
189189
rw [nhds_within_prod_eq, nhds_within_univ,
190190
nhds_within_Icc_eq_nhds_within_Ici (@zero_lt_one α _ _)],
191191
exact tendsto_id.prod_map (tendsto_fract_right _) } },

src/topology/homotopy/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,24 @@ lemma extend_apply_of_le_zero (F : homotopy f₀ f₁) {t : ℝ} (ht : t ≤ 0)
141141
F.extend t x = f₀ x :=
142142
begin
143143
rw [←F.apply_zero],
144-
exact continuous_map.congr_fun (set.Icc_extend_of_le_left (@zero_le_one ℝ _ _ _ _) F.curry ht) x,
144+
exact continuous_map.congr_fun (set.Icc_extend_of_le_left (zero_le_one' ℝ) F.curry ht) x,
145145
end
146146

147147
lemma extend_apply_of_one_le (F : homotopy f₀ f₁) {t : ℝ} (ht : 1 ≤ t) (x : X) :
148148
F.extend t x = f₁ x :=
149149
begin
150150
rw [←F.apply_one],
151-
exact continuous_map.congr_fun (set.Icc_extend_of_right_le (@zero_le_one ℝ _ _ _ _) F.curry ht) x,
151+
exact continuous_map.congr_fun (set.Icc_extend_of_right_le (zero_le_one' ℝ) F.curry ht) x,
152152
end
153153

154154
@[simp]
155155
lemma extend_apply_coe (F : homotopy f₀ f₁) (t : I) (x : X) : F.extend t x = F (t, x) :=
156-
continuous_map.congr_fun (set.Icc_extend_coe (@zero_le_one ℝ _ _ _ _) F.curry t) x
156+
continuous_map.congr_fun (set.Icc_extend_coe (zero_le_one' ℝ) F.curry t) x
157157

158158
@[simp]
159159
lemma extend_apply_of_mem_I (F : homotopy f₀ f₁) {t : ℝ} (ht : t ∈ I) (x : X) :
160160
F.extend t x = F (⟨t, ht⟩, x) :=
161-
continuous_map.congr_fun (set.Icc_extend_of_mem (@zero_le_one ℝ _ _ _ _) F.curry ht) x
161+
continuous_map.congr_fun (set.Icc_extend_of_mem (zero_le_one' ℝ) F.curry ht) x
162162

163163
lemma congr_fun {F G : homotopy f₀ f₁} (h : F = G) (x : I × X) : F x = G x :=
164164
continuous_map.congr_fun (congr_arg _ h) x

src/topology/path_connected.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ begin
555555
have : range f = univ,
556556
{ rw range_iff_surjective,
557557
intro t,
558-
have h₁ : continuous (Icc_extend (@zero_le_one ℝ _ _ _ _) f),
558+
have h₁ : continuous (Icc_extend (zero_le_one' ℝ) f),
559559
{ continuity },
560-
have := intermediate_value_Icc (@zero_le_one ℝ _ _ _ _) h₁.continuous_on,
560+
have := intermediate_value_Icc (zero_le_one' ℝ) h₁.continuous_on,
561561
{ rw [Icc_extend_left, Icc_extend_right] at this,
562562
change Icc (f 0) (f 1) ⊆ _ at this,
563563
rw [hf₀, hf₁] at this,

0 commit comments

Comments
 (0)