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

Commit c1edbdd

Browse files
committed
chore(data/complex/exponential): golf 2 proofs (#5126)
1 parent cb9e5cf commit c1edbdd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/algebra/ordered_ring.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ begin
791791
exact mul_self_le_mul_self_iff (abs_nonneg a) (abs_nonneg b)
792792
end
793793

794+
lemma abs_le_one_iff_mul_self_le_one : abs a ≤ 1 ↔ a * a ≤ 1 :=
795+
by simpa only [abs_one, one_mul] using @abs_le_iff_mul_self_le α _ a 1
796+
794797
end linear_ordered_ring
795798

796799
/-- A `linear_ordered_comm_ring α` is a commutative ring `α` with a linear order

src/data/complex/exponential.lean

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,14 +952,10 @@ lemma cos_sq_le_one : cos x ^ 2 ≤ 1 :=
952952
by rw ← sin_sq_add_cos_sq x; exact le_add_of_nonneg_left (pow_two_nonneg _)
953953

954954
lemma abs_sin_le_one : abs' (sin x) ≤ 1 :=
955-
(mul_self_le_mul_self_iff (_root_.abs_nonneg (sin x)) (by exact zero_le_one)).2 $
956-
by rw [← _root_.abs_mul, abs_mul_self, mul_one, ← pow_two];
957-
apply sin_sq_le_one
955+
abs_le_one_iff_mul_self_le_one.2 $ by simp only [← pow_two, sin_sq_le_one]
958956

959957
lemma abs_cos_le_one : abs' (cos x) ≤ 1 :=
960-
(mul_self_le_mul_self_iff (_root_.abs_nonneg (cos x)) (by exact zero_le_one)).2 $
961-
by rw [← _root_.abs_mul, abs_mul_self, mul_one, ← pow_two];
962-
apply cos_sq_le_one
958+
abs_le_one_iff_mul_self_le_one.2 $ by simp only [← pow_two, cos_sq_le_one]
963959

964960
lemma sin_le_one : sin x ≤ 1 :=
965961
(abs_le.1 (abs_sin_le_one _)).2

0 commit comments

Comments
 (0)