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

Commit f23c00f

Browse files
committed
chore(algebra/order/ring): move lemmas about invertible into a new file (#11511)
The motivation here is to eventually be able to use the `one_pow` lemma in `algebra.group.units`. This is one very small step in that direction.
1 parent 01fa7f5 commit f23c00f

File tree

5 files changed

+38
-23
lines changed

5 files changed

+38
-23
lines changed

src/algebra/group_power/lemmas.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2015 Jeremy Avigad. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Robert Y. Lewis
55
-/
6+
import algebra.invertible
67
import data.int.cast
78

89
/-!

src/algebra/order/invertible.lean

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/-
2+
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury G. Kudryashov
5+
-/
6+
import algebra.order.ring
7+
import algebra.invertible
8+
9+
/-!
10+
# Lemmas about `inv_of` in ordered (semi)rings.
11+
-/
12+
13+
variables {α : Type*} [linear_ordered_semiring α] {a : α}
14+
15+
@[simp] lemma inv_of_pos [invertible a] : 0 < ⅟a ↔ 0 < a :=
16+
begin
17+
have : 0 < a * ⅟a, by simp only [mul_inv_of_self, zero_lt_one],
18+
exact ⟨λ h, pos_of_mul_pos_right this h.le, λ h, pos_of_mul_pos_left this h.le⟩
19+
end
20+
21+
@[simp] lemma inv_of_nonpos [invertible a] : ⅟a ≤ 0 ↔ a ≤ 0 :=
22+
by simp only [← not_lt, inv_of_pos]
23+
24+
@[simp] lemma inv_of_nonneg [invertible a] : 0 ≤ ⅟a ↔ 0 ≤ a :=
25+
begin
26+
have : 0 < a * ⅟a, by simp only [mul_inv_of_self, zero_lt_one],
27+
exact ⟨λ h, (pos_of_mul_pos_right this h).le, λ h, (pos_of_mul_pos_left this h).le⟩
28+
end
29+
30+
@[simp] lemma inv_of_lt_zero [invertible a] : ⅟a < 0 ↔ a < 0 :=
31+
by simp only [← not_le, inv_of_nonneg]
32+
33+
@[simp] lemma inv_of_le_one [invertible a] (h : 1 ≤ a) : ⅟a ≤ 1 :=
34+
by haveI := @linear_order.decidable_le α _; exact
35+
mul_inv_of_self a ▸ decidable.le_mul_of_one_le_left (inv_of_nonneg.2 $ zero_le_one.trans h) h

src/algebra/order/ring.lean

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2016 Jeremy Avigad. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro
55
-/
6-
import algebra.invertible
76
import algebra.order.group
87
import algebra.order.sub
98
import data.set.intervals.basic
@@ -571,34 +570,12 @@ lemma neg_of_mul_pos_right (h : 0 < a * b) (ha : b ≤ 0) : a < 0 :=
571570
lemma neg_iff_neg_of_mul_pos (hab : 0 < a * b) : a < 0 ↔ b < 0 :=
572571
⟨neg_of_mul_pos_left hab ∘ le_of_lt, neg_of_mul_pos_right hab ∘ le_of_lt⟩
573572

574-
@[simp] lemma inv_of_pos [invertible a] : 0 < ⅟a ↔ 0 < a :=
575-
begin
576-
have : 0 < a * ⅟a, by simp only [mul_inv_of_self, zero_lt_one],
577-
exact ⟨λ h, pos_of_mul_pos_right this h.le, λ h, pos_of_mul_pos_left this h.le⟩
578-
end
579-
580-
@[simp] lemma inv_of_nonpos [invertible a] : ⅟a ≤ 0 ↔ a ≤ 0 :=
581-
by simp only [← not_lt, inv_of_pos]
582-
583573
lemma nonneg_of_mul_nonneg_left (h : 0 ≤ a * b) (h1 : 0 < a) : 0 ≤ b :=
584574
le_of_not_gt (assume h2 : b < 0, (mul_neg_of_pos_of_neg h1 h2).not_le h)
585575

586576
lemma nonneg_of_mul_nonneg_right (h : 0 ≤ a * b) (h1 : 0 < b) : 0 ≤ a :=
587577
le_of_not_gt (assume h2 : a < 0, (mul_neg_of_neg_of_pos h2 h1).not_le h)
588578

589-
@[simp] lemma inv_of_nonneg [invertible a] : 0 ≤ ⅟a ↔ 0 ≤ a :=
590-
begin
591-
have : 0 < a * ⅟a, by simp only [mul_inv_of_self, zero_lt_one],
592-
exact ⟨λ h, (pos_of_mul_pos_right this h).le, λ h, (pos_of_mul_pos_left this h).le⟩
593-
end
594-
595-
@[simp] lemma inv_of_lt_zero [invertible a] : ⅟a < 0 ↔ a < 0 :=
596-
by simp only [← not_le, inv_of_nonneg]
597-
598-
@[simp] lemma inv_of_le_one [invertible a] (h : 1 ≤ a) : ⅟a ≤ 1 :=
599-
by haveI := @linear_order.decidable_le α _; exact
600-
mul_inv_of_self a ▸ decidable.le_mul_of_one_le_left (inv_of_nonneg.2 $ zero_le_one.trans h) h
601-
602579
lemma neg_of_mul_neg_left (h : a * b < 0) (h1 : 0 ≤ a) : b < 0 :=
603580
by haveI := @linear_order.decidable_le α _; exact
604581
lt_of_not_ge (assume h2 : b ≥ 0, (decidable.mul_nonneg h1 h2).not_lt h)

src/analysis/convex/basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alexander Bentkamp, Yury Kudriashov, Yaël Dillies
55
-/
6+
import algebra.order.invertible
67
import algebra.order.module
78
import linear_algebra.affine_space.midpoint
89
import linear_algebra.affine_space.affine_subspace

src/linear_algebra/affine_space/ordered.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2020 Yury G. Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury G. Kudryashov
55
-/
6+
import algebra.order.invertible
67
import algebra.order.module
78
import linear_algebra.affine_space.midpoint
89
import linear_algebra.affine_space.slope

0 commit comments

Comments
 (0)