@@ -29,6 +29,8 @@ theorem rat.dist_eq (x y : ℚ) : dist x y = abs (x - y) := rfl
29
29
30
30
@[norm_cast, simp] lemma rat.dist_cast (x y : ℚ) : dist (x : ℝ) y = dist x y := rfl
31
31
32
+ namespace int
33
+
32
34
section low_prio
33
35
-- we want to ignore this instance for the next declaration
34
36
local attribute [instance, priority 10 ] int.uniform_space
@@ -46,21 +48,33 @@ begin
46
48
end
47
49
end low_prio
48
50
49
- theorem int. dist_eq (x y : ℤ) : dist x y = abs (x - y) := rfl
51
+ theorem dist_eq (x y : ℤ) : dist x y = abs (x - y) := rfl
50
52
51
- @[norm_cast, simp] theorem int. dist_cast_real (x y : ℤ) : dist (x : ℝ) y = dist x y := rfl
53
+ @[norm_cast, simp] theorem dist_cast_real (x y : ℤ) : dist (x : ℝ) y = dist x y := rfl
52
54
53
- @[norm_cast, simp] theorem int. dist_cast_rat (x y : ℤ) : dist (x : ℚ) y = dist x y :=
55
+ @[norm_cast, simp] theorem dist_cast_rat (x y : ℤ) : dist (x : ℚ) y = dist x y :=
54
56
by rw [← int.dist_cast_real, ← rat.dist_cast]; congr' 1 ; norm_cast
55
57
58
+ theorem preimage_ball (x : ℤ) (r : ℝ) : coe ⁻¹' (ball (x : ℝ) r) = ball x r := rfl
59
+
60
+ theorem preimage_closed_ball (x : ℤ) (r : ℝ) :
61
+ coe ⁻¹' (closed_ball (x : ℝ) r) = closed_ball x r := rfl
62
+
63
+ theorem ball_eq (x : ℤ) (r : ℝ) : ball x r = Ioo ⌊↑x - r⌋ ⌈↑x + r⌉ :=
64
+ by rw [← preimage_ball, real.ball_eq, preimage_Ioo]
65
+
66
+ theorem closed_ball_eq (x : ℤ) (r : ℝ) : closed_ball x r = Icc ⌈↑x - r⌉ ⌊↑x + r⌋ :=
67
+ by rw [← preimage_closed_ball, real.closed_ball_eq, preimage_Icc]
68
+
56
69
instance : proper_space ℤ :=
57
70
⟨ begin
58
71
intros x r,
59
- apply set.finite.is_compact,
60
- have : closed_ball x r = coe ⁻¹' (closed_ball (x:ℝ) r) := rfl,
61
- simp [this , closed_ball_Icc, set.Icc_ℤ_finite],
72
+ rw closed_ball_eq,
73
+ exact (set.Icc_ℤ_finite _ _).is_compact,
62
74
end ⟩
63
75
76
+ end int
77
+
64
78
theorem uniform_continuous_of_rat : uniform_continuous (coe : ℚ → ℝ) :=
65
79
uniform_continuous_comap
66
80
@@ -111,7 +125,7 @@ instance : order_topology ℚ :=
111
125
induced_order_topology _ (λ x y, rat.cast_lt) (@exists_rat_btwn _ _ _)
112
126
113
127
instance : proper_space ℝ :=
114
- { compact_ball := λx r, by { rw closed_ball_Icc , apply is_compact_Icc } }
128
+ { compact_ball := λx r, by { rw real.closed_ball_eq , apply is_compact_Icc } }
115
129
116
130
instance : second_countable_topology ℝ := second_countable_of_proper
117
131
@@ -264,7 +278,7 @@ lemma real.bounded_iff_bdd_below_bdd_above {s : set ℝ} : bounded s ↔ bdd_bel
264
278
⟨begin
265
279
assume bdd,
266
280
rcases (bounded_iff_subset_ball 0 ).1 bdd with ⟨r, hr⟩, -- hr : s ⊆ closed_ball 0 r
267
- rw closed_ball_Icc at hr, -- hr : s ⊆ Icc (0 - r) (0 + r)
281
+ rw real.closed_ball_eq at hr, -- hr : s ⊆ Icc (0 - r) (0 + r)
268
282
exact ⟨bdd_below_Icc.mono hr, bdd_above_Icc.mono hr⟩
269
283
end ,
270
284
begin
0 commit comments