Skip to content

Commit

Permalink
chore(UnitInterval): golf (#9544)
Browse files Browse the repository at this point in the history
  • Loading branch information
urkud committed Jan 8, 2024
1 parent 78002f2 commit 6688f91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Mathlib/Topology/UnitInterval.lean
Expand Up @@ -48,7 +48,7 @@ theorem one_mem : (1 : ℝ) ∈ I :=
#align unit_interval.one_mem unitInterval.one_mem

theorem mul_mem {x y : ℝ} (hx : x ∈ I) (hy : y ∈ I) : x * y ∈ I :=
⟨mul_nonneg hx.1 hy.1, (mul_le_mul hx.2 hy.2 hy.1 zero_le_one).trans_eq <| one_mul 1
⟨mul_nonneg hx.1 hy.1, mul_le_one hx.2 hy.1 hy.2
#align unit_interval.mul_mem unitInterval.mul_mem

theorem div_mem {x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hxy : x ≤ y) : x / y ∈ I :=
Expand Down Expand Up @@ -94,11 +94,11 @@ instance : Mul I :=

-- todo: we could set up a `LinearOrderedCommMonoidWithZero I` instance
theorem mul_le_left {x y : I} : x * y ≤ x :=
Subtype.coe_le_coe.mp <| (mul_le_mul_of_nonneg_left y.2.2 x.2.1).trans_eq <| mul_one x.1
Subtype.coe_le_coe.mp <| mul_le_of_le_one_right x.2.1 y.2.2
#align unit_interval.mul_le_left unitInterval.mul_le_left

theorem mul_le_right {x y : I} : x * y ≤ y :=
Subtype.coe_le_coe.mp <| (mul_le_mul_of_nonneg_right x.2.2 y.2.1).trans_eq <| one_mul y.1
Subtype.coe_le_coe.mp <| mul_le_of_le_one_left y.2.1 x.2.2
#align unit_interval.mul_le_right unitInterval.mul_le_right

/-- Unit interval central symmetry. -/
Expand Down

0 comments on commit 6688f91

Please sign in to comment.