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

Commit c782e28

Browse files
committed
chore(analysis/normed_space/units): add protected, minor review (#6544)
1 parent f158f25 commit c782e28

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/analysis/normed_space/units.lean

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ begin
5252
nontriviality R using [zero_lt_one],
5353
have hpos : 0 < ∥(↑x⁻¹ : R)∥ := units.norm_pos x⁻¹,
5454
calc ∥-(↑x⁻¹ * t)∥
55-
= ∥↑x⁻¹ * t∥ : by { rw norm_neg }
56-
... ≤ ∥(↑x⁻¹ : R)∥ * ∥t∥ : norm_mul_le x.inv _
55+
= ∥↑x⁻¹ * t∥ : by { rw norm_neg }
56+
... ≤ ∥(↑x⁻¹ : R)∥ * ∥t∥ : norm_mul_le ↑x⁻¹ _
5757
... < ∥(↑x⁻¹ : R)∥ * ∥(↑x⁻¹ : R)∥⁻¹ : by nlinarith only [h, hpos]
58-
... = 1 : mul_inv_cancel (ne_of_gt hpos)
58+
... = 1 : mul_inv_cancel (ne_of_gt hpos)
5959
end)
6060

6161
@[simp] lemma add_coe (x : units R) (t : R) (h : ∥t∥ < ∥(↑x⁻¹ : R)∥⁻¹) :
@@ -70,20 +70,19 @@ x.add ((y : R) - x) h
7070
↑(x.unit_of_nearby y h) = y := by { unfold units.unit_of_nearby, simp }
7171

7272
/-- The group of units of a complete normed ring is an open subset of the ring. -/
73-
lemma is_open : is_open {x : R | is_unit x} :=
73+
protected lemma is_open : is_open {x : R | is_unit x} :=
7474
begin
7575
nontriviality R,
7676
apply metric.is_open_iff.mpr,
77-
rintros x' ⟨x, h⟩,
77+
rintros x' ⟨x, rfl⟩,
7878
refine ⟨∥(↑x⁻¹ : R)∥⁻¹, inv_pos.mpr (units.norm_pos x⁻¹), _⟩,
7979
intros y hy,
80-
rw [metric.mem_ball, dist_eq_norm, ←h] at hy,
81-
use x.unit_of_nearby y hy,
82-
simp
80+
rw [metric.mem_ball, dist_eq_norm] at hy,
81+
exact ⟨x.unit_of_nearby y hy, unit_of_nearby_coe _ _ _⟩
8382
end
8483

85-
lemma nhds (x : units R) : {x : R | is_unit x} ∈ 𝓝 (x : R) :=
86-
mem_nhds_sets is_open (by { rw [set.mem_set_of_eq], exact is_unit_unit x })
84+
protected lemma nhds (x : units R) : {x : R | is_unit x} ∈ 𝓝 (x : R) :=
85+
mem_nhds_sets units.is_open (is_unit_unit x)
8786

8887
end units
8988

@@ -92,10 +91,7 @@ open_locale classical big_operators
9291
open asymptotics filter metric finset ring
9392

9493
lemma inverse_one_sub (t : R) (h : ∥t∥ < 1) : inverse (1 - t) = ↑(units.one_sub t h)⁻¹ :=
95-
begin
96-
rw ← inverse_unit (units.one_sub t h),
97-
refl,
98-
end
94+
by rw [← inverse_unit (units.one_sub t h), units.one_sub_coe]
9995

10096
/-- The formula `inverse (x + t) = inverse (1 + x⁻¹ * t) * x⁻¹` holds for `t` sufficiently small. -/
10197
lemma inverse_add (x : units R) :

0 commit comments

Comments
 (0)