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

Commit eb2780b

Browse files
committed
feat(topology/unit_interval): add lemmas (#13344)
* also change the statement of `unit_interval.mul_mem` * from the sphere eversion project
1 parent 87f8076 commit eb2780b

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/topology/unit_interval.lean

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We provide basic instances, as well as a custom tactic for discharging
1919

2020
noncomputable theory
2121
open_locale classical topological_space filter
22-
open set
22+
open set int
2323

2424
/-! ### The unit interval -/
2525

@@ -30,13 +30,25 @@ localized "notation `I` := unit_interval" in unit_interval
3030

3131
namespace unit_interval
3232

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+
3345
lemma mem_iff_one_sub_mem {t : ℝ} : t ∈ I ↔ 1 - t ∈ I :=
3446
begin
3547
rw [mem_Icc, mem_Icc],
3648
split ; intro ; split ; linarith
3749
end
3850

39-
instance has_zero : has_zero I := ⟨⟨0, by split ; norm_num⟩⟩
51+
instance has_zero : has_zero I := ⟨⟨0, zero_mem⟩⟩
4052

4153
@[simp, norm_cast] lemma coe_zero : ((0 : I) : ℝ) = 0 := rfl
4254

@@ -62,10 +74,7 @@ not_iff_not.mpr coe_eq_one
6274

6375
instance : nonempty I := ⟨0
6476

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⟩⟩
6978

7079
@[simp, norm_cast] lemma coe_mul {x y : I} : ((x * y : I) : ℝ) = x * y := rfl
7180

@@ -78,7 +87,7 @@ lemma mul_le_right {x y : I} : x * y ≤ y :=
7887
subtype.coe_le_coe.mp $ (mul_le_mul_of_nonneg_right x.2.2 y.2.1).trans_eq $ one_mul y
7988

8089
/-- 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
8291

8392
localized "notation `σ` := unit_interval.symm" in unit_interval
8493

0 commit comments

Comments
 (0)