@@ -19,7 +19,7 @@ We provide basic instances, as well as a custom tactic for discharging
19
19
20
20
noncomputable theory
21
21
open_locale classical topological_space filter
22
- open set
22
+ open set int
23
23
24
24
/-! ### The unit interval -/
25
25
@@ -30,13 +30,25 @@ localized "notation `I` := unit_interval" in unit_interval
30
30
31
31
namespace unit_interval
32
32
33
+ lemma zero_mem : (0 : ℝ) ∈ I := ⟨le_rfl, zero_le_one⟩
34
+
35
+ lemma one_mem : (1 : ℝ) ∈ I := ⟨zero_le_one, le_rfl⟩
36
+
37
+ lemma mul_mem {x y : ℝ} (hx : x ∈ I) (hy : y ∈ I) : x * y ∈ I :=
38
+ ⟨mul_nonneg hx.1 hy.1 , (mul_le_mul hx.2 hy.2 hy.1 zero_le_one).trans_eq $ one_mul 1 ⟩
39
+
40
+ lemma div_mem {x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hxy : x ≤ y) : x / y ∈ I :=
41
+ ⟨div_nonneg hx hy, div_le_one_of_le hxy hy⟩
42
+
43
+ lemma fract_mem (x : ℝ) : fract x ∈ I := ⟨fract_nonneg _, (fract_lt_one _).le⟩
44
+
33
45
lemma mem_iff_one_sub_mem {t : ℝ} : t ∈ I ↔ 1 - t ∈ I :=
34
46
begin
35
47
rw [mem_Icc, mem_Icc],
36
48
split ; intro ; split ; linarith
37
49
end
38
50
39
- instance has_zero : has_zero I := ⟨⟨0 , by split ; norm_num ⟩⟩
51
+ instance has_zero : has_zero I := ⟨⟨0 , zero_mem ⟩⟩
40
52
41
53
@[simp, norm_cast] lemma coe_zero : ((0 : I) : ℝ) = 0 := rfl
42
54
@@ -62,10 +74,7 @@ not_iff_not.mpr coe_eq_one
62
74
63
75
instance : nonempty I := ⟨0 ⟩
64
76
65
- lemma mul_mem (x y : I) : (x : ℝ) * y ∈ I :=
66
- ⟨mul_nonneg x.2 .1 y.2 .1 , (mul_le_mul x.2 .2 y.2 .2 y.2 .1 zero_le_one).trans_eq $ one_mul 1 ⟩
67
-
68
- instance : has_mul I := ⟨λ x y, ⟨x * y, mul_mem x y⟩⟩
77
+ instance : has_mul I := ⟨λ x y, ⟨x * y, mul_mem x.2 y.2 ⟩⟩
69
78
70
79
@[simp, norm_cast] lemma coe_mul {x y : I} : ((x * y : I) : ℝ) = x * y := rfl
71
80
@@ -78,7 +87,7 @@ lemma mul_le_right {x y : I} : x * y ≤ y :=
78
87
subtype.coe_le_coe.mp $ (mul_le_mul_of_nonneg_right x.2 .2 y.2 .1 ).trans_eq $ one_mul y
79
88
80
89
/-- Unit interval central symmetry. -/
81
- def symm : I → I := λ t, ⟨1 - t.val , mem_iff_one_sub_mem.mp t.property ⟩
90
+ def symm : I → I := λ t, ⟨1 - t, mem_iff_one_sub_mem.mp t.prop ⟩
82
91
83
92
localized " notation `σ` := unit_interval.symm" in unit_interval
84
93
0 commit comments